<?php
session_start();
include 'session_check.php';
include 'get_user_info.php';
?>
	<head>
    <meta charset="UTF-8">
    <title>AdminLTE 2 | Dashboard</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <!-- Bootstrap 3.3.2 -->
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />    
    <!-- FontAwesome 4.3.0 -->
   <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <!-- Ionicons 2.0.0 -->
    <link href="https://code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css" rel="stylesheet" type="text/css" />    
    <!-- Theme style -->
    <link href="dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <!-- AdminLTE Skins. Choose a skin from the css/skins 
         folder instead of downloading all of them to reduce the load. -->
    <link href="dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
    <!-- iCheck -->
    <link href="plugins/iCheck/flat/blue.css" rel="stylesheet" type="text/css" />
    <!-- Morris chart -->
    <link href="plugins/morris/morris.css" rel="stylesheet" type="text/css" />
    <!-- jvectormap -->
    <link href="plugins/jvectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" />
    <!-- Date Picker -->
    <link href="plugins/datepicker/datepicker3.css" rel="stylesheet" type="text/css" />
    <!-- Daterange picker -->
    <link href="plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
    <!-- bootstrap wysihtml5 - text editor -->
    <link href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css" />

   <!-----		sweet alert css and js link	---->
	<link rel="stylesheet" href="dist/sweetalert.css">
	<script src="dist/sweetalert.min.js"> </script>
   
	<link rel="stylesheet" type="text/css" href="custom/custom.css">
	<!---- Ck editor-->
	 <script src="ckeditor/ckeditor.js"></script>
	 <!-----	custom css	------>
	 <link rel="stylesheet" href="css/custom_css.css">
	 
	 <!---  css for tree  ---->
	 <link href="css/main.css" rel="stylesheet" type="text/css">
	 <!----    data table css file   ---->
	  <link href="DataTables/datatables.min.css" rel="stylesheet" type="text/css">
	  <style>
	    .print_data span{
	        font-weight: normal;
	        font-size: 15px;
	    }
	    .all_show_fields{
	        border: none;
	        outline: none;
	        width: 100%;
	    }
	  </style>
  </head>

<?php
include 'include/header.php';
include 'include/left-nav.php';
?>
      <!-- Right side column. Contains the navbar and content of the page -->
      <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
           Payout all details
            
          </h1>
          <ol class="breadcrumb">
            <li><a href="dashboard.php"><i class="fa fa-dashboard"></i> Home</a></li>
            <li class="active">payout details</li>
          </ol>
        </section>
        <!-- Main content -->
        <section class="content">
          <div class="row">
             <div class="col-sm-12">
                
             </div>
            <div class="col-sm-12">
              <div class="box">
                <div class="box-header">
                </div><!-- /.box-header -->
                <div class="box-body table-responsive">
				    <table id="example" class="table table-striped table-bordered nowrap" style="width:100%">
        <thead>
            <tr>
                <th> Sr.no </th>
                <th>Transaction id</th>
                <th>Unique id</th>
                <th>Name</th>
                <th>Request balance</th>
                <th> Fees amount </th>
                <th>Request date</th>
                <th> Status </th>
            </tr>
        </thead>
        <tbody>
                <?php
                    /*$qr1="select * from registration inner join wallet_balance on registration.unique_user_id=wallet_balance.balance_user_id
                    inner join bank_details on wallet_balance.balance_user_id=bank_details.unique_user_id
                    inner join payout_details on bank_details.unique_user_id=payout_details.payout_user_id";*/
                    $qr1="select * from registration left join payout_details on registration.unique_user_id=payout_details.payout_user_id
                    left join wallet_balance on payout_details.payout_user_id=wallet_balance.balance_user_id
                    left join bank_details on wallet_balance.balance_user_id=bank_details.user_unique_id 
                    where payout_details.payout_accept_status!='0' and payout_details.payout_user_id is not null";
                    $con1=mysqli_query($conn,$qr1);
                    if(mysqli_num_rows($con1)>0)
                    {
                        $count=1;
                        while($ro=mysqli_fetch_array($con1))
                        {
                            
                ?>
                
                <tr>
                    <td> <?php echo $count++; ?> </td>
                     <td>
                        <input type="text" name="transaction_id" value="<?php echo $ro['payout_transaction_id'];?>" class="all_show_fields" readonly>
                    </td>
                    <td> <input type="text" name="user_id" value="<?php echo $ro['unique_user_id'];?>" class="all_show_fields" readonly></td>
                    <td> <input type="text" name="user_name" value="<?php echo $ro['user_name'];?>" class="all_show_fields" readonly> </td>
                    <td> <input type="text" name="request_balance" value="<?php echo $ro['payout_amount'];?>" class="all_show_fields" readonly> </td>
                    <td> <input type="text" name="fees_amount" value="<?php echo $ro['fee_amount'];?>" class="all_show_fields" readonly> </td>
                    <td>
                        <?php
					        $date=explode(' ',$ro['payout_request_date']);
					        echo $date['0']. ' &nbsp' .$date['1'];
                        ?> 
                    </td>
                    <td>
					    <?php
					        if($ro['payout_accept_status']==0)
					        {
					            echo '<span style="background-color:yellow"> Pending  </span>';
					        }
					        else if($ro['payout_accept_status']==1)
					        {
					            echo '<span style="color:green"> Accepted </span>';
					        }
					        else if($ro['payout_accept_status']==2)
					        {
					            echo '<span style="color:red"> Declined </span>';
					        }
					        else if($ro['payout_accept_status']==3)
					        {
					            echo '<span style="color:green"> Successfully  </span>';
					        }
					        else if($ro['payout_accept_status']==4)
					        {
					            echo '<span style="color:red"> Failed  </span>';
					        }
					        
					    ?>
					</td>
                </tr>
               
                <?php
                        }
                    }
                    
                ?>
             </tbody>
    </table>
                </div><!-- /.box-body -->
              </div><!-- /.box -->
              
            </div><!-- /.col -->
          </div><!-- /.row -->
        </section><!-- /.content -->
      </div><!-- /.content-wrapper -->
    
    <!---   bank details show modal   ->
    <div class="container">
  <!-- Modal -->
  <div class="modal fade" style="z-index: 9999" id="bank_details_show_modal" role="dialog">
    <div class="modal-dialog" style="margin-top: 4%;">
    
      <!-- Modal content-->
      <div class="modal-content col-sm-8 col-sm-offset-2">
       
        <div class="modal-body">
		<form method="POST" id="form1">
		
			<div class="row" style="text-align: center; padding-top: 10px">
				<h5 style="font-weight: 400; color: #4f565a; font-size: 17px; font-family: "Brandon Grotesque","proxima-nova","Helvetica Neue",Helvetica,Arial,sans-serif"> 
					User bank details <span id="md_user_name">  </span>  
				</h5>
			</div>
			<br>
			<div class="row">
				<div class="form-group">
					<div class="col-sm-8 col-sm-offset-2 print_data" style="color: black; font-weight: 600; padding-left:10px; font-size: 15px; text-align: left; line-height: 28px">
					    
					    Name : <span id="user_name"></span> <br>
					    Unique id : <span id="user_id"></span>
					    <hr>
					    Adhar Number : <span id="print_adhar"></span> <br>
					    Pan Number : <span id="print_pan"></span> <br>
					    Holder Name : <span id="print_holder"></span> <br>
					    Ifsc Code : <span id="print_ifsc"></span> <br>
					    Nominee Name : <span id="print_nominee"></span>
						<br>
						 <span id="md_msg">  </span>
					</div>
				</div>
			</div>
			<br>
			<div class="row">
				<div class="form-group">
					<div class="text-center">
						<input type="button" class="btn btn-info" id="" data-dismiss="modal" value="Cancel">
					</div>
				</div>
			</div>
        </form>
		</div>
		
      </div>
      
    </div>
  </div>
