Project Report of Electricity Billing System
Page - 89
{
$statement = "UPDATE `image` SET";
$cond = "WHERE `image_id` = '$R[image_id]'";
$msg = "Data Updated Successfully.";
$condQuery = "";
}
else
{
$statement = "INSERT INTO `image` SET";
$msg="Data saved successfully.";
}
$SQL= $statement."
`image_room_id` = '$R[image_room_id]',
`image_name` = '$image_name',
`image_title` = '$R[image_title]'".
$cond;
Project Report of Electricity Billing System
Page - 90
$rs = mysql_query($SQL) or die(mysql_error());
header("Location:../image-report.php?msg=$msg");
}
#########Function for delete image##########3
function delete_image()
{
$SQL="SELECT * FROM image WHERE image_id = $_REQUEST[image_id]";
$rs=mysql_query($SQL);
$data=mysql_fetch_assoc($rs);
/////////Delete the record//////////
$SQL="DELETE FROM image WHERE image_id = $_REQUEST[image_id]";
mysql_query($SQL) or die(mysql_error());
//////////Delete the image///////////
if($data[image_name])
Project Report of Electricity Billing System
Page - 91
{
unlink("../uploads/".$data[image_name]);
}
header("Location:../image-report.php?msg=Deleted Successfully.");
}
?>
Project Report of Electricity Billing System
Page - 92
Coding for Login.php
session_start();
include_once("../includes/db_connect.php");
if($_REQUEST[act]=="check_login")
{
check_login();
}
if($_REQUEST[act]=="logout")
{
logout();
}
if($_REQUEST[act] == "change_password")
{
|