<?php

session_start();


if (!isset($_SESSION['admin_userName'])) {
    header('Location: login.php');
    }
?>
<?php include("header.php");
?>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

    
<style >
     .b {
        background-color: rgba(0,0,0,0.5);
    }
     #nav  .b1
    {
        color: #f9a825;
        font-weight: 600;
    }
       nav a:hover {
    background-color: #721418;
    color: #f9a825;
        font-weight: 600;
}
/*#printHead{*/
/*      display: none;*/
/*  }*/

@media print {
  body * {
visibility: hidden;
}
  #memo-tb, #memo-tb * {
    visibility: visible;
    margin-top: 0px;
  }
  /*#logo, #logo * {*/
  /*  visibility: visible;*/
  /*}*/
  /*#brdate, #brdate * {*/
  /*  visibility: visible;*/

  /*}*/
  
  /*#amemo-tb{*/
  /*  position: absolute;*/
  /*  left: 0;*/
  /*  top: 0;*/
  /*}*/
  .printable{
      margin-top: -36%;
  }
 
  
  
}
</style>
<?php
     include '../Admin_modules/memo_fetch.php';?>
<body>
                       
                            
                        
	<div id="row-data" class="row">



        <!--Grid column-->
    <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="memo.php" method="POST" class="printHide" style="width: 100%;">
                <div class="row" style="margin-top: 10px; ">
                    
                    	<div class="col-md-1" style="text-align: center; padding-top: 12px"><label style="float: right;"><b>To Branch :</b></label></div>
                        <!--Grid column-->
                        <div class="col-md-2">
                            <div class="border-light">
                            	<select name="memo_from" id="memo_from" class="form-control mb-4">
                            		<option value="def">Select Branch</option>
                                    <?php
                                        include '../Admin_modules/branch_call.php';

                                        foreach ($branch_fetch as $key => $value) {?>
                                            <option id="<?php echo $value['branch_name'];?>"><?php echo $value['branch_name'];?></option> 
                                        
                                        <?php 
                                        }
                                    ?>
                                </select>
                            </div>
                        </div>
                        
                       
    					<div class="col-md-1" style="text-align: center; padding-top: 12px"><label style="float: right;"><b>Date :</b></label></div>
                        
                        <!--Grid column-->
                        <div class="col-md-2">
                            <div class="border-light">
                                  <input type="date" id="date" name="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>

             <p class="solid1" id="solid1" style="outline-style: solid;  color: #00AC8B" />
				<div class="row printable">
					<div class="col-md-12 table-responsive">
                        
                                
					<table class="table table-bordered " style="text-align: center; border-radius: 5px;" id="memo-tb">
					  
					  <thead style="border: none;">
					      
					       <tr class="printtr" style="background-color: #EFEEEE;text-align: center;border: none;">
					      <th class="printth" scope="col" colspan="11" style="border:none;">
                        <div class="logo" id="logo" style="text-align: center;" >
                        <img src="sunshine_banner.png" style="width: 30%; margin-bottom: 20px;">
                        </div>
                        <div id="brdate" style="text-align: center;font-weight: bold; margin: 10px; font-size: 25px; ">
                        <span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MEMO</span><br>
                        <span>Branch Name:&nbsp;<?php echo $from;?></span>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <span>Date:&nbsp;<?php echo date("d-m-Y",strtotime($date));?></span>
                        </div>
                        </th>
					    </tr>
					  
					    <tr style="background-color: #EFEEEE">
					      <th scope="col">Receipt Number</th>
					      <th scope="col">From</th>
					      <th scope="col">To</th>
					      <th scope="col">Particulars</th>
					      <th scope="col">No of Parcels</th>
					      <th scope="col">Kg</th>
					      <th scope="col">Courier Charges</th>
                          <th scope="col">VPP Amount</th>
					      <th scope="col">Grand Total</th>
                <th scope="col">Mode</th>
					      <th scope="col">Remarks</th>
					    </tr>
					  </thead>
					  <tbody>
					    
                            <?php
                            // for($i=1;$i<50;$i++){
                            foreach ($rc 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
                                                $des=$value['rc_particulars'];
                                                $ex=explode('_', $des);
                                                $new = strtoupper(end($ex));
                                                echo $new;
                                            ?>
                                                
                                            </td> 
                                        <td><?php echo $value['rc_parcels'];?></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_vvp'];?>
                                        </td>
                                        <td><?php echo "&#8377; "; echo $value['rc_total'];?></td>
                                        <td><?php echo $value['cc_status'];?></td>
                                        <td><?php if(!empty($value['rc_remarks'])){ echo $value['rc_remarks'];} else{echo "---";}?></td>

                                        <!-- <td><button name="submit" type="submit" style="background: transparent; border: none;"><a href="test.php?rc=<?php echo $value['rc_number'];?>&&from=<?php echo $value['rc_from'];?>&&to=<?php echo $value['rc_to'];?>&&kg=<?php echo $value['rc_kg'];?>&&brfrom=<?php echo $value['rc_fromBranch'];?>&&brto=<?php echo $value['rc_toBranch'];?>&&date=<?php echo $value['rc_date'];?>&&no_par=<?php echo $value['rc_parcels'];?>&&tot=<?php echo $value['rc_total'];?>&&type=<?php echo $new;?>" class="btn" style="background-color: #00AC8B; border-radius: 4px; color: #fff">Print</a></button></td> -->
                                    </tr>
                                
                                <?php 
                                } 
                                // }
                            ?>
					    
					  </tbody>
					</table>
                    <button name="submit" type="submit" style="background-color: transparent; border: none;" onClick="window.print();"><a class="btn" style="background-color: #00AC8B; border-radius: 4px; color: #fff">Print</a></button>
					</div>
				</div>
			</div>

        </div>
	</div>  
</div>
</body>
</html>

