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

Crucial wordpress edit, Crucial wordpress edit I need this job to be don...

Crucial wordpress edit I need this job to be done asap Budget is around $40-$60 Make the pixel perfect for this site as well as create collection page Desired Skills are A

We need drupal updates, We need Drupal Updates We have 6 websites built ...

We need Drupal Updates We have 6 websites built on the Drupal platform that essentially updating from v.6 to v.7. We need a Drupal developer to help us update as well as test ea

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 inventory and stock, I need Inventory and Stock Project Descripti...

I need Inventory and Stock Project Description: I need a module of Stock & Inventory which will be integrated with our existing Accounts Module; Our existing module is prepar

Describe two types of looping statements in php, Question: (a) Describe...

Question: (a) Describe the two methods used to retrieve information from web forms using PHP. (b) Explain two different kinds of arrays that PHP uses. Give an example scri

Create an html document and java applets, For this project, you are requir...

For this project, you are required to design and create an HTML document (also referred to as a "Web page"), in which certain basic HTML elements are incorporated. Your HTML docume

I need help in wpmu appointment and customization, I need help in WPMU Appo...

I need help in WPMU Appointment and Customization I have a want for a ninja developer who knows the ins/outs of Appointment and can do the customization below- a) Facility to

Need long-term php developer for e-commerce product, Need Long-term PHP dev...

Need Long-term PHP developer for e-commerce product I'm seeking to work with a PHP developer in the UK who has experience working with custom software such as e-commerce product

Php, Ask question #Create a Web page to be used for storing software develo...

Ask question #Create a Web page to be used for storing software development bug reports in a MySQL database. Include fields such as product name and version, type of hardware, oper

I want help for it developer, I want help for IT Developer needed - Benelux...

I want help for IT Developer needed - Benelux Region We are seeking an experienced web developer with the following skills 1) Front-end development (HTML5/CSS3) 2) Front-end

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