<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title></title>
	
	
	  <style>
        
        h1,h2,h3,h4,h5,h6{
            margin: 0;
            padding: 0;
        }
        p{
            margin: 0;
            padding: 0;
        }
        .container7{
            width: 100%;
            margin-right: auto;
            margin-left: auto;
			background-color: #F6F6F6;
        }
        .brand-section{
           background-color: #0d1033;
           padding: 10px 40px;
		   border: 1px solid gray;
        }
		.brand-section1{
           background-color: #F6F6F6;
           padding: 10px 40px;
		   font-size:7px;
		   border: 1px solid gray;
        }
        .logo{
            width: 50%;
        }

        .row{
            display: flex;
            flex-wrap: wrap;
        }
        .col-6{
            width: 50%;
            flex: 0 0 auto;
        }
        .text-white{
            color: #fff;
        }
        .company-details{
            float: right;
            text-align: right;
        }
        .body-section{
            padding: 16px;
            border: 1px solid gray;
        }
        .heading{
            font-size: 15px;
            margin-bottom: 08px;
        }
        .sub-heading{
            color: #262626;
            margin-bottom: 05px;
			font-size:12px;
        }
        table{
            background-color: #fff;
            width: 100%;
            border-collapse: collapse;
        }
        table thead tr{
            border: 1px solid #111;
            background-color: #f2f2f2;
        }
        table td {
            vertical-align: middle !important;
            text-align: center;
        }
        table th, table td {
            padding-top: 08px;
            padding-bottom: 08px;
        }
        .table-bordered{
            box-shadow: 0px 0px 5px 0.5px gray;
        }
        .table-bordered td, .table-bordered th {
            border: 1px solid #dee2e6;
        }
        .text-right{
            text-align: end;
        }
        .w-20{
            width: 20%;
        }
        .float-right{
            float: right;
        }
    </style>

   </head>
   
   <body>
   
   <?php
   
   $sql81 = "SELECT quotation.quot_no,quotation.quot_date,quotation.quot_status,clients.client_fname,clients.client_lname,clients.client_phone,quotation.total_amount,quotation.vat,quotation.grand_total_amount,clients.client_email FROM quotation,quotation_items 	
					WHERE quotation.quot_id = {$quot_id} and clients.client_id=quotation.client_id";

				$result81 = $conn->query($sql81);
   
 	
				
				while($data81 = mysqli_fetch_array($result81))
							{
							$quotNo = $data81['quot_no'];
							$client = $data81['client_fname'].'&nbsp&nbsp'.$data81['client_lname'];
							$firstname = $data81['client_fname'];
							$phoneNumber = $data81['client_phone'];
							$total_amount = $data81['total_amount'];
							$vat = $data81['vat'];
							$vat_rate = $data81['vat_rate'];
							$grand_total_amount = $data81['grand_total_amount'];
							$clientEmail = $data81['client_email'];
							$quot_date = $data81['quot_date'];
							$mailto = $data81['client_email'];
				            }
                  $quotDate = date('Y-m-d', strtotime($quot_date));
  
				 $phone = substr($phoneNumber, 3);
	             $phone_number = '0'.$phone;
				 
   ?>
   
   
   <div class="container7">
        <div class="brand-section">
            <div class="row">
                <div class="col-6">
                    <h1 class="text-white">Kreen Logistics</h1>
                </div>
                <div class="col-6">
                    <div class="company-details">
                        <p class="text-white">0757965150</p>
						<p class="text-white">info@kreenlogistics.co.tz</p>
                    </div>
                </div>
            </div>
        </div>
		
		<div class="brand-section1">
            <div class="row">
                <div class="col-12">
                    <h1 class="text-black"><center>QUOTATION</center></h1>
                </div>
            </div>
        </div>

        <div class="body-section">
		
		 
            <div class="row">
			
			   <table border="0" style="width:100%">
			   
			   <tr>
			   <td style="width:45%">
                <div class="col-6">
                    <h2 class="heading">Quotation No: <?php print $quotNo; ?></h2>
                    <p class="sub-heading"><b>Date:</b> <?php print $quotDate; ?> </p>
                </div>
				</td>
				<td style="width:55%">
                <div class="col-6">
                    <p class="sub-heading"><b>Client:</b>  <?php print $client; ?></p>
					<p class="sub-heading"><b>Phone Number:</b>  <?php print $phone_number; ?> </p>
					<p class="sub-heading"><b>Email: </b> <?php print $clientEmail; ?>  </p>
                </div>
				</td>
				</tr>
				</table>
            </div>
        </div>

        <div class="body-section">
            <h3 class="heading">Expenses</h3>
            <br>
          
            <table class="table-bordered">
                <thead>
                    <tr>
					    <th><center>S/N</center></th>
                        <th><center>Services</center></th>
                        <th class="w-20"><center>Quantity</center></th>
                        <th class="w-20"><center>Price</center></th>
                        <th class="w-20"><center>Total</center></th>
                    </tr>
                </thead>
                <tbody>
				
				<?php
  $procRequestSql = "SELECT quotation_items.qty,quotation_items.standardexp_id,quotation_items.unit_price,quotation_items.amount,inv_services.name FROM inv_services,quotation_items WHERE quotation_items.standardexp_id=inv_services.invserv_id and quotation_items.quot_id = {$quot_id}";
  $procRequestResult = $conn->query($procRequestSql);
                    $x = 1;
					$no = 1;
    while($procRequestData = $procRequestResult->fetch_array()){ 

    ?>
				
                    <tr>
					    <td><?php print $no;  ?></td>
                        <td><?php print $procRequestData['name'];  ?></td>
                        <td><?php print $procRequestData['qty'];?></td>
                        <td><?php print number_format($procRequestData['unit_price'],2);  ?></td>
                        <td><?php print number_format($procRequestData['amount'],2);  ?></td>
                    </tr>
                    
					
				<?php
				$no++;
}
?>	
					
	<tr>
                        <td colspan="4" class="text-right">Sub Total </td>
                        <td> <?php print number_format($total_amount,2); ?></td>
                    </tr>
                    <tr>
                        <td colspan="4" class="text-right">VAT <?php echo $vat_rate; ?>%</td>
                        <td> <?php print number_format($vat,2); ?></td>
                    </tr>
                    <tr>
                        <td colspan="4" class="text-right">Grand Total</td>
                        <td> <?php print number_format($grand_total_amount,2); ?></td>
                    </tr>				
					
					
                </tbody>
            </table>


		
        </div>

        <div class="body-section">
			 <p>&copy; Copyright <?php print date("Y");  ?> - Kreen Logistics. All rights reserved.
        </div>      
    </div>
   
 		  
</body>
</html>	
			  
		
		
 
  
		
			  
			  
			  
			  
			  
			  
			  
			  
			  
  
		
			  
  
		
			  
			  
			  
		
		
 
  
		
			  
			  
			  
		
		
 
  
		
			  
			  
			  
			  
		
		
 
  
		
			  
			  
			  
			  
			 
			  
			  
			  
			 
 
		
			  
			  
			  
			  
		
 
  	  
			  
			  
			 
			  
			  
			  
			  
				 
				 
   
   