-
Notifications
You must be signed in to change notification settings - Fork 0
/
editcandidate.php
295 lines (244 loc) · 13.9 KB
/
editcandidate.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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<?php
$link=mysqli_connect("localhost","root","","onps");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>ONPS|candidate|registration form</title>
<!-- Bootstrap Core CSS -->
<link href="../bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- MetisMenu CSS -->
<link href="../bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">
<!-- Timeline CSS -->
<link href="../dist/css/timeline.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="../dist/css/sb-admin-2.css" rel="stylesheet">
<!-- Morris Charts CSS -->
<link href="../bower_components/morrisjs/morris.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="../bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div id="wrapper">
<!-- Navigation -->
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">ONLINE NATIONAL POLLING SYSTEM</a>
</div>
<!-- /.navbar-header -->
<ul class="nav navbar-top-links navbar-right">
<!-- /.dropdown -->
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><a href="#"><i class="fa fa-user fa-fw"></i> User Profile</a>
</li>
<li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a>
</li>
<li class="divider"></li>
<li><a href="index.php"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
</li>
</ul>
<!-- /.dropdown-user -->
</li>
<!-- /.dropdown -->
</ul>
<!-- /.navbar-top-links -->
</div>
<fieldset>
<div class="main">
<div class="header">
<div class="header_resize">
<img src="images/edit.png" width="1350" height="300" alt="" class="hbgimg" />
</div>
</div>
</div>
</fieldset>
<div class="navbar-default sidebar" role="navigation">
<div class="sidebar-nav navbar-collapse">
<ul class="nav" id="side-menu">
<li class="sidebar-search">
<div class="input-group custom-search-form">
<input type="text" class="form-control" placeholder="Search..."/>
<span class="input-group-btn">
<button class="btn btn-default" type="button">
<i class="fa fa-search"></i>
</button>
</span>
</div>
<!-- /input-group -->
</li>
<li><a href="index.php"><i class="fa fa-dashboard fa-fw"></i>Home </a></li>
<!--/candidate navigation-->
<li class="dropdown-menu-right">
<a class="dropdown-toggle" data-toggle="dropdown" href="candidate.php">
<i class="fa fa-bar-chart-o fa-fw"></i>Candidate<span class="fa arrow"></span></a>
<ul class="dropdown-menu dropdown-Candidate">
<li>
<a href="candidate_reg.php">Candidate Registration</a>
</li>
<li>
<a href="editcandidate.php">Edit Profile</a>
</li>
<li>
<a href="promisecand.php">Add/Edit Promises</a>
</li>
<li>
<a href="questionanscand.php">Read/Answer Questions</a>
</li>
</ul>
</li>
<!--/voter navigation-->
<li class="dropdown-menu-right">
<a class="dropdown-toggle" data-toggle="dropdown" href="Voter.php">
<i class="fa fa-bar-chart-o fa-fw"></i>Voter<span class="fa arrow"></span></a>
<ul class="dropdown-menu dropdown-Voter">
<li>
<a href="voter_reg.php">Voter Registration</a>
</li>
<li>
<a href="voter_login.php">Update Account</a>
</li>
<li>
<a href="voter_login.php">View Candidate Information</a>
</li>
<li>
<a href="voter_login.php">Ask Questions to Candidate</a>
</li>
<li>
<a href="voter_login.php">View Election Result</a>
</li>
</ul>
</li>
<!--/admin navigation-->
<li class="dropdown-menu-right">
<a href="adminlogin.php">
<i class="fa fa-bar-chart-o fa-fw"></i>Administrator<span class="fa arrow"></span></a>
</li>
<!--/about us-->
<li>
<a href="aboutus.php"><i class="fa fa-bar-chart-o fa-fw"></i>About Us</a>
</li>
</div>
<!-- /.sidebar-collapse -->
</div>
</div>
<!-- /.navbar-static-side -->
</nav>
<div id="page-wrapper" style="background-color:whitesmoke;">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Edit Profile</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<form method="POST" enctype="multipart/form-data">
<fieldset>
<br />
<br />
<div class="col-lg-7">
<section class="panel">
<header class="panel-heading" style="background-color: dimgray;">
Edit profile Form
</header>
<div class="panel-body" style="background-color: floralwhite;">
<form role="form">
<table class="table table-hover">
<div class="form-group">
<label for="exampleInputText1">C_Id</label>
<input type="text" name="c_id" required="true" class="form-control" id="exampleInputText11" placeholder="Enter candidate id" oninvalid="setcustomvalidity(don't leave filed blank)" oninput="setcustomvalidity" />
</div>
First name<input type="text" name="firstname" required="true" class="form-control" id="exampleInputText11" placeholder="Enter First name" oninvalid="setcustomvalidity(don't leave filed blank)" oninput="setcustomvalidity"/> </td></tr>
Last name<input type="text" name="lastname" required="true" class="form-control" id="exampleInputText11" placeholder="Enter Last name" oninvalid="setcustomvalidity(don't leave filed blank)" oninput="setcustomvalidity"/> </td></tr>
Father's name<input type="text" name="fathername" required="true" class="form-control" id="exampleInputText11"placeholder="Enter Father's name" oninvalid="setcustomvalidity(don't leave filed blank)" oninput="setcustomvalidity"/> </td></tr>
Date of birth<input type="date" name="Dob"required="true" class="form-control" id="exampleInputText11" placeholder="mm/dd/yyyy"oninvalid="setcustomvalidity(don't leave filed blank)" oninput="setcustomvalidity"/></td></tr>
State<input type="text" name="state"required="true" class="form-control" id="exampleInputText11" placeholder="Enter state"oninvalid="setcustomvalidity(don't leave filed blank)" oninput="setcustomvalidity"/></td></tr>
City<input type="text" name="city"required="true" class="form-control" id="exampleInputText11" placeholder="Enter City"oninvalid="setcustomvalidity(don't leave filed blank)" oninput="setcustomvalidity"/></td></tr>
Party<input type="text" name="party"required="true" class="form-control" id="exampleInputText11" placeholder="Enter Party"/></td></tr>
Photo<input type="file" name="fil" /></td></tr>
Email<input type="email" name="email"required="true" class="form-control" id="exampleInputText11" placeholder="Enter Email id"oninvalid="setcustomvalidity(don't leave filed blank)" oninput="setcustomvalidity"/></td></tr>
Address<textarea name="address" rows="5" cols="15" required="true" class="form-control" id="exampleInputText11" placeholder="Enter Address"oninvalid="setcustomvalidity(don't leave filed blank)" oninput="setcustomvalidity"></textarea></td></tr>
Contact number<input type="text" name="contactno"required="true" class="form-control" id="exampleInputText11" placeholder="Enter mobile no."oninvalid="setcustomvalidity(don't leave filed blank)" oninput="setcustomvalidity"/></td></tr>
Username<input type="text" name="username"required="true" class="form-control" id="exampleInputText11" placeholder="Enter Username"oninvalid="setcustomvalidity(don't leave filed blank)" oninput="setcustomvalidity"/></td></tr>
Password<input type="password" name="password"required="true" class="form-control" id="exampleInputText11" placeholder="Enter Password"oninvalid="setcustomvalidity(don't leave filed blank)" oninput="setcustomvalidity"/></td></tr>
Election_reason<input type="text" name="election_reason"required="true" class="form-control" id="exampleInputText11" placeholder="Enter Reason for election"/></td></tr>
Voter id<input type="text" name="v_id" required="true" class="form-control" id="exampleInputText11" placeholder="Enter voter id no."oninvalid="setcustomvalidity(don't leave filed blank)" oninput="setcustomvalidity"/></td></tr>
</fieldset>
</table>
<center><button type="submit" name="sbt17" class="btn btn-info">Submit</button> </center>
</form>
<br />
</div>
</div>
</div>
</div>
<!-- /#wrapper -->
<!-- jQuery -->
<script src="../bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- Metis Menu Plugin JavaScript -->
<script src="../bower_components/metisMenu/dist/metisMenu.min.js"></script>
<!-- Morris Charts JavaScript -->
<script src="../bower_components/raphael/raphael-min.js"></script>
<script src="../bower_components/morrisjs/morris.min.js"></script>
<script src="../js/morris-data.js"></script>
<!-- Custom Theme JavaScript -->
<script src="../dist/js/sb-admin-2.js"></script>
</body>
<div>
<footer>©Designed By Vipul Singh</footer>
</div>
</html>
<?php
if(isset($_POST['sbt17']))
{
$c_id=$_POST['c_id'];
$firstname=$_POST['firstname'];
$lastname=$_POST['lastname'];
$fathername=$_POST['fathername'];
$Dob=$_POST['Dob'];
$state=$_POST['state'];
$city=$_POST['city'];
$party=$_POST['party'];
$fil=$_FILES['fil'];
$email=$_POST['email'];
$address=$_POST['address'];
$contactno=$_POST['contactno'];
$username=$_POST['username'];
$password=$_POST['password'];
$election_reason=$_POST['election_reason'];
$v_id=$_POST['v_id'];
$tname=$_FILES['fil']['tmp_name'];
$type=$_FILES['fil']['type'];
$size=$_FILES['fil']['size'];
$error=$_FILES['fil']['error'];
$ilink=fopen($tname,"r");
$tfile=fread($ilink,$size);
$img=addslashes($tfile);
$query="update candidate_reg values('$c_id','$firstname','$lastname','$fathername','$Dob','$state','$city','$party','$photo','$email','$address','$contactno','$username','$password','$election_reason','$v_id')";
mysqli_query($link,$query);
echo "<script>alert('Profile edited Successfully')</script>";
}