</div>


	 <!-- jQuery 2.1.3 -->
    <script src="plugins/jQuery/jQuery-2.1.3.min.js"></script>
    <!-- jQuery UI 1.11.2 -->
    <script src="https://code.jquery.com/ui/1.11.2/jquery-ui.min.js" type="text/javascript"></script>
    <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
     <?php
    if($status=='Deactive')
    {
        include 'modal_show.php';
    }
    ?>
    <script>
      $.widget.bridge('uibutton', $.ui.button);
    </script>
    <!-- Bootstrap 3.3.2 JS -->
    <script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>    
    <!-- Morris.js charts -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
    <!--<script src="plugins/morris/morris.min.js" type="text/javascript"></script>-->
    <!-- Sparkline -->
    <script src="plugins/sparkline/jquery.sparkline.min.js" type="text/javascript"></script>
    <!-- jvectormap -->
    <script src="plugins/jvectormap/jquery-jvectormap-1.2.2.min.js" type="text/javascript"></script>
    <script src="plugins/jvectormap/jquery-jvectormap-world-mill-en.js" type="text/javascript"></script>
    <!-- jQuery Knob Chart -->
    <script src="plugins/knob/jquery.knob.js" type="text/javascript"></script>
    <!-- daterangepicker -->
    <script src="plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
    <!-- datepicker -->
    <script src="plugins/datepicker/bootstrap-datepicker.js" type="text/javascript"></script>
    <!-- Bootstrap WYSIHTML5 -->
    <script src="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js" type="text/javascript"></script>
    <!-- iCheck -->
    <script src="plugins/iCheck/icheck.min.js" type="text/javascript"></script>
    <!-- Slimscroll -->
    <script src="plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script>
    <!-- FastClick -->
    <script src='plugins/fastclick/fastclick.min.js'></script>
    <!-- AdminLTE App -->
    <script src="dist/js/app.min.js" type="text/javascript"></script>
    <!--  Data table js link   --->
    <script src="DataTables/datatables.min.js"></script>
    
   	 <!----     tool ip0 link for hover   ----->
	 <script language="JavaScript" src="css/bubble-tooltip.js"></script>
    <script src="css/tooltip.js"></script>
    
    <script>
	 $('#example').DataTable();
	 
	 $(document).ready(function(){
	     $(".bank_details_show").click(function(){
	         //  append value into modal
	         $("#user_id").text(this.id);
	         $("#user_name").text($(this.form.hdn_name).val());
	         $("#print_adhar").text($(this.form.hdn_adhar).val());
	         $("#print_pan").text($(this.form.hdn_pan).val());
	         $("#print_holder").text($(this.form.hdn_holder_name).val());
	         $("#print_ifsc").text($(this.form.hdn_ifsc).val());
	         $("#print_nominee").text($(this.form.hdn_nominee).val());
	         //  show modal
	         $("#bank_details_show_modal").modal('show');
	     });
	     $(".action_btn").click(function(){
	           if(!$('.all_checked_id').is(":checked"))
	             {
	                 alert("Please select any row");
	                 return false;
	             }
	     });
	 });
    </script>
	
<?php
include 'include/footer.php';
?>