<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>World Wide Automotive Center</title>
    <script src=" rightclick_deactive.js"></script> 
    <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
* This notice must stay intact for use
***********************************************/
                
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>
.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>


<link href="css/form.css" type="text/css" rel="stylesheet" media="screen"  />
<body bgcolor="#0033FF">
<div class='cont'>



<?
session_start();
if(strlen($user)<=0)
{
 print "<script> alert('You are not logged in') </script>";
 include("logout.php");
 return;
}

include("opendb.php");
include('includes/top.php');
?>
<input type=button value='Find Duplicate A/C Head' onClick=window.open('getdupcust.php')>
<br>&nbsp;

<script>
function valid()
{ 
 subOK="false";
 x=confirm("Do you want to save?");
 if(x)
  subOK="true";
   if(subOK=="true")
     return true;
   else
     return false;
} 

function chkey(abc)
{
 yy=abc.value
 if(yy.length>35)
 { 
   alert('Name exeeds the limit');
   return;
 }

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

if(yy.indexOf("&")>-1) 
  {
    alert("& is not allowed");
    abc.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>


<center>
<form action='svinsurance.php' onSubmit="return valid()">
<table cellspacing=1 cellpadding=2 class="form">
<tr height=21><td colspan=2 align=center ><FONT COLOR=IVORY><B>Insurance Master</td></tr>
<TR><TD>Creation Date </TD><TD>dd  <input type=text name=d size=2 value='<?print date("d",time())?>' onKeyPress="return handleEnter(this, event)">
mm  <input type=text name=m size=2 value='<?print date("m",time())?>' onKeyPress="return handleEnter(this, event)">
yy  <input type=text name=y size=4 value='<?print date("Y",time())?>' onKeyPress="return handleEnter(this, event)">
</td></tr>
<tr><td>Insurance Name</td><td><input type=text name='cname' size=40 onKeyPress="return handleEnter(this, event)" onKeyDown=chkey(this);></td></tr>




<tr ><td><font color=red>Display Name<br><font color=blue>(A/c Head) 
</td><td><input type=text name='acname' size=40 onKeyPress="return handleEnter(this, event)" onKeyDown=chkey(this);></td></tr>

<tr><td colspan=2 align=center bgcolor='lightsteelblue' >INSURANCE MASTER</td></tr>
<tr><td>Address</td><td><input type=text name='addr1' size=40 onKeyPress="return handleEnter(this, event)"></td></tr>

<tr><td>P.O Box</td><td><input type=text name='pin1' size=6 onKeyPress="return handleEnter(this, event)"></td></tr>
<tr><td>Phone</td><td><input type=text name='phone1' size=40 onKeyPress="return handleEnter(this, event)"></td></tr>


<tr><td colspan=2 align=center bgcolor='lightsteelblue'>OTHER</td></tr>
<tr><td>Mobile</td><td><input type=text name='mob' size=40 onKeyPress="return handleEnter(this, event)"></td></tr>


<tr><td>Email_id </td><td><input type=text name='email' size=40 onKeyPress="return handleEnter(this, event)"></td></tr>
<tr><td>ShortName</td><td><input type=text name='web' size=40 onKeyPress="return handleEnter(this, event)"></td></tr>

<tr><td colspan=2>TIN <input type=text name='tin' size=10 onKeyPress="return handleEnter(this, event)">
CST <input type=text name='cst' size=10 onKeyPress="return handleEnter(this, event)">
KGST <input type=text name='kgst' size=10></td></tr>



<tr><td colspan=2 align=center bgcolor='lightsteelblue'>
<input type=submit value='Save' name='sv'> <input type=button value='Cancel'>
</td></tr>
</table>
</form>
<br><br>
<table cellspacing=1 cellpadding=3 bgcolor='lightsteelblue'>
<th>No. <th>Name <th>A/C Name<th>ShortName <th> P.O Box <th>Phone <th>Mobile <th>Cramt<th>Crdays<th>Action
<?
$re=mysqli_query($db,"select * from insmaster order by acname")or die(mysqli_error($db));
$i=1;
while($row=mysqli_fetch_array($re))
{
 print "\n<form action='editins.php'>\n<input type=hidden name='code' value='$row[1]'><input type=hidden name='acname' value='$row[5]'>";
 print "\n<tr bgcolor=aliceblue><td>".$i++."</td><td>$row[cname]</td><td>$row[acname]</td><td>$row[web]</td><td>$row[pin1]</td><td>$row[phone1]</td>";
 print "<td>$row[mob]</td><td>$row[cramt]</td><td>$row[crdays]</td><td>\n<input type=submit value='Edit' name='edit'></td></tr></form>";
}
?>
</table>




