<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/fusing_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 sm = jQuery.noConflict();
sm().ready(function() 
{ 
	sm("#job_card_no").autocomplete("include/autocomplete/fusion_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=fusing_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 fusing_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_fusing_status=$rsdata['printer_status'];
	   $edit_job_type=$rsdata['job_type'];
	   	   $edit_fabric_type=$rsdata['fabric_type'];

 
  }
?>

<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:13px;}

</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">Fusing 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="3%">&nbsp;</td>
      <td width="15%" 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 width="52%" height="40"  class="text" style="font-size:14px; color:#080;"><span >
     <input type="text" name="job_card_no" id="job_card_no" tabindex="1" class="types_class1" style="font-size:14px" onKeyUp="view_fusing_jobcard(this.value),get_fusing_job_details(this.value),get_fusing_size(this.value),fusing_clear_validation(this.value),enterevent(event,'print_date','job_card_no')" value="<?php if($edit_id!=''){ echo $edit_job_card_no; }?>"> 
      </span><div id="job_card_no_validation_div" style="color:#F00"></div></td>
      <td width="5%"  height="40" align="right" class="heading text"><strong>Date</strong>&nbsp;&nbsp;&nbsp;</td>
      <td width="21%"  height="40" align="left" valign="center" class="txt ">
        <input type="datetime-local" name="print_date" id="print_date" tabindex="2" readonly style="height:25px; width:215px;" onKeyUp="enterevent(event,'production_time','print_date')" class="types_class1" value="<?php if($edit_id!=''){echo $edit_print_date;}else{echo date('Y-m-d').'T'.date('H:i');}?>"/></td>
      <td width="4%">&nbsp;</td>

    </tr>
    <tr>
      <td>&nbsp;</td>
      <td colspan="4" align="center"><div id="get_job_details_div">  <table width="96%" cellpadding="0" cellspacing="0">
  <tr height="25px">
  <td width="11%" height="31" class="heading text" valign="bottom">Customer Name&nbsp;</td>
  <td width="23%" class="heading text" valign="bottom"><strong><?php if($edit_id!=''){echo $edit_cust_name;}?></strong><input type="hidden" class="types_class1" name="cust_name" id="cust_name" style="width:200px; " readonly value="<?php if($edit_id!=''){echo $edit_cust_name;}?>"/></td>
  <td width="13%" class="heading text" align="left" valign="bottom">Job Created by&nbsp;&nbsp;&nbsp;</td>
  <td width="19%" class="heading text" valign="bottom"><strong><?php if($edit_id!=''){echo $edit_job_created;}?></strong><input type="hidden" class="types_class1" name="job_created" id="job_created" style="width:150px; " readonly value="<?php if($edit_id!=''){echo $edit_job_created;}?>"/></td>
  <td width="14%" class="heading text" align="left" valign="bottom">Customer PO No&nbsp;&nbsp;&nbsp;</td>
  <td width="20%" class="heading text" valign="bottom"><strong><?php if($edit_id!=''){echo $edit_cust_po;}?></strong><input type="hidden" class="types_class1" name="cust_po" id="cust_po" style="width:150px;" readonly value="<?php if($edit_id!=''){echo $edit_cust_po;}?>"/></td>
  </tr>
    <tr height="25px">
  <td height="43" class="heading text" valign="bottom">Style No &nbsp;&nbsp;&nbsp;</td>
  <td  valign="bottom" class="heading text"><strong><?php if($edit_id!=''){echo $edit_style_no;}?></strong><input type="hidden" class="types_class1" name="style_no" id="style_no" style="width:150px;" readonly value="<?php if($edit_id!=''){echo $edit_style_no;}?>"/></td>
  <td class="heading text" align="left" valign="bottom">Style Name&nbsp;&nbsp;&nbsp;</td>
  <td  valign="bottom" class="heading text"><strong><?php if($edit_id!=''){echo $edit_style_name;}?></strong><input type="hidden" class="types_class1" name="style_name" id="style_name" style="width:150px;" readonly value="<?php if($edit_id!=''){echo $edit_style_name;}?>"/></td>
  <td class="heading text" align="left" valign="bottom">Combo&nbsp;&nbsp;&nbsp;</td>
  <td   valign="bottom" class="heading text"><strong><?php if($edit_id!=''){echo $edit_combo;}?></strong><input type="hidden" class="types_class1" name="combo" id="combo" style="width:150px;" readonly value="<?php if($edit_id!=''){echo $edit_combo;}?>"/></td>
  </tr>
  <tr height="25px">
    <td height="43" class="heading text" valign="bottom">Job Type &nbsp;&nbsp;&nbsp;</td>
    <td  valign="bottom" class="heading text"><strong>
      <?php if($edit_id!=''){echo $edit_job_type;}?>
      </strong>
      <input type="hidden" class="types_class1" name="job_type" id="job_type" style="width:150px;" readonly value="<?php if($edit_id!=''){echo $edit_job_type;}?>"/></td>
    <td class="heading text" align="left" valign="bottom">Fabric Type</td>
    <td  valign="bottom" class="heading text"><strong>
      <?php if($edit_id!=''){echo $edit_fabric_type;}?>
      </strong>
      <input type="hidden" class="types_class1" name="fabric_type" id="fabric_type" style="width:150px;" readonly value="<?php if($edit_id!=''){echo $edit_fabric_type;}?>"/></td>
  <td class="heading text" align="left" valign="bottom">Printed Qty&nbsp;&nbsp;&nbsp;</td>
  <td  valign="bottom" class="heading text"><strong><?php if($edit_id!=''){echo $edit_printed_qty;}?></strong><input type="hidden" class="types_class1" name="printed_qty" id="printed_qty" style="width:150px; " readonly value="<?php if($edit_id!=''){echo $edit_printed_qty;}?>"/></td>
  </tr>

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

    <tr>
    	<td>&nbsp;</td>
      	<td colspan="4" align="center"><div id="get_prod_print_sub_div"><?php include('fusing_production_sublist.php')?></div></td>
    	<td>&nbsp;</td>
    </tr>

    <tr>
    	<td>&nbsp;</td>
      	<td align="left" class="heading text"><strong>Fusing Production Status</strong>&nbsp;</td>
      	<td width="52%" align="left" class="heading text"><select name="fusing_status" id="fusing_status" onChange="enterevent(event,'submit','fusing_status')" tabindex="12" class="types_class" style="font-size:14px; width:120px;">
      	  <option value="0" <?php if($edit_fusing_status==0){echo "Selected";}?>>Pending</option>
      	  <option value="1" <?php if($edit_fusing_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="6"><input type="button" name="submit" tabindex="13" id="submit" 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="fusing_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,fusing_status.value,count.value,fabric_type.value,this.value,'<?php echo $_GET[edit_id]?>','<?php echo $edit_job_card_id?>')"></td>
          </tr>
        </table>
</form>
</div>
</div>
</div>
</div>