<?php
	include ("connect.php");

	$memLname = $_POST["memLname"];
	$memName = $_POST["memName"];
	$memPassword = $_POST["memPassword"];
	$ICDate = $_POST["ICDate"];
	$ICState = $_POST["ICState"];
	$ICNo = $_POST["ICNo"];
	$memD = $_POST["memD"];
	$memM = $_POST["memM"];
	$memY = $_POST["memY"];
	$memSex = $_POST["memSex"];
	$memRace = $_POST["memRace"];
	$memAddress = $_POST["memAddress"];
	$memPcode = $_POST["memPcode"];
	$memCity = $_POST["memCity"];
	$memState = $_POST["memState"];
	$memHnum1 = $_POST["memHnum1"];
	$memHnum2 = $_POST["memHnum2"];
	$memHpnum1 = $_POST["memHpnum1"];
	$memHpnum2 = $_POST["memHpnum2"];
	$memEmail = $_POST["memEmail"];
	
	
	if($_POST["Submit"] == "Submit")
	{
	$query = "INSERT INTO member(memLname, memName, memPassword, ICDate, ICState, ICNo, memD, memM, memY, memSex, memRace, memAddress, memPcode, memCity, memState, memHnum1, memHnum2, memHpnum1, memHpnum2, memEmail)
	VALUES
	('$memLname', '$memName', '$memPassword', '$ICDate', '$ICState', '$ICNo', '$memD', '$memM', '$memY', '$memSex', '$memRace', '$memAddress', '$memPcode', '$memCity', '$memState', '$memHnum1', '$memHnum2', '$memHpnum1', '$memHpnum2', '$memEmail')";
	$result = $db->query($query);
	$db->close();
	echo "<script language='javascript'>alert('Insert success.')</script>";
}
?>
<html>
<head><title>Online Bookshop - New Member Registration Form</title>
</head>

<body style="background:lightyellow">

<table width="100%">
<tr>
<td rowspan="2" align="center" valign="center" alt="天天书局" title="天天书局" ><img src="Logo.gif" width="110" height="110"></td>

<td width="25%"></td>
<td width="25%"></td>

<td>
<form method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8 >
<input type=hidden name=oe value=UTF-8 target="_blank">
<table bgcolor="#FFFFFF" target="_blank">
<tr>
<td>
<a href="http://www.google.com">
<img src="GoogleLogo.jpg" border="0" alt="Google" align="absmiddle" title="Google" >
</a>
<input type=text name=q size=25 maxlength=255 value="">
<input type=submit name=btnG value="Google Search">
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<hr/>
<center>
<h2>New Member Application Form</h2>
</center>

<table border="1" align="right">
<tr>
<td><center>
<a href="index.php"><h4>Home Page</h4></a>
<a href=".html" target="TT"><h4>Top of the Book</h4></a>
<a href=".html" target="TT"><h4>New Books</h4></a>
<a href="bookmenu.php"><h4>Search Our Book</h4></a>
<a href=".html" target="TT"><h4>News & Promo</h4></a>
<a href="Addmem.php"><h4>Membership</h4></a>
<a href=".html" target="TT"><h4>Cart</h4></a>
<a href=".html" target="TT"><h4>Login</h4></a>
<a href=".html" target="TT"><h4>About Us</h4></a>
<a href=".html" target="TT"><h4>Site Map</h4></a>
</center></td>
</tr>
</table>
<form name="memform" method="post">
<fieldset> 
<legend>New Member Registration Form</legend>

