  <script type="text/javascript" src="calendar1.js"></script>
   <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/themes/base/jquery-ui.css" type="text/css" media="all" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js" type="text/javascript"></script>
 <script>
$(function() {
var date = $('#datepicker').datepicker({ dateFormat: 'dd-mm-yy' });
    //$( "#datepicker" ).datepicker({ minDate: 0 });
	
});
</script>

<form method="post" action="">
<table border=1 cellspacing=1 cellpadding=2 width=928 style="border: 1px inset;">
<tr><td colspan="2" class=newscontent><b>Change Date</b> (Will Effect MRO, ITQ, PO)</td></tr>
<tr><td class=formlabel>MRO Number : &nbsp;&nbsp;&nbsp;</td><td class=newscontent><input type="text" name="mro_x"> (** Must keep in only number ex: if MRO088, just put 88 )</td></tr>
<tr><td class=formlabel>Date : &nbsp;&nbsp;&nbsp;</td><td class=newscontent><input type="text" id="datepicker" name="date_x"> (mm-dd-yy)</td></tr>
</table>
<input type="Submit" value="Submit" name="Submit">
</form>

<?php
date_default_timezone_set('GMT');

extract($_POST);
if($mro_x == NULL OR $date_x == NULL){
echo "<span style='color:red;'>Please Keep In MRO and Date !!!</span>";
}else{
echo "<span style='color:green;'>Successful : Date Change !!!</span><br />";
}
/*
echo "MRO : " . $mro_x;
echo "<br />";
$m = strtotime($date_x);
echo "New Date : " . $m;
echo "<br />". date('d-m-Y', $m);
*/
$mro_number = $mro_x;
$ch_date = strtotime($date_x);

$sqlx = mysql_query("select mro_pkey from mro_details where mro_id = '$mro_number'");
//$sqlx = mysql_query("select mro_pkey from mro_details where mro_id = '$mro_number' AND mro_revno ='1'");
$datax = mysql_fetch_assoc($sqlx);
$ch_key = $datax['mro_pkey'];
//print_r($ch_key);
$sql1 = mysql_query("update itq_details set itq_date = '$ch_date' where itq_mropkey = '$ch_key'");
$sql2 = mysql_query("update mro_details set mro_requestdate = '$ch_date' where mro_pkey = '$ch_key'");
$sql3 = mysql_query("update po_details set po_date = '$ch_date' where po_mropkey = '$ch_key'"); 
$sql4 = mysql_query("select itq_pkey from itq_details where itq_mropkey = '$ch_key' ");
$data = mysql_fetch_assoc($sql4);
$itqx = $data['itq_pkey'];
$sql5 = mysql_query("update itq_approvals set approval_date = '$ch_date' where approval_itqpkey = '$itqx'");
?>