<?php

session_start();


if (!isset($_SESSION['admin_userName'])) {
    header('Location: login.php');
    }
?>
<?php
                                include '../Admin_modules/fetch_by_date.php'; ?>

<?php include("header.php"); ?>
<style>
     .g{
        background-color: rgba(0,0,0,0.5);
    }
     #nav  .d1
    {
        color: #f9a825;
        font-weight: 600;
    }
    nav a:hover {
       background-color: #721418;
       color: #f9a825;
       font-weight: 600;
}
@media print {
  body * {
    visibility: hidden;
  }
  #pay-by-date-tb, #pay-by-date-tb * {
    visibility: visible;
    margin-top: 0px;
  }
  #logo, #logo * {
    visibility: visible;
  }
  #brdate, #brdate * {
    visibility: visible;
  }
  #pay-by-date-tb{
    position: absolute;
    left: 0;
    top: 20%;
  }
}
</style>
<body>
    <div class="logo" id="logo" style="text-align: center; visibility: hidden;" >
        <img src="img/sun logo4.jpg" style="width: 30%; margin-bottom: 20px;">
    </div>
    <div id="brdate" style="text-align: center;font-weight: bold; margin: 10px; font-size: 25px; visibility: hidden;">
        <span>From:&nbsp;<?php echo $fromDate;?></span>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <span>To:&nbsp;<?php echo $toDate;?></span>
    </div>

<div class="wrapped" style="position: absolute; top: 20%;">
	<div class="col-md-12 ">
    
        <div class="card" style=" border-radius: 8px; margin: 10px 10px 10px 10px;">
            <div class="data" style=" padding: 10px">
				 <!--Grid row-->
                <form action="vvp_pay_by_date.php" method="POST" style="width: 100%;">
                <div class="row" style="margin-top: 10px; padding-right: 100px">
                    
                    	 
    					<div class="col-md-1" style="text-align: center; padding-top: 12px"><label style="float: right;"><b> From Date :</b></label></div>
                        
                        <!--Grid column-->
                        <div class="col-md-2">
                            <div class="border-light">
                                  <input type="date" id="date" name="from_date" data-date-inline-picker="true" class="form-control mb-4" value="<?php echo date("Y-m-d");?>" max="<?php echo date("Y-m-d");?>">
                            </div>
                        </div>
                        
                       
    					<div class="col-md-1" style="text-align: center; padding-top: 12px"><label style="float: right;"><b>To Date :</b></label></div>
                        
                        <!--Grid column-->
                        <div class="col-md-2">
                            <div class="border-light">
                                  <input type="date" id="date" name="to_date" data-date-inline-picker="true" class="form-control mb-4" value="<?php echo date("Y-m-d");?>" max="<?php echo date("Y-m-d");?>">
                            </div>
                        </div>
                        <!--Grid column-->
                        <div class="col-md-2">
                        	<button class="btn  btn-rounded btn-sm my-0" type="submit" id="search" name="search" class="btn-change" style="background-color: #00AC8B;font-size: 14px"><span>SEARCH</span></button>
                        </div>
                    
                </div>
                </form> 
            </div>
        </div>
    </div>

    <p class="solid1" style="outline-style: solid; margin-top: 10px; margin-bottom: 20px; color: #00AC8B" />



 <div class="row" >

                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                     
                        <div class="card" style="padding: 40px; margin-top: 30px;">
                       
                           <!-- <div class="tbl_header"><h1>Franchise Table</h1></div> -->
                            <div class="sparkline13-graph">
                                <div class="datatable-dashv1-list custom-datatable-overright" >
                                   <div id="printable">
                                    <table id="table" data-toggle="table" data-pagination="true" data-search="true" data-show-columns="false" data-show-pagination-switch="false" data-show-refresh="false" data-key-events="true" data-show-toggle="false" data-resizable="true" data-cookie="true"
                                        data-cookie-id-table="saveId" data-show-export="false" data-click-to-select="true" data-toolbar="#toolbar">
                                        <thead>
                                            <tr>
                                                
                                            
                                                
                                               
                                                <th data-field="id">Receipt Number.</th>
                                                <th data-field="fullname" data-editable="true">From</th>
                                                <th data-field="MobileNo" data-editable="true">To</th>
                                                <th data-field="loginpin" data-editable="true">To Branch</th>
                                                
                                                <th data-field="emailId" data-editable="true">Particulars</th>
                                                <th data-field="Location" data-editable="true">Kg</th>
                                                <th data-field="pinnumber" data-editable="true">Grand Total</th>
                                                <th data-field="status" data-editable="true">VPP Amount</th>
                                                
                                                <th data-field="Action" data-editable="true">Status</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php
                                            $_SESSION['vppData']=$report_data;
                                                $x=1;
                                                 foreach ($report_data as $key => $value) {?>
                                    <tr>
                                        <td><?php echo $value['rc_number'];?></td>
                                        <td><?php echo $value['rc_from'];?></td> 
                                        <td><?php echo $value['rc_to'];?></td> 
                                         <td><?php echo $value['rc_toBranch'];?></td>
                                        <td>
                                            <?php
                                                $des=$value['rc_particulars'];
                                                $ex=explode('_', $des);
                                                $new = strtoupper(end($ex));
                                                echo $new;
                                            ?>
                                                
                                            </td> 
                                       
                                        <td><?php echo $value['rc_kg']; echo " KG";?></td> 
                                       <!--  <td><?php echo "&#8377; "; echo $value['rc_cour_total'];?></td>  
                                        <td><?php echo "&#8377; "; echo $value['rc_gst_total'];?></td> -->
                                        <td><?php echo "&#8377; "; echo $value['rc_total'];?></td>
                                     <td><?php echo $value['rc_vvp'];?></td> 

                                        <td><?php echo $value['vvp_payment_status'];  ?></td>
                                    </tr>
                                
                                               <?php }
                                            ?>
                                            
                                            
                                         
                                         
                                           
                                        </tbody>
                                    </table>
                                    </div>
                                                <button name="submit" type="submit" style="background-color: transparent; border: none;"><a class="btn" target="_blank" href="printVPP.php?vppSt=" style="background-color: #00AC8B; border-radius: 4px; color: #fff">Print</a></button>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>


</div>        

</div>	
</body>
<?php 

    include 'datatable.php';

?>