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

date_default_timezone_set ("Singapore"); 
$date=date("d-m-Y", time());
$time=date("h:i:sa", time());
$date2=date("Y-m-d", time());
$time2=date("H:i:sa", time());
$sorttime=$date2." ".$time2;

$rate=$_GET['a'];
$productid=$_GET['b'];
$clientid=$_GET['c'];
$content=$_GET['d'];
///////////////////////////////////////////////////////////////////////
$str2 = "SELECT Max(reviewID) FROM userreview";
$result3 = mysql_query ($str2,$login);
list($result3)=mysql_fetch_array($result3);
$rid = ++$result3;
if($rid == "1")
{
	$rid = "UR00000001";
}
///////////////////////////////////////////////////////////////////////
if($rate == "api=Rubbish"){
$ratemark = "1";
}
elseif($rate == "api=Normal")
{
$ratemark = "2";
}
elseif($rate == "api=Good"){
$ratemark = "3";
}
elseif($rate == "api=VeryGood"){
$ratemark = "4";
}
elseif($rate == "api=Best"){
$ratemark = "5";
}

mysql_query("insert into userreview (reviewID,productID,userID2,rating,comment,dateSubmit,timeSubmit,datecomment)values('$rid','$productid','$clientid','$ratemark','$content','$date','$time','$sorttime')");

echo "<b><p class='result'>Thanks for you support this product!!</p></b>";







?>