mikemaner
asked on
PHP Development Issue - the sequel
I have this code in place to define the quantity function (thx Brian:)...
<?php
$qty_string = "<input type=\"text\" size=\"2\" name=\"qty[]\" style=\"font-family: verdana; font-size: 8pt\" value=\"";
// Item 1
$qty = $_POST["qty"][0]; // Quantity after Update
$with_disc01 = round( (($price01*(round($discoun t01/100, 2)))-$price01), 2);
$ext_npl01 = ($price01*$qty);
$ext_inst01 = ($inst01*$qty);
$ext_maint01 = ($maint01*$qty);
$ext_usc01 = ($cost01*$qty);
// Item 2
$qty = $_POST["qty"][1]; // Quantity after Update
$with_disc02 = round( (($price02*(round($discoun t02/100, 2)))-$price02), 2);
$ext_npl02 = ($price02*$qty);
$ext_inst02 = ($inst02*$qty);
$ext_maint02 = ($maint02*$qty);
$ext_usc02 = ($cost02*$qty);
// There will be a total of 64 Items, this is just 2 of them
?>
So now I am working on creating totals and am looking for a way to use the existing quantities specified by the user, per item, to create them. I have tried a few different ways, but being a n00b I'm not having much luck. Here's an example of what I have tried...
<?php
$x_ext_npl = (($price01*$qty_string . $_POST["qty"][0])+($price0 2*$qty_str ing . $_POST["qty"][1])+($price0 3*$qty_str ing . $_POST["qty"][2]));
$x_ext_inst = (($inst01*$qty_string . $_POST["qty"][0])+($inst02 *$qty_stri ng . $_POST["qty"][1])+($inst03 *$qty_stri ng . $_POST["qty"][2]));
$x_ext_maint = (($maint01*$qty_string . $_POST["qty"][0])+($maint0 2*$qty_str ing . $_POST["qty"][1])+($maint0 3*$qty_str ing . $_POST["qty"][2]));
$x_ext_usc = (($cost01*$qty_string . $_POST["qty"][0])+($cost02 *$qty_stri ng . $_POST["qty"][1])+($cost03 *$qty_stri ng . $_POST["qty"][2]));
$x_ext_disc = (($with_disc01*$qty_string . $_POST["qty"][0])+($with_d isc02*$qty _string . $_POST["qty"][1])+($with_d isc03*$qty _string . $_POST["qty"][2]));
?>
Welll, it didn't work :) Anyone have any ideas? thanks for the help.
<?php
$qty_string = "<input type=\"text\" size=\"2\" name=\"qty[]\" style=\"font-family: verdana; font-size: 8pt\" value=\"";
// Item 1
$qty = $_POST["qty"][0]; // Quantity after Update
$with_disc01 = round( (($price01*(round($discoun
$ext_npl01 = ($price01*$qty);
$ext_inst01 = ($inst01*$qty);
$ext_maint01 = ($maint01*$qty);
$ext_usc01 = ($cost01*$qty);
// Item 2
$qty = $_POST["qty"][1]; // Quantity after Update
$with_disc02 = round( (($price02*(round($discoun
$ext_npl02 = ($price02*$qty);
$ext_inst02 = ($inst02*$qty);
$ext_maint02 = ($maint02*$qty);
$ext_usc02 = ($cost02*$qty);
// There will be a total of 64 Items, this is just 2 of them
?>
So now I am working on creating totals and am looking for a way to use the existing quantities specified by the user, per item, to create them. I have tried a few different ways, but being a n00b I'm not having much luck. Here's an example of what I have tried...
<?php
$x_ext_npl = (($price01*$qty_string . $_POST["qty"][0])+($price0
$x_ext_inst = (($inst01*$qty_string . $_POST["qty"][0])+($inst02
$x_ext_maint = (($maint01*$qty_string . $_POST["qty"][0])+($maint0
$x_ext_usc = (($cost01*$qty_string . $_POST["qty"][0])+($cost02
$x_ext_disc = (($with_disc01*$qty_string
?>
Welll, it didn't work :) Anyone have any ideas? thanks for the help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That was it, thanks m8, I am still a bit confused by syntax at this point. I 'AM' learning though :)
$x_ext_npl = (($price01*$_POST["qty"][0
$x_ext_npl = (($inst01*$_POST["qty"][0]
$x_ext_npl = (($maint01*$_POST["qty"][0
$x_ext_npl = (($cost01*$_POST["qty"][0]
$x_ext_npl = (($with_disc01*$_POST["qty