• No results found

Code of the Project Electricity Billing

In document Electricity Billing System (Page 62-173)

System

Project Report of Electricity Billing System

Page - 63

Coding for Bill.php

<?php

include_once("../includes/db_connect.php");

include_once("../includes/functions.php");

if($_REQUEST[act]=="save_bill")

{

save_bill();

exit;

}

if($_REQUEST[act]=="delete_bill")

{

delete_bill();

exit;

}

if($_REQUEST[act]=="update_bill_status")

Project Report of Electricity Billing System

Page - 64

{

update_bill_status();

exit;

}

###Code for save bill#####

function save_bill()

{

$R=$_REQUEST;

if($R[bill_id])

{

$statement = "UPDATE `bill` SET";

$cond = "WHERE `bill_id` = '$R[bill_id]'";

$msg = "Data Updated Successfully.";

}

else

Project Report of Electricity Billing System

Page - 65

{

$statement = "INSERT INTO `bill` SET";

$cond = "";

$msg="Data saved successfully.";

}

$SQL= $statement."

`bill_connection_id` = '$R[bill_connection_id]',

`bill_current_reading` = '$R[bill_current_reading]',

`bill_previous_reading` = '$R[bill_previous_reading]',

`bill_total_units` = '$R[bill_total_units]',

`bill_charge_per_unit` = '$R[bill_charge_per_unit]',

`bill_fix_charges` = '$R[bill_fix_charges]',

`bill_tax` = '$R[bill_tax]',

`bill_month` = '$R[bill_month]',

`bill_final_amout` = '$R[bill_final_amout]',

`bill_description` = '$R[bill_description]'".

Project Report of Electricity Billing System

Page - 66

$cond;

$rs = mysql_query($SQL) or die(mysql_error());

header("Location:../bill-report.php?msg=$msg");

}

#########Function for delete bill##########3

function delete_bill()

{

/////////Delete the record//////////

$SQL="DELETE FROM bill WHERE bill_id = $_REQUEST[bill_id]";

mysql_query($SQL) or die(mysql_error());

header("Location:../bill-report.php?msg=Deleted Successfully.");

}

?>

Project Report of Electricity Billing System

Page - 67

Coding for Booking.php

<?php

include_once("../includes/db_connect.php");

include_once("../includes/functions.php");

if($_REQUEST[act]=="save_book")

{

save_book();

exit;

}

if($_REQUEST[act]=="delete_book")

{

delete_book();

exit;

}

if($_REQUEST[act]=="get_report")

Project Report of Electricity Billing System

Page - 68

{

get_report();

exit;

}

###Code for save book#####

function save_book()

{

$R=$_REQUEST;

/// Get the room details ///////

$SQL = "SELECT * FROM room WHERE room_id = '$R[book_room_id]'";

$rs = mysql_query($SQL) or die(mysql_error());

$data = mysql_fetch_assoc($rs);

/// Date and amount calculation //////

$dStart = new DateTime($R[book_from_date]);

Project Report of Electricity Billing System

Page - 69

$dEnd = new DateTime($R[book_to_date]);

$dDiff = $dStart->diff($dEnd);

$totalDays = $dDiff->days;

$totalAmount = $totalDays * $R[book_no_rooms] * $data['room_fare'];

if($dDiff->format('%R') == "-")

{

die("From date should me smaller than current date.");

}

if($R[book_id])

{

$statement = "UPDATE `book` SET";

$cond = "WHERE `book_id` = '$R[book_id]'";

$msg = "Data Updated Successfully.";

}

else

Project Report of Electricity Billing System

Page - 70

{

$statement = "INSERT INTO `book` SET";

$cond = "";

$msg="Data saved successfully.";

}

$SQL= $statement."

`book_user_id` = '$_SESSION[user_details][user_id]',

`book_date` = now(),

`book_room_id` = '$R[book_room_id]',

`book_from_date` = '$R[book_from_date]',

`book_to_date` = '$R[book_to_date]',

`book_no_rooms` = '$R[book_no_rooms]',

`book_no_persons` = '$R[book_no_persons]',

`book_no_childs` = '$R[book_no_childs]',

`book_name` = '$R[book_name]',

`book_mobile` = '$R[book_mobile]',

Project Report of Electricity Billing System

Page - 71

`book_email` = '$R[book_email]',

`book_total_amount` = '$totalAmount',

`book_status` = '0'".

$cond;

$rs = mysql_query($SQL) or die(mysql_error());

if($R[book_id] == "") {

$book_id = mysql_insert_id();

}

header("Location:../make_payment.php?book_id=".$book_id);

}

