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

$user=$_SESSION['admin'];
$new=$_POST["newRate"];

date_default_timezone_set ("Singapore"); 
		$ldate=date("d-m-Y", time());
		$ltime=date("h:i:sa", time());

$str = "SELECT Max(id) FROM price";
	
		$result2 = mysql_query ($str,$login);
		list($result2)=mysql_fetch_array($result2);
		$number = ++$result2;
			
		if($number == "1")
		{
			$number = "PRICE000001";
		}

	mysql_query("INSERT INTO price (id,price,date,time)
			VALUES('$number','$new','$ldate','$ltime')");

echo "<script language=javascript>alert('Renew rate successful!!');
		window.location='price.php'</script>";		

?>