<?php
error_reporting(0);
include ("../../include/db.php");
date_default_timezone_set('Asia/Kolkata');
ob_start();
session_start();
$user_id = $_SESSION['login_user_id'];
?>
<style type="text/css">
<!--
.style2 {font-size: 36px}
.header {	font-family: Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", serif;
	font-size: 60px;
	color: #06F;
}
.title0 {color:#000033;font-family:Calibri;font-size:16px;}
.title00 {	color: #000033;
	font-family: Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, sans-serif;
	font-size: 16px;
}
.title1 {color: #000033;font-family:Calibri;font-size: 17px;}
-->
</style>

<table width="916" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #999;">
<tr style="height:60">
<td width="137" height="106" align="center" style="font-size:12px; border-bottom:1px solid #999;"><img src="../../img/logo_image.png" width="125" height="173" style="padding-left:7px;"/></td>
<td width="711" colspan="5" align="center" valign="top" style="border-bottom:1px solid #999;"><span class="header">SRI AMMAN DIGITAL PRINTS</span><br/>
  <span width="80%" class="title1" style="font-size:15px;font-family:Verdana, sans-serif; font-weight:bold"> DOOR No: 1/2,1/3  KOMBAI THOTTAM MAIN ROAD,</span><br />
  <span width="80%" class="title0" style="font-size:15px;font-family:Verdana, sans-serif; font-weight:bold"><b></b>SELLANDIAMMAN THURAI ROAD,</span><br />
  <span width="80%" class="title0" style="font-size:15px;font-family:Verdana, sans-serif; font-weight:bold">TIRUPUR-641604 <span class="title0" style="font-size:15px;font-family:Verdana, sans-serif; font-weight:bold">TAMILNADU STATE INDIA,</span></span><br/>
  <br/>
  <span width="80%" class="title00" style="font-size:15px;font-family:Verdana, sans-serif; font-weight:bold"><b></b>Contact Office : 0421-4355333,+91 83442-33555,+91 83442-33888.</span><br/>
  <span width="80%" class="title00" style="font-size:15px;font-family:Verdana, sans-serif; font-weight:bold"><b></b>Email Id : sriammandigitalprints@gmail.com/yahoo.com,</span><br/>
  <span width="80%" class="title0" style="font-size:15px;font-family:Verdana, sans-serif; font-weight:bold"><b></b>TIN NO : 33826412977,</span> <span width="80%" class="title0" style="font-size:15px;font-family:Verdana, sans-serif; font-weight:bold"><b></b>CST NO : 33826412977/12.09.16, </span> <span width="80%" class="title0" style="font-size:15px;font-family:Verdana, sans-serif; font-weight:bold"><b></b>PAN NO : ADDFS1470L</span></td>
  </tr>
  <tr><td colspan="2" align="right"><div align="center" class="style2" style="font-size:25px; font-family:Arial, Helvetica, sans-serif;"><b>RATE QUOTATION</b></div></td></tr>
  <tr>
    <td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0" >
       
     <?PHP 
	$cust_name=$_GET['cust_name'];
    $sql="select * from   party_creation where party_name='$cust_name' and `party_type`='Customer' and delete_status!='1'   order by party_name ASC ";
    $rs=mysql_query($sql);
	$sno=0;
   		while($rsdata=mysql_fetch_array($rs))
  			{ 
   				$sno=$sno+1;
   				$party_name=$rsdata['party_name'];
     			$mobile_no=$rsdata['mobile_no'];
				$address=$rsdata['address'];
   				$city=$rsdata['city'];
			}

?>  

 <?PHP 
	$jobcard_no=$_GET['jobcard_no'];
    $sql="select * from   jobcard_quotation where jobcard_quot_no='$_GET[jobcard_quot_no]'";
    $rs=mysql_query($sql);
	 $rscount=mysql_num_rows($rs);
	
   		while($rsdata=mysql_fetch_array($rs))
  			{ 
   				$style_nos=$rsdata['style_no'];
     			$style_names=$rsdata['style_name'];
				$job_type=$rsdata['job_type'];
   				$fabric_type=$rsdata['fabric_type'];
				$combo2=$rsdata['combo'];
				$entry_date=$rsdata['entry_date'];
				 $order_bys=$rsdata['order_by'];
				$cust_po_no=$rsdata['cust_po_no'];
				$payment_terms1=$rsdata['payment_terms'];

				
			}

?>  

      <tr>
        <td width="531" rowspan="3" valign="top"  style="font-family:Verdana; font-size:14px;  letter-spacing:1px;line-height:16px; padding-left:0px;border-right:0px solid #999;"><p><b>&nbsp;To,</b></p>
            <p style="padding-left:20px;">M/S&nbsp;<?php echo $_GET['cust_name'];?>,<br />
              <?php echo $address;?>&nbsp;<br />
              <?php echo $city;?>&nbsp;</p>
            <p><br />
            </p></td>
        <td height="23" colspan="3" valign="top"  style="font-family:Verdana; font-size:14px; padding-right:30px;"><div align="right">
          <p><b>Date:</b>
            <?php  echo date('d-m-Y',strtotime($entry_date)); ?>
            </p>
        </div></td>
        </tr>
      
      <tr>
        <td width="103" height="19" colspan="-2" valign="top"  style="font-family:Verdana; font-size:14px;">&nbsp;</td>
        <td width="66" colspan="-2" align="center" valign="top" >&nbsp;</td>
        <td width="148" colspan="-2"  align="left" valign="top"  style="font-family:Verdana; font-size:14px;">&nbsp;</td>
      </tr>
      <tr>
        <td height="19" colspan="3" valign="top"  style="font-family:Verdana; font-size:14px;">&nbsp;</td>
        </tr>
      
      <tr>
        <td valign="top" style="font-family:Verdana; font-size:14px;border-right:0px solid #999; padding-left:0px;"><b>&nbsp;Dear Sir,</b></td>
        <td height="18" style="font-family:Verdana; font-size:14px;">&nbsp;</td>
        <td align="center" style="font-family:Verdana; font-size:14px;">&nbsp;</td>
        <td style="font-family:Verdana; font-size:14px;">&nbsp;</td>
      </tr>
        <tr>
        <td valign="top" style="font-family:Verdana; font-size:14px;border-right:0px solid #999; padding-left:30px;">&nbsp;&nbsp;<b>Our best rate for sublimation digital printing are as follows,</b></td>
        <td height="18" style="font-family:Verdana; font-size:14px;">&nbsp;</td>
        <td align="center" style="font-family:Verdana; font-size:14px;">&nbsp;</td>
        <td style="font-family:Verdana; font-size:14px;">&nbsp;</td>
      </tr>
     
      <tr>
        <td colspan="10" height="172" valign="top">
          <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> 
           <tr>
             <td rowspan="3" align="center"  style="font-family:Verdana; font-size:14px; font-weight:bold; border-bottom:0px solid #999; border-top:0px solid #999;border-right:0px solid #999;">&nbsp;</td>
             <td height="22" width="278"  align="center"  style="font-family:Verdana; font-size:14px; border-bottom:0px solid #999; border-top:0px solid #999;border-right:0px solid #999;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Style Name&nbsp;&nbsp;:</b></td>
             
             <td  align="left" style="font-family:Verdana; font-size:14px; border-bottom:0px solid #999; border-top:0px solid #999;border-right:0px solid #999;">&nbsp;<?php echo $style_names ;?></td>
             <td colspan="6" rowspan="3"  align="center" style="font-family:Verdana; font-size:14px; border-bottom:0px solid #999; border-top:0px solid #999;border-right:0px solid #999;">&nbsp;</td>
             </tr>
           <tr>
             <td height="22"  align="center"  style="font-family:Verdana; font-size:14px; border-bottom:0px solid #999; border-top:0px solid #999;border-right:0px solid #999;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Style No&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b></td>
             <td  align="left" style="font-family:Verdana; font-size:14px; border-bottom:0px solid #999; border-top:0px solid #999;border-right:0px solid #999;">&nbsp;<?php echo $style_nos ;?></td>
             </tr>
           <tr>
             <td height="22"  align="left"  style="font-family:Verdana; font-size:14px; border-bottom:0px solid #999; border-top:0px solid #999;border-right:0px solid #999;">&nbsp;</td>
             <td  align="left" style="font-family:Verdana; font-size:14px;border-bottom:0px solid #999; border-top:0px solid #999;border-right:0px solid #999;">&nbsp;</td>
             </tr>
             
           <tr>
       <td width="66" height="21" align="center"  style="font-family:Verdana; font-size:13px; font-weight:bold; border-bottom:1px solid #999; border-top:1px solid #999;border-right:1px solid #999;">&nbsp;S.No</td>
       <td width="278"  align="left"  style="font-family:Verdana; font-size:13px;font-weight:bold; border-bottom:1px solid #999; border-top:1px solid #999;border-right:1px solid #999;">&nbsp;&nbsp;Particulars</td>
              <td width="149"  align="center" style="font-family:Verdana; font-size:13px;font-weight:bold; border-bottom:1px solid #999; border-top:1px solid #999;border-right:1px solid #999;">&nbsp;Width</td>
              <td width="158"  align="center" style="font-family:Verdana; font-size:13px;font-weight:bold; border-bottom:1px solid #999; border-top:1px solid #999;border-right:1px solid #999;">&nbsp;Height</td>
             
              <td width="153"  align="right" style="font-family:Verdana; font-size:13px;font-weight:bold; border-bottom:1px solid #999; border-top:1px solid #999;border-right:1px solid #999;">Amount&nbsp;</td>
            
              <td width="110"  align="right" style="font-family:Verdana; font-size:13px;font-weight:bold; border-bottom:1px solid #999; border-top:1px solid #999;border-right:1px solid #999;">Qty&nbsp;</td>
             
              </tr>
              <?PHP 
	$jobcard_quot_no=$_GET['jobcard_quot_no'];

    $sql="select * from   jobcard_quotation_sub where jobcard_quot_no='$jobcard_quot_no'";
    $rs=mysql_query($sql);
 $rscount_sub=mysql_num_rows($rs);
	$sno=0;
   		while($rsdata=mysql_fetch_array($rs))
  			{ 
   				$sno=$sno+1;
   				$job_id=$rsdata['job_id'];
     			$jobcard_no=$rsdata['jobcard_no'];
				$particulars=$rsdata['particulars'];
   				$width=$rsdata['width'];
				$height=$rsdata['height'];
				$rate=$rsdata['rate'];
				$amount=$rsdata['amount'];
				$conformed_amt=$rsdata['conformed_amt'];
				$qty=$rsdata['qty'];
				$jobcard_values=$rsdata['jobcard_values'];
				if($weight_kg=="0.00")
				{
					$weight_kg_res='';
				}
				else
				{
					$weight_kg_res=$weight_kg;
				}
				$kg_rate=$rsdata['kg_rate'];
				
				if($kg_rate=="0.00")
				{
					$kg_rate_res='';
				}
				else
				{
					$kg_rate_res=$kg_rate;
				}
				$frieght_charge=$rsdata['frieght_charge'];
?>

              <tr>
              <td width="66" height="34" align="center"  style="font-family:Verdana; font-size:13px;border-right:1px solid #999;border-bottom:1px solid #999;"><?php echo $sno; ?>&nbsp;</td>
              <td width="278" align="left"  style="font-family:Verdana; font-size:13px;border-right:1px solid #999;border-bottom:1px solid #999;">&nbsp;&nbsp;<?php echo $particulars; ?>&nbsp;</td>
              <td width="149" align="center" style="font-family:Verdana; font-size:13px;border-right:1px solid #999;border-bottom:1px solid #999;"><?php echo $width; ?>&nbsp;</td>
              <td width="158" align="center" style="font-family:Verdana; font-size:13px;border-right:1px solid #999;border-bottom:1px solid #999;"><?php echo $height; ?>&nbsp;</td>
             
              <td width="153" align="right"  style=";font-family:Verdana; font-size:13px;border-right:1px solid #999;border-bottom:1px solid #999;"><?php echo number_format($amount,4); ?>&nbsp;&nbsp;</td>
            
              <td width="110" align="right"  style="font-family:Verdana; font-size:13px;border-right:1px solid #999;border-bottom:1px solid #999;"><?php echo $qty; ?>&nbsp;</td>
             
              </tr>
              <?php $overall_values+= $jobcard_values;
			  $qtys+= $qty;
			  } ?>
              <?php 
			   
			    if($rscount_sub=='10')
			    {
				$height1='120px';
				}
				if($rscount_sub=='9')
			    {
				$height1='140px';
				}
			    if($rscount_sub=='8')
			    {
				$height1='160px';
				}
				if($rscount_sub=='7')
			    {
				$height1='180px';
				}	
				if($rscount_sub=='6')
				{
				$height1='190px';
				}	
				if($rscount_sub=='5')
				{
				$height1='240px';
				}	
				if($rscount_sub=='4')
			    {
				$height1='260px';
				}
				if($rscount_sub=='3')
			    {
				$height1='280px';
				}
				if($rscount_sub=='2')
			    {
				$height1='300px';
				}	
				if($rscount_sub=='1')
			    {
				$height1='340px';
				}	
				?>
      <tr height="<?php echo $height1; ?>">
              <td width="66" height="26" align="center"></td>
              <td width="278" align="left">&nbsp;</td>
              <td width="149" align="center">&nbsp;</td>
              <td width="158" align="center">&nbsp;</td>
              <td width="153" align="right">&nbsp;&nbsp;</td>
              <td width="110" align="right">&nbsp;</td>
    </tr>
  </table>
  </td>
      </tr>        
 <tr>
 <td colspan="10" height="62" valign="top"><table cellpadding="0" cellspacing="0" align="center" >
 <tr>  
 <?php
  $sql="select * from  file_upload_jobcard_quotation where jobcard_quot_no='$_GET[jobcard_quot_no]'";
    $rs=mysql_query($sql);
	$fcount=mysql_num_rows($rs);
	$sno=0;
   		while($rsdata=mysql_fetch_array($rs))
  			{ 
			$sno=$sno+1;
?>
<td valign="bottom" style="text-align:center; font-family:Verdana, sans-serif; font-size:14px; font-weight:bold;"><?php echo  $sno;?>
</td>
<?php } ?>
</tr>
   <tr>  
 <?php
  $sql="select * from  file_upload_jobcard_quotation where jobcard_quot_no='$_GET[jobcard_quot_no]'";
    $rs=mysql_query($sql);
	$fcount=mysql_num_rows($rs);
	$sno=0;
   		while($rsdata=mysql_fetch_array($rs))
  			{ 
   				$file_id=$rsdata['file_id'];
     			$file_name=$rsdata['file_name'];
?>
<td>
<div class="box left <?php echo $val[0]; ?> leftmargin"  style="width:50%;">
<img  src="../../upload/<?php echo  $file_name;?>" width="60" height="60"/></div>
</td>
<?php } ?>
</tr>
</table></td>
      </tr>
    </table>    </td>
  </tr>
  <tr>
 <td></td>
</tr>
  <tr>
    <td height="34" colspan="2"> <table style="border-bottom:1px solid #999;" width="100%" height="33" border="0" cellpadding="0" cellspacing="0" >
      <tr >
        <td width="645" height="33"   style="font-family: Verdana; font-size: 14px; border-top: 1px solid #999; border-right: 1px solid #999;  font-weight: bold;">&nbsp;&nbsp;&nbsp;<strong>PAYMENT TERMS :&nbsp;&nbsp;<?php echo $payment_terms1 ;?></strong></td>
        <td width="108" align="right"   style="font-family:Verdana; font-size:14px;border-top:1px solid #999; border-right: 1px solid #999;"><span style="font-weight: bold">Qty</span> &nbsp;&nbsp;&nbsp;</td>
        <td width="97" align="center"   style="font-family:Verdana; font-size:14px;border-top:1px solid #999;border-right:1px solid #999;"><div align="right"><?php echo number_format($qtys,2); ?>
        &nbsp;</div>
          <div align="right"></div>
          <div align="center"></div>
          <div align="left"></div></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="110" colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
    <tr>
    <td width="70%" height="110" valign="top" style="border-top:0px solid #999; font-family: Verdana; font-size: 14px; border-right:1px solid #999; padding-left:10px;" >
      1. Please check print before stiching and other process <br />
2. Our responsibility ceases absolutely after goods has been handed over to careers.<br />
3. Printing rejection ,color variation acceptable range 8-10% varies according to design and sizes. <br />
4. Payment requested only by payees account or demand draft<br />
5. Subject to tirupur jurisdiction.</td>
    <td width="30%" align="left" valign="bottom"    style="font-family: Verdana; font-size: 13px; padding:1px; border-top: 0px solid #999; font-weight: bold;"><p align="center"><strong>For <span style="color: #06F">SRI AMMAN DIGITAL PRINTS</span>&nbsp;</strong>
   </p>
     <p>&nbsp;</p>
     <p>&nbsp;</p>
     <center>
          <p>Mr . <?php echo $order_bys; ?></p>
          <p>Marketing Manager</p>
     </center></td>
      </tr>
    </table></td>
  </tr>
  
</table> 
<table>
    <td style="font-family: Verdana;font-size: 14px;padding-left: 820px;" align="right">Printed Date : <?php echo $curdate=date('d-m-Y');?>&nbsp;&nbsp;&nbsp;&nbsp;<br>Printed Time : <?php echo $current_time=date('h:i:s A');?>&nbsp;&nbsp;<br>IP Address   : <?php echo $ip_address = $_SERVER['REMOTE_ADDR'];?>&nbsp;</td>
    </table>
<style>
.title {
	color: #444;
	text-align: center;
}

.section {
	margin-bottom: 1%;
}

.red {
	background: #F6B89E;
}
.green {
	background: #AFD19F;
}
.left {
	float: left;
}

.leftmargin {
	margin-right: 1%;
}

.right {
	float: right;
}
.center {
	text-align:center;
 
}


.rightmargin {
	margin-left: 1%;
}

.box {
	height: 125px;
	width:125px;
	padding-top:60px;
	padding-right:6px;
	padding-left:15px;
	padding-bottom:30px;
}

.cf {
	clear: both;
}
</style>