<style type="text/css">.style4 {font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
}
.text {font-family: Verdana; font-size:13px;}
.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");
  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'];

?>
<table width="850" height="51" border="0"  cellpadding="0" cellspacing="0" align="center">
<tr style="height:60">
<td width="137" height="106" align="right" style="font-size:12px;"><img src="../../img/logo_image.png" width="126" height="130"/></td>
<td width="711" 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">Ink Purchase Print</span></p></td>
  </tr>

<tr>
<td width="166" 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="684" 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 border="0" width="850"  cellpadding="0" cellspacing="0" style="border-top:dashed 1px"  align="center">
      <tr>
      <td height="26" align="center" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;"><strong>S.No</strong></td>
      <td width="274" align="left"  style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;"  scope="col"><strong>&nbsp;Date</strong><strong>&nbsp;</strong></td>
      <td scope="col" align="left" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;"  ><strong>&nbsp;Ink Pur.No</strong></td>
      <td scope="col" align="right" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;"  ><strong>&nbsp;Total Qty</strong></td>
     
  </tr>
  <?php
  include ("../../include/db.php");

$from_date=$_GET['from_date'];
$to_date=$_GET['to_date'];
$cur_dates=date('Y-m-d');
if($from_date!=""){ $from_date1= "DATE_FORMAT(ink_date,'%Y-%m-%d')>='$from_date'"; }else{$from_date1="DATE_FORMAT(ink_date,'%Y-%m-%d')='$cur_dates'"; }
if($to_date!=""){ $to_date1 = "DATE_FORMAT(ink_date,'%Y-%m-%d')<='$to_date'";}else{$to_date1="DATE_FORMAT(ink_date,'%Y-%m-%d')='$cur_dates'";}
$all_value10 = $from_date1."@".$to_date1;
$all_array10 = explode('@',$all_value10);
foreach($all_array10 as $value10)
{ 
if($value10!='')
{
$get_query103 .= $value10." AND ";
}
}	  
  if(($from_date=='')&&($to_date==''))
  {
   $sql="select * from  ink_purchase where  DATE_FORMAT(ink_date,'%Y-%m-%d')='$cur_dates' order by ink_pur_no ASC ";
  } 
  else
  {
    $sql="select * from  ink_purchase where $get_query103 main_id!='' order by ink_pur_no ASC ";
  }
    $rs=mysql_query($sql);
	$sno=0;
   		while($rsdata=mysql_fetch_array($rs))
  			{
   				$sno=$sno+1;
				$from=$from+1;
   			
   				$main_id=$rsdata['main_id'];
   				$ink_pur_no=$rsdata['ink_pur_no'];
				$ink_date=$rsdata['ink_date'];
	   			$total_mtr=$rsdata['total_mtr'];
				$fabric_type=$rsdata['fabric_type'];
				$overall_value=$rsdata['overall_value'];
				$customer_dc_no=$rsdata['customer_dc_no'];
				

  ?>
  <tr class="stylebottom">
    <td width="80" height="26"  align="center" style=" font-family:Verdana, sans-serif; font-size:12px;" ><?php echo $sno; ?></td>
    <td align="left" style=" font-family:Verdana, sans-serif; font-size:12px;"  >&nbsp;<?php echo date("d-m-Y",strtotime($ink_date));?>&nbsp;</td>
    <td width="269" style=" font-family:Verdana, sans-serif; font-size:12px;"  >&nbsp;<?php echo $ink_pur_no;?></td>
    <td width="227" align="right" style=" font-family:Verdana, sans-serif; font-size:12px;" >&nbsp;<?php echo number_format($total_mtr,2);?></td>
   
  </tr>
  <?php 
  $total_values+=$overall_value;
   $total_qty+=$total_mtr;
} ?>
  <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="6" style=" font-family:Verdana, sans-serif; font-size:12px;border-top:dashed 1px; "><?php echo number_format($total_qty,2); ?></td>
  </tr>
<td height="30" colspan="15"align="right"  class=" style4 " style="border-top:dashed 1px;" >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;</p></td>
</table>
