
<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/vehicle_type_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+v",function() 
{
	document.getElementById("vehicle_type").focus();
});

shortcut.add("Alt+n",function() 
{
	document.getElementById("vehicle_no").focus();
});
shortcut.add("Alt+o",function() 
{
	document.getElementById("own").focus();
});
shortcut.add("Alt+r",function() 
{
	document.getElementById("rental").focus();
});
shortcut.add("Alt+a",function() 
{
	document.getElementById("address").focus();
});

function show_tables(value)
{
if(value=='own'){
document.getElementById("radio_val").value='own';
}
}
function show_tabless(value)
{
if(value=='rental'){
document.getElementById("radio_val").value='rental';
}
}

</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 vehicle_entry where id='$_GET[edit_id]'";
  $rs=mysql_query($sql);
  $rscount=mysql_num_rows($rs);
 
  while($rsdata=mysql_fetch_array($rs))
  {
	  $vehicle_type=$rsdata['vehicle_type'];
	  $vehicle_no=$rsdata['vehicle_no'];
	  $radio_val=$rsdata['own'];
	  $address=$rsdata['address'];
  }
?>

<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;}

.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;
  } 

</style>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
input:focus {  border-color:#0171b9; }
select:focus {  border-color:#0171b9; } 
textarea:focus {  border-color:#0171b9; } 
</style>
    <table width="100%" >
  <tr>
    <td height="26" colspan="6" class="txt" style="font-size:14px;"><strong>Vehicle Form</strong></td>
  </tr>
 
  <tr>
    <td height="30" align="left" class="field"></td>
    <td align="left" class="txt"><span class="style1"><strong>V</strong></span>ehicle Type&nbsp;<span class="style2 style1">*</span></td>
    <td class="style7 txt"><input type="text" name="vehicle_type" id="vehicle_type" autofocus class="types_class" tabindex="1" onKeyUp="vehicle_clear_validation(this.value),enterevent(event,'vehicle_no','vehicle_type')" style="height:26px;" value="<?php if($_GET['edit_id']!='') { echo $vehicle_type; } ?>"><div id="vehicle_type_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">Vehicle <span class="style1"><strong>N</strong></span>o<span class="style2 style1">*</span>&nbsp;</td>
    <td class="style7"><input type="text" name="vehicle_no" id="vehicle_no"  class="types_class" tabindex="2" onKeyUp="vehicle_clear_validation(this.value),enterevent(event,'own','vehicle_no')" style="height:26px;" value="<?php if($_GET['edit_id']!='') { echo $vehicle_no; } ?>"><div id="vehicle_no_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>O</strong></span>wn / <span class="style1"><strong>R</strong></span>ental&nbsp;<span class="style2 style1">*</span></td>
  
  <td width="344" class="style7">
    
   <input type="radio" name="RadioGroup1" value="own" id="own" tabindex="3" onClick="show_tables(this.value),vehicle_clear_validation(this.value),enterevent(event,'rental','own')" <?php  if($radio_val=='own') {?> checked="checked" <?php  }  ?> >Own
   <input type="radio" name="RadioGroup1" value="rental" id="rental"  tabindex="4" onClick="show_tabless(this.value),vehicle_clear_validation(this.value),enterevent(event,'address','rental')"  <?php  if($radio_val=='rental') {?> checked="checked" <?php  }  ?>>
   Rental
   <input type="hidden" name="radio_val" id="radio_val" <?php if($radio_val=='') {?>value=""<?php } else {?>value="<?php echo $radio_val;?>" <?php }?> /> 
 <div id="own_validation_div" style="color:#F00"></div></td>
  <td width="344" class="style7">&nbsp;</td>
  </tr>
  <tr>
    <td height="34" valign="top" class="style7">&nbsp;</td>
    <td valign="top"  class="style7"><span class="style1"><strong>A</strong></span>ddress</td>
    <td  ><textarea name="address" id="address" cols="45" rows="5" class="types_class" tabindex="5"  style="width:200px; height:50px;" onKeyUp="enterevent(event,'action','address')"><?php if($_GET['edit_id']!='') { echo $address; } ?></textarea></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" >&nbsp;</td>
  </tr>
        <tr>  
    <td colspan="8" class="style7" align="center"><input type="button" name="action"  id="action" tabindex="6" value="<?php if($_GET['edit_id']!='') { echo "EDIT";  } else { echo "ADD"; } ?>" class="add_button" onClick="vehicle_entry_add(vehicle_type.value,vehicle_no.value,radio_val.value,address.value,'<?php echo $id;?>',this.value)" style="
    background-color: #0171b9;      color: #fff;      border: 0px;      
    padding: 9px 15px 9px;
">&nbsp;&nbsp;</td>
            </tr>
  </table>   
</html>