<html>
<head>
<link rel="stylesheet" href="css/jquery-ui.css" />
<link rel="stylesheet" href="css/jquery.autocomplete.css" type="text/css" />
<link rel="stylesheet" href="css/font.css" type="text/css" />
<script type="text/javascript" src="js/printer_production_ajax.js"></script>
<script src="js/jquery/jquery.js" type="text/javascript"></script>
<script src="js/jquery/jquery-1.8.2.js"></script>
<script src="js/jquery/jquery-ui.js"></script>
<script type="text/javascript" src="js/jquery/autocomplete_jquery_plugin.js"></script>
<script src="js/shortcut.js"  type="text/javascript"></script>
<script type="text/javascript" src="js/enter_event_ajax.js"></script>
<script>
function add_new_inward(url)
{	
onmouseover10= window.open(url,'onmouseover10','height=400,width=650,scrollbars=no,resizable=no,left=50,top=50,toolbar=no,location=no,directories=no,status=no');	
}

var printer = jQuery.noConflict();
printer().ready(function() 
{ 
	printer("#job_card_no").autocomplete("include/autocomplete/printer_job_card_no_auto.php", {
	width: 250,
	matchContains: true,
	selectFirst: true
	});	
});


 function order_entry_search(from_date,to_date,customer_name)
 {
  jQuery.ajax({
  type: "POST",
  url: "order/order_entry/order_entry_list.php",
  data: "from_date="+from_date+"&to_date="+to_date+"&customer_name="+customer_name,
  success: function(msg){jQuery("#order_main_list_div").html(msg);
 }
    });
 }
 
 
 
 
 function inward_close()
{
window.location.href="main_fram.php?file=printer_production_list";
window.location.reaload(true);
}

function reload_div() 
{
	jQuery("#reload_div").load(location.href + " #reload_div");
}
</script>
<style> 
.someclass{ 
background:url(img/plus.png) no-repeat 0 0 ; 
} 
  .types_class1 { 
    height: 25px; 
    width: 250px; 
    background-color: transparent;  
    border-style: solid;  
    border-width: 0px 0px 1px 0px;  
    border-color:#CCC; 
    outline:0;
	font-size:13px;
	font-family:Verdana;
	
  }
