<!-- Content Wrapper. Contains page content -->
<?php
$userRol = $_SESSION['USERS_DATA']['userType'];
$userId = $_SESSION['USERS_DATA']['userId'];

?>
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header mb_9">
      <h1>Payment Refund Notification</h1>
    </section>
    <!-- Main content -->
    
	<div class="row">
	<div class="col-lg-12">
		<div class="box wholeSaleWrapper">
            <div class="box-body">
			<div class="table-responsive">
              <table id="mfw_ItemsTable" class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th>Sr No.</th>
                  <th>Notification Date</th>
                  <th>Order No.</th>
                  <th>Payment Type</th>
                  <th>Order Status</th>
                  <th>Name</th>
                  <th>Mobile No.</th>
                  <th>City</th>
                  <th>Account No.</th>
                  <th>IFSC Code</th>
                  <th>Amount</th>
                  <th>Payment Refund</th>
                </tr>
                </thead>
                <tbody>
				<?php if(!empty($notification)){
					$countItem = count($notification);
					 $i = $countItem;
					 $a=1;
					foreach($notification as $value){ 
				?>
                <tr>
                  <td><?php echo $a; ?></td>
					<td><?php if(!empty($value['notificationDate'])){ 
                                    $date = $value['notificationDate'];
                                    $rdate = str_replace("/","-",$date);
                                    $datem =date_create($rdate);
                                    echo date_format($datem,"d-M-Y");
                                    
                                    } ?>
                    </td>
					<td><?php if(!empty($value['orderId'])){ echo $value['orderId']; } ?></td>
					<td><?php if(!empty($value['paymentType'])){ echo $value['paymentType']; } ?></td>
					<td>
					    <?php
    				         if($value['deliveryStatus']==2){echo "Admin Cancel";}
                             if($value['deliveryStatus']==1){echo "Delivered";}
                             if($value['deliveryStatus']==0){echo "Pending";}
                             if($value['deliveryStatus']==3){echo "Customer Cancel";}
                             if($value['deliveryStatus']==4){echo "Payment Refund";}
                         ?>
					</td>
					<td><?php if(!empty($value['userName'])){ echo $value['userName']; } ?></td>
					<td><?php if(!empty($value['userMobile'])){ echo $value['userMobile']; } ?></td>
					<td><?php if(!empty($value['address'])){  
    					$test_str = $value['address']; 
                        $words = explode('|', $test_str);
                        if($words[0]){
                           echo $words[0];
                        }
                        } ?>
                    </td>
				    <td><?php if(!empty($value['accountNumber'])){ echo $value['accountNumber']; } ?></td>
				    <td><?php if(!empty($value['ifscCode'])){ echo $value['ifscCode']; } ?></td>
				    <td><?php if(!empty($value['totalAmount'])){ echo $value['totalAmount']; } ?></td>
					<td class="text-center">
					    <label class="switch refundStatus" data-refundId ="<?php if(!empty($value['refundId'])) {echo $value['refundId']; }?>" data-userEmail='<?php if(!empty($value['userEmail'])) {echo $value['userEmail']; }?>'>
                          <input type="checkbox" name="u_status"<?php if($value['refundStatus']==1) {echo 'checked'; }?> >
                          <span class="slider round"></span>
                        </label>
					</td>
                </tr>
				<?php 
				$a++;
				$i--;
				}
				} ?> 
                </tbody>
                <tfoot> 
                <tr>
                  <th>Sr No.</th>
                  <th>Notification Date</th>
                  <th>Order No.</th>
                  <th>Payment Type</th>
                  <th>Order Status</th>
                  <th>Name</th>
                  <th>Mobile No.</th>
                  <th>City</th>
                  <th>Account No.</th>
                  <th>IFSC Code</th>
                  <th>Amount</th>
                  <th>Payment Refund</th>
                </tr>
                </tfoot> 
              </table>
            </div>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
		</div>
		</div>

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
  