#########Function for delete book##########3

function delete_book()

{

/////////Delete the record//////////

$SQL="DELETE FROM book WHERE book_id = $_REQUEST[book_id]";

mysql_query($SQL) or die(mysql_error());

Project Report of Electricity Billing System

Page - 72

header("Location:../book-report.php?msg=Deleted Successfully.");

}

##############Function for reporting ##################3

function get_report()

{

$fname = 'myCSV.csv';

$fp = fopen($fname,'w');

$column_name =

'"ID","book_name","book_add1","book_add2","book_state","book_email","book_city","book_mobile","

book_gender","book_dob","book_nl_id","book_image"'."\n\r";

fwrite($fp,$column_name);

$SQL="SELECT * FROM book,city WHERE book_city = city_id";

$rs=mysql_query($SQL);

while($data=mysql_fetch_assoc($rs))

{

$csvdata=implode(",",$data)."\n\r";

Project Report of Electricity Billing System

Page - 73

fwrite($fp,$csvdata);

}

fclose($fp);

header('Content-type: application/csv');

header("Content-Disposition: inline; filename=".$fname);

readfile($fname);

}

?>

Project Report of Electricity Billing System

Page - 74

Coding for Category.php

<?php

include_once("../includes/db_connect.php");

include_once("../includes/functions.php");

if($_REQUEST[act]=="save_category")

{

save_category();

exit;

}

if($_REQUEST[act]=="delete_category")

{

delete_category();

exit;

}

if($_REQUEST[act]=="update_category_status")

Project Report of Electricity Billing System

Page - 75

{

update_category_status();

exit;

}

###Code for save category#####

function save_category()

{

$R=$_REQUEST;

if($R[category_id])

{

$statement = "UPDATE `category` SET";

$cond = "WHERE `category_id` = '$R[category_id]'";

$msg = "Data Updated Successfully.";

}

else

Project Report of Electricity Billing System

Page - 76

{

$statement = "INSERT INTO `category` SET";

$cond = "";

$msg="Data saved successfully.";

}

$SQL= $statement."

`category_name` = '$R[category_name]',

`category_description` = '$R[category_description]'".

$cond;

$rs = mysql_query($SQL) or die(mysql_error());

header("Location:../category-report.php?msg=$msg");

}

#########Function for delete category##########3

function delete_category()

{

/////////Delete the record//////////

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

<?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]',

Project Report of Electricity Billing System

Page - 81

`connection_add_email` = '$R[connection_add_email]',

`connection_request_load` = '$R[connection_request_load]',

`connection_contract_demand` = '$R[connection_contract_demand]',

`connection_plot` = '$R[connection_plot]',

`connection_description` = '$R[connection_description]',

`connection_address` = '$R[connection_address]'".

$cond;

$rs = mysql_query($SQL) or die(mysql_error());

header("Location:../connection-report.php?msg=$msg");

}

#########Function for delete connection##########3

function delete_connection()

{

/////////Delete the record//////////

$SQL="DELETE FROM connection WHERE connection_id = $_REQUEST[connection_id]";

mysql_query($SQL) or die(mysql_error());

Project Report of Electricity Billing System

Page - 82

header("Location:../connection-report.php?msg=Deleted Successfully.");

}

?>

Project Report of Electricity Billing System

Page - 83

Coding for Facility.php

<?php

include_once("../includes/db_connect.php");

include_once("../includes/functions.php");

if($_REQUEST[act]=="save_facility")

{

save_facility();

exit;

}

if($_REQUEST[act]=="delete_facility")

{

delete_facility();

exit;

}

if($_REQUEST[act]=="update_facility_status")

Project Report of Electricity Billing System

Page - 84

{

update_facility_status();

exit;

}

###Code for save facility#####

function save_facility()

{

$R=$_REQUEST;

if($R[facility_id])

{

$statement = "UPDATE `facility` SET";

$cond = "WHERE `facility_id` = '$R[facility_id]'";

$msg = "Data Updated Successfully.";

}

else

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

<?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])

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

<?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")

{

Project Report of Electricity Billing System

Page - 93

change_password();

}

####Function check user#######

function check_login()

