Project Report of Electricity Billing System
Page - 77
$SQL="DELETE FROM category WHERE category_id = $_REQUEST[category_id]";
mysql_query($SQL) or die(mysql_error());
header("Location:../category-report.php?msg=Deleted Successfully.");
}
?>
Project Report of Electricity Billing System
Page - 78
Coding for Connection.php
include_once("../includes/db_connect.php");
include_once("../includes/functions.php");
if($_REQUEST[act]=="save_connection")
{
save_connection();
exit;
}
if($_REQUEST[act]=="delete_connection")
{
delete_connection();
exit;
}
if($_REQUEST[act]=="update_connection_status")
Project Report of Electricity Billing System
Page - 79
{
update_connection_status();
exit;
}
###Code for save connection#####
function save_connection()
{
$R=$_REQUEST;
if($R[connection_id])
{
$statement = "UPDATE `connection` SET";
$cond = "WHERE `connection_id` = '$R[connection_id]'";
$msg = "Data Updated Successfully.";
}
else
Project Report of Electricity Billing System
Page - 80
{
$statement = "INSERT INTO `connection` SET";
$cond = "";
$msg="Data saved successfully.";
}
$SQL= $statement."
`connection_category_id` = '$R[connection_category_id]',
`connection_customer_id` = '$R[connection_customer_id]',
`connection_bill_unit` = '$R[connection_bill_unit]',
`connection_company_name` = '$R[connection_company_name]',
`connection_occupation` = '$R[connection_occupation]',
`connection_add_city` = '$R[connection_add_city]',
`connection_add_pincode` = '$R[connection_add_pincode]',
`connection_add_state` = '$R[connection_add_state]',
`connection_add_landline` = '$R[connection_add_landline]',
`connection_add_mobile` = '$R[connection_add_mobile]',
|