<?php

	$StaffID =$_GET['StaffID'];
	$Password=$_POST['Password'];
	$Name=$_POST["Name"];
	$Email=$_POST["Email"];
	$Phone=$_POST["Phone"];
	$HPhone=$_POST["HPhone"];
	$Gender=$_POST["sex"];
	$Address1=$_POST["Address1"];
	$Postcode=$_POST["Postcode"];
	$IC=$_POST["IC"];

	$BDay=$_POST["sd"];

	
if($BDay == "" ){
echo "<script language=javascript>alert('Please Fill In Completely!!');window.location='http://www.wauhaha.com/karaoke/admineditmem.php?MemID=$MemID'</script>";
}

	$login=mysql_connect('localhost', 'wauhaha_karaoke', 'cross123','wauhaha_karaoke');
	
	mysql_selectDB("wauhaha_karaoke",$login);
	
	$query=mysql_query("SELECT * from staff where StaffID='$StaffID'");


$query2=mysql_query("UPDATE staff SET Name = '$Name',
Password='$Password',
Gender='$Gender',
BDay ='$BDay',
Address1 ='$Address1',
Postcode ='$Postcode',
IC ='$IC',
Email = '$Email',
Phone = '$Phone',
HPhone = '$HPhone'
WHERE StaffID='$StaffID'");
if($query2){
	echo "<script language=javascript>alert('Update successful!!');window.location='http://www.wauhaha.com/karaoke/adminviewstaff.php'</script>";
}
echo "<script language=javascript>alert('Update fail!!');window.location='http://www.wauhaha.com/karaoke/adminviewstaff.php'</script>";
	
	?>