<?php
	$login=mysql_connect('localhost', 'wauhaha_karaoke', 'cross123','wauhaha_karaoke');
	
	mysql_selectDB("wauhaha_karaoke",$login);
	
	$no = $_GET["no"];
	$position = $_POST["position"];
	$basic = $_POST["basic"];
	$overtime = $_POST["overtime"];
	$epfrate = $_POST['epfrate']/100;
	$c1 = $_POST['cepf']/100;
	echo $position;
	echo $basic;
	echo $overtime;
	$result5=mysql_query("select rate from socso where '$basic' between mins and maxs");
$r = mysql_fetch_array($result5);
$so = $r['rate'];
	$query=mysql_query("SELECT * from salaryrate where no ='$no'");
	
	$query2=mysql_query("UPDATE salaryrate SET position='$position',
												basic='$basic',
												overtime='$overtime',
												epfrate='$epfrate',
												cepf='$c1',
												socso='$so' WHERE no='$no'");
	
	
if($query2){ 	
	echo "<script language=javascript>alert('Changed successful!!');window.location='http://www.wauhaha.com/karaoke/viewsalaryrate.php'</script>";
}else{
echo "<script language=javascript>alert('Changed fail!!');window.location='http://www.wauhaha.com/karaoke/viewsalaryrate.php'</script>";
}	
	?>
	
	
	