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

I desire php help for bilingual website, I desire PHP help for BILINGUAL WE...

I desire PHP help for BILINGUAL WEBSITE We are in desire of a bilingual website that will have an online store and information about the designer of the product. Our product is

We need joomla-php-mysql developer, We Need Joomla-PHP-MySQL Developer W...

We Need Joomla-PHP-MySQL Developer We need a developer who can work on our website built on Joomla to focus. Candidate must be very strong in Joomla, PHP, MySQL Development.

We are looking for php development utilizing mongodb, PHP Driven Web App ...

PHP Driven Web App We are working on a project that will require heavy PHP development utilizing MongoDB as the backend database. Developer will want to 1) Create registratio

Need help interactive weather map using weather data api, Create Interactiv...

Create Interactive Weather Map using Weather Data API Looking for an experienced web developer to create an interactive weather map of the US using the Aeris API. Desired Ski

We need a jr developer, Jr Developer a) I have an Immediate project that...

Jr Developer a) I have an Immediate project that needs to be done right now. I have a few PSDs that want to be converted to HTML / CSS for Email (MailChimp) I am looking for a J

How can we increase the execution time of a php script, How can we increase...

How can we increase the execution time of a php script? By the use of void set_time_limit(int seconds) Set number of seconds a script is allowed to run. If this is reached,

Need help in new business start up, New Business Start up I' have a lump...

New Business Start up I' have a lumpy design on how the website must look like (mobile website). What I am seeking is a website developer who can guide me from A to Z The dev

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

Tables, In this you will learn how to put tables in your web documents. It ...

In this you will learn how to put tables in your web documents. It is not that a table is just a combination of rows & columns. If you have ever seen any table in web page you may

Development of ecommerce store in cakephp, Development of ecommerce store i...

Development of ecommerce store in cakephp Project Description: We want to get help finishing off a project based in cakephp (because we don't have time). Things that would re

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