<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</head>
<?php
error_reporting(0);
include ("../../include/db.php");
date_default_timezone_set('Asia/Kolkata');
ob_start();
session_start();
$user_id = $_SESSION['login_user_id'];
?>

<table width="850px" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #999;">
<tr style="height:60">
<td width="112" height="106" align="right" style="font-size:12px; border-bottom:1px solid #999;"><img src="../../img/logo_image.png" width="125" height="173"/></td>
<td width="736" colspan="5" align="center" valign="top" style="border-bottom:1px solid #999;"><strong style="font-size: 50px; color: #06F; padding-top: 5px; width: 80px; font-family: Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", serif;">SRI AMMAN DIGITAL PRINTS</strong><br />
        <span width="80%" class="title1" style="font-size:15px;font-family:Verdana, sans-serif; font-weight:bold"><b></b></span><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:14px;font-family:Verdana, sans-serif; font-weight:bold"><b></b>GSTIN : 33ADDFS1470L1Z1, PAN NO : ADDFS1470L.</span><br/></td>
  </tr>
  <tr>
    <td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0" >
       <tr>
        <td width="543" height="20"  style="padding:3px; font-family:Verdana, sans-serif; font-size:12px; font-weight:bold;border-right:1px solid #999;"><strong>Customer Detail</strong></td>
        <td width="95" colspan="-2" style="font-family:Verdana; font-size:12px;">&nbsp;DC No</td>
        <td width="20" colspan="-2" align="center">:</td>
        <td width="192" colspan="-2" style="font-family:Verdana, sans-serif; font-size:12px;">&nbsp;<?php echo $_GET['delivery_no']; ?></td>
      </tr>
     <?PHP 
	$customer_name=$_GET['customer_name'];
    $sql="select * from   party_creation where party_name='$customer_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'];
				$tin_no=$rsdata['tin_no'];
				$gst_no=$rsdata['gst_no'];

			}

?>  

 <?PHP 
  function get_order_by($job_no)
{
$sql_query11="select * from jobcard_main where jobcard_no='$job_no' ";
$rs11=mysql_query($sql_query11);
 while($rsdata11=mysql_fetch_object($rs11))
 {
 $order_by=$rsdata11->order_by;
 } 
	return $order_by;
}
	$delivery_no=$_GET['delivery_no'];
    $sql="select * from   sticker_delivery_challan_main where delivery_no='$delivery_no'";
    $rs=mysql_query($sql);
   		while($rsdata=mysql_fetch_array($rs))
  			{ 
   				$style_no=$rsdata['style_no'];
     			$style_name=$rsdata['style_name'];
				$job_type=$rsdata['job_type'];
   				$fabric_type=$rsdata['fabric_type'];
				$combo=$rsdata['combo'];
				$date_time=$rsdata['date_time'];
				$order_by=$rsdata['order_by'];
				$cust_po_no=$rsdata['cust_po_no'];
				$job_no=$rsdata['job_no'];
				$order_by=get_order_by($job_no);
       $vehicle_no=$rsdata['vehicle_no'];
        $delivery_through=$rsdata['delivery_through'];
			}