<!--registration form--> 
<table width="100%" cellspacing="0" cellpadding="2" border="0">
		<tr> 
			<td colspan="3" class="contents">Fields that are marked with * are mandatory</td> 
		</tr> 
			
		<tr> 
			<td valign="top">*</td> 
			<td valign="top">Login Name</td> 
			<td><input type="text" name="memLname" size="55" maxlength="15"/>
			<br/>(please enter 6-15 numbers or alphabets)</td> 
		</tr>
		
		<tr> 
			<td valign="top">*</td>
			<td valign="top">Name</td> 
			<td><input type="text" name="memName" size="55" maxlength="15"/></td> 
		</tr>
		
		<tr> 
			<td valign="top">*</td> 
			<td valign="top">Password</td> 
			<td><input type="password" name="memPassword" size="55" maxlength="15"/> 
			<br/>(please enter 6-15 numbers or alphabets)</td> 
		</tr>

		<tr>
			<td valign="top">*</td>
			<td valign="top">NRIC</td>
			<td><input type="text" name="ICDate" maxlength="6" size="6"/>-
			<input type="text" name="ICState" maxlength="2" size="2"/>-
			<input type="text" name="ICNo" maxlength="4" size="4"/></td>
		</tr>
		
			<tr>
			<td></td>
			<td valign="top">Date of Birth<br>(DD/MM/YYYY):	</td>
			<td><select name="memD"> 
			<option value="01">01</option>  <option value="02">02</option>  
			<option value="03">03</option>  <option value="04">04</option>  
			<option value="05">05</option>  <option value="06">06</option>  
			<option value="07">07</option>  <option value="08">08</option>  
			<option value="09">09</option>  <option value="10">10</option>  
			<option value="11">11</option>  <option value="12">12</option>  
			<option value="13">13</option>  <option value="14">14</option>  
			<option value="15">15</option>  <option value="16">16</option>  
			<option value="17">17</option>  <option value="18">18</option>  
			<option value="19">19</option>  <option value="20">20</option>  
			<option value="21">21</option>  <option value="22">22</option>  
			<option value="23">23</option>  <option value="24">24</option>  
			<option value="25">25</option>  <option value="26">26</option>  
			<option value="27">27</option>  <option value="28">28</option>  
			<option value="29">29</option>  <option value="30">30</option>  
			<option value="31">31</option></select>
			
			<select name="memM"> 
			<option value="01">01</option>  <option value="02">02</option>  
			<option value="03">03</option>  <option value="04">04</option>  
			<option value="05">05</option>  <option value="06">06</option>  
			<option value="07">07</option>  <option value="08">08</option>  
			<option value="09">09</option>  <option value="10">10</option>  
			<option value="11">11</option>  <option value="12">12</option>
			</select>
			
			<select name="memY">
			<option value="1900">1900</option>  <option value="1901">1901</option>  
			<option value="1902">1902</option>  <option value="1903">1903</option>  
			<option value="1904">1904</option>  <option value="1905">1905</option>  
			<option value="1906">1906</option>  <option value="1907">1907</option>  
			<option value="1908">1908</option>  <option value="1909">1909</option>  
			<option value="1910">1910</option>  <option value="1911">1911</option>  
			<option value="1912">1912</option>  <option value="1913">1913</option>  
			<option value="1914">1914</option>  <option value="1915">1915</option>  
			<option value="1916">1916</option>  <option value="1917">1917</option>  
			<option value="1918">1918</option>  <option value="1919">1919</option>  
			<option value="1920">1920</option>  <option value="1921">1921</option>  
			<option value="1922">1922</option>  <option value="1923">1923</option>  
			<option value="1924">1924</option>  <option value="1925">1925</option>  
			<option value="1926">1926</option>  <option value="1927">1927</option>  
			<option value="1928">1928</option>  <option value="1929">1929</option>  
			<option value="1930">1930</option>  <option value="1931">1931</option>  
			<option value="1932">1932</option>  <option value="1933">1933</option>  
			<option value="1934">1934</option>  <option value="1935">1935</option>  
			<option value="1936">1936</option>  <option value="1937">1937</option>  
			<option value="1938">1938</option>  <option value="1939">1939</option>  
			<option value="1940">1940</option>  <option value="1941">1941</option>  
			<option value="1942">1942</option>  <option value="1943">1943</option>  
			<option value="1944">1944</option>  <option value="1945">1945</option>  
			<option value="1946">1946</option>  <option value="1947">1947</option>  
			<option value="1948">1948</option>  <option value="1949">1949</option>  
			<option value="1950">1950</option>  <option value="1951">1951</option>  
			<option value="1952">1952</option>  <option value="1953">1953</option>  
			<option value="1954">1954</option>  <option value="1955">1955</option>  
			<option value="1956">1956</option>  <option value="1957">1957</option>  
			<option value="1958">1958</option>  <option value="1959">1959</option>  
			<option value="1960">1960</option>  <option value="1961">1961</option>  
			<option value="1962">1962</option>  <option value="1963">1963</option>  
			<option value="1964">1964</option>  <option value="1965">1965</option>  
			<option value="1966">1966</option>  <option value="1967">1967</option>  
			<option value="1968">1968</option>  <option value="1969">1969</option>  
			<option value="1970">1970</option>  <option value="1971">1971</option>  
			<option value="1972">1972</option>  <option value="1973">1973</option>  
			<option value="1974">1974</option>  <option value="1975">1975</option>  
			<option value="1976">1976</option>  <option value="1977">1977</option>  
			<option value="1978">1978</option>  <option value="1979">1979</option>  
			<option value="1980">1980</option>  <option value="1981">1981</option>  
			<option value="1982">1982</option>  <option value="1983">1983</option>  
			<option value="1984">1984</option>  <option value="1985">1985</option>  
			<option value="1986">1986</option>  <option value="1987">1987</option>  
			<option value="1988">1988</option>  <option value="1989">1989</option>  
			<option value="1990">1990</option>  <option value="1991">1991</option>  
			<option value="1992">1992</option>  <option value="1993">1993</option>  
			<option value="1994">1994</option>  <option value="1995">1995</option>  
			<option value="1996">1996</option>  <option value="1997">1997</option>  
			<option value="1998">1998</option>  <option value="1999">1999</option>  
			<option value="2000">2000</option></select></td>
        </tr>
		
		<tr>
			<td >*</td>
			<td>Gender:</td>
			<td><table border="0">
			<tr><td><input type="radio" name="memSex" value="Male"/>Male</td></tr>
			<tr><td><input type="radio" name="memSex" value="Female"/>Female</td></tr>
			</td></table>
		</tr>
			
		<tr>
			<td valign="top">*</td>
			<td valign="top">Race:</td>
			<td><select name="memRace"><option value="0">Choose One</option>
						<option value="1">Chinese</option>
						<option value="2">Malay</option>
						<option value="3">Indian</option>
						<option value="4">Others</option>
						</select>
			</td>
		</tr>
			
		<tr>
			<td valign="top">*</td>
			<td valign="top">Address :</td>
			<td valign="top"><textarea name="memAddress"rows="5" cols="34"></textarea></td>
		</tr>
			
		<tr>
			<td valign="top">*</td>
			<td valign="top">Post Code :</td>
			<td><input name="memPcode" type="text" maxlength="6" size="6"/></td>
		</tr>

		<tr>
			<td valign="top">*</td>
			<td valign="top">City :</td>
			<td><input name="memCity" type="text" maxlength="20" size="20"/></td>
		</tr>

		<tr>
			<td valign="top">*</td>
			<td valign="top">State :</td>
			<td><select name="memState"><option value="0">Select</option>
									 <option value="Johor">Johor</option>
									 <option value="Kedah">Kedah</option>
									 <option value="Kelantan">Kelantan</option>
									 <option value="Kuala Lumpur">Kuala Lumpur</option>
									 <option value="Melaka">Melaka</option>
									 <option value="Negeri Sembilan">Negeri Sembilan</option>
									 <option value="Pahang">Pahang</option>
									 <option value="Penang">Penang</option>
									 <option value="Perak">Perak</option>
									 <option value="Perlis">Perlis</option>
									 <option value="Sabah">Sabah</option>
									 <option value="Sarawak">Sarawak</option>
									 <option value="Selangor">Selangor</option>
									 <option value="Terengganu">Terengganu</option>
									 </select>
			</td>
		</tr>
		
		<tr>
			<td valign="top">*</td>
			<td valign="top">Contact :</td>
			<td><table>
		<tr><td>Home :</td>
			<td><input name="memHnum1" type="text" maxlength="3" size="3"/>&nbsp;-&nbsp;
				<input name="memHnum2" type="text" maxlength="10" size="10"/></td>
		</tr>
		<tr>
			<td>Handphone :</td>
			<td><select name="memHpnum1">
								<option value=""></option>
								<option value="010">010</option>
								<option value="012">012</option>
								<option value="013">013</option>
								<option value="014">014</option>
								<option value="016">016</option>
								<option value="017">017</option>
								<option value="019">019</option>
								</select>&nbsp;-&nbsp;
								<input name="memHpnum2" type="text" maxlength="10" size="10"/>
			</td>
			</table></td>
		</tr>
		</tr>
		<tr>
			<td></td>
			<td valign="top">Email :</td>
			<td><input name="memEmail" type="text" maxlength="50" size="50"/>
		</tr>
		
		
		<tr>
			<td></td>
			<td></td>
			<td><br>
			<input type="submit" name="Submit" value="Submit"/>
			<input type="reset" value="Reset"/>
			</td>
		</tr>
	
</table>
</fieldset>
</form>
</body>
</html>
