<?
session_start();
if(strlen($user)<=0)
{
 print "<script> alert('You are not logged in') </script>";
 include("logout.php");
 return;
}
include("opendb.php");
if($upd)
{
$qry="update vehicle_master set regno='$regnm',owner='$ownr',make='$make',model='$model',mobile='$mob',address='$addr',engno='$engno',chasisno='$chasno' where id='$idm'";
mysqli_query($db,$qry);

}

?>
<title>World Wide Automotive Center</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript" src="scripts/jquery-latest.js"></script>
<link type="text/css" href="includes/style1.css" rel="stylesheet" />
<link rel="stylesheet" href="css/form.css" type="text/css" />
<script type="text/javascript">
        $(function() {
          if ($.browser.msie && $.browser.version.substr(0,1)<7)
          {
			$('li').has('ul').mouseover(function(){
				$(this).children('ul').show();
				}).mouseout(function(){
				$(this).children('ul').hide();
				})
          }
        });        
</script>
<body background="back_ground.jpg">

<?php include('includes/top.php'); ?>
<br>
<table class="container"><tr><td>
<font style="font-family: 'Trebuchet MS',Verdana,Helvetica,sans-serif; font-size:15px;">  &nbsp;&nbsp;Master >> Vehicle Master >>Edit Vehicle Master</font>
<br><br>
<?
 $sql="select * from vehicle_master where id='$id' and brcode='$brcode'";
$re=mysqli_query($db,$sql)or die(mysqli_error($db));
$row=mysqli_fetch_array($re);
$dt1=explode('-',$row[crdate]);
$dt2=explode('-',$row[dob]);
?>
<center>
<form action='' onSubmit="return valid()">
<input type=hidden name='code' value='<?print $code?>'>
<table cellspacing=1 cellpadding=2 class='form'>
<tr height=21><td colspan=2 align=center bgcolor='steelblue'><FONT COLOR=IVORY><B>EDIT Vehicle Master</td></tr>
<tr><td>Register No</td><td><input type=text name='regnm' size=40 value='<?print $row[regno]?>'></td></tr>

<tr><td>Owner</td><td><input type=text name='ownr' size=40 value='<?print $row[owner]?>'>
</td></tr>


<tr><td>Make</td><td><input type=text name='make' value='<?print $row[make]?>' style="background-color:ivory"></td></tr>

<tr><td>Model</td><td><input type=text name='model' size=40 value='<?print $row[model]?>'></td></tr>
<tr><td>Mobile</td><td><input type=text name='mob' size=40 value='<?print $row[mobile]?>'></td></tr>
<tr><td>Address</td><td><input type=text name='addr' size=40 value='<?print $row[address]?>'></td></tr>
<tr><td>Year</td><td><input type=text name='engno' size=40 value='<?print $row[engno]?>'></td></tr>
<tr><td>Chasis No</td><td><input type=text name='chasno' size=40 value='<?print $row[chasisno]?>'></td></tr>
<tr><td>id</td><td><input type=text readonly name='idm' size=40 value='<?print $id ?>'></td></tr>





<tr><td colspan=2 align=center bgcolor='lightsteelblue'>
<input type=submit value='Save' name='upd'> 
<input type=button value='Cancel' onClick=history.go(-1)>
</td></tr>
</table>
</form>
</table>
</td></tr></table>

