-
Notifications
You must be signed in to change notification settings - Fork 0
/
billing.php
255 lines (223 loc) · 7.63 KB
/
billing.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<?php session_start();
if(!isset($_SESSION['id'])){
echo '<script>windows: location="index.php"</script>';
}
?>
<?php
$session=$_SESSION['id'];
include 'db.php';
$result = mysql_query("SELECT * FROM user where id= '$session'");
while($row = mysql_fetch_array($result))
{
$sessionname=$row['name'];
}
?>
<?php
include 'db.php';
$results = mysql_query("SELECT * FROM user");
$users = mysql_num_rows($results);
?>
<?php
include 'db.php';
$results = mysql_query("SELECT * FROM bill");
$bill = mysql_num_rows($results);
?>
<?php
include 'db.php';
$jibu = mysql_query("SELECT * FROM owners");
$client = mysql_num_rows($jibu);
?>
<?php
if (isset($_POST['add']))
{
include 'db.php';
$id=$_POST['id'] ;
$lname= $_POST['lname'] ;
$fname=$_POST['fname'] ;
$mi=$_POST['mi'] ;
$address=$_POST['address'] ;
$contact=$_POST['contact'] ;
mysql_query("INSERT INTO owners (id,lname,fname,mi,address,contact)
VALUES ('$id','$lname','$fname','$mi','$address','$contact')");
echo '<script>alert("success")</script>';
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="src/facebox.css" media="screen" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap/dist/css/bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="css/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css" />
<script type="text/javascript">
function addCommas(nStr){
nStr += '';
var x = nStr.split('.');
var x1 = x[0];
var x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
}
</script>
<script src="lib/jquery.js" type="text/javascript"></script>
<script src="src/facebox.js" type="text/javascript"></script>
<script src="css/bootstrap/dist/js/jquery.js"></script>
<script src="css/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox({
loadingImage : 'src/loading.gif',
closeImage : 'src/closelabel.png'
})
})
</script>
<script src="js/application.js" type="text/javascript" charset="utf-8"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Billing System</title>
<style type="text/css">
#wrapper{
width:100%;
margin:0 auto;
border:3px solid rgba(0,0,0,0);
-webkit-border-radius:5px;
-moz-border-radius:5px;
border-radius:5px;
-webkit-box-shadow:0 0 18px rgba(0,0,0,0.4);
-moz-box-shadow:0 0 18px rgba(0,0,0,0.4);
box-shadow:0 0 18px rgba(0,0,0,0.4);
margin-top:2%;
padding:10px;
height:550px;
}
#header { width:900px; height:100px;}
table th {background:#999;}
#form {
width:400px;
float:left;
border:3px solid rgba(0,0,0,0);
-webkit-border-radius:5px;
-moz-border-radius:5px;
border-radius:5px;
-webkit-box-shadow:0 0 18px rgba(0,0,0,0.4);
-moz-box-shadow:0 0 18px rgba(0,0,0,0.4);
box-shadow:0 0 18px rgba(0,0,0,0.4);
margin-top:5%;
}
#ryt {
float:right;
border:3px solid rgba(0,0,0,0);
-webkit-border-radius:5px;
-moz-border-radius:5px;
border-radius:5px;
-webkit-box-shadow:0 0 18px rgba(0,0,0,0.4);
-moz-box-shadow:0 0 18px rgba(0,0,0,0.4);
box-shadow:0 0 18px rgba(0,0,0,0.4);
margin-top:5%;
}
#header ul li{
list-style:none;
float:left; margin-top:30px; margin-left:10px;}
</style>
</head>
<body>
<div class="container">
<div id="wrapper">
<h1><center><b>Water Billing System</b></center></h1>
<div style="color:#F00; font-size:12px; margin-left:900px;">
<span><?php echo $sessionname;?></span><a href="logout.php"> <span class="btn btn-danger glyphicon glyphicon-log-out"> Logout</span></a>
</div>
<ul class="nav nav-pills">
<li class="btn btn-default btn-xs"><a href="billing.php"><span class="glyphicon glyphicon-home"></span> Home</a></li>
<li><a href="bill.php"><span class="glyphicon glyphicon-usd"></span> Billing</a></li>
<li><a href="user.php"><span class="glyphicon glyphicon-user"></span> Users</a></li>
<li><a href="clients.php"><span class="glyphicon glyphicon-list"></span> Clients</a></li>
</ul>
<hr color="#999999" />
<div class="tab-content">
<div id="home" class="tab-pane fade in active">
<!-------- home panel ----------------------------->
<h4>Welcome Dear, <?php echo $sessionname; ?></4>
<hr color="#000000" />
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading">
<div class="panel-title"><h5 style="font-size:24px; font-weight:bold;">Clients</h5></div>
</div>
<div class="panel-body">
<h1 align="center" style="font:Verdana, Geneva, sans-serif; font-weight:bolder;"><?php echo $client; ?></h1>
</div>
<a href="clients.php"><div class="panel-footer"><span class="alert-link glyphicon glyphicon-circle-arrow-right"></span>View</div></a>
</div>
</div>
</div>
<!----- ######################################### -->
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading">
<div class="panel-title"><h5 style="font-size:24px; font-weight:bold;">Users</h5></div>
</div>
<div class="panel-body">
<i><h1 align="center" style="font:Verdana, Geneva, sans-serif; font-weight:bolder;"><?php echo $users; ?></h1>
</div>
<a href="user.php"><div class="panel-footer"><span class="alert-link glyphicon glyphicon-circle-arrow-right"></span>View</div></a>
</div>
</div>
</div>
<!----- ######################################### -->
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading">
<div class="panel-title"><h5 style="font-size:24px; font-weight:bold;">Bills and Income</h5></div>
</div>
<div class="panel-body">
<h1 align="center" style="font:Verdana, Geneva, sans-serif; font-weight:bolder;"><?php echo $bill; ?>
<?php
include "db.php";
$add=mysql_query("Select SUM(price) from Bill");
while($row1=mysql_fetch_array($add))
{
$total=$row1['SUM(price)'];
}
?>
</h1>
</div>
<a href="bill.php"> <div class="panel-footer"><span class="alert-link glyphicon glyphicon-circle-arrow-right"></span>View</div></a>
</div>
</div>
</div>
<!--------- ########################################### ------>
<!-------------------------------- home ends ------------------------------>
</div>
</body>
</html>
<script src="js/jquery.js"></script>
<script type="text/javascript">
$(function() {
$(".delbutton").click(function(){
//Save the link in a variable called element
var element = $(this);
//Find the id of the link that was clicked
var del_id = element.attr("id");
//Built a url to send
var info = 'id=' + del_id;
if(confirm("Sure you want to delete this update? There is NO undo!"))
{
$.ajax({
type: "GET",
url: "delete.php",
data: info,
success: function(){
}
});
$(this).parents(".record").animate({ backgroundColor: "#fbc7c7" }, "fast")
.animate({ opacity: "hide" }, "slow");
}
return false;
});
});
</script>
<footer><center><p>Brought To You By: code-projects.org</p></center></footer>