session_start();
if(!isset($_SESSION['udesig']) || ($_SESSION['udesig']!="admin" && $_SESSION['udesig']!="deo"))
header("Location:loginmain.php");
include "head.inc";
if(!isset($_POST["Submit"]))
{
$usstates = array("AL","AK","AS","AZ","AR","CA","CO","CT","DE","DC","FM","FL","GA","GU","HI","ID","IL","IN","IA","KS","KY","LA","ME","MH","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","MP","OH","OK","OR","PW","PA","PR","RI","SC","SD","TN","TX","UT","VT","VI","VA","WA","WV","WI","WY");
?>
}
else
{
include "common.php";
dbconnect();
$customer_code = $_POST["customer_code"];
$user_type = $_POST["user_type"];
$customer_lastname = $_POST["customer_lastname"];
$customer_initial = $_POST["customer_initial"];
$customer_firstname = $_POST["customer_firstname"];
$customer_address = $_POST["customer_address"];
$customer_state = $_POST["customer_state"];
$customer_city = $_POST["customer_city"];
$customer_zip = $_POST["customer_zip"];
$customer_phone = $_POST["customer_phone"];
$customer_fax = $_POST["customer_fax"];
$customer_email = $_POST["customer_email"];
$customer_card_type = $_POST["customer_card_type"];
$customer_card_no = $_POST["customer_card_no"];
$year = $_POST["year"];
$month = $_POST["month"];
$customer_card_name = $_POST["customer_card_name"];
$customer_card_code = $_POST["customer_card_code"];
$sql = "INSERT INTO `cust_profile` ( `cust_Code` , `user_Type` , `last_Name` , `middle_Initial` , `first_Name` , `address` , `state` , `city` , `zip` , `tel_No` , `fax_No` , `email` , `card_Type` , `card_Number` , `expiry_Date` ,`card_Name`, `card_Code` )
VALUES (
'$customer_code','$user_type','$customer_lastname','$customer_initial','$customer_firstname','$customer_address','$customer_state','$customer_city','$customer_zip','$customer_phone','$customer_fax','$customer_email','$customer_card_type','$customer_card_no','$year-$month-30','$customer_card_name','$customer_card_code')";
$result = @mysql_query($sql);
if($result)
{
mysql_close();
print_msg("New customer added !!","admin_main.php");
}
else
{
print_msg("Process failed !!".mysql_error(),"admin_main.php");
}
}
include "foot.inc";
?>