Am currently developing a school management system, but am stack i believe you are the only one who can help in this.
I need to display a cgridview in this format
The php code is like this
<?php
$sum=0;
$ad=6; //i assumed this to be the amount entered by the accountanty
$a = array(1, 2, 3, 4, 5); //this are assumed to be the item that a student is supposed to pay
foreach ($a as $
{
?>
<?php
//echo $b."<br>";?><?php
$sum=$ad-$b; //minus the item amount from the school fees payed
//print "<br>".$b . " <br>";
if ($sum<=0){ //if the result if less or equal to zero the raw cell is automaticaly initialized by zero
echo ($sum=0)."<br>";
}
else{echo $b."<br>";}
$ad=$sum; //the next loop is assign with the result of the current ammount
//echo $ad;
}
?>
The the entire grid should be saved in the db.
Please how can I achieve this using Cgridview because currently I must say I have no idea on how to go about this in yii