session_start();
if(!isset($_SESSION['udesig']) || $_SESSION['udesig']!="admin")
header("Location:loginmain.php");
include "head.inc";
if(isset($_GET[cc]) && $_GET[cc]!="")
{
include "common.php";
dbconnect();
$sql_getvals = "select * from cust_profile where cust_Code='".$_GET[cc]."'";
$row = mysql_fetch_row(mysql_query($sql_getvals));
if(!isset($_GET["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
{
$sql_del = "delete from cust_profile where cust_Code='$_GET[cc]'";
mysql_query($sql_del);
$customer_code = $_GET["customer_code"];
$user_type = $_GET["user_type"];
$customer_lastname = $_GET["customer_lastname"];
$customer_initial = $_GET["customer_initial"];
$customer_firstname = $_GET["customer_firstname"];
$customer_address = $_GET["customer_address"];
$customer_state = $_GET["customer_state"];
$customer_city = $_GET["customer_city"];
$customer_zip = $_GET["customer_zip"];
$customer_phone = $_GET["customer_phone"];
$customer_fax = $_GET["customer_fax"];
$customer_email = $_GET["customer_email"];
$customer_card_type = $_GET["customer_card_type"];
$customer_card_no = $_GET["customer_card_no"];
$year = $_GET["year"];
$month = $_GET["month"];
$customer_card_name = $_GET["customer_card_name"];
$customer_card_code = $_GET["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("Customer info updated !!","admin_main.php");
}
else
{
mysql_close();
print_msg("Process failed !!".mysql_error(),"admin_main.php");
}
}
}
else
{
include "common.php";
dbconnect();
$sql = "select * from cust_profile order by first_Name ASC";
$result = mysql_query($sql);
$numrows = mysql_num_rows($result);
?>
| ::. ADMINISTRATOR
>> CUSTOMER >> UPDATE |
if($numrows<1)
{
?>
| No records available !! |
exit;
}
else
{
?>
while($row=mysql_fetch_row($result))
{
?>
|
=$row[0]?>
|
=$row[2]?>
|
=$row[3]?>
|
=$row[4]?>
|
=$row[5]?>
|
=$row[7]?>
|
=$row[6]?>
|
=$row[8]?>
|
=$row[9]?>
|
=$row[10]?>
|
=$row[11]?>
|
=$row[12]?>
|
=$row[13]?>
|
$expdt = explode("-",$row[14]);
print $expdt[1]."-".$expdt[0];
?>
|
=$row[15]?>
|
=$row[16]?>
|
=$row[1]?>
|
}
}
?>
|
}
include "foot.inc";
?>