{

$user_user=$_REQUEST[user_user];

$user_password=$_REQUEST[user_password];

$SQL="SELECT * FROM user WHERE user_username = '$user_user' AND user_password = '$user_password'";

$rs = mysql_query($SQL) or die(mysql_error());

if(mysql_num_rows($rs))

{

$_SESSION[login]=1;

$_SESSION['user_details'] = mysql_fetch_assoc($rs);

header("Location:../index.php");

}

Project Report of Electricity Billing System

Page - 94

else

{

header("Location:../login.php?msg=Invalid User and Password.");

}

}

####Function logout####

function logout()

{

$_SESSION[login]=0;

$_SESSION['user_details'] = 0;

header("Location:../login.php?msg=Logout Successfullly.");

}

#####Function for changing the password ####

function change_password() {

$R = $_REQUEST;

if($R['user_confirm_password'] != $R['user_new_password']) {

Project Report of Electricity Billing System

Page - 95

header("Location:../change-password.php?msg=Your new passsword and confirm password does not match!!!");

exit;

}

$SQL = "UPDATE `user` SET user_password = '$R[user_new_password]' WHERE `user_id` =

".$_SESSION['user_details']['user_id'];

$rs = mysql_query($SQL) or die(mysql_error());

header("Location:../change-password.php?msg=Your Password Changed Successfully !!!");

print $SQL;

die;

}

?>

Project Report of Electricity Billing System

Page - 96

oding for Room.php

<?php

include_once("../includes/db_connect.php");

include_once("../includes/functions.php");

if($_REQUEST[act]=="save_room")

{

save_room();

exit;

}

if($_REQUEST[act]=="delete_room")

{

delete_room();

exit;

}

Project Report of Electricity Billing System

Page - 97

###Code for save room#####

function save_room()

{

$R=$_REQUEST;

$image_name = $_FILES[room_image][name];

$location = $_FILES[room_image][tmp_name];

if($image_name!="")

{

move_uploaded_file($location,"../uploads/".$image_name);

}

else

{

$image_name = $R[avail_image];

}

$facility_id = implode(",",$R['room_facility_id']);

if($R[room_id])

Project Report of Electricity Billing System

Page - 98

{

$statement = "UPDATE `room` SET";

$cond = "WHERE `room_id` = '$R[room_id]'";

$msg = "Data Updated Successfully.";

}

else

{

$statement = "INSERT INTO `room` SET";

$cond = "";

$msg="Data saved successfully.";

}

$SQL= $statement."

`room_category_id` = '$R[room_category_id]',

`room_title` = '$R[room_title]',

`room_facility_id` = '$facility_id',

Project Report of Electricity Billing System

Page - 99

`room_name` = '$R[room_name]',

`room_no_of_beds` = '$R[room_no_of_beds]',

`room_max_adult` = '$R[room_max_adult]',

`room_max_child` = '$R[room_max_child]',

`room_fare` = '$R[room_fare]',

`room_image` = '$image_name',

`room_description` = '$R[room_description]'".

$cond;

$rs = mysql_query($SQL) or die(mysql_error());

header("Location:../room-report.php?msg=$msg");

}

#########Function for delete room##########3

function delete_room()

