change quantity button cannot be functioned, PHP Web Programming

Assignment Help:
error_reporting(0);
session_start();
header(''Content-type: text/html; charset=utf-8'');
include_once(''../../xajax_core/xajax.inc.php''); // ?? xajax
$xajax = new xajax(); // ?? xajax ??

// ??????
$chaObj=$xajax->registerFunction(''change_quantity'');
$chaObj->useSingleQuote();
$chaObj->addParameter(XAJAX_FORM_VALUES,''form1'');
$xajax->processRequest(); // ????

$xajax->printJavascript();


//---------------------- ????? ---------------------
// ?????????????

function change_quantity($form) {

$objResponse = new xajaxResponse(); // ??????
// ???? Checkbox ??? p_id, ????, ??????
// ?????????? ''p_id'' ??, ??????????
// ????????

if(isset($form[''p_id''])) {
// ?????????????
foreach($form[''p_id''] as $p_id) {
// ???????????????
if($form[''qua''][$p_id]==''0'') {
// ???????? 0, ????????????
unset($_SESSION[''cart''][$p_id]);

if(count($_SESSION[''cart''])==0) { // ????????
$objResponse-> // ?????
script(''alert("cart has no items");window.close();'');
unset($_SESSION[''cart'']);
}
else { // ???????????
// ?????????????
$objResponse->remove($p_id);

// ???????????
$objResponse->assign(''total'',''innerHTML'',gettotal());
}
}
else if ($form[''qua''][$p_id]>0) {
// ????? 0 ??, ?????????????
$_SESSION[''cart''][$p_id][''quantity''] = $form[''qua''][$p_id];

// ??????, ?????????????????
$objResponse->assign(''sub['' . $p_id . '']'', ''innerHTML'',
$_SESSION[''cart''][$p_id][''quantity''] *
$_SESSION[''cart''][$p_id][''price'']);
$objResponse->assign(''total'',''innerHTML'',gettotal());
}
else {
// ??????, ?????????
$objResponse->assign(''qua['' . $pid . '']'', ''innerHTML'',
$_SESSION[$pid][''quantity'']);
}
}
}
return $objResponse; // ??????
} // ???? change_quantity() ??

// ????????
function getTotal() {
$total = 0;
foreach($_SESSION[''cart''] as $p_id => $item)
$total += ($item[''quantity''] * $item[''price'']);

return $total;
}


//---------------------- ??? HTML ---------------------
// ?????????, ?????????????????
if( !isset($_SESSION[''cart'']) ) { // ???????
echo "";
exit();
}
?>
?????




printJavaScript(''/''); ?>





cellspacing="0" cellpadding="2"
style="text-align:center;border:1px solid silver">













// ?????????
$total = 0;
foreach($_SESSION[''cart''] as $p_id => $item) {
// ???? id ???? $p_id, ???????
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "";
echo "\n";
echo "\n";
}
?>




cart
all

onClick="select_all(''form1'',''p_id[]'',this.name);">
product name unit price quantity subtotal
" .
" $p_id . "''>
" . $item[''name''] . "" . $item[''price''] . "×" .
" value=''" . $item[''quantity''] . "'' size=''3''>
=" .""."
total:













onClick="settozero(''form1'',''p_id[]'')">

onClick="xajax_change_quantity(xajax.getFormValues(''form1''))">

onClick="window.close();">

onClick="location.href=''checkout.php'';">



Related Discussions:- change quantity button cannot be functioned

We need help in web development, We need help in Web Development - Ongoi...

We need help in Web Development - Ongoing. WordPress as well as Infusionsoft experience required.

We need to incorporate data feed into wordpress site, We need to Incorporat...

We need to Incorporate data feed into wordpress site I want someone who can incorporate the following real estate data feed into my wordpress site. Once integrated, users must b

Include html tags in the email from the php script, For example, Use HTML, ...

For example, Use HTML, to make the content of the message bold red-colored text.   You can Google this issue to learn how to do this in PHP.  It might (or might not be helpful) to

Looking for netflow web application developer, Looking for NetFlow Web Appl...

Looking for NetFlow Web Application Developer I am seeking a programmer who can write a web-based front end for nfcapd /NFDUMP. I am alert that Nfsen is available (the recommend

Looking for a good programmer to work with my graphic design, I am looking ...

I am looking for a good programmer to work with my graphic design/illustrator on my team to actively blend animation with gameplay and create a fun, simple and easy, 2d iPhone gam

I need custom t-shirt website, I need Custom T-shirt Website Project Des...

I need Custom T-shirt Website Project Description: Seeking a full-time developer to help custom t-shirt company with multiple projects in the upcoming year. Skills require

Billing and invoice generation, Billing and Invoice Generation Project D...

Billing and Invoice Generation Project Description: Below is the short of description of my Invoice Generation Portal: Companies need to prepare an Invoice/Billing for the

I need help to fix joomla bugs, I need help to fix Joomla Bugs I have a ...

I need help to fix Joomla Bugs I have a Joomla site (version 2.5.7) that has some minor issues. Needs fixed ASAP 1. We are feat error message on backend when trying to edit a

I want help in styling live xml feed, Styling Live XML Feed Need the reo...

Styling Live XML Feed Need the reordering as well as styling of a short (dynamic) xml feed. The outcomes are to be showed within an external webpage. Further work is available s

Need nationbuilder developer, NationBuilder Developer We are seeking a l...

NationBuilder Developer We are seeking a long term NationBuilder developer to help us at our agency we produce websites for churches as well as nonprofits on the NB platform as

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd