<?php  $this->load->view('master/common/header.php',$data);
$base_name = $data['base_name'];

?>

    <div class="content">
        
        <!-- Start Content-->
        <div class="container-fluid">
            
            <!-- start page title -->
            <div class="row">
                <div class="col-12">
                    <div class="page-title-box">
                        <div class="page-title-right">
                            <ol class="breadcrumb m-0">
                                <li class="breadcrumb-item"><a href="javascript: void(0);"><?= $base_name;?></a></li>
                                <li class="breadcrumb-item active text-capitalize"><?= $page;?></li>
                            </ol>
                        </div>
                        <h4 class="page-title text-uppercase"><?= $page;?></h4>
                    </div>
                </div>
            </div>     
            <!-- end page title --> 

            <div class="row">
                <div class="col-md-12 col-xl-12">
                    <div class="card-box">
                        <div class="row">
                            <div class="col-sm-12">
							    <table id="key-table" class="table table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
                                    <thead>
                                        <tr>
                                            <th>#</th>
        									<th>Name</th>
        									<th>Mobile</th>
        									<th>Pan</th>
        									<th>DOB</th>
        									<th>Address</th>
        									<th>Pincode</th>
        								    <th>Status</th>
        									<th>Action</th>
                                        </tr>
                                    </thead>


                                        <tbody>
                                        
								<?php if (!empty($coupon)) {?>
									<?php 
									$i=1;
									foreach ($coupon as $row) {?>
								        <tr>
                                            <td><?=$i++;?></td>
        									<td><?=$row['full_name'];?></td>
        									<td><?=$row['mobile'];?></td>
        									<td><?=$row['pan'];?></td>
        									<td><?=date('d-m-Y',strtotime($row['dob']))   ;?></td>
        									
        									<td><?=$row['address'];?></td>
        									<td><?=$row['pincode'];?></td>
        									<td>
        										<?php if ($row['status'] == 1) {?>
        											<span class="badge badge-success">Success</span>
        										<?php } else {?>
        											<span class="badge badge-danger">Failed</span>
        										<?php }?>
        									</td>
        									<td class="text-center">
        									    <div class="row">
        									        
        									        <?php
        									        if($row['message']=='No Cibil Score Found'){ echo 'Report Not Found';} else { ?>
        									       
        									        <div class="col-sm-6 text-right"><a href="<?=base_url().'master/cibil/view/'.$row['txnid'];?>" class="btn btn-primary btn-sm" title="Edit"><i class="far fa-edit"></i> View Report</a></div>
        									      <?php } ?>
        									    </div>
        									</td>
        								</tr>
								<?php }?>
								<?php } else {?>
								<tr>
									<td colspan="4" class="text-center">Records Not Found</td>
								</tr>
								<?php }?>
							</tbody>
							</table>
							</div>
					    </div>
					</div>
				</div>
				<!-- /.col-md-6 -->
			</div>
			<!-- /.row -->
		</div>
		<!-- /.container-fluid -->
	</div>
	<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php $this->load->view('master/common/footer.php'); ?>

<script type="text/javascript">
	function deletecoupon() {
		if (confirm("Are You Sure You Want TO Delete Coupon ?")) {
            return true;
		}
		return false;
	}
</script>