
PK 
<?php
include_once('../include/common.php');
include_once('../include/connection.php');
$get_root=get_root();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../css/myStyle.css" rel="stylesheet" type="text/css">
<link href="../css/drop_style.css" rel="stylesheet" type="text/css">
<title>registration</title>
<script language="javascript">
//function checkEmail(userName) {
var str = new String(userName);
var isOK = true;
rExp = /[!\"£$%\^&*()-+=<>,\'#?\\|¬`\/\[\]]/
if( rExp.test(str) )
isOK = false;
if( str.indexOf('.') == -1 || str.indexOf('@') == -1 )
isOK = false;
if( str.slice(str.lastIndexOf('.')+1,str.length).length < 2 )
isOK = false;
if( str.slice(0,str.indexOf('@')).length < 1 )
isOK = false;
if( str.slice(str.indexOf('@')+1,str.lastIndexOf('.')).length < 1 )
isOK = false;
if( !isOK )
alert( "Invalid email address" );
return isOK;
}
function emptyfield()
{
var firstName=document.getElementById("firstName");
var lastName=document.getElementById("lastName");
var gender=document.getElementById("gender");
var street=document.getElementById("street");
var city=document.getElementById("city");
var mobile=document.getElementById("mobile");
<!--var userName=document.getElementById("userName");-->
var pass=document.getElementById("pass");
var conPass=document.getElementById("conPass");
if(firstName.value=='')
{
alert("Enter your First Name");
firstName.focus();
return false;
}
if(lastName.value=='')
{
alert("Enter your Last Name");
lastName.focus();
return false;
}
if(gender.value=='')
{
alert("Enter your Gender");
gender.focus();
return false;
}
if(street.value=='')
{
alert("Enter your Street");
street.focus();
return false;
}
if(city.value=='')
{
alert("Enter your City");
city.focus();
return false;
}
if(mobile.value=='')
{
alert("Enter your Phone no:");
mobile.focus();
return false;
}
if(userName.value=='')
{
alert("Enter your Username id");
userName.focus();
return false;
}
if(pass.value=='')
{
alert("Enter your Password");
pass.focus();
return false;
}
if(conPass.value=='')
{
alert("Please Confirm your Password");
conPass.focus();
return false;
}
}
</script>
</head>
<body>
<form name="registration" action="reg_action.php" method="post" enctype="multipart/form-data">
<table align="center" border="0px" height="500px" width="100%" cellpadding="0" cellspacing="0">
<?php
$act="add";
if($_GET['action']=='edit') {
$sqlSelectForReg="SELECT * FROM reg WHERE id='".$_GET['id']."'";
$sqlQueryForReg=mysql_query($sqlSelectForReg);
$sqlFetchForReg=mysql_fetch_array($sqlQueryForReg);
$act='edit';
}
?>
<tr>
<td colspan="3"><?php include_once('../include/header.php'); ?></td>
</tr>
<tr>
<td valign="top" align="center" width="25%"> </td>
<td width="50%">
<table class="reg" align="center" height="500px" cellpadding="5px" cellspacing="0">
<tr>
<th align="left" colspan="3">Personal Details</th>
</tr>
<tr>
<td>First Name</td>
<td>:</td>
<td><input type="text" name="name" id="name" value="<?=$sqlFetchForReg['name']; ?>" /></td>
</tr>
<tr>
<td>Gender</td>
<td>:</td>
<td>Male<input type="radio" name="gender" id="gender" value="male" class="gender" />
Female<input type="radio" name="gender" id="gender" value="female" class="gender" />
</td>
</tr>
<tr>
<td>Date of Birth</td>
<td>:</td>
<?php
$redate=explode("-",$editrow['admiDate']);$_POST['day']."-".$_POST['mon']."-".$_POST['year'];
//print_r($redate);
?>
<td><select name="day"><option value="dd">--DD--</option>
<?php
for($i=1; $i<=31; $i++) {
if($redate[0]==$i) {
echo "<option value=".$i." selected='selected'>".$i."</option>";
} else {
echo "<option value=".$i.">$i</option>";
}
}
?>
</select>
<select name="mon"><option value="mm">--MM--</option>
<?php
for($i=1; $i<=12; $i++) {
if($redate[1]==$i) {
echo "<option value=".$i." selected='selected'>$i</option>";
} else {
echo "<option value=".$i.">$i</option>";
}
}
?>
</select>
<select name="year"><option value="YYYY">YYYY</option>
<?php
for($i=1970; $i<=2000; $i++) {
if($redate[2]==$i) {
echo "<option value=".$i." selected='selected'>$i</option>";
} else {
echo "<option value=".$i.">$i</option>";
}
}
?>
</select></td>
</tr>
<tr>
<td>Contact</td>
<td>:</td>
<td><input type="text" name="contact" id="contact" value="<?=$sqlFetchForReg['contact']; ?>" /></td>
</tr>
<tr>
<td>Street</td>
<td>:</td>
<td><input type="text" name="street" id="street" value="<?=$sqlFetchForReg['street']; ?>" /></td>
</tr>
<tr>
<td>Country</td>
<td>:</td>
<td><input type="text" name="country" id="country" value="<?=$sqlFetchForReg['country']; ?>" /></td>
</tr>
<tr>
<td>State</td>
<td>:</td>
<td><input type="text" name="state" id="state" value="<?=$sqlFetchForReg['state']; ?>" /></td>
</tr>
<tr>
<td>City</td>
<td>:</td>
<td><input type="text" name="city" id="city" value="<?=$sqlFetchForReg['city']; ?>" /></td>
</tr>
<tr>
<th align="left" colspan="3">Login Details</th>
</tr>
<tr>
<td>Username</td>
<td>:</td>
<td><input type="text" name="email" id="email" value="<?=$sqlFetchForReg['email']; ?>" /></td>
</tr>
<tr>
<td>Password</td>
<td>:</td>
<td><input type="password" name="pass" id="pass" value="<?=$sqlFetchForReg['pass']; ?>" /></td>
</tr>
<tr>
<td>Confirm Password</td>
<td>:</td>
<td><input type="password" name="veryfyPass" id="veryfyPass" value="<?=$sqlFetchForReg['veryfyPass']; ?>" /></td>
</tr>
<tr>
<td> <input type="hidden" name="id" value="<?=$sqlFetchForReg['id']; ?>"></td>
<td> <input type="hidden" name="action" value="<?=$act; ?>"></td>
<td align="right"><input type="submit" name="submit" value="Submit" onclick="return checkEmail(userName);" onblur="return emptyfield();"></td>
</tr>
</table>
</td>
<td valign="top" align="center" width="25%"> </td>
</tr>
<tr>
<td colspan="3"><?php include_once('../include/footer.php'); ?></td>
</tr>
</table>
</form>
</body>
</html>


PK 99