I have file with class which consist of several functions. This file I have included to controller and use returned data to build table. I need to change column data by `onkeyup` of different column. To do this, i need to pass number `onkeyup` to my array(in controller ) which will return data from function and set this data to my view. Here is my controller:
Code: Select all
require_once('catalog/controller/product/onlinecredit.php');
$credonl = new OnlineCredit();
foreach ($data['credittules'] as $rndb) {
//echo $rndb['model'];
$array = array(
'Rule' => array(
'rule_id' => $rndb['credit_rule_id'],
'rule_name' => '' . $rndb['rule_name'] . '',
'interest' => $rndb['interest'],
'comission' => $rndb['comission'],
'best_offer_downpayment' => $rndb['best_offer_downpayment'],
'best_offer_duration' => $rndb['best_offer_duration']
),
'Product' => array(
'product_id' => $rndb['product_id'],
'category_id' => $rndb['best_offer_duration'],
'manufacturer_id' => $rndb['manufacturer_id'],
'product_price' => $rndb['price']
),
'Credit' => array(
'downpayment' => $rndb['best_offer_downpayment'],
'duration' => $rndb['best_offer_duration']
)
);
}
$data['credits']=$credonl->BuildCreditTable($array);
Code: Select all
<div class="table-responsive" style="text-align: center">
<div class="crhead"><h1 class="h1size">Hissə-hissə ödə!</h1></div>
<table id="kreditable" width="100%">
<thead>
<tr>
<th>{{ text_choise }}</th>
<th>{{ text_vznos }}</th>
<th>{{ text_month }}</th>
<th>{{ text_monthly }}</th>
<th>{{ text_total }}</th>
</tr>
</thead>
<tbody>
{% for credit_item in credits.Options %}
<tr class="tr_row">
{% if credit_id %}
<td>
<label class="containerk">
<input type="radio" name="credit_id" {% if credit_item.duration == credit_id %} checked {% endif %} value="{{ credit_item.duration }}">
<span class="checkmarkk"></span>
</label>
</td>
{% else %}
<td>
<label class="containerk">
<input type="radio" name="credit_id" value="{{ credit_item.duration }}">
<span class="checkmarkk"></span>
</label>
</td>
{% endif %}
<td> <input type="text" class="inptsize" id="publicname-change" value="{{ credit_item.downpayment }}" onkeyup="setprice()"></td>
<td>{{ credit_item.duration }}</td>
<td>{{ credit_item.monthly }}</td>
<td>{{ credit_item.total }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="cb"></div>
<a href="{{ action_credit }}&product_id={{product_id}}" class="button btn btn-cart kredit-type" onclick="kredit_click('{{ product_id }}'); return false;"/>
{{ text_nuraceiet_et }}
</a>
</div>