<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
include('../include/session.php');
require_once('../include/tc_calendar.php');

?>

<!--style sheets-->
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="../css/tooltip.css" />


<!--jscript-->
<script type="text/javascript" src="../jscript/tablesort.js"></script>
<script language="JavaScript" src="../jscript/tooltip.js"  type="text/javascript"></script> 
<script language="javascript" src="../jscript/calendar.js"></script>
<script language="JavaScript" src="../jscript/cancel_confirmation.js"  type="text/javascript"></script> 

</head>

<?php 
$job_card_no = $_GET['job_card_no'];
$table_name = $_SESSION['db_prefix']."_mworks_jobs";
$job_data_query = "SELECT  cust_id, del_date, end_date FROM $table_name WHERE job_card_no = '".$job_card_no."' ";
$job_data_result = mySQL_query($job_data_query);

$start_date = mysql_result($job_data_result, 0, "del_date");
$end_date = mysql_result($job_data_result, 0, "end_date");
$cust_id = mysql_result($job_data_result, 0, "cust_id");




$quote='no';

$start_date = strtotime($start_date);
$ds = date("d", $start_date ) ;
$ms = date("m", $start_date ) ;
$ys = date("Y", $start_date ) ;

$end_date = strtotime($end_date);
$de = date("d", $end_date ) ;
$me = date("m", $end_date ) ;
$ye = date("Y", $end_date ) ;

?>




?>

<body>
<?php
include ("../navigation/header.php");
$page_name = "Production-main";
include ("../navigation/access.php");

if ($permission_num==1) {
	include ("../navigation/production_sidebar.php");
?>

<div class="main_frame" style="height:auto;">
<div class="page_head_frame">
 <table width="800" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><label class="label_page_head">Edit planning M-works job card no:<?php echo $job_card_no ?>.</label></td>
            <td width="171" align="right">&nbsp;</td>
          </tr>
        </table>
      </div>
       
  <div class="page_inside_frame" style="min-height:500px; width:700px;">
  
<div class="page_inside_frame"> 
<?php 
include('../include/customer_block.php');
echo '<br>';
include('../include/job_block.php');
?>
</div>
<form action="edit_planner_save.php" method="get">
<div class="page_inside_frame">
<label class="label_std">Edit job here:</label>
<table width="600" id="table_details_display">
  <tr>
    <td width="130">Start date:</td>
    <td><?php 
				  //instantiate class and set properties
		$myCalendar = new tc_calendar("start_date", true);
		$myCalendar->setIcon("../images/iconCalendar.gif");
		$myCalendar->setDate($ds, $ms, $ys);
		$myCalendar->setYearInterval(1990, 2020);
		//output the calendar
		$myCalendar->writeScript();
?></td>
    </tr>
  <tr>
    <td>End date:</td>
    <td><?php 
				  //instantiate class and set properties
		$myCalendar = new tc_calendar("end_date", true);
		$myCalendar->setIcon("../images/iconCalendar.gif");
		$myCalendar->setDate($de, $me, $ye);
		$myCalendar->setYearInterval(1990, 2020);
		//output the calendar
		$myCalendar->writeScript();
?></td>
    </tr>
  <tr>
    <td><input type="hidden" name="job_card_no_text" id="job_card_no_text" value="<?php echo $job_card_no ?>"></td>
    <td>&nbsp;</td>
    </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
</table>
</div>
<div class="page_inside_frame">
  <table width="645" border="0">
    <tr>
      <td width="20"></td>
      <td width="615" align="right"><input type="hidden" name="job_card_no" id="fuel_id_text" value="<?php echo $job_card_no?>" />
        <input name="close_button" type="button" class="imagebutton" id="close_button" onClick="cancel_confirmation(3, '../production/production_planner.php');" value="Close"/>
        <input name="save_close_button"  id="save_close_button" type="submit" class="imagebutton" value="Save &amp; Close" onClick="needToConfirm = false; confirmRefresh();" /></td>
    </tr>
  </table>
</div>
</form>
</div>
  
</div>
</body>



<?php } else {
$_SESSION['denied_return'] = $_SESSION['location'];	
include ("../navigation/production_sidebar.php");?>
	<body onload="accessdenied(); return false">
	</body>
<?php }
?>

<?php include ('../navigation/side_bar.php');?>
</html>