<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;
	font-weight: bold;
}
.style27 {font-size: 12px}
.style28 {
	font-size: 16px;
	font-weight: bold;
}
.text {font-family: Verdana; font-size:13px;}
.style29 {	font-family: Verdana;
font-size: 14px;
}
.stylebottom
{
	border-right:1px solid #999;	
	border-bottom:1px solid #999;
}	
</style>

<?php 
  include ("../../include/db.php");
  date_default_timezone_set('Asia/Kolkata');
error_reporting(0);
ob_start();
session_start();
$session_branch=$_SESSION['branch'];
$session_user_type=$_SESSION['user_type'];
$branch_name=$_GET['branch_name'];


?>
<div class="row-fluid">
<div class="span12">
<div class="table-responsive">
<div class="CSSTableGenerator"> 
 <table width="800" border="0" align="center"  cellpadding="0" cellspacing="0"  >
<tr style="height:60">
<td width="174" height="106" align="right" style="font-size:12px;"><img src="../../img/logo_image.png" width="126" height="130"/></td>
<td width="626" 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="title1" style="font-size:18px;font-family:Verdana, sans-serif; font-weight:bold"><b></b>Fusing  Production</span></p></td>
  </tr>  

<tr>
<td width="200" 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="600" 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>

<table width="1000" border="0" align="center"  cellpadding="0" cellspacing="0" style="border-top:dashed 1px; border-bottom:dashed 1px"  >
      <tr>
      <th height="26" align="center" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;"  >S.No</th>
      <th scope="col" align="left" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;"  >&nbsp;Date</th>
      <th width="114" align="left" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;"  scope="col">&nbsp;&nbsp;Jobcard No</th>
      <th scope="col" align="left" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;"  > &nbsp;Customer Name</th>
      <th width="115" align="left" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;" scope="col" >&nbsp;Job Created</th>
      <th width="90" align="left" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;" scope="col"  >&nbsp;Style No</th>
      <th width="100" align="left" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;" scope="col"  >&nbsp;Style Name&nbsp;</th>
	  <th width="100" align="left" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;" scope="col"  >&nbsp;Fabric Type&nbsp;</th>
      <th width="107" align="center" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;" scope="col"  >&nbsp;Printed Qty</th>
      </tr>
   <?php
  include ("../../include/db.php");
  

$cust_name=$_GET['customer_name'];
$from_date=$_GET['from_date'];
$to_date=$_GET['to_date'];
$current_date=date('Y-m-d');
 $job_card_num=$_GET['jobcard_no'];
$fabric_types=$_GET['fabric_types'];
$value=explode(',',$_GET['fabric_types']);
 
                   for($i=0;$i<count($value);$i++){                  
                    $fabric1.=$value[$i];                 
				    
				   if($i<(count($value)-1)) {
                   $fabric1.="','";
                  
                   }
				   }
if($cust_name!=""){ $customer_name1= "cust_name='$cust_name'"; }else{$customer_name1=''; }
if($from_date!=""){ $from_date1= "DATE_FORMAT( print_date,'%Y-%m-%d' )>='$from_date'"; }else{$from_date1="DATE_FORMAT(print_date,'%Y-%m-%d' )='$current_date'"; }
if($to_date!=""){ $to_date1 = "DATE_FORMAT(print_date,'%Y-%m-%d' )<='$to_date'";}else{$to_date1="DATE_FORMAT(print_date,'%Y-%m-%d' )='$current_date'";}
if($job_card_num!=""){ $job_card_nums = "job_card_no='$job_card_num'";}else{$job_card_nums='';}
if($fabric_types!=""){ $fabric_type1 = "fabric_type IN ('$fabric1') ";}else{$fabric_type1='';}

$all_value10 = $customer_name1."/".$from_date1."/".$to_date1."/".$job_card_nums."/".$fabric_type1;
$all_array10 = explode('/',$all_value10);
foreach($all_array10 as $value10)
{ 
if($value10!='')
{
 $get_query103 .= $value10." AND ";
}
}
	$sql="select * from fusing_production_main where $get_query103 p_id!='' order by job_card_no ASC";
    $rs=mysql_query($sql);
	$sno=0;
	$from=0;
   		while($rsdata=mysql_fetch_array($rs))
  			{
   				$sno=$sno+1;
				$from=$from+1;
   				$p_id=$rsdata['p_id'];
   				$job_card_no=$rsdata['job_card_no'];
				$print_date=$rsdata['print_date'];
	   			$cust_name=$rsdata['cust_name'];
	   			$job_created=$rsdata['job_created'];
				$cust_po=$rsdata['cust_po'];
	   			$style_no=$rsdata['style_no'];
	   			$style_name=$rsdata['style_name'];
				$combo=$rsdata['combo'];
	   			$printed_qty=$rsdata['printed_qty'];
				$fabric_type=$rsdata['fabric_type'];
  ?>
 
  <tr>
    <td width="44" height="26"  align="center" style=" font-family:Verdana, sans-serif; font-size:12px;" ><?php echo $from; ?></td>
    <td width="112" align="left" style=" font-family:Verdana, sans-serif; font-size:12px;" >&nbsp;&nbsp;<?php echo date("d-m-Y",strtotime($print_date));?></td>
    <td align="left" >&nbsp;&nbsp;&nbsp;<?php echo $job_card_no;?></td>
    <td width="150" align="left" style=" font-family:Verdana, sans-serif; font-size:12px;" >&nbsp;<?php echo $cust_name;?></td>
    <td align="left" style=" font-family:Verdana, sans-serif; font-size:12px;" >&nbsp;<?php echo $job_created;?></td>
    <td align="left" style=" font-family:Verdana, sans-serif; font-size:12px;" >&nbsp;<?php echo $style_no;?></td>
    <td align="left" style=" font-family:Verdana, sans-serif; font-size:12px;" ><?php echo $style_name;?>&nbsp;</td>
	 <td align="left" width="150" style=" font-family:Verdana, sans-serif; font-size:12px;" ><?php echo $fabric_type;?>&nbsp;</td>
    <td align="right" style=" font-family:Verdana, sans-serif; font-size:12px;" ><?php echo number_format($printed_qty,3);?></td>

   </tr>
  <?php 
$tot_qty+=$printed_qty;
} ?>
  <tr>
  
    <td height="30" align="right" colspan="8" 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="5" 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>
</table>

<table>
<tr>
  <td style="font-family:Baskerville, 'Palatino Linotype', Palatino, 'Century Schoolbook L', 'Times New Roman', serif;font-size:14px;padding-left: 880px;"><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>
</div>
</div></div></div></div>
