<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");
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="947" border="0" align="center"  cellpadding="0" cellspacing="0">
<tr>
<td align="center" class="style5 style23" style="font-family:Verdana, sans-serif; font-size:12px; font-family:Verdana, sans-serif; font-size:large">Billing Print</td>
</tr>
</table>


&nbsp;
&nbsp;

<table width="947" align="center"  cellpadding="0" cellspacing="0" style="border-top:dashed 1px; border-bottom:dashed 1px" >
      <tr>
      <th align="center" height="26" style="border-bottom:dashed 1px"  >S.No</th>
      <th scope="col" align="center" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px; font-family:Verdana, sans-serif; font-size:12px;">&nbsp;Date</th>
      <th width="140" align="center" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px; font-family:Verdana, sans-serif; font-size:12px;">&nbsp;&nbsp;Jobcard No</th>
      <th align="left" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px; font-family:Verdana, sans-serif; font-size:12px;" scope="col">&nbsp;&nbsp;Invoice No&nbsp;</th>
      <th align="left" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px; font-family:Verdana, sans-serif; font-size:12px;" scope="col"> &nbsp;Customer Name</th>
      <th width="116" align="left" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px; font-family:Verdana, sans-serif; font-size:12px;">Job Created</th>
      <th width="71" align="left" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px; font-family:Verdana, sans-serif; font-size:12px;">Style No</th>
      <th width="99" align="right" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px; font-family:Verdana, sans-serif; font-size:12px;" >Style Name&nbsp;</th>
      <th width="107" align="center" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px; font-family:Verdana, sans-serif; font-size:12px;" >Printed Qty</th>
      </tr>
  <?php
  include ("../../include/db.php");
  
 $from_date=$_GET['from_date'];
 $to_date=$_GET['to_date'];

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


if(($from_date=='')&&($to_date==''))
{
	$sql="select * from printer_production_main where printer_status='1' and bill_date='$current_date' union select * from fusing_production_main where printer_status='1' and bill_date='$current_date'  group by invoice_no,billing_type";
}
if(($from_date!='')&&($to_date!=''))
{
	$sql="select * from printer_production_main where printer_status='1' and  bill_date>='$from_date' and bill_date<='$to_date'  union select * from fusing_production_main where printer_status='1' and  bill_date>='$from_date' and bill_date<='$to_date'  group by invoice_no,billing_type";
}

   $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'];
				$bill_date=$rsdata['bill_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'];
				$billed_status=$rsdata['billed_status'];
			    $refer=$rsdata['refer'];
		        $invoice_no=$rsdata['invoice_no'];

				
  ?>
  <tr>
    <td width="44"  align="center" height="30"><?php echo $from; ?></td>
    <td width="92" align="left" >&nbsp;&nbsp;<?php echo date("d-m-Y",strtotime($bill_date));?></td>
    <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $job_card_no;?></td>
    <td width="129" align="left" >&nbsp;<?php echo $invoice_no;?></td>
    <td width="129" align="left" >&nbsp;&nbsp;<?php echo $cust_name;?></td>
    <td align="left" >&nbsp;&nbsp;<?php echo $job_created;?></td>
    <td align="left" >&nbsp;<?php echo $style_no;?></td>
    <td align="right" ><?php echo $style_name;?>&nbsp;</td>
    <td align="center" ><?php echo number_format($printed_qty,3);?></td>
   </tr>
  <?php } ?>
</table>
<table width="947" align="center">
<tr>
<td width="100">&nbsp;</td>
<td width="968">&nbsp;</td>
  <td width="227" align="center" style="font-family:Baskerville, 'Palatino Linotype', Palatino, 'Century Schoolbook L', 'Times New Roman', serif; font-size:14px;"> Printed Date: <?php echo date('d-m-y')?>  </td>
  </tr>
  </table>
</div>
</div>
</div>
</div>
</div></div></div></div>
