<?
session_start();
if(strlen($brcode)<=0)
{
 print "<script> alert('Invalid Login'); parent.document.location='ind.php' </script>";
 return;
}
include("../opendb.php");
include("../test.php");
?>
<link rel="stylesheet" href="../style.css" type="text/css" />
<style>
body,td{font-family:arial narrow;font-size:14}
th{background-color:silver}
</style>
<script>
 function valid()
 {
 if(document.f1.acode.value.length<=0)
 {
   alert('Invalid Asset Code');
   document.f1.acode.focus();
   return false;
 }
 if(document.f1.aname.value.length<=0)
 {
   alert('Invalid Asset Name');
   document.f1.aname.focus();
   return false;
 }
 if(document.f1.insure.selectedIndex==0)
 {
  
 if(document.f1.insuco.value.length<=0)
 {
   alert('Invalid Insurance Details');
   document.f1.insuco.focus();
   return false;
 }
 }

 }
</script>

<center>
<h3>Asset Master</h3>
<form name='f1' action='<?print $PHP_SELF?>' method='post' onSubmit="return valid()">
<table border=1 width=80%>
<tr><td>
<table cellspacing=1 cellpadding=2 width=85%>
<tr><td>Asset Code</td><td><input type=text name='acode'></td></tr>
<tr><td>Asset Name</td><td><input type=text name='aname' size=40></td></tr>


<tr><td>Asset Group</td><td><select name='agroup'>
	<option>Building</option>
	<option>Land</option>
	<option>Plant and Machinary</option>
	<option>Lease Land Premises</option>
	<option>Desk top Computer</option>
	<option>Lap top Computer</option>
	<option>Printer</option>
	<option>Scanner</option>
	<option>Vehicle</option>
	</select>
	</td>
</tr>
<tr><td>Description</td><td><textarea name='adesc' cols=38></textarea></td></tr>
<tr><td>Purchase Cost</td><td><input type=text name='pcost' size=8> Current Value
<input type=text name='curval'  size=8></td></tr>



<tr><td>Supplier</td><td><input type=text name='supp' size=40></td></tr>
<tr><td>Purchase Date</td><td>dd<input type=text name='pd' size=2> 
mm <input type=text name='pm' size=2> yy
<input type=text name='py' size=4> </td></tr>
<tr><td>Location</td><td><select name='location'> 
<?
$locre=mysqli_query($db,"select * from loc_master where brcode='$brcode' order by lname");
while($locrow=mysqli_fetch_array($locre))
{
 print "<option>$locrow[lname]</option>";
}
?>
</select>
</td></tr>
<tr><td>Place</td><td><input type=text name='place' size=40></td></tr>
<tr><td>In-Use</td><td><select name='inuse'> <option>Yes</option><option>No</option></select></td></tr>
<tr><td>Sale / Not in use Details</td><td><textarea name='saledet' cols=38></textarea></td></tr>
<tr><td>Insured</td><td><select name='insure'> <option>Yes</option><option>No</option></select></td></tr>

</table>
</td></tr>
<table border=1  width=80%>
<tr><td bgcolor='e4ecc4'><center>VEHICLE DETAILS</TD></TR>
<TR><TD>
<table cellspacing=1 cellpadding=2>
<tr><td>Reg No</td><td><input type=text name='regno'></td><td>Model</td><td><input type=text name='vehmodel'></td></tr>

<tr><td>Tax Due Date</td><td colspan=3>dd<input type=text name='pdt' size=2> 
mm <input type=text name='pmt' size=2> yy
<input type=text name='pyt' size=4> </td></tr>


<tr><td>Fit Certi Due Date</td><td colspan=3>dd<input type=text name='fitdt' size=2> 
mm <input type=text name='fitmt' size=2> yy
<input type=text name='fityt' size=4> </td></tr>

<tr><td>Permit Due Date</td><td colspan=3>dd<input type=text name='perdt' size=2> 
mm <input type=text name='permt' size=2> yy
<input type=text name='peryt' size=4> </td></tr>

<tr><td>Pollution Certi. Due Date</td><td colspan=3>dd<input type=text name='poldt' size=2> 
mm <input type=text name='polmt' size=2> yy
<input type=text name='polyt' size=4> </td></tr>

<tr><td>Advt License Due Date</td><td colspan=3>dd<input type=text name='advdt' size=2> 
mm <input type=text name='advmt' size=2> yy
<input type=text name='advyt' size=4> </td></tr>

<tr><td>Original RC at</td><td colspan=3><input type=text name='orgrc' size=30> </td></tr>


<tr><td>Sale Date</td><td colspan=3>dd<input type=text name='saledt' size=2> 
mm <input type=text name='salemt' size=2> yy
<input type=text name='saleyt' size=4> </td></tr>

<tr><td>Customer</td><td colspan=3><input type=text name='cust' size=30> </td></tr>
<tr><td>Sale Amount</td><td colspan=3><input type=text name='saleamt' size=10> </td></tr>
</table>
</td></tr>
<table border=1  width=80%>
<tr><td bgcolor='e4ecc4'><center>INSURANCE DETAILS</TD></TR>
<TR><TD>
<table cellspacing=1 cellpadding=2>
<tr><td>Insurance Company</td><td colspan=3><input type=text name='insuco'  size=30> </td></tr>

<tr><td>Policy Number</td><td colspan=3><input type=text name='policyno'  size=30> </td></tr>

<tr><td>Due Date</td><td colspan=3>dd<input type=text name='indt' size=2> 
mm <input type=text name='inmt' size=2> yy
<input type=text name='inyt' size=4> </td></tr>
</TABLE>

<tr><td colspan=4 align=center BGCOLOR='LIGHTSTEELBLUE'><INPUT TYPE=SUBMIT VALUE='SAVE'></TD></TR>
</table>
</form>

