<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/place_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 place_creation where id='$_GET[edit_id]'";
  $rs=mysql_query($sql);
  $rscount=mysql_num_rows($rs);
 
  while($rsdata=mysql_fetch_array($rs))
  {
	  $from_place=$rsdata['from_place'];
	  $to_place=$rsdata['to_place'];
	  $kms=$rsdata['kms'];
  }
?>

<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:#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>Place 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 Place&nbsp;<span class="style2 style1">*</span></td>
    <td class="style7 txt">
    <select id="from_place" name="from_place" style="height:26px;" class="types_class" tabindex="1" autofocus onChange="place_clear_validation(this.value),enterevent(event,'to_place','from_place')" >
	    <?php
			$sql1="select * from branch_creation where delete_status!='1'";
            $rs1=mysql_query($sql1);
            while($rsdata1=mysql_fetch_array($rs1))
            {
			  $branch_name=$rsdata1['branch_name'];
	          $branch_id=$rsdata1['branch_id'];
			?>
            <option value="<?php echo $branch_name;?>" <?php if($branch_name== $from_place){ echo "Selected"; } ?>><?php echo $branch_name;?>
            </option>
         <?php } ?> 
  </select>
    <div id="from_place_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 Place <span class="style2 style1">*</span>&nbsp;</td>
    <td class="style7">
    <select id="to_place" name="to_place" style="height:26px;" class="types_class" tabindex="2" onChange="place_clear_validation(this.value),enterevent(event,'kms','to_place')" >
	    <?php
			$sql1="select * from branch_creation where delete_status!='1'";
            $rs1=mysql_query($sql1);
            while($rsdata1=mysql_fetch_array($rs1))
            {
			  $branch_name=$rsdata1['branch_name'];
	          $branch_id=$rsdata1['branch_id'];
			?>
            <option value="<?php echo $branch_name;?>" <?php if($branch_name== $to_place){ echo "Selected"; } ?>><?php echo $branch_name;?></option>
         <?php } ?> 
  </select>
    <div id="to_place_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>K</strong></span>ilometers&nbsp;<span class="style2 style1">*</span></td>
  
  <td width="344" class="style7"><input type="number" name="kms" id="kms"  class="types_class" tabindex="3" onKeyUp="place_clear_validation(this.value),enterevent(event,'action','kms')" style="height:26px;" value="<?php if($_GET['edit_id']!='') { echo $kms; } ?>"><div id="kms_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">&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="place_entry_add(from_place.value,to_place.value,kms.value,'<?php echo $id;?>',this.value)" style="background-color: #0171b9;
    color: #fff;
    border: 0px;
    padding: 10px 15px 8px;"  />&nbsp;&nbsp;</td>
            </tr>
  </table>   
</html>