Project Report of Electricity Billing System
Page - 104
}
if($R[user_id])
{
$statement = "UPDATE `user` SET";
$cond = "WHERE `user_id` = '$R[user_id]'";
$msg = "Data Updated Successfully.";
$condQuery = "";
}
else
{
$statement = "INSERT INTO `user` SET";
$condQuery = "`user_username` = '$R[user_username]',
`user_password` = '$R[user_password]',";
$cond = "";
$msg="Data saved successfully.";
}
Project Report of Electricity Billing System
Page - 105
$SQL= $statement."
`user_level_id` = '$R[user_level_id]',
".
$condQuery
."
`user_name` = '$R[user_name]',
`user_add1` = '$R[user_add1]',
`user_add2` = '$R[user_add2]',
`user_city` = '$R[user_city]',
`user_state` = '$R[user_state]',
`user_country` = '$R[user_country]',
`user_email` = '$R[user_email]',
`user_mobile` = '$R[user_mobile]',
`user_gender` = '$R[user_gender]',
`user_dob` = '$R[user_dob]',
`user_image` = '$image_name'".
Project Report of Electricity Billing System
Page - 106
$cond;
$rs = mysql_query($SQL) or die(mysql_error());
if($_SESSION['login']!=1)
{
header("Location:../login.php?msg=You are registered successfully. Login with
your credential !!!");
exit;
}
else if($_SESSION['user_details']['user_level_id'] == 3) {
header("Location:../user.php?user_id=".$_SESSION['user_details']['user_id']."&msg=Your
account updated successfully !!!");
exit;
}
header("Location:../user-report.php?msg=$msg&type=$R[user_level_id]");
}
#########Function for delete user##########3
|