i’m new in yii, on my last post, i have learn how to get data from two model in one form, now, i getting curious how to use calculation method within two tables in yii,
for example :
i got 2 tables,
assumption
asmp_id --> PK
asmp_name
asmp_score
cost_variable
var_id --> PK
var_name
var_score
var_qty
var_price
var_tot_price
each assumption (asmp_id) whenever it was selected by user, and according to user need, it could be calculate (+,-,*,/) with the selected value of cost_variable attributes,
is it possible for me, when i choose asmp_id = 1 then i need to multiplied it with the sum of (var_id =1 + var_id =2) ? ===> 25% * (1.600.000.000 + 4.000.000) and then the result i displayed the result in a form.
meanwhile the first question, the asmp_id = 2 needed to calculate only with var_id = 3 (12% * 150.000.000)