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

Newbi, how use the simple aplication for web with php fron iner and mysql t...

how use the simple aplication for web with php fron iner and mysql the databse

I am looking for a programmer who can implement my mockups, BigCommerce ful...

BigCommerce fully responsive design implementation I am looking for a programmer who can implement my Mockups on my BigCommerce shop. Requirement- a) You write clean code

Php app in bootstrap with user mgmt, Php app in bootstrap with user mgmt, f...

Php app in bootstrap with user mgmt, form, csv import/export and stats Project Description: Overview: Need an application construct in PHP to allow agents to log in, view

Display ads as well as native ad server and advertiser, Display Ads as well...

Display Ads as well as Native Ad Server and Advertiser and Publisher Tools This project has two tasks- a) Build an ad-serving solution as well as analytics dashboard for disp

We are need of wordpress and php plugin, We are need of Wordpress and PHP P...

We are need of Wordpress and PHP Plugin Our company want a Wordpress/PHP plugin that could generate PDF real estate feature sheets. User could upload the photos as well as in

We need help in woocommerce design & programming adjustments, We need help ...

We need help in Woocommerce Design & Programming Adjustments +mysql Woocommerce & Wordpress Programming should have experience in Woocommerce and Wordpress php programming. A

Needed a front-end developer, Front-end Developer As a freelance front-e...

Front-end Developer As a freelance front-end developer, you will be appointed on a per-project basis. You will be accountable for the production, modification and maintenance of

Need capable to design any required worpress plugin, Wordpress Web designer...

Wordpress Web designer/Developer with web application development skills Be capable to design any required Worpress plugin, component, modules. We are begin a new USMLE/COMLE

Internet, The Internet is worldwide computer network which interconnects, m...

The Internet is worldwide computer network which interconnects, millions of computing devices all through the world. Mostly devices are PC's, and servers which store & transmit inf

We want help in codeignier script change easy, We want help in Codeignier S...

We want help in Codeignier Script Change Easy Project details as follow- To add three simple modifications for an existing CMS script. The script to alter is a modified version

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