<html>
<head>
<link rel="stylesheet" href="../../css/font.css" type="text/css" />

<link href="../../css/pop_up style.css" rel="stylesheet" type="text/css">

<script src="../../js/shift_creation_ajax.js"         type="text/javascript"></script>
<script src="../../js/jquery/jquery.js"         type="text/javascript"></script>
<script src="../../js/shortcut.js"  type="text/javascript"></script>
<script src="../../js/enter_event_ajax.js"       type="text/javascript"></script>

<script>
shortcut.add("Alt+f",function() 
{
	document.getElementById("from_place").focus();
});

shortcut.add("Alt+t",function() 
{
	document.getElementById("to_place").focus();
});

shortcut.add("Alt+k",function() 
{
	document.getElementById("kms").focus();
});

</script>
</head>
<?php
error_reporting(0);
$edit_id=$_GET['edit_id'];
include("../../include/db.php");
if($_GET['edit_id']!='')
{
$measurement_table_display_style='style="display:inline;"';
} 
else
{
$measurement_table_display_styles='style="display:none;"';
}
 
 $id=$_GET[edit_id];
  $sql="select * from shift_creation where id='$_GET[edit_id]'";
  $rs=mysql_query($sql);
  $rscount=mysql_num_rows($rs);
 
  while($rsdata=mysql_fetch_array($rs))
  {
	  $from_time=$rsdata['from_time'];
	  $to_time=$rsdata['to_time'];
	  $shift_name=$rsdata['shift_name'];
	  $description=$rsdata['description'];

  }
?>

<style type="text/css">

.style2 {color: #FF0000}
.style7{font-family: Tahoma, Arial, Helvetica, sans-serif;font-size: 13px;}
.headings{ font-family:verdana; font-size:10px;}
.txt{ font-family: Verdana, Arial, Helvetica, sans-serif; font-size:13px;}


</style>
<style type="text/css">
<!--
.style1 {color: #FF0000}
.types_class { 
    height: 25px; 
    width: 200px; 
    background-color: transparent;  
    border-style: solid;  
    border-width: 0px 0px 1px 0px;  
    border-color:#CCC; 
    outline:0;
	font-size:14px;
  } 
  input:focus {  border-color:#87BB07; }
  select:focus {  border-color:#87BB07; } 
  textarea:focus {  border-color:#87BB07; } 
-->
</style>
    <table width="100%">
  <tr>
    <td height="26" colspan="6" class="txt" style="font-size:14px;"><strong>Shift Creation</strong></td>
  </tr>
  <tr>
    <td height="30" align="left" class="field"></td>
    <td align="left" class="txt"><span class="style1"><strong>F</strong></span>rom Time&nbsp;<span class="style2 style1">*</span></td>
    <td class="style7 txt"><input type="time" id="from_time" name="from_time" autofocus class="types_class" value="<?php if($id==''){echo date('H:i');}else{ echo $from_time;} ?>" onKeyUp="shift_clear_validation(this.value),enterevent(event,'to_time','from_time')" >
     <div id="from_time_validation_div" style="color:#F00"></div></td>
    <td class="style7">&nbsp;</td>
  </tr>
  <tr>
    <td height="37" align="left" class="txt"></td>
    <td align="left" class="txt"><strong><span style="color: #F00">T</span></strong>o Time <span class="style2 style1">*</span>&nbsp;</td>
    <td class="style7"><input type="time" id="to_time" name="to_time" autofocus class="types_class" value="<?php if($id==''){echo date('h:i');}else{echo $to_time;}?>" onKeyUp="shift_clear_validation(this.value),enterevent(event,'shift_name','to_time')" >
    
    <div id="to_time_validation_div" style="color:#F00"> </div></td>
    <td class="style7">&nbsp;</td>
  </tr>
  <tr>
  <td width="106" height="37" align="left" class="field"></td>
  <td width="494" align="left" class="txt"><span class="style1"><strong>S</strong></span>hift Name&nbsp;<span class="style2 style1">*</span></td>
  
  <td width="344" class="style7"><input type="text" name="shift_name" id="shift_name" autofocus class="types_class" value="<?php echo $shift_name; ?>" onKeypress="shift_clear_validation(this.value),enterevent(event,'description','shift_name')">
      <div id="shift_name_validation_div" style="color:#F00"> </div></td>

  <td width="344" class="style7">&nbsp;</td>
  </tr>
  <tr>
  <td width="106" height="37" align="left" class="field"></td>
  <td width="494" align="left" class="txt"><span class="style1"><strong>D</strong></span>escription&nbsp;<span class="style2 style1"></span></td>
    <td width="344" class="style7"><input type="text" name="description" id="description" onKeypress="enterevent(event,'action','description')" class="types_class" value="<?php echo $description; ?>">
    <div id="description_validation_div" style="color:#F00"> </div></td>

  <td  >&nbsp;</td>
  </tr>
<tr>
  <td height="34" valign="top" class="style7">&nbsp;</td>
  <td valign="top" class="style7">&nbsp;</td>
  <td valign="top"  >&nbsp;</td>
  <td  >&nbsp;</td>
  </tr>
    <tr>
    <td colspan="6">
    <span style="color:#F00" class="headings">&nbsp;&nbsp;&nbsp;</span></td>
  </tr>
        <tr>  
    <td colspan="8" class="style7" align="center">
    <input type="button" name="action"  id="action" tabindex="4" value="<?php if($_GET['edit_id']!='') {echo "EDIT";  } else {echo "ADD"; } ?>" class="add_button" 
    onClick="shift_entry_add(from_time.value,to_time.value,shift_name.value,description.value,'<?php echo $id;?>',this.value)" style="background-color: #87BB07;
    color: #fff;
    border: 0px;
    padding: 10px 15px 8px;"  />&nbsp;&nbsp;</td>
            </tr>
  </table>   
</html>