<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Xpress</title>
    <script type="text/javascript" src="scripts/jquery-latest.js"></script>
	<link type="text/css" href="includes/style1.css" rel="stylesheet" />
      <link type="text/css" href="css/form.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>

    <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>
	<script type="text/javascript">
    $(document).ready(function() {
        var cont_left = $("#container").position().left;
        $("a img").hover(function() {
            // hover in
            //$(this).parent().parent().css("z-index", 1);
            $(this).animate({
               height: "110",
               width: "110",
              
            }, "fast");
        }, function() {
            // hover out
         //   $(this).parent().parent().css("z-index", 0);
            $(this).animate({
                height: "80",
                width: "80",
                
            }, "fast");
        });
        
        $(".img").each(function(index) {
            var left = (index * 160) + cont_left;
            $(this).css("left", left + "px");
        });
    });




    </script>

<!-- js code below for active enter with textfield-->


<script type="text/javascript">

/***********************************************
* Disable "Enter" key in Form script- By Nurul Fadilah(nurul@REMOVETHISvolmedia.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
                
function handleEnter (field, event) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();
			return false;
		} 
		else
		return true;
	}      

</script>
<style>
#txt{
font-family: Arial, Helvetica;
background-color: #F2F2F2;

}
</style>

<style>
.cont
	{


       background-color:#3b5998;

	//background:url(images/bg-inner.jpg) #e9e0c3 repeat-x;
  	width: 100%;position: absolute ;
	height:99%;
    	/* Optional - just for DIV)*/
    	//border: solid 1px #000000;
	-moz-box-shadow: 0px 5px 5px #888;
	-webkit-box-shadow: 0px 5px 5px #888;
	box-shadow: 0px 5px 10px #888;
    
	}
</style>

<style>
th{background-color:steelblue;color:white}
</style>


<body bgcolor="#0033FF">


<?php include('includes/top.php'); ?>

<table class="container"><tr><td>


	<link type="text/css" href="css/redmond/jquery-ui-1.8.16.custom.css" rel="stylesheet" />	
		<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
		<script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript">
$(function(){

$(".regno").live("keydown.autocomplete",function(){

$regno = $(this);

$row = $regno.parent().parent();
$(this).autocomplete({
		source: function( request, response ) {

		$.ajax({
			url: "search1.php",
			dataType: "json",
			data: "key="+$regno.val(),
			success: function( data ) {
				response( $.map( data, function( item ) {
					return {
						label: item.regno+' | '+  item.chasisno + '| '+ item.make +'|'+item.model    ,
						value: item.regno,
						name:item.chasisno,
						qty:item.make,
						price:item.model,
						


					}
				}));
			}
		});
	}
	
,
	minLength: 2,
	select: function( event, ui ) {

	$row.find('.chasisno').val(ui.item.name);
	$row.find('.make').val(ui.item.qty);
	$row.find('.model').val(ui.item.price);
	
	
	/*log( ui.item ?
	"Selected: " + ui.item.label :
	"Nothing selected, input was " + this.value);
	*/
	 }
	
	});

					
});







});
</script>

<script type="text/javascript">

/***********************************************
* Disable "Enter" key in Form script- By Nurul Fadilah(nurul@REMOVETHISvolmedia.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
                
function handleEnter (field, event) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();
			return false;
		} 
		else
		return true;
	}      

</script>







<?php echo "<body onload='f1.entrydate.focus()'>\n"; ?>

<link href="css1/xp.css" type="text/css" rel="stylesheet" media="print,screen"  />



<?
session_start();
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../ind.php'; </script>";
 return;
}
include("opendb.php");
if($save)
{
 $r=mysqli_query($db,"select * from desigmast where divname='$divname' and brcode='$brcode'");
  if(mysqli_num_rows($r)>0)
  {
    print "<script> alert('Duplicate Division'); </script>";
    
  }
else{
 $sql="insert into desigmast (brcode,divname) values('$brcode','$divname')";

 mysqli_query($db,$sql) or die(mysqli_error($db));
 print "<font color=green> Data has been saved</font>";
}
}
if($del)
{
 mysqli_query($db,"delete from desigmast where code='$code' and brcode='$brcode'");
}
?>

<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript" src="scripts/jquery-latest.js"></script>
<body background="back_ground.jpg">
<form name='f1' action='<?print $PHP_SELF?>' onSubmit="return valid()" method='post'> 
<table class="container" bgcolor="#0033FF"><tr><td>

<font style="font-family: 'Trebuchet MS',Verdana,Helvetica,sans-serif; font-size:15px;">  &nbsp;&nbsp;Master >>  Desig Master</font>

<br>

<center>
<form action='<?print $PHP_SELF ?>'>
<table class='form'>
<th colspan=2 ><font color="white">DESIGNATION MASTER</font>
<tr><td>Division Name</td><td><input type=text name='divname' size=40 onKeyDown=chkey(this) onKeyPress="return handleEnter(this, event)"></td></tr>
<tr><th colspan=2 align=center > <input type=submit name='save' value='Save'></th></tr>
</table>
</form>
<HR>
EXISTING DESIGNATIONS
<HR>
<table width=50% class='form'>
<th width=12>No <th>Division <TH width=50>Action
<?
$result=mysqli_query($db,"select * from desigmast where brcode='$brcode' order by divname");
$i=1;
while($row=mysqli_fetch_array($result))
{
 print "\n<form action='$PHP_SELF'><input type=hidden name=code value='$row[code]'>";
 print "\n<tr><td>".$i++."</td><td>$row[divname]</td><td><input type=submit value='Del' name='del'></td></tr></form>";
}
?>
</table>

<br>&nbsp;
