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

Need help to make checkout page customisation, Checkout Page Customisation ...

Checkout Page Customisation 1) Clone process need to be exact same as the reference checkout site 2) Final product must be responsive to all devices Desired Skills are MyS

Web developer wanted to create a website, Web developer wanted to create a ...

Web developer wanted to create a website for an exciting start-up company We are presently looking to develop an editable website with responsive design. The basic design has pr

I am seeking a web developer- frontend as well as backend, Web developer (F...

Web developer (Frontend and Backend) I am seeking a Web Developer- Frontend as well as Backend to create a responsive website very similar to Zomato Your responsibilities-

Magento ecommerce convertion to order and pay later for site, Magento ecomm...

Magento ecommerce convertion to order and pay later for website I have a magento multistore set up with a total of ten websites. All ten websites are configured now as ecommerce

Need help from senior website coder wordpress, Need help from Senior Websit...

Need help from Senior Website Coder wordpress A marketing firm for international brands. Job Description- We're seeking for a Web Developer. Your responsibilities- I'm

I want a help in moodle modification, I want a help in Moodle modification ...

I want a help in Moodle modification I need modifications to Moodle to permit for many schools to use the same software, however no school may see each other's teachers or stude

Need multi-language website of a retirement resort project, Multi-language ...

Multi-language website of a retirement resort project. I am seeking a website developer for a retirement resort project with the end in view of marketing the resort to worldwide

I need help in styling live xml feed, I need help in Styling Live XML Feed ...

I need help in Styling Live XML Feed Need the reordering and styling of a short (dynamic) xml feed. The results are to be displayed within an external webpage. Additional wor

We desire help in web site development, We need help in web site developmen...

We need help in web site development I need a developer to replicate a site for me. This will need the developer to setup an account as well as engage in to the site understandi

Develop a professional site like match, I am mainly looking for a version o...

I am mainly looking for a version of a VERY professional site that is very same to a match.com - basically it would match people to jobs and vice verso. It would show percentage

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