Project Report of Electricity Billing System
Page - 85
{
$statement = "INSERT INTO `facility` SET";
$cond = "";
$msg="Data saved successfully.";
}
$SQL= $statement."
`facility_name` = '$R[facility_name]',
`facility_description` = '$R[facility_description]'".
$cond;
$rs = mysql_query($SQL) or die(mysql_error());
header("Location:../facility-report.php?msg=$msg");
}
#########Function for delete facility##########3
function delete_facility()
{
/////////Delete the record//////////
Project Report of Electricity Billing System
Page - 86
$SQL="DELETE FROM facility WHERE facility_id = $_REQUEST[facility_id]";
mysql_query($SQL) or die(mysql_error());
header("Location:../facility-report.php?msg=Deleted Successfully.");
}
?>
Project Report of Electricity Billing System
Page - 87
Coding for Image.php
session_start();
include_once("../includes/db_connect.php");
include_once("../includes/functions.php");
if($_REQUEST[act]=="save_image")
{
save_image();
exit;
}
if($_REQUEST[act]=="delete_image")
{
delete_image();
exit;
}
Project Report of Electricity Billing System
Page - 88
###Code for save image#####
function save_image()
{
$R=$_REQUEST;
/////////////////////////////////////
$image_name = $_FILES[image_name][name];
$location = $_FILES[image_name][tmp_name];
if($image_name!="")
{
move_uploaded_file($location,"../uploads/".$image_name);
}
else
{
$image_name = $R[avail_image];
}
if($R[image_id])
|