//*** Add Condition ***//
if($_POST["hdnCmd"] == "Add")
{
$strSQL = "INSERT INTO customer ";
$strSQL .="(CustomerID,Name,Email,CountryCode,Budget,Used,Last_edit) ";
$strSQL .="VALUES ";
$strSQL .="('".$_POST["txtAddCustomerID"]."','".$_POST["txtAddName"]."' ";
$strSQL .=",'".$_POST["txtAddEmail"]."' ";
$strSQL .=",'".$_POST["txtAddCountryCode"]."','".$_POST["txtAddBudget"]."' ";
$strSQL .=",'".$_POST["txtAddUsed"]."' ";
$strSQL .=", NOW() ) ";
$objQuery = mysql_query($strSQL);
if(!$objQuery)
{
echo "Error Save [".mysql_error()."]";
}
//header("location:$_SERVER[PHP_SELF]");
//exit();
}
//*** Update Condition ***//
if($_POST["hdnCmd"] == "Update")
{
$strSQL = "UPDATE customer SET ";
$strSQL .="CustomerID = '".$_POST["txtEditCustomerID"]."' ";
$strSQL .=",Name = '".$_POST["txtEditName"]."' ";
$strSQL .=",Email = '".$_POST["txtEditEmail"]."' ";
$strSQL .=",CountryCode = '".$_POST["txtEditCountryCode"]."' ";
$strSQL .=",Budget = '".$_POST["txtEditBudget"]."' ";
$strSQL .=",Used = '".$_POST["txtEditUsed"]."' ";
$strSQL .=",Last_edit = NOW() ";
$strSQL .="WHERE CustomerID = '".$_POST["hdnEditCustomerID"]."' ";
$objQuery = mysql_query($strSQL);
if(!$objQuery)
{
echo "Error Update [".mysql_error()."]";
}
//header("location:$_SERVER[PHP_SELF]");
//exit();
}