?>  
      <tr>
         <td rowspan="4" valign="top"  style="font-family:Verdana; font-size:12px;  letter-spacing:1px;line-height:16px; padding-left:10px;border-right:1px solid #999;">To.M/S&nbsp;<?php echo $_GET['customer_name'];?>,<br /><?php echo $address;?>&nbsp;<br /><?php echo $city;?>&nbsp;<br /></td>
        <td height="19" colspan="-2" valign="top"  style="font-family:Verdana; font-size:12px;">&nbsp;Date</td>
        <td width="20" colspan="-2" align="center" valign="top" >:</td>
        <td colspan="-2"  align="left" valign="top"  style="font-family:Verdana; font-size:12px;">&nbsp;<?php  echo date('d-m-Y',strtotime($date_time)); ?>
          </td>
      </tr>
      <tr>
        <td height="19" colspan="-2" valign="top"  style="font-family:Verdana; font-size:12px;"> &nbsp;Job Type</td>
        <td width="20" colspan="-2" align="center" valign="top" >:</td>
        <td colspan="-2"  align="left" valign="top"  style="font-family:Verdana; font-size:12px;">&nbsp;<?php echo $job_type;?></td>
      </tr>
      <tr>
        <td height="19" colspan="-2" valign="top"  style="font-family:Verdana; font-size:12px;">&nbsp;JobCard No</td>
        <td width="20" colspan="-2" align="center" valign="top" >:</td>
        <td colspan="-2"  align="left" valign="top"  style="font-family:Verdana; font-size:12px;">&nbsp;<?php echo $job_no;?></td>
      </tr>
      <tr>
        <td height="19" colspan="-2" valign="top"  style="font-family:Verdana; font-size:12px;">&nbsp;Style No</td>
        <td width="20" colspan="-2" align="center" valign="top" >:</td>
        <td colspan="-2"  align="left" valign="top"  style="font-family:Verdana; font-size:12px;">&nbsp;<?php echo $style_no;?></td>
      </tr>
      <tr>
        <td valign="top" style="font-family:Verdana; font-size:14px;border-right:1px solid #999;"><b>Gst No :</b> &nbsp;&nbsp;<?php echo $gst_no;?></td>
        <td height="18" style="font-family:Verdana; font-size:12px;">&nbsp;Style Name</td>
        <td align="center" style="font-family:Verdana; font-size:12px;">:</td>
        <td style="font-family:Verdana; font-size:12px;">&nbsp;<?php echo $style_name;?></td>
      </tr>
      <tr>
        <td valign="top" style="font-family:Verdana; font-size:12px;border-right:1px solid #999;">&nbsp;</td>
        <td height="18" style="font-family:Verdana; font-size:12px;">&nbsp;Po.No</td>
        <td align="center" style="font-family:Verdana; font-size:12px;">:</td>
        <td style="font-family:Verdana; font-size:12px;">&nbsp;<?php echo $cust_po_no;?></td>
      </tr>
       <tr>
        <td valign="top" style="font-family:Verdana; font-size:12px;border-right:1px solid #999;"><b>Order By :</b> <?php echo $order_by;?></td>
        <td height="18" style="font-family:Verdana; font-size:12px;">&nbsp;Combo</td>
        <td align="center" style="font-family:Verdana; font-size:12px;">:</td>
        <td style="font-family:Verdana; font-size:12px;">&nbsp;<?php echo $combo;?></td>
      </tr>
          <tr>
        <td colspan="10" height="220" valign="top">
          <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> 
           <tr>
       <td width="34" height="21" align="center"  style="font-family:Verdana; font-size:12px; font-weight:bold; border-bottom:1px solid #999; border-top:1px solid #999;border-right:1px solid #999;">S.No</td>
       <td width="178"  align="left"  style="font-family:Verdana; font-size:12px;font-weight:bold; border-bottom:1px solid #999; border-top:1px solid #999;border-right:1px solid #999;">&nbsp;&nbsp;Particulars</td>
              <td width="85"  align="center" style="font-family:Verdana; font-size:12px;font-weight:bold; border-bottom:1px solid #999; border-top:1px solid #999;border-right:1px solid #999;">&nbsp;Width</td>
              <td width="89"  align="center" style="font-family:Verdana; font-size:12px;font-weight:bold; border-bottom:1px solid #999; border-top:1px solid #999;border-right:1px solid #999;">&nbsp;Height</td>
              <td width="83"  align="right" style="font-family:Verdana; font-size:12px;font-weight:bold; border-bottom:1px solid #999; border-top:1px solid #999;border-right:1px solid #999;">Qty&nbsp;</td>
              </tr>
              <?PHP 
	$delivery_no=$_GET['delivery_no'];
    $sql="select * from   sticker_delivery_challan_sub where delivery_no='$delivery_no'";
    $rs=mysql_query($sql);
	$sno=0;
   		while($rsdata=mysql_fetch_array($rs))
  			{ 
   				$sno=$sno+1;
   				$job_id=$rsdata['job_id'];
     			$jobcard_no=$rsdata['delivery_no'];
				$particulars=$rsdata['particulars'];
   				$width=$rsdata['rollno_width'];
				$height=$rsdata['kg_meter_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="34" height="26" align="center"  style="font-family:Verdana; font-size:12px;border-right:1px solid #999;border-bottom:1px solid #999;"><?php echo $sno; ?>&nbsp;</td>
              <td width="178" align="left"  style="font-family:Verdana; font-size:12px;border-right:1px solid #999;border-bottom:1px solid #999;">&nbsp;&nbsp;<?php echo $particulars; ?>&nbsp;</td>
              <td width="85" align="center" style="font-family:Verdana; font-size:12px;border-right:1px solid #999;border-bottom:1px solid #999;"><?php echo $width; ?>&nbsp;</td>
              <td width="89" align="center" style="font-family:Verdana; font-size:12px;border-right:1px solid #999;border-bottom:1px solid #999;"><?php echo $height; ?>&nbsp;</td>
              <td width="83" align="right"  style="font-family:Verdana; font-size:12px;border-right:1px solid #999;border-bottom:1px solid #999;"><?php echo $qty; ?>&nbsp;</td>
              </tr>
              <?php $overall_values+= $jobcard_values;
			  $qtys+= $qty;
			  } ?>
  </table>
          </td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
 <td>
</td>
</tr>
  <tr>
    <td height="34" colspan="2"> <table width="100%" border="0" cellpadding="0" cellspacing="0" >
      <tr>
          <td width="124" height="34" align="center"   style="font-family: Verdana; font-size: 14px; border-top: 1px solid #999;  border-right:1px solid #999; font-weight: bold;">Bundles</td>
              <td width="100" height="34"    style="font-family: Verdana; font-size: 14px; border-top: 1px solid #999; font-weight: bold;">
              <input type="text" name="textfield" id="textfield" style="height:35px; width:" /></td>
        <td width="218" align="right"   style="font-family:Verdana; font-size:12px;border-top:1px solid #999;"><span style="font-weight: bold">Qty</span> &nbsp;&nbsp;&nbsp;</td>
        <td width="145" align="right"   style="font-family:Verdana; font-size:12px;border-top:1px solid #999;border-right:1px solid #999;"><?php echo number_format($qtys,2); ?>&nbsp;&nbsp;</td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
    <tr>
 <td width="35%" valign="top" style="border-top:1px solid #999;border-right:1px solid #999; font-family:Verdana, sans-serif; font-size:14px; font-weight:bold;" >&nbsp; &nbsp;Delivery Through: &nbsp; <?php echo $delivery_through; ?> <br/></td>
    <td width="36%" valign="top" style="border-top:1px solid #999;border-right:1px solid #999; font-family:Verdana, sans-serif; font-size:14px; font-weight:bold;" >&nbsp; &nbsp;Vehicle No : &nbsp; <?php echo $vehicle_no; ?></td>   <td width="34%" align="center" valign="bottom"   style="font-family: Verdana; font-size: 12px; padding: 3px; border-top: 1px solid #999; font-weight: bold;"><strong>For <span style="color: #06F">SRI AMMAN DIGITAL PRINTS&nbsp;</span></strong>
          <p>&nbsp;</p>
          <p>Authorised Signature</p></td>
      </tr>
    </table></td>
  </tr>
</table> 
<table>
<td align="center" style=" font-family:Verdana, sans-serif; font-size:12px; padding-left: 800px;"><br>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   &nbsp;&nbsp;&nbsp;: <?php echo $ip_address = $_SERVER['REMOTE_ADDR'];?>&nbsp;</p></td>
</table>
<?php 
function convert_number($number) 
{ 
    if (($number < 0) || ($number >99999999)) 
    { 
    throw new Exception("Number is out of range");
    } 
    $Gn = floor($number / 10000000); 
    $number -= $Gn * 1000000; 
	$ln = floor($number / 100000);  
    $number -= $ln * 100000; 
    $kn = floor($number / 1000);   
    $number -= $kn * 1000; 
    $Hn = floor($number / 100);    
    $number -= $Hn * 100; 
    $Dn = floor($number / 10);      
    $n = $number % 10;               

    $res = ""; 

    if ($Gn) 
    { 
        $res .= convert_number($Gn) . " Crores"; 
    } 
  if ($ln) 
    { 
        $res .= (empty($res) ? "" : " ") . 
            convert_number($ln) . " Laksh"; 
    } 
    if ($kn) 
    { 
        $res .= (empty($res) ? "" : " ") . 
            convert_number($kn) . " Thousand"; 
    } 

    if ($Hn) 
    { 
        $res .= (empty($res) ? "" : " ") . 
            convert_number($Hn) . " Hundred"; 
    } 

    $ones = array("", "One", "Two", "Three", "Four", "Five", "Six", 
        "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", 
        "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eightteen", 
        "Nineteen"); 
    $tens = array("", "", "Twenty", "Thirty", "Fourty", "Fifty", "Sixty", 
        "Seventy", "Eigthy", "Ninety"); 

    if ($Dn || $n) 
    { 
        if (!empty($res)) 
        { 
            $res .= " and "; 
        } 

        if ($Dn < 2) 
        { 
            $res .= $ones[$Dn * 10 + $n]; 
        } 
        else 
        { 
            $res .= $tens[$Dn]; 

            if ($n) 
            { 
                $res .= " " . $ones[$n]; 
            } 
        } 
    } 
    if (empty($res)) 
    { 
        $res = "zero"; 
    } 
    return $res; 
} 
?>       		