ok

Mini Shell

Direktori : /home2/selectio/www/frames-hub/ui-pages/
Upload File :
Current File : /home2/selectio/www/frames-hub/ui-pages/print-customer-histomer.php

<?php
include"../api/config/config.php";



if(isset($_REQUEST['customer_name']) && $_REQUEST['customer_name']!='')
{
    $customer_id = $_REQUEST['customer_name'];
    
$statement = $pdo->prepare("SELECT frames.*,customer.cust_firstname,customer.cust_phone FROM `frames` LEFT JOIN customer ON frames.customer_id=customer.id WHERE 1=1 and customer.id=".$customer_id);
$statement->execute();
$customer_result = $statement->fetchAll(PDO::FETCH_ASSOC); 
$total_customer_frames=$statement->rowCount();
    
?>

                    <div class="canvas_div_pdf" id="print_history_frame">
        		    
        			    <table style="width:100%;border-collapse: collapse!important">
            		           <tr>
            		               <td style="text-align:center;">
            		                   <img src="https://selectionsilks.com/frames-hub/image/frames-hub-org.png" style="width:16%;height:10%;"><br>
            		                   <h2 style="font-family: SFProDisplay-Bold;font-size: 28px;margin-bottom: 2rem;font-weight: bold;">Frames Hub</h2>
            		               </td>
            		           </tr>
            		           
            		       </table>
            		       
            		       <table style="width:100%;border-collapse: collapse!important" class="table_style">
            		           <tr>
            		             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border-right:none!important;border: 1px solid #ddd;">Name</td>
            		             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border-right:none!important;border-left:none!important;border: 1px solid #ddd;">:</td>
            		             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border-left:none;border: 1px solid #ddd;"><?=$customer_result[0]['cust_firstname']?></td>
            		             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border-right:none!important;border: 1px solid #ddd;">Mobile No</td>
            		             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border-right:none!important;border-left:none!important;border: 1px solid #ddd;">:</td>
            		             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border-left:none!important;border: 1px solid #ddd;">+91 <?=$customer_result[0]['cust_phone']?></td>
            		           </tr>
            		       </table>
        			    <?php foreach($customer_result as $frames_result){  ?>
        			    
                        
            		           <br>
            		        <table style="width:100%;border-collapse: collapse!important;border: 1px solid #ddd;" class="table_style">
            		            <tr>
            		                <td colspan="3">
            		                    <center><h2 style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight">Power Details</h2></center>
            		                    
            		                </td>
            		            </tr>
            		            <tr>
            		                <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;"><b>Lens Type</b> &nbsp;&nbsp; :  &nbsp;&nbsp; <?=$frames_result['lens_type']?></td>
            		                <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;"><b>Date</b> &nbsp;&nbsp; :  &nbsp;&nbsp; <?=date('d-m-Y', strtotime($frames_result["date"]))?></td>
            		                <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;"><b>PD</b> &nbsp;&nbsp; :  &nbsp;&nbsp; <?=$frames_result['fram_pd_first']?> - <?=$frames_result['frame_pd_second']?></td>
            		               
            		            </tr>
            		            <tr>
            		                <td colspan="3">
            		                    <table style="width:100%;">
            		                         <tr>
            		                             <td style="border: 1px solid #ddd;"></td>
            		                             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;">SPH</td>
            		                             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;">CYL</td>
            		                             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;">AXIS</td>
            		                             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;">ADD</td>
            		                         </tr>
            		                          <tr>
            		                             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;">RE</td>
            		                             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;"><?=$frames_result['right_sph']?></td>
            		                             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;"><?=$frames_result['right_cyl']?></td>
            		                             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;"><?=$frames_result['right_axis']?></td>
            		                             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;"><?=$frames_result['right_add']?></td>
            		                         </tr>
            		                          <tr>
            		                             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;">LE</td>
            		                             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;"><?=$frames_result['left_sph']?></td>
            		                             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;"><?=$frames_result['left_cyl']?></td>
            		                             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;"><?=$frames_result['left_axis']?></td>
            		                             <td style="font-family: SFProDisplay-Bold!important; font-size: 20px; margin-bottom: 2rem; font-weight;text-align:center;border: 1px solid #ddd;"><?=$frames_result['left_add']?></td>
            		                         </tr>
            		                         
            		                    </table>
            		                    
            		                </td>
            		            </tr>
            		            
            		        </table> 
        				<?php } ?>
        				
        			</div>	
        				
                     <br>

                        	<div class="row">
                             <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
                                 <center><input type='button' id='btn' value='Print' onclick='printDiv();' class="btn btn-warning btn-sm"> &nbsp;&nbsp;&nbsp; <button onclick="getPDF()" class="btn btn-primary btn-sm">Download</button> &nbsp;&nbsp;&nbsp;<a href="https://api.whatsapp.com/send?phone=<?=$customer_result[0]['cust_phone']?>&text=" target="_blank" class="btn btn-success btn-sm "><i class="fa fa-share-alt"></i> Whatsapp </a> &nbsp;&nbsp;&nbsp; </center>
                             </div>
                         </div><br><br>

<?php } ?>
<script>
    function printDiv() 
{

  var divToPrint=document.getElementById('print_history_frame');

  var newWin=window.open('','Print-Window');

  newWin.document.open();

  newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>');

  newWin.document.close();

  setTimeout(function(){newWin.close();},10);

}
</script>
<style>
.table_style {
  border-collapse: collapse!important;
  width: 100%;
}

.table_style td, #customers th {
  border: 1px solid #ddd;
  padding: 8px!important;
}


.table_style th {
  padding-top: 12px!important;
  padding-bottom: 12px!important;
  text-align: center!important;
}
</style>

Zerion Mini Shell 1.0