{

/////////Delete the record//////////

$SQL="DELETE FROM room WHERE room_id = $_REQUEST[room_id]";

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

<?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;

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

Project Report of Electricity Billing System

Page - 107

function delete_user()

{

$SQL="SELECT * FROM user WHERE user_id = $_REQUEST[user_id]";

$rs=mysql_query($SQL);

$data=mysql_fetch_assoc($rs);

/////////Delete the record//////////

$SQL="DELETE FROM user WHERE user_id = $_REQUEST[user_id]";

mysql_query($SQL) or die(mysql_error());

//////////Delete the image///////////

if($data[user_image])

{

unlink("../uploads/".$data[user_image]);

}

header("Location:../user-report.php?msg=Deleted Successfully.&type=$data[user_level_id]");

Project Report of Electricity Billing System

Page - 108

}

?>

Project Report of Electricity Billing System

Page - 109

Coding for Bill.php

<?php

include_once("includes/header.php");

if($_REQUEST[bill_id])

{

$SQL="SELECT * FROM `bill` WHERE bill_id = $_REQUEST[bill_id]";

$rs=mysql_query($SQL) or die(mysql_error());

$data=mysql_fetch_assoc($rs);

}

?>

<div class="crumb">

</div>

<div class="clear"></div>

<div id="content_sec">

<div class="col1">

Project Report of Electricity Billing System

Page - 110

<div class="contact">

<h4 class="heading colr">Creating Electricity Bill</h4>

<?php if($_REQUEST['msg']) { ?>

<div class="msg"><?=$_REQUEST['msg']?></div>

<?php } ?>

<form action="lib/bill.php" enctype="multipart/form-data"

method="post" name="frm_type">

<ul class="forms">

<li class="txt">Connection Number</li>

<li class="inputfield">

<select name="bill_connection_id"

id="bill_connection_id" class="bar" required/>

<?php echo

Project Report of Electricity Billing System

Page - 111

<li class="txt">Bill For Month</li>

<li class="inputfield">

<select name="bill_month" id="bill_month" class="bar"

required/>

<li class="txt">Current Reading</li>

<li class="inputfield"><input

name="bill_current_reading" id="bill_current_reading" type="text" class="bar" required value="<?=$data[bill_current_reading]?>"/></li>

</ul>

<ul class="forms">

<li class="txt">Previous Reading</li>

<li class="inputfield"><input

name="bill_previous_reading" id="bill_previous_reading" type="text" class="bar" required

Project Report of Electricity Billing System

Page - 112

value="<?=$data[bill_previous_reading]?>"/></li>

</ul>

<ul class="forms">

<li class="txt">Total Units</li>

<li class="inputfield"><input name="bill_total_units"

id="bill_total_units" type="text" class="bar" required value="<?=$data[bill_total_units]?>"/></li>

</ul>

<ul class="forms">

<li class="txt">Charge Per Unit</li>

<li class="inputfield"><input

name="bill_charge_per_unit" id="bill_charge_per_unit" type="text" class="bar" required value="<?=$data[bill_charge_per_unit]?>"/></li>

</ul>

<ul class="forms">

<li class="txt">Fix Charges</li>

<li class="inputfield"><input name="bill_fix_charges"

id="bill_fix_charges" type="text" class="bar" required value="<?=$data[bill_fix_charges]?>"/></li>

</ul>

Project Report of Electricity Billing System

Page - 113

<ul class="forms">

<li class="txt">Tax</li>

<li class="inputfield"><input name="bill_tax"

id="bill_tax" type="text" class="bar" required value="<?=$data[bill_tax]?>"/></li>

</ul>

<ul class="forms">

<li class="txt">Final Amount</li>

<li class="inputfield"><input name="bill_final_amout"

id="bill_final_amout" type="text" class="bar" required value="<?=$data[bill_final_amout]?>"/></li>

</ul>

<ul class="forms">

<li class="txt">Description</li>

<li class="textfield"><textarea name="bill_description"

cols="" rows="6" required><?=$data[bill_description]?></textarea></li>

</ul>

<div class="clear"></div>

<ul class="forms">

<li class="txt">&nbsp;</li>

Project Report of Electricity Billing System

Page - 114

<li class="textfield"><input type="submit"

value="Submit" class="simplebtn"></li>

<li class="textfield"><input type="reset" value="Reset"

class="resetbtn"></li>

</ul>

<input type="hidden" name="act" value="save_bill">

<input type="hidden" name="bill_id"

value="<?=$data[bill_id]?>">

</form>

</div>

</div>

<div class="col2">

<?php include_once("includes/sidebar.php"); ?>

</div>

</div>

<?php include_once("includes/footer.php"); ?>

Project Report of Electricity Billing System

Page - 115

Coding for Billing-Confirmation.php

<?php

include_once("includes/header.php");

/// Update the booking status /////

$date = date("F j, Y");

$SQL = "UPDATE bill SET bill_payment_status = 1, bill_payment_date = '$date' WHERE bill_id = '$_REQUEST[bill_id]'";

$rs = mysql_query($SQL) or die(mysql_error());

/// Get the booking details /////

if($_REQUEST[bill_id])

{

$SQL="SELECT * FROM `bill`,`connection`,`user`,`month` WHERE bill_month = month_id AND connection_customer_id = user_id AND bill_connection_id = connection_id AND bill_id =

$_REQUEST[bill_id]";

$rs=mysql_query($SQL) or die(mysql_error());

$data=mysql_fetch_assoc($rs);

Project Report of Electricity Billing System

Page - 116

}

?>

<style>

td{

padding:5px;

text-align:center;

boder:1px solid;

margin:1px;

border:1px solid #101746;

}

th {

font-weight:bold;

color:#ffffff;

font-size:12px;

background-color:#bf3c22;

padding:5px;

Project Report of Electricity Billing System

Page - 117

}

</style>

<div class="crumb">

</div>

<div class="clear"></div>

<div id="content_sec">

<div class="col1">

<div class="contact">

<h4 class="heading colr">Bill Payment Receipt (Your bill payment was successfull !!!)</h4>

<div>

<table style="border:1px solid; width:100%">

<tr>

<th>Payment Refrence ID</th>

<td>10000<?=$data[bill_id]?></td>

Project Report of Electricity Billing System

Page - 118

</tr>

<tr>

<th>Payment Date</th>

<td><?=$data[bill_payment_date]?></td>

</tr>

<tr>

<th>Customer Name</th>

<td><?=$data[user_name]?></td>

</tr>

<tr>

<th>Mobile</th>

<td><?=$data[user_mobile]?></td>

</tr>

<tr>

<th>Email</th>

Project Report of Electricity Billing System

Page - 119

<td><?=$data[user_email]?></td>

</tr>

<tr>

<th>Bill Month</th>

<td><?=$data[month_name]?></td>

</tr>

<tr>

<th>Current Reading</th>

<td><?=$data[bill_current_reading]?>

Units</td>

</tr>

<tr>

<th>Previous Reading</th>

<td><?=$data[bill_previous_reading]?>

Units</td>

</tr>

<tr>

Project Report of Electricity Billing System

Page - 120

<th>Total Units Consumed</th>

<td><?=$data[bill_total_units]?>

Units</td>

</tr>

<tr>

<th>Charge Per Unit</th>

<td><?=$data[bill_charge_per_unit]?>.00/-</td>

</tr>

<tr>

<th>Fix Charge</th>

<td><?=$data[bill_fix_charges]?>.00/-</td>

</tr>

<tr>

<th>Tax</th>

<td><?=$data[bill_tax]?>.00/-</td>

</tr>

Project Report of Electricity Billing System

Page - 121

<tr>

<th>Total Amount Paid</th>

<td><?=$data[bill_final_amout]?>.00/-</td>

</tr>

</table>

<ul class="forms" style="float:right; margin-top:20px;">

<li class="textfield"><input type="button"

value="Print Receipt" class="simplebtn" onClick="window.print()"></li>

</ul>

</div>

</div>

</div>

<div class="col2">

<?php include_once("includes/sidebar.php"); ?>

</div>

</div>

Project Report of Electricity Billing System

Page - 122

<?php include_once("includes/footer.php"); ?>

Project Report of Electricity Billing System

Page - 123

Coding for Bill-Report.php

<?php

include_once("includes/header.php");

include_once("includes/db_connect.php");

if($_SESSION['user_details']['user_level_id'] == 2)

$SQL="SELECT * FROM `bill`,`month`,`connection`,`user` WHERE user_id = connection_customer_id AND bill_month = month_id AND user_id =

".$_SESSION['user_details']['user_id'];

else

$SQL="SELECT * FROM `bill`,`month` WHERE bill_month = month_id";

$rs=mysql_query($SQL) or die(mysql_error());

?>

<script>

function delete_bill(bill_id)

{

if(confirm("Do you want to delete the bill?"))

{

Project Report of Electricity Billing System

Page - 124

this.document.frm_bill.bill_id.value=bill_id;

this.document.frm_bill.act.value="delete_bill";

this.document.frm_bill.submit();

}

}

</script>

<div class="crumb">

</div>

<div class="clear"></div>

<div id="content_sec">

<div class="col1" style="width:100%">

<div class="contact">

<h4 class="heading colr">Electricity Bill Report</h4>

<?php

if($_REQUEST['msg']) {

?>

Project Report of Electricity Billing System

Page - 125

<div class="msg"><?=$_REQUEST['msg']?></div>

<?php

}

?>

<form name="frm_bill" action="lib/bill.php" method="post">

<div class="static">

<table style="width:100%">

<tbody>

<tr class="tablehead bold">

<td scope="col">ID</td>

<td scope="col">Connection ID</td>

<td scope="col">Connection ID</td>

In document Electricity Billing System (Page 62-173)

Related documents