input:focus {  border-color:#87BB07; }
select:focus {  border-color:#87BB07; } 
textarea:focus {  border-color:#87BB07; } 
</style> 
<?php
error_reporting(0);
date_default_timezone_set('Asia/Kolkata');
include ("include/db.php");	
$from_date=$_POST['from_date'];
$to_date=$_POST['to_date'];
$edit_job_card_id=$_GET['job_card_no'];
$edit_id=$_GET['edit_id'];
ob_start();
session_start();
  $sql="select * from printer_production_main where p_id='$_GET[edit_id]'";
  $rs=mysql_query($sql);
  $rscount=mysql_num_rows($rs);
 
  while($rsdata=mysql_fetch_array($rs))
  {
	   $sno=$sno+1;
	   $from=$from+1;
	   $edit_p_id=$rsdata['p_id'];
	   $edit_job_card_no=$rsdata['job_card_no'];
	   $edit_print_date=$rsdata['print_date'];
	   $edit_cust_name=$rsdata['cust_name'];
	   $edit_job_created=$rsdata['job_created'];
	   $edit_cust_po=$rsdata['cust_po'];
	   $edit_style_no=$rsdata['style_no'];
	   $edit_style_name=$rsdata['style_name'];
	   $edit_combo=$rsdata['combo'];
       $edit_printed_qty=$rsdata['printed_qty'];
	   $edit_cr_date=$rsdata['cr_date'];	   
	   $edit_printer_status=$rsdata['printer_status'];	   
  }
?>

<style type="text/css">
.style2 {color: #FF0000}
.style7{font-family: Tahoma, Arial, Helvetica, sans-serif;font-size: 13px;}
.style8{ text-align:center;font-family:Tahoma, Arial, Helvetica, sans-serif; font-size: 15px; padding:40px; font-weight: 500;color:#32328e;letter-spacing: 1px;}
.style9{ text-align:left;font-family:Tahoma, Arial, Helvetica, sans-serif; font-size: 15px; padding:0px; font-weight: 600;color:#080;letter-spacing: 1px;padding:10px; background-color:#f7f7f7;}
.style4 {border-bottom: solid 1px;border-bottom-color: #CCCCCC;}
.style5 {border-left: solid 1px;border-left-color: #CCCCCC;}
.text {font-family: Verdana; font-size:14px;}

</style>
<div class="container">
<div class="row-fluid">
<div class="span12">
<div class="table-responsive">
<form name="inward_form"  id="inward_form" method="post" action=""  enctype="multipart/form-data">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="border-top:solid 1px; color:#ddd;">
<tr align="left" style="font-size:14px"><div class="style9">Printer Production Entry</div>
<td width="12%" align="left"><img src="img/wrong.png" name="add_button" id="add_button" title="Cancel Booking Order"  onclick="javascript:inward_close()" align="top" width="30" height="30" border="0" tabindex="4" style="cursor:pointer; margin-left:96%; margin-top:-34px;" class="button green-button" >
</td></tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
	<tr>
      <td width="1%">&nbsp;</td>
      <td width="9%" height="40" class="text" style="font-size:14px; color:#080;">&nbsp;<strong><span style="color: #F00">J</span>obcard No</strong><span style="color:#FF0000">*</span></td>
      <td height="40" colspan="2"  class="text" style="font-size:14px; color:#080;"><span >
        <input type="text" name="job_card_no" id="job_card_no" class="types_class" tabindex="1" style="font-size:14px" autofocus onKeyUp="view_jobcard(this.value),get_job_details(this.value),get_size(this.value),printer_clear_validation(this.value),enterevent(event,'print_date','job_card_no')" onFocus="view_jobcard(this.value),get_job_details(this.value),get_size(this.value)" value="<?php echo $_GET['job_card_no']?>">
      </span><div id="printer_validation_div" style="color:#F00"></div></td>
      <td width="20%"  height="40" align="right" class="heading text">Date&nbsp;&nbsp;</td>
      <td width="16%"  height="40" align="center" valign="center" class="txt ">
        <input type="datetime-local" name="print_date" id="print_date" tabindex="2" readonly style="height:25px; width:85%;" class="types_class1" onKeyUp="enterevent(event,'production_time','print_date')" value="<?php if($edit_id!=''){echo $edit_print_date;}else{echo date('Y-m-d').'T'.date('H:i');}?>"/></td>
      <td width="1%">&nbsp;</td>

    </tr>
    <tr>
      <td>&nbsp;</td>
      <td colspan="5" align="center"><div id="get_job_details_div"><table width="100%" cellpadding="0" cellspacing="0">
  <tr height="25px">
  <td width="10%" height="38" class=" text">Customer Name &nbsp;</td>
  <td width="21%" class="heading text"><strong><?php if($edit_id!=''){echo $edit_cust_name;}?><input type="hidden" id="cust_name" value="<?php if($edit_id!=''){echo $edit_cust_name;}?>"></strong></td>
  <td width="16%" class="heading text">Job Created by&nbsp;</td>
  <td width="24%" class="heading text"><strong><?php if($edit_id!=''){echo $edit_job_created;}?><input type="hidden" id="job_created" value="<?php if($edit_id!=''){echo $edit_job_created;}?>"></strong></td>
  <td width="11%" class="heading text">Customer PO No&nbsp;</td>
  <td width="18%" class="heading text"><strong><?php if($edit_id!=''){echo $edit_cust_po;}?><input type="hidden" id="cust_po" value="<?php if($edit_id!=''){echo $edit_cust_po;}?>"></strong></td>
  </tr>
    <tr height="25px">
  <td height="31" class="heading text">Style No &nbsp;</td>
  <td class="heading text"><strong><?php if($edit_id!=''){echo $edit_style_no;}?><input type="hidden" id="style_no" value="<?php if($edit_id!=''){echo $edit_style_no;}?>"></strong></td>
  <td class="heading text">Style Name&nbsp;</td>
  <td class="heading text"><strong><?php if($edit_id!=''){echo $edit_style_name;}?><input type="hidden" id="style_name" value="<?php if($edit_id!=''){echo $edit_style_name;}?>"></strong></td>
  <td class="heading text">Combo<strong>&nbsp;</strong></td>
  <td class="heading text"><strong><?php if($edit_id!=''){echo $edit_combo;}?><input type="hidden" id="combo" value="<?php if($edit_id!=''){echo $edit_combo;}?>"></strong></td>
  </tr>
  <tr height="25px">
    <td height="31" class="heading text">Job Type &nbsp;</td>
    <td class="heading text"><strong>
    </strong></td>
  <td height="30"><span class="heading text">Fabric Type </span></td>
  <td height="30"></td>
  <td class="heading text">Printed Qty&nbsp;</td>
  <td class="heading text"><strong><?php if($edit_id!=''){echo $edit_printed_qty;}?><input type="hidden" id="printed_qty" value="<?php if($edit_id!=''){echo $edit_printed_qty;}?>"></strong></td>
  </tr>

  </table></div></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td align="center">&nbsp;</td>
      <td colspan="2">&nbsp;</td>
      <td align="right" class="heading text">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>

    <tr>
    	<td>&nbsp;</td>
      	<td colspan="5" align="center"><div id="get_prod_print_sub_div"><?php include('printer_production_sublist.php')?></div></td>
    	<td>&nbsp;</td>
    </tr>
        <tr>
    	<td>&nbsp;</td>
      	<td colspan="5" align="center"></td>
    	<td>&nbsp;</td>
    </tr>
        <tr>
    	<td>&nbsp;</td>
      	<td colspan="2" align="left" class="heading text"><strong>Printer Production Status</strong>&nbsp;</td>
      	<td width="40%" align="left" class="heading text"><select name="printer_status" id="printer_status" onChange="enterevent(event,'submit','printer_status')" class="types_class" tabindex="11" style="font-size:14px">
      	  <option value="0" <?php if($edit_printer_status==0){echo "Selected";}?>>Pending</option>
      	  <option value="1" <?php if($edit_printer_status==1){echo "Selected";}?>>Completed</option>
    	  </select></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    	<td>&nbsp;</td>
    </tr>

    <tr>
      <td  height="86">&nbsp;</td> 
      <td align="center" colspan="7"><input type="button" name="submit" id="submit" tabindex="12" style="background-color: #87BB07;    color: #fff;    border: 0px; font-family:verdana; font-size:14px; width:120px; height:27px; " value="<?php if($_GET['edit_id']!='') { echo "UPDATE";  } else { echo "SUBMIT"; } ?>" class="button" onClick="printer_main_add(job_card_no.value,print_date.value,cust_name.value,job_created.value,cust_po.value,style_no.value,style_name.value,combo.value,printed_qty.value,this.value,printer_status.value,'<?php echo $_GET[edit_id]?>','<?php echo $edit_job_card_id?>')"></td>
          </tr>
        </table>
</form>
</div>
</div>
</div>
</div>