<?php session_start();
include ('../inc/dbcon.php');
include ('../inc/functions.php');
include ('../inc/cartfunctions.php');
$body='';
$foot='';
$s=0;
$totamo=0;
if(isset($_SESSION['axes_qcitem'])){
if(is_array($_SESSION['axes_qcitem'])){
$max=count($_SESSION['axes_qcitem']);
for($i=($max-1);$i>=0;$i=$i-1){ 
$amo=$_SESSION['axes_qcitem'][$i]['amo'];
$pid=$_SESSION['axes_qcitem'][$i]['pid'];

$qty=$_SESSION['axes_qcitem'][$i]['qty'];

$pname = get_fild_data('tbl_item',$pid,'name');          
$s+=1;
$body.='<tr>';
$body.='<td style="text-align:center">'.$s.'</td>';
$body.='<td>'.$pname.'</td>';
$body.='<th class="text-right">'.$qty.'</th>';
$body.='<td>'.$amo.'</td>';
$body.='<td style="text-align:center"><a id="'.$i.'" class="remove"><span style="cursor: pointer;color:red;" class="fa fa-times"></span></a></td>';    
$body.='</tr>';     
}
$foot.='<tr>';
$foot.='<th colspan="3" class="text-right">TOTAL</th>';
$foot.='<th class="text-right">'.number_format(total_qcvalue(),2).'</th>';    
$foot.='<th colspan="1"></th>';    
$foot.='</tr>'; 
   
}else{
$body.='<tr>';
$body.='<td colspan="5" class="text-center">There are no items in list!</td>';
$body.='</tr>'; 
} 
}else{
$body.='<tr>';
$body.='<td colspan="5" class="text-center">There are no items in list!</td>';
$body.='</tr>';
}
            
if(isset($_POST['body'])){
echo $body;
}elseif(isset($_POST['foot'])){
echo $foot;	
}
exit;    
?>    