 <style type="text/css">
<!--
.style20 {
	font-family: Verdana;
	font-size: 12px;
}
.style5 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
}
.style3 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
}
.style10{ border-top:solid 1px; border-top-color:#999;}
.style11{ border-bottom:dashed 1px; border-bottom-color:#333333;}
.style4 {font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
}
.style23 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style29 {font-size: 12px}
.style28 {	font-size: 16px;
	font-weight: bold;
}
.stylebottom
{
	border-right:1px solid #999;

	
	border-bottom:1px solid #999;
}	
-->
</style>
<div class="row-fluid">
<div class="span12">
<div class="table-responsive">
<div class="CSSTableGenerator">
<?php 
include ("../../include/db.php");
error_reporting(0);
ob_start();
session_start();
$session_branch=$_SESSION['branch'];
$session_user_type=$_SESSION['user_type'];
 $from_date=$_GET['from_date'];
  $to_date=$_GET['to_date'];
 $jobcard=$_GET['jobcard'];
  $current_date=date('Y-m-d');

?>
<?php 
include ("../../include/db.php");
error_reporting(0);
ob_start();
session_start();
$session_branch=$_SESSION['branch'];
$session_user_type=$_SESSION['user_type'];
 $from_date=$_GET['from_date'];
  $to_date=$_GET['to_date'];
 $jobcard=$_GET['jobcard'];
  $customer_name=$_GET['customer_name'];

  $current_date=date('Y-m-d');

?>
  <table border="0" width="850"  align="center" cellpadding="0" cellspacing="0"  >
<tr style="height:60">
<td width="217" height="106" align="right" style="font-size:12px; "><img src="../../img/logo_image.png" width="126" height="130"/></td>
<td colspan="5" align="center" valign="top" style=""><strong style="font-size: 30px; color: #06F; padding-top: 5px; width: 80px; font-family: Verdana, sans-serif">SRI AMMAN DIGITAL PRINTS</strong><br />
        <span width="80%" class="title1" style="font-size:14px;font-family:Verdana, sans-serif; font-weight:bold"><b></b> DOOR No: 1/2,1/3  KOMBAI THOTTAM MAIN ROAD,</span><br />
       <span width="80%" class="title0" style="font-size:14px;font-family:Verdana, sans-serif; font-weight:bold"><b></b>SELLANDIAMMAN THURAI ROAD,</span><br />
       <span width="80%" class="title0" style="font-size:14px;font-family:Verdana, sans-serif; font-weight:bold"><b></b>TIRUPPUR-641604 TAMILNADU STATE INDIA,</span><br/>
       <span width="80%" class="title00" style="font-size:14px;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="title0" style="font-size:14px;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/>
    
    <span width="80%" class="title1" style="font-size:18px;font-family:Verdana, sans-serif; font-weight:bold"><b></b>Fabric Delivery Challan Print</span></p></td>
  </tr>
<tr>
<td width="217" height="25" align="left" class="style4"><strong>From Date :</strong>  <?php if($_GET['from_date']==''){ echo $curdate=date('d-m-Y');} else { echo date("d-m-Y",strtotime($_GET['from_date']));}?></td>
<td width="286" height="25" align="center" class="style4"><strong>Customer Name:</strong>  <?php if($_GET['customer_name']==''){ echo "All";} else { echo $_GET['customer_name'];}?></td>
<td width="194" height="25" align="left" class="style4"><strong>Jobcard No:</strong>  <?php if($_GET['jobcard']==''){ echo "All";} else { echo $_GET['jobcard'];}?></td>
<td width="153" align="right" class="style4" scope="col"><strong>To Date :</strong>  <?php if($_GET['to_date']==''){ echo $curdate=date('d-m-Y');} else { echo date("d-m-Y",strtotime($_GET['to_date'])); }?></td>
</tr>
</table>
&nbsp;
<table border="0" width="850"  align="center" cellpadding="0" cellspacing="0" style="border-top:dashed 1px; border-bottom:dashed 1px">
<thead>
<tr>
    <th  align="center" width="99" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;">S.No</th>
    <th width="128" height="30"  align="left" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px" >&nbsp;&nbsp;Delivery No</th>
    <th  align="left"  style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px">&nbsp;Jobcard No</th>
    <th  align="left"  style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px" >&nbsp;Customer Name</th>
    <th  align="center" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px" >Job_type</th>
    <th  align="center" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px" >Fabric_Type&nbsp;</th>
    <th  align="right" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px" >Tot Qty&nbsp;</th>
    <th  align="center" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px" > Status</th>

      </tr>
      
  <?php
include("../../include/db.php");  
ob_start();
session_start();

$show = 20;
$num_links = 19;
$from = $_GET['from'];
if (empty($from))
	 {
		$from = "0";
	 } 
else 
	{
	$html_query = $html_query. "&from=$from";
	}

 $from_date=$_GET['from_date'];
  $to_date=$_GET['to_date'];
 $jobcard=$_GET['jobcard'];
   $customer_name=$_GET['customer_name'];

  $current_date=date('Y-m-d');



if($jobcard!=""){ $jobcard1= "job_no='$cust_name'"; }else{$jobcard1=''; }
if($from_date!=""){ $from_date1= "DATE_FORMAT( date_time,'%Y-%m-%d' )>='$from_date'"; }else{$from_date1="DATE_FORMAT(date_time,'%Y-%m-%d' )='$current_date'"; }
if($to_date!=""){ $to_date1 = "DATE_FORMAT(date_time,'%Y-%m-%d' )<='$to_date'";}else{$to_date1="DATE_FORMAT(date_time,'%Y-%m-%d' )='$current_date'";}
if($customer_name!=""){ $customer_name1 = "customer_name='$customer_name'";}else{$customer_name1='';}

$all_value10 = $customer_name1.";".$from_date1.";".$to_date1.";".$customer_name1;
$all_array10 = explode(';',$all_value10);
foreach($all_array10 as $value10)
{ 
if($value10!='')
{
 $get_query103 .= $value10." AND ";
}
}	  

if(($from_date=='')&&($to_date==''))
  {
   $sql="select * from  delivery_challan_main where  DATE_FORMAT( date_time,  '%Y-%m-%d' )='$current_date'  order by id  DESC LIMIT $from,20";
  } 

else
  {
   $sql="select * from  delivery_challan_main where $get_query103 	id!='' order by id DESC LIMIT $from,20";
  }


if($jobcard!='')
{
    $sql="select * from  delivery_challan_main where job_no='$jobcard' ";
	 
}


   $rs=mysql_query($sql);
	$s_no=0;
   		while($rsdata=mysql_fetch_array($rs))
  			{
   				 $s_no=$s_no+1;
                 $id=$rsdata['id'];
                 $delivery_no=$rsdata['delivery_no'];
				 $date_time=$rsdata['date_time'];
				 $job_no=$rsdata['job_no'];
				 $created_by=$rsdata['created_by'];
                 $customer_name=$rsdata['customer_name'];
				 $style_no=$rsdata['style_no'];
				 $style_name=$rsdata['style_name'];
				 $combo=$rsdata['combo'];
				 $customer_po_no=$rsdata['customer_po_no'];
				 $job_type=$rsdata['job_type'];
				 $fabric_type=$rsdata['fabric_type'];
				 $remarks=$rsdata['remarks'];
				 $total_qty=$rsdata['total_qty'];
				 $deliv_status=$rsdata['deliv_status'];
 ?>
  <tr>
    <td width="99" height="30"  align="center" style=" font-family:Verdana, sans-serif; font-size:12px;" >&nbsp;<?php echo $s_no; ?></td>
    <td align="left" style=" font-family:Verdana, sans-serif; font-size:12px;"  >&nbsp;<?php echo $delivery_no; ?></td>
    <td width="127" style=" font-family:Verdana, sans-serif; font-size:12px;" align="left" >&nbsp;<?php echo $job_no; ?></td>
    <td width="139" style=" font-family:Verdana, sans-serif; font-size:12px;"  align="left" >&nbsp;<?php echo $customer_name; ?></td>
    <td width="91" style=" font-family:Verdana, sans-serif; font-size:12px;"  align="center" >&nbsp;<?php echo $job_type; ?></td>
    <td width="108" style=" font-family:Verdana, sans-serif; font-size:12px;" align="center" ><?php echo $fabric_type; ?>&nbsp;</td>
    <td width="71" style=" font-family:Verdana, sans-serif; font-size:12px;" align="right"  ><?php echo $total_qty; ?>&nbsp;</td>
    <td width="87" style=" font-family:Verdana, sans-serif; font-size:12px;" align="center"  ><?php echo $deliv_status; ?></td>
    
  </tr>
  <?php
$tot_qty+=$total_qty;
   } ?>
  <tr>
    <td height="30" align="right" colspan="3" style=" font-family:Verdana, sans-serif; font-size:12px;border-top:dashed 1px; "><strong >   Total&nbsp;&nbsp;:</strong></td>
    <td height="30" align="right" colspan="4" style=" font-family:Verdana, sans-serif; font-size:12px;border-top:dashed 1px; "><?php echo number_format($tot_qty,2); ?></td>
    <td height="30" style=" font-family:Verdana, sans-serif; font-size:12px;border-top:dashed 1px; "></td>
  </tr>
  </thead>
</table>
</div>
<table>
<tr>
<!--<td width="100">&nbsp;</td>-->
<!--<td width="968">&nbsp;</td>-->

  <td align="right" style="font-family:Verdana, sans-serif;font-size:12px;padding-right: 0px;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   : <?php echo $ip_address = $_SERVER['REMOTE_ADDR'];?>&nbsp;</td>
  </tr>
  </table>
  </div></div></div>
