<?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_edpayitem'])){
if(is_array($_SESSION['axes_edpayitem'])){
$max=count($_SESSION['axes_edpayitem']);
for($i=($max-1);$i>=0;$i=$i-1){
     
$dty = $_SESSION['axes_edpayitem'][$i]['dty'];
$did=$_SESSION['axes_edpayitem'][$i]['did'];
$dname = get_namebytype($dty,'N',$did);    
$amo=$_SESSION['axes_edpayitem'][$i]['amo'];
$cid=$_SESSION['axes_edpayitem'][$i]['cid'];
$cty=$_SESSION['axes_edpayitem'][$i]['cty'];
$cname = get_namebytype($cty,'N',$cid);    
$chkno=$_SESSION['axes_edpayitem'][$i]['chkno'];
$chkdt=$_SESSION['axes_edpayitem'][$i]['chkdt'];
$ref=$_SESSION['axes_edpayitem'][$i]['ref'];
$refinv=$_SESSION['axes_edpayitem'][$i]['refinv'];
    
$s+=1;
$body.='<tr>';
$body.='<td style="text-align:center">'.$s.'</td>';
$body.='<td>'.$cname.'</td>';
$body.='<td>'.$dname.'</td>';    
$body.='<th class="text-right">'.number_format($amo,2).'</th>';
$body.='<td>'.$chkno.'</td>'; 
$body.='<td>'.$chkdt.'</td>';  
$body.='<td>'.$refinv.'</td>';    
$body.='<td>'.$ref.'</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_edpayvalue(),2).'</th>';    
$foot.='<th colspan="5"></th>';    
$foot.='</tr>';    
}else{
$body.='<tr>';
$body.='<td colspan="9" class="text-center">There are no items in your payment list!</td>';
$body.='</tr>'; 
} 
}else{
$body.='<tr>';
$body.='<td colspan="9" class="text-center">There are no items in your payment list!</td>';
$body.='</tr>';
}
            
if(isset($_POST['body'])){
echo $body;
}elseif(isset($_POST['foot'])){
echo $foot;	
}
exit;    
?>    