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

Redirect visitor to custom page based on ip, i need an php script that redi...

i need an php script that redirect the visitor to url or dir based on their ip address if the visitor from Germany then they should redirected to this dir "DE" If France . => "F

Drupal flow of information among 5 main layers, Explain drupal flow Mainly...

Explain drupal flow Mainly, there are 5 important layers in Drupal where information flows, a. Data (Node, ETC) b. Modules c. Blocks and Menus d. User Permissions e. Template a.

Objects, A JavaScript object is an example of data type. Object is given a ...

A JavaScript object is an example of data type. Object is given a unique name & the set of properties of the corresponding object might be accessed by means of the dot syntax. As a

We need help to create ecommerce and software app, We need help to create E...

We need help to create Ecommerce and Software App Development For Yahoo / Shopify I am in search of a developer or company to build an App that can work with Yahoo Stores and Sh

Need help in zendesk integration, Twilio SMS Zendesk Integration This ...

Twilio SMS Zendesk Integration This must be a relatively quick job - Create a (PHP) script that creates / updates a new ticket in Zendesk when an SMS Text message is sent t

Networking models, There are two kinds of networking models obtainable: OSI...

There are two kinds of networking models obtainable: OSI reference Model & the TCP/IP Network Model for the design of computer network system. we shall look at these models in this

We need a team of web expert, We need a team of web expert I will get to...

We need a team of web expert I will get to the point. A website is completed as well as hosted under a VPS and the code is written in python. Here's what I am in search of- 1

Mailing, how to mail to google from php

how to mail to google from php

Want help to customize wordpress theme, Customize Wordpress theme I will...

Customize Wordpress theme I will buying theme (unless you own it) a) The theme needs to be customized b) A few hours of light graphic work c) Customizing the sidebar (l

I want help of php programmer with codeignite, I want help of PHP Programme...

I want help of PHP Programmer with CodeIgnite, Java, and MySQL experience. We are in succession on Ubuntu with a MySQL Backend. The website is written in PHP and CodeIgnter.

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