<? session_start();
$brcode = $_SESSION['brcode'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../ind.php'; </script>";
 return;
}

include("../opendb.php");


?>
<script>
function valid()
{
  submitOK="true";

 if(document.f1.mcode.value.length<=0)
 {
   submitOK="false";
   alert('Invalid Model Code');
 }

 if(document.f1.config.value.length<=0)
 {
   submitOK="false";
   alert('Invalid Configuration');
 }

  if(submitOK=="true")
   return true;
  else
   return false;
}


function chkey(abc)
{
 yy=abc.value
 if(yy.indexOf('  ')>-1) 
  {
    alert('Multiple space is not allowed');
    abc.value='';
  }
 if(yy.indexOf("'")>-1) 
  {
    alert("\' is not allowed");
    abc.value='';
  }
}
</script>

<style>
body,td{font-family:'arial narrow';letter-spacing:1;font-size:13.89}
tr{background-color:c1d7bb}
.mnu{margin-left:5}
</style>
<body bgcolor='ivory'>

<CENTER>
<BR>
<FORM name='f1' ACTION='<?print $PHP_SELF?>' METHOD='POST' onSubmit="return valid()">

<?
print "<table cellspacing=1 cellpadding=1 border=1 style={font-size:13}>";
print "<th> No.<th>Model Code <th>Customer<th>Address<th>Chasis<th> Engine No<th>GVW <th>W Base <th>H Power <th>Fuel <th>Color <th>Edit";


$i=1;
$result=mysqli_query($db,"select * from scert where brcode='$brcode' order by id")or die(mysqli_error());
while($row=mysqli_fetch_row($result))
{
 print "\n<tr class=x><td>".$i++."</td><td>$row[0]</td><td>$row[22]<td>$row[23]</td></td><td>$row[3]</td>";
 print "<td>$row[4]</td><td>$row[16]</td><td>$row[18]</td><td>$row[5]</td><td>$row[6]</td><td>$row[15]</td>";
 print "<td><a href='editscert.php?code=$row[20]'> <img src='../img/signit.gif' border=0></a></td></tr>";
}

?>
</table>

<script>
function edit(x,y)
{
 value=prompt("Enter Configuration for "+x);
 if(value)
 document.location="editscert.php?code="+y+"&config="+value;
}

function del(vcode)
{
if(confirm("Do you want to delete vehicle configuration "+vcode+" ?"))
 document.location="delvehmas.php?vcode="+vcode;

}
</script>



