<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<style>
td{font-size:10}
</style>
</head>

<body bgcolor="#EBF0DB">

<div align="center">
  <table border="1" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td width="100%">
        <p align="right">
<input type=button value='Search' onClick=document.location='searegn.html'></td>
    </tr>
  </table>
</div>
<?
include ("opendb.php");
$sql="select max(regno) from regn where regno like '".date('Y',time())."%'";

$result=mysqli_query($db,$sql) or die(mysqli_error());

$reg_row=mysqli_fetch_row($result);

if($reg_row[0]<=0)
 $newregno=date('Y',time()).'1';
else
 {
 $x= substr($reg_row[0],4);
 $x++;
// $newregno=($reg_row[0]+1);
	 $newregno=date("Y",time()).$x;
 }
?>
<p align="center">
<b><font face="Verdana" size="3"><u>NEW REGISTRATION</u></font></b> <br>&nbsp;
<form name=f1 action='svregn.php' method='post'>
<table width=100% cellspacing=1 cellpadding=1 bgcolor=black>
<tr><td bgcolor=ebf0db>
  <table border="1" cellpadding="0" cellspacing="0" width="36%">
    <tr bgclor=D1D0AF>
      <td width="26%" bgcolor="#D1D0AF">REG. NO.</font></td>
      <td width="74%" bgcolor="#D1D0AF">
        <p align="left"><input type=text name='regno' size=20 value='<?print $newregno?>'></p>
      </td>
    </tr>
  </table>
<div align="center">
  <center>
  <table border="0" cellpadding="2" cellspacing="0" width="548">
    <tr>
      <td width="90">NAME</font></td>
      <td width="151"><input type=text name=name size=20></font></td>
      <td width="99">DATE_BIRTH<br>
        (d-m-y)</font></td>
      <td width="158"><input type=text name=d size=2>  <input type=text name=m size=2>
        <input type=text name=y size=4> </td>
      <td width="29">SEX</font></td>
      <td width="30"><input type=text name='sex' size=1 value='M'></td>
    </tr>
    <tr>
      <td width="90">AGE</font></td>
      <td width="152">
        <input type=text name=age size=20> </td>
      <td width="99">HOUSE NAME</font></td>
      <td width="219" colspan="3"><input type=text name='house' size=29> </font></td>
    </tr>
    <tr>
      <td width="90">ADDRESS<br>
        &nbsp;&nbsp;&nbsp;&nbsp; /<br>
        &nbsp; PLACE</font></td>
      <td width="252" colspan="2"><textarea name='adr' rows=3 cols=29></textarea></font></td>
      <td width="219" colspan="3">PHONE / MOBILE <input type=text name='ph' size=29> </font></td>
    </tr>
  </table>
  </tr>
  <tr><td colspan=2 align=center bgcolor="#D1D0AF"><input type=submit value='Save'>
 <input type=button value='Cancel' OnClick=document.location='blank.html'></td></tr>
  </table>
</form>
</body>

