phpretard Posted April 22, 2008 Share Posted April 22, 2008 // THIS IS HOW THE ARRAY SETS UP Array ( [P1120081.jpg] => Array ( [picture] => ALBUMS/Denis/P1120081.jpg [file] => P1120081.jpg [QU46] => 0 [QU57] => 1 [QU810] => 0 [QU1114] => 2 [QU1216] => 0 [QU1620] => 0 [QU2024] => 4 [QU2030] => 0 [order_photo] => Update This Order ) [P1120082.jpg] => Array ( [picture] => ALBUMS/Denis/P1120082.jpg [file] => P1120082.jpg [QU46] => 10 [QU57] => 0 [QU810] => 0 [QU1114] => 13 [QU1216] => 0 [QU1620] => 0 [QU2024] => 15 [QU2030] => 0 [order_photo] => Order This Photo ) ) //THIS ADDS THE TOTALS AND PUTS IT AN VAR CALLED $total foreach ($_SESSION as $file => $val){ $P46=($_SESSION[$file]['QU46'] * 7); $P57=($_SESSION[$file]['QU57'] * 10); $P810=($_SESSION[$file]['QU810'] * 20); $P1114=($_SESSION[$file]['QU1114'] * 40); $P1216=($_SESSION[$file]['QU1216'] * 50); $P1620=($_SESSION[$file]['QU1620'] * 60); $P2024=($_SESSION[$file]['QU2024'] * 70); $P2030=($_SESSION[$file]['QU2030'] * 80); $total=($P46+$P57+$P810+$P1114+$P1216+$P1620+$P2024+$P2030); } echo GRAND TOTAL???? Somehow I need a grand total from this mess. Any thought on this? Quote Link to comment Share on other sites More sharing options...
intodesi Posted April 22, 2008 Share Posted April 22, 2008 echo "this is the Grand Total $total ? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 22, 2008 Share Posted April 22, 2008 //THIS ADDS THE TOTALS AND PUTS IT AN VAR CALLED $total $grandtotal; foreach ($_SESSION as $file => $val){ $P46=($_SESSION[$file]['QU46'] * 7); $P57=($_SESSION[$file]['QU57'] * 10); $P810=($_SESSION[$file]['QU810'] * 20); $P1114=($_SESSION[$file]['QU1114'] * 40); $P1216=($_SESSION[$file]['QU1216'] * 50); $P1620=($_SESSION[$file]['QU1620'] * 60); $P2024=($_SESSION[$file]['QU2024'] * 70); $P2030=($_SESSION[$file]['QU2030'] * 80); $total=($P46+$P57+$P810+$P1114+$P1216+$P1620+$P2024+$P2030); $grandtotal += $total; } echo $grandtotal; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.