Project Report of Electricity Billing System
Page - 100
mysql_query($SQL) or die(mysql_error());
header("Location:../room-report.php?msg=Deleted Successfully.");
}
?>
Project Report of Electricity Billing System
Page - 101
Coding for User.php
session_start();
include_once("../includes/db_connect.php");
include_once("../includes/functions.php");
if($_REQUEST[act]=="save_user")
{
save_user();
exit;
}
if($_REQUEST[act]=="delete_user")
{
delete_user();
exit;
}
Project Report of Electricity Billing System
Page - 102
if($_REQUEST[act]=="get_report")
{
get_report();
exit;
}
###Code for save user#####
function save_user()
{
$R=$_REQUEST;
///Checking Username Exits or not ////
$SQL="SELECT * FROM user WHERE user_username = '$_REQUEST[user_username]'";
$rs=mysql_query($SQL);
$data=mysql_fetch_assoc($rs);
if($data['user_username'] && $R['user_id'] != $_SESSION['user_details']['user_id']) {
header("Location:../user.php?msg=Username Already Exits. Kindly choose
another....");
Project Report of Electricity Billing System
Page - 103
return;
}
/////////////////////////////////////
$image_name = $_FILES[user_image][name];
$location = $_FILES[user_image][tmp_name];
if($image_name!="")
{
move_uploaded_file($location,"../uploads/".$image_name);
}
else
{
$image_name = $R[avail_image];
}
if($R[user_level_id] == "" || !isset($R[user_level_id]))
{
$R[user_level_id] = 2;
|