<?php 
require_once 'vendor/autoload.php';
use Dompdf\Dompdf;
$connect = new PDO("mysql:host=localhost;dbname=pearlcrm_crmsoftware", "pearlcrm", "PEARL#crm@2023");

$querydiscount ="select * from quotation_order_01 where quotation_id = '".$_REQUEST['quotation_id']."' ";
$statement2 = $connect->prepare($querydiscount);
$statement2->execute();
$resultdiscount1 = $statement2->fetchAll();
foreach($resultdiscount1 as $list)
{ $bank_details=$list['bank_details'];

$quotation_id= $list['quotation_id'];$company_name= $list['company_name'];$c_id= $list['c_id'];$type_products= $list['type_products'];$address= $list['address'];$email_id= $list['email_id'];$contact= $list['contact'];$currency= $list['currency'];$unique_id= $list['unique_id'];$entry_date= $list['entry_date'];$entry_by= $list['entry_by'];$po_number= $list['po_number'];$po_date= $list['po_date'];$delivery_name= $list['delivery_name'];$warranty_name= $list['warranty_name'];$payment_mode= $list['payment_mode'];$tax_name= $list['tax_name'];$final_quotation_no= $list['final_quotation_no'];$f_year= $list['f_year'];$quotation_date= $list['quotation_date'];$quotation_type= $list['quotation_type'];$validity= $list['validity'];$installation_charge= $list['installation_charge'];
$installation_charge_text= $list['installation_charge_text'];$jurisdiction= $list['jurisdiction'];
$pf_and_delivery_charge= $list['pf_and_delivery_charge'];
$pf_and_delivery_charge_text= $list['pf_and_delivery_charge_text'];

$delivery_charges=$list['delivery_charges'];
$delivery_charges_text=$list['delivery_charges_text'];

$mobile_no= $list['mobile_no']; $subject=$list['subject'];
$bank_charges=$list['bank_charges'];
$bank_charges_text=$list['bank_charges_text'];

$enquiry_from=$list['enquiry_from'];
$enquiry_date=$list['enquiry_date'];

}



$query = "select * from quotation_more_product02 where quotation_id='$quotation_id' and c_id='$c_id' and item_type='machine' order by more_product_id ASC , item_sr_no ASC";
 $i=1;

	$statement = $connect->prepare($query);
	$statement->execute();
	$result = $statement->fetchAll();

	
	$output = '
	<!DOCTYPE html>
<html>
  <head>

<style type="text/css">
<!--
.style5 {font-family: Arial, Helvetica, sans-serif; font-size: 13px; }
.style5a {font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height:150%; padding-bottom:10px; padding-top:10px;; }

.style7 {font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; line-height:110%; }

.style8 {font-family: Arial, Helvetica, sans-serif; font-size: 13px; font-weight: bold; }

.style8a {font-family: Arial, Helvetica, sans-serif; font-size: 13px; }
  body{        
        padding-top: 60px;
        padding-bottom: 40px;
    }
    .container{
        width: 80%;
        margin: 0 auto; /* Center the DIV horizontally */
    }
    .fixed-header, .fixed-footer{
        width: 100%;
        position: fixed;        
        padding: 10px 0;
        color: #fff;
    }
    .fixed-header{
        top: 0;
    }
    .fixed-footer{
        bottom: 0;
    }    
    /* Some more styles to beutify this example */
    nav a{
        color: #fff;
        text-decoration: none;
        padding: 7px 25px;
        display: inline-block;
    }
    .container p{
        line-height: 200px; /* Create scrollbar to test positioning */
    }
</style>



<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>







<body>
<div class="fixed-header">
        <div class="container"> <img src="https://cnpmasterapp.com/dompdf/header_bar.png" alt="logo"></div>
    </div>
    <div class="container">

    <table width="100%">
    

      <tbody>
        <tr>
          <td>


            <div class="page">
			
			
	<table width="100%"  border="1">
<tr>
<td>Sr No </td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>

<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
			
			
 </div>    
    <div class="fixed-footer">
        <div class="container">Copyright &copy; 2016 Your Company</div>        
    </div>

</body>







</html>

	';
$dompdf = new Dompdf;
$dompdf->loadHtml($output);
$dompdf->setPaper('A4','portrait');
$dompdf->render();
$dompdf->stream('demo.pdf',array("Attachment"=>0));
