<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>
<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'];
$branch_name=$_GET['branch_name'];

function get_categ_branch_id($branch_name)
{
$sql_query11="select * from branch_creation where branch_id='$branch_name' and delete_status!='1'";
$rs11=mysql_query($sql_query11);
 while($rsdata11=mysql_fetch_object($rs11))
 {
 $id=$rsdata11->branch_name;
 } 
	return $id;
 }
 $bran_name=get_categ_branch_id($branch_name);
?>
<table width="850" height="51" border="0"  cellpadding="0" cellspacing="0" align="center">
<tr>
<td height="26" colspan="2" align="center" class="style5 style23"><b>Media Entry Print</b></td>
</tr>
<tr>
<td width="50%" 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="50%" 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="131" 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;Jobcard No</strong></td>
      <td scope="col" align="left" style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;"  ><strong>&nbsp;Customer Name</strong></td>
      <td width="166" align="left"  style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;"   scope="col"><strong>&nbsp;Fabric Type</strong></td>
      <td width="103" align="right"  style="border-bottom:dashed 1px; font-family:Verdana, sans-serif; font-size:12px;" scope="col" ><strong>Qty&nbsp;</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(entry_date,'%Y-%m-%d')>='$from_date'"; }else{$from_date1="DATE_FORMAT(entry_date,'%Y-%m-%d')='$cur_dates'"; }
if($to_date!=""){ $to_date1 = "DATE_FORMAT(entry_date,'%Y-%m-%d')<='$to_date'";}else{$to_date1="DATE_FORMAT(entry_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  media_main where  DATE_FORMAT(entry_date,'%Y-%m-%d')='$cur_dates' order by jobcard_no ASC ";
  } 
  else
  {
    $sql="select * from  media_main where $get_query103 main_id!='' order by jobcard_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'];
   				$jobcard_no=$rsdata['jobcard_no'];
				$entry_date=$rsdata['entry_date'];
	   			$cust_name=$rsdata['cust_name'];
	   			$job_type=$rsdata['job_type'];
				$fabric_type=$rsdata['fabric_type'];
				$overall_value=$rsdata['overall_value'];
				$customer_dc_no=$rsdata['customer_dc_no'];
				

  ?>
  <tr class="stylebottom">
    <td width="55" 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($entry_date));?>&nbsp;</td>
    <td width="152" style=" font-family:Verdana, sans-serif; font-size:12px;"  >&nbsp;<?php echo $jobcard_no;?></td>
    <td width="243" style=" font-family:Verdana, sans-serif; font-size:12px;" >&nbsp;<?php echo ucfirst($cust_name);?></td>
    <td align="left"  style=" font-family:Verdana, sans-serif; font-size:12px;" >&nbsp;<?php echo $fabric_type;?></td>
    <td align="right" style=" font-family:Verdana, sans-serif; font-size:12px;" ><?php echo  number_format($overall_value,2); ?>&nbsp;</td>
  </tr>
  <?php 
  $total_values+=$overall_value;} ?>
<td height="30" colspan="15"align="right"  class=" style4 " >Printed Date : <?php echo $curdate=date('d-m-Y');?>&nbsp;</p></td>
</table>
