-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.php
More file actions
182 lines (146 loc) · 4.92 KB
/
update.php
File metadata and controls
182 lines (146 loc) · 4.92 KB
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
<?php
include("db.php");
session_start();
$user=$_SESSION["session_user"];
if(!isset($user)){
header("Location: login.php");
}
else
{
?>
<!DOCTYPE html>
<!--[if IE 8 ]><html class="no-js oldie ie8" lang="en"> <![endif]-->
<!--[if IE 9 ]><html class="no-js oldie ie9" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html class="no-js" lang="en"> <!--<![endif]-->
<head>
<!--- basic page needs
================================================== -->
<meta charset="utf-8">
<title>Style Demo - Kards</title>
<meta name="description" content="">
<meta name="author" content="">
<!-- mobile specific metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- CSS
================================================== -->
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/vendor.css">
<style type="text/css" media="screen">
#styles {
background: white;
padding-top: 12rem;
padding-bottom: 12rem;
}
#styles .row {
max-width: 1024px;
}
#styles .section-intro {
max-width: 800px;
}
</style>
<!-- script
================================================== -->
<script src="js/modernizr.js"></script>
<script src="js/pace.min.js"></script>
<!-- favicons
================================================== -->
<link rel="icon" type="image/png" href="favicon.png">
</head>
<body id="top">
<!-- header
================================================== -->
<header>
<div class="row">
<div class="top-bar">
<a class="menu-toggle" href="#"><span>Menu</span></a>
<div class="logo">
<a href="index.html">KARDS</a>
</div>
<nav id="main-nav-wrap">
<ul class="main-navigation">
<li><a href="index.php" title="">Home</a></li>
<li><a href="userpage.php" title="">View Customer</a></li>
<li><a href="caluculatebill.php" title="">Caluculate Bill</a></li>
<li><a href="update.php" title="">Update</a></li>
<li><a href="viewfeedback.php" title="">View Feedback</a></li>
<li><a href="index.php" title="">Logout</a></li>
</ul>
</nav>
</div> <!-- /top-bar -->
</div> <!-- /row -->
</header> <!-- /header -->
<!-- Style Demo
================================================== -->
<section id="styles">
<div class="row section-intro">
<div class="col-twelve">
<h2>Welcome <?php echo $user; ?></h2>
<h1>Update Per Unit Cost</h1>
<form action="" method="POST">
<div>
<label for="sampleInput">1 Kilowatt-hour {kWh) cost</label>
<input class="full-width" type="text" placeholder="enter per unit cost" id="sampleInput" name="update1">
</div>
<input class="button-primary" type="submit" value="Update" name="update">
<?php
if(isset($_POST['update']))
{
@$update1=$_POST['update1'];
if(!empty($update1))
{
@$query="UPDATE update1 SET update1='$update1'";
@$query_pro=mysqli_query($con,$query);
if($query_pro){
echo "<script>alert('Thanku! Updated!!')</script>";
echo "<script>window.open('adminpage.php','_self')</script>";
}else{
header("Location:update1.php");
}
}
else{
echo "<script>alert('All field are Required!')</script>";
echo "<script>window.open('update1.php','_self')</script>";
}
}
?>
</form>
</div>
</div> <!-- /row -->
</section> <!--styles -->
<footer>
<div class="row">
<div class="col-six tab-full pull-right social">
<ul class="footer-social">
<li><a href="#"><i class="fa fa-facebook"></i></a></li>
<li><a href="#"><i class="fa fa-behance"></i></a></li>
<li><a href="#"><i class="fa fa-twitter"></i></a></li>
<li><a href="#"><i class="fa fa-dribbble"></i></a></li>
<li><a href="#"><i class="fa fa-instagram"></i></a></li>
</ul>
</div>
<div class="col-six tab-full">
<div class="copyright">
<span>© Copyright Kards 2016.</span>
<span>Design by <a href="http://www.styleshout.com/">styleshout</a></span>
</div>
</div>
<div id="go-top">
<a class="smoothscroll" title="Back to Top" href="#top"><i class="fa fa-long-arrow-up"></i></a>
</div>
</div> <!-- /row -->
</footer>
<div id="preloader">
<div id="loader"></div>
</div>
<!-- Java Script
================================================== -->
<script src="js/jquery-2.1.3.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
</body>
</html>
<?php
}
?>