<?php include("links/top.php");
$action=$_GET['action'];
?>
<?php
if($action=='delete'){
$id=$_GET['id'];

$del="delete from acc_transactions where id='$id'";
$DB->executeQuery($del);

header('Location:acc_transactions.php?action=list');
}
?>
<?php
if(isset($_POST['update'])){
$id=$_GET['id'];
extract($_POST);

$arr=array('delivery'  => $delivery,'updated' 	=> date('Y-m-d H:i:s'));
$DB->update('acc_transactions',$arr,"id='$id'");

header('Location: acc_transactions.php?action=list&oid='.$oid);
}
?>
		<div id="content">
			<div class="container">
				<div class="page-header">
					<div class="page-title">
						<h3>Stripe Payment List</h3>
					</div>
				</div>
				<div class="row">

					<div class="col-md-12">
                     
					<div class="widget box">
                        <div class="widget-header">
                            <h4>Stripe Payment List</h4>
							</div>
                        <div class="widget-content">
                             <?php if($action=='list'){
								 $sno=1;
								$sel=executeQuery("select * from acc_transactions  ");
								?>

								<table class="table table-striped table-bordered table-hover table-checkable datatable">
									<thead>
										<tr>
											<!-- <th class="checkbox-column"><input type="checkbox" class="uniform"></th> -->
											
				                <th>S.No</th>
								 <th>Name</th>
                                   <th>Email</th>
                                   <th>Item_name</th>
                                   
                                   <th>Paid_amount</th>
                                   <th>Currency</th>
                                   <th>Txn_id</th>
                                   <th>Payment Status</th>
                                   <th>Stripe_checkout_session_id</th>	
                                   <th>Date</th>
										</tr>
									</thead>
									<tbody>
                                    <?php
								  $sno=1;
								 while($rec=getAssoc($sel)){
								 	
								 	?>
										<tr>
											<!--<td class="checkbox-column"><input type="checkbox" class="uniform"></td>-->
											
											 <td><?php echo $sno;?></td>

									<td><?php echo $rec['customer_name'];?></td>
                                    
                                    <td><?php echo $rec['customer_email'];?></td>

                                    <td><?php echo $rec['item_name'];?></td>
                                    
                                    <td><?php echo $rec['paid_amount'];?></td>
                                    
                                    <td><?php echo $rec['paid_amount_currency'];?></td>
                                    
                                    <td><?php echo $rec['txn_id'];?></td>
                                    <td>$<?php echo $rec['payment_status'];?></td>
                                    <td>$<?php echo $rec['stripe_checkout_session_id'];?></td>
                                    
                                    <td><?php echo $rec['modified'];?></td>
                              
                                    
                                  <?php /*  <td><?php if($rec['status']=='0'){?> Failed <?php } ?> <?php if($rec['status']=='1'){?> Sucess <?php } ?></td> */ ?>
                                    
                                  
										</tr>
                                        <?php $sno++;}?>
									</tbody>
								</table>

                            <?php }?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
	<?php include("links/bottom.php");?>