-
Notifications
You must be signed in to change notification settings - Fork 7
/
Ciudadanos.php
500 lines (408 loc) · 30.1 KB
/
Ciudadanos.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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
<?php
include 'Auth.php';
include 'LQS_EUQ/CiudadanosDB.php';
if (!empty($_POST['Registrar'])) {
$FDPI = $_POST['form-DPI'];
$FNameF = $_POST['form-nombre'];
$FNameL = $_POST['form-apellido'];
$Genero = $_POST['form-genero'];
$Direccion = $_POST['form-direccion'];
$Departamento = $_POST['form-departamento'];
$Municipio = $_POST['form-municipio'];
$FPassword = $_POST['form-password'];
$FPasswordR = $_POST['form-password2'];
$Estado = $_POST['form-roll'];
//echo $FNameF."<br>".$FNameL."<br>".$FUserName."<br>".$FEmail."<br>".$FEmailR."<br>".$FPassword."<br>".$FPasswordR ;
if ($FPassword==$FPasswordR) {
$conn = new mysqli($servername,$username,$password,$dbname);
if ($conn->connect_error){
die("Error en la conexion: ".$conn->connect_error);
}
$FPasswordR =md5($FPasswordR);
$sql ="INSERT INTO `sistema1`.`ciudadanos` (`DPI`, `Nombre`, `Apellido`, `Genero`, `Direccion`, `IdDepartamento`, `IdMunicipio`, `Estado`, `Contraseña`) VALUES ('".$FDPI."','".$FNameF."','".$FNameL."','".$Genero."','".$Direccion."','".$Departamento."','".$Municipio."','".$Estado."','".$FPasswordR."')";
if ($conn->query($sql) === TRUE) {
$mensajeExito = '<div class="alert alert-success" role="alert">El registro fue agregado correctamente</div>';
}
else{
echo "Error: " .$sql."<br>".$conn->error;
$error = '<div class="alert alert-danger" role="alert"><p><strong>No se guardaron los datos </div>';
}
}
else{
$error = '<div class="alert alert-danger" role="alert"><p><strong>Las contraseñas no son iguales </div>';
}
}
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Admin SVG</title>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<link href="css/font-awesome.css" rel="stylesheet" type="text/css" />
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="css/animate.css" rel="stylesheet" type="text/css" />
<link href="css/admin.css" rel="stylesheet" type="text/css" />
<link href="css/jquerysctipttop.css" rel="stylesheet" type="text/css">
<link href="plugins/kalendar/kalendar.css" rel="stylesheet">
<link rel="stylesheet" href="plugins/scroll/nanoscroller.css">
<link href="plugins/morris/morris.css" rel="stylesheet" />
<link rel="stylesheet" href="css/custom2.css">
<link rel="stylesheet" href="css/EstiloTablas.css">
</head>
<body class="dark_theme fixed_header left_nav_fixed">
<div class="wrapper">
<!--\\\\\\\ wrapper Start \\\\\\-->
<div class="header_bar">
<!--\\\\\\\ header Start \\\\\\-->
<div class="brand">
<!--\\\\\\\ brand Start \\\\\\-->
<div class="logo" style="display:block"><span class="theme_color">TSE</span> Board</div>
</div>
<!--\\\\\\\ brand end \\\\\\-->
<div class="header_top_bar ">
<!--\\\\\\\ header top bar start \\\\\\-->
<a href="javascript:void(0);" class="menutoggle"> <i class="fa fa-bars"></i> </a>
<div class="top_left">
<div class="top_left_menu">
<ul>
<li> <a href="javascript:void(0);"><i class="fa fa-repeat"></i></a> </li>
<li class="dropdown">
<a data-toggle="dropdown" href="javascript:void(0);"> <i class="fa fa-th-large"></i> </a>
<ul class="drop_down_task dropdown-menu" style="margin-top:50px">
<div class="top_left_pointer"></div>
<li>
<div class="checkbox">
<label>
<input type="checkbox" name="remember">
Recordarme </label>
</div>
</li>
<li> <a href="help.html"><i class="fa fa-question-circle"></i> Ayuda</a> </li>
<li> <a href="settings.html"><i class="fa fa-cog"></i> Configuración </a></li>
<li> <a href="login.php"><i class="fa fa-power-off"></i> LogOut</a> </li>
</ul>
</li>
</ul>
</div>
</div>
<div class="top_right_bar">
<div class="top_right">
<div class="top_right_menu">
</div>
</div>
<div class="user_admin dropdown">
<ul class="dropdown-menu">
<div class="top_pointer"></div>
<li> <a href="profile.html"><i class="fa fa-user"></i> Perfil</a> </li>
<li> <a href="help.html"><i class="fa fa-question-circle"></i> Ayuda</a> </li>
<li> <a href="settings.html"><i class="fa fa-cog"></i> Configuracion </a></li>
<li> <a href="login.php"><i class="fa fa-power-off"></i> Logout</a> </li>
</ul>
</div>
</div>
</div>
<!--\\\\\\\ header top bar end \\\\\\-->
</div>
<!--\\\\\\\ header end \\\\\\-->
<div class="inner">
<!--\\\\\\\ inner start \\\\\\-->
<div class="left_nav">
<!--\\\\\\\left_nav start \\\\\\-->
<div class="search_bar"> <i class="fa fa-search"></i>
<input name="" type="text" class="search" placeholder="Buscar..." />
</div>
<div class="left_nav_slidebar">
<ul>
<li class="left_nav_active theme_border"><a href="javascript:void(0);"><i class="fa fa-home"></i> DASHBOARD <span class="left_nav_pointer"></span> <span class="plus"><i class="fa fa-plus"></i></span> </a>
<ul class="opened" style="display:block">
<li>
<a href="DashboardAdministrador.php"> <span> </span> <i class="fa fa-circle "></i> <b>Dashboard</b> </a>
</li>
<li>
<a href="Elecciones.php"> <span> </span> <i class="fa fa-circle"></i> <b>Elecciones</b> </a>
</li>
<li>
<a href="Partidos.php"> <span> </span> <i class="fa fa-circle "></i> <b>Partidos</b> </a>
</li>
<li>
<a href="Candidatos.php"> <span> </span> <i class="fa fa-circle"></i> <b>Candidatos</b> </a>
</li>
<li>
<a href="Resultados.php"> <span> </span> <i class="fa fa-circle"></i> <b>Resultados</b> </a>
</li>
<li>
<a href="Ciudadanos.php"> <span> </span> <i class="fa fa-circle theme_color"></i> <b class="theme_color">Ciudadanos</b> </a>
</li>
<li>
<a href="votacionesAdmin.php"> <span> </span> <i class="fa fa-circle"></i> <b>Emitir Votos</b> </a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!--\\\\\\\left_nav end \\\\\\-->
<div class="contentpanel">
<!--\\\\\\\ contentpanel start\\\\\\-->
<!-- Inicia la barra de Tutulo en right -->
<div class="pull-left breadcrumb_admin clear_both">
<div class="pull-left page_title theme_color">
<h1>Administracion de Ciudadanos</h1>
<h2 class="">Registro y control de ciudadanos...</h2>
</div>
<div class="pull-right">
<ol class="breadcrumb">
<li><a href="http://www.google.com">TSE</a></li>
<li><a href="http://www.google.com">AplicacionesWeb</a></li>
<li class="active">Sistema de Votaciones</li>
</ol>
</div>
</div>
<!-- Finaliza Barra de Titulo en right -->
<div class="container clear_both padding_fix">
<!-- Inicia La seccion de usuarios -->
<div class="row">
<div id="listausuarios" class="col-md-8" >
<div class="myform-all Color_Claro" >
<!-- Inicia Tabla de Usuarios; -->
<br></br>
<h1 class="Titulos">Ciudadanos Registrados</h1>
<table>
<tr>
<th>Numero</th>
<th>DPI</th>
<th>Nombre</th>
<th>Apellido</th>
<th>Genero</th>
<th>Direccion</th>
<th>Roll</th>
<th>Modificar</th>
<th>Eliminar</th>
<?php
for($i=0; $i<$lista_usuario; $i++){
echo "<tr>";
echo "<td>";
echo $lista_usuario['Numero_Interno'];
echo "</td>";
echo "<td>";
echo $lista_usuario['DPI'];
echo "</td>";
echo "<td>";
echo $lista_usuario['Nombre'];
echo "</td>";
echo "<td>";
echo $lista_usuario['Apellido'];
echo "</td>";
echo "<td>";
echo $lista_usuario['Genero'];
echo "</td>";
echo "<td>";
echo $lista_usuario['Direccion'];
echo "</td>";
echo "<td>";
if($lista_usuario['Estado'] == '0'){
echo 'Administrador';
}else if($lista_usuario['Estado'] == '1'){
echo 'Ciudadano';
} else if($lista_usuario['Estado'] == '2'){
echo 'Supervisor';
}
echo "</td>";
//Prueba de Botones
echo "<td>";
echo '<a href="'.$lista_usuario['Numero_Interno'].'" class="fa fa-edit btn btn-success data-togle="modal" data-target="#myModal"></a>';
echo "</td>";
echo "<td>";
echo '<a href="'.$lista_usuario['Numero_Interno'].'" class="fa fa-trash-o btn btn-danger data-togle="modal" data-target="#myModal"></a>';
echo "</td>";
echo "</tr>";
$lista_usuario =$ejecutar_sentencia->fetch_array();
}
?>
</tr>
</table>
<!-- Finaliza Tabla de Usuarios; -->
</div>
</div>
<div class="coontainer">
<!--Inicia Formulario Login-->
<div class="col-md-4 my-content formulario formulario ">
<div> <?php echo $error . $mensajeExito; ?> </div>
<div class="myform-top">
<div class="myform-top-left">
<h3 class="whitecolor">Registro de Ciudadanos</h3>
<p class="whitecolor">Digita tus datos:</p>
</div>
<div class="myform-top-rigth">
<i class="fa fa-user whitecolor"> </i>
</div>
</div>
<div class="myform-botton">
<form role="form" action="" method="post" class="">
<div class="form-grup">
<input type="text" name="form-DPI" placeholder="DPI..." class=" form-control" id="form-DPI" minlength="4" onkeyup="mascara(this,'-',patron3,true)">
</div>
<div class="saltito"><h1></h1></div>
<div class="form-grup">
<input type="text" name="form-nombre" placeholder="Nombre..." class="form-control" id="form-nombre">
</div>
<div class="saltito"><h1></h1></div>
<div class="form-grup">
<input type="text" name="form-apellido" placeholder="Apellido..." class="form-control" id="form-apellido">
</div>
<div class="saltito"><h1></h1></div>
<div >
<select class="funy form-control ng-pristine ng-valid ng-valid-required ng-touched" name="form-genero" id="form-genero" ng-model="properties.value" ng-options="ctrl.getValue(option) as (ctrl.getLabel(option) | uiTranslate) for option in properties.availableValues" ng-required="properties.required" ng-disabled="properties.disabled">
<option style="display:none; height:50px;" value="" class="ng-binding">
Genero...
</option>
<option value="Hombre" label="Hombre">Hombre</option>
<option value="Mujer" label="Mujer">Mujer</option>
</select>
</div>
<div class="saltito"><h1></h1></div>
<div >
<select class="funy form-control ng-pristine ng-valid ng-valid-required ng-touched" name="form-roll" id="form-roll" ng-model="properties.value" ng-options="ctrl.getValue(option) as (ctrl.getLabel(option) | uiTranslate) for option in properties.availableValues" ng-required="properties.required" ng-disabled="properties.disabled">
<option style="display:none; height:50px;" value="" class="ng-binding">
Roll...
</option>
<option value="0" label="Administrador">Administrador</option>
<option value="1" label="Ciudadano">Ciudadano</option>
<option value="2" label="Dashboard">Dashboard</option>
</select>
</div>
<div class="saltito"><h1></h1></div>
<div class="form-grup">
<input type="text" name="form-direccion" placeholder="Dirección..." class="form-control" id="form-direccion">
</div>
<!-- Departamento -->
<div class="saltito"><h1></h1></div>
<div >
<select class="funy form-control ng-pristine ng-valid ng-valid-required ng-touched" name="form-departamento" id="form-departamento" ng-model="properties.value" ng-options="ctrl.getValue(option) as (ctrl.getLabel(option) | uiTranslate) for option in properties.availableValues" ng-required="properties.required" ng-disabled="properties.disabled">
<option style="display:none; height:50px;" value="" class="ng-binding">
Departamento...
</option>
<?php
$conn = new mysqli($servername,$username,$password,$dbname);
$departamentos = "SELECT * FROM sistema1.departamentos;";
$result = $conn->query($departamentos);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
echo '<option value="'.$row['codigo'].'">'.utf8_encode($row['nombre']).'</option>';
$CodMunicipio = ['form-departamento'];
}
}
?>
</select>
</div>
<!-- Municipio -->
<div class="saltito"><h1></h1></div>
<div >
<select class="funy form-control ng-pristine ng-valid ng-valid-required ng-touched" name="form-municipio" id="form-mubicipio" ng-model="properties.value" ng-options="ctrl.getValue(option) as (ctrl.getLabel(option) | uiTranslate) for option in properties.availableValues" ng-required="properties.required" ng-disabled="properties.disabled">
<option style="display:none; height:50px;" value="" class="ng-binding">
Municipio...
</option>
<?php
$CodMunicipio = ['form-departamento'];
$conn = new mysqli($servername,$username,$password,$dbname);
$municipios = "SELECT * FROM sistema1.municipio order by nombre;"; //where codigo_depto = ".$CodMunicipio
$result = $conn->query($municipios);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
echo '<option value="'.$row['codigo'].'">'.utf8_encode($row['nombre']).'</option>';
}
}
?>
</select>
</div>
<div class="saltito"><h1></h1></div>
<div class="form-group">
<input type="password" name="form-password" placeholder="Contaseña..." class="form-control" id="form-password">
</div>
<div class="saltito"><h1></h1></div>
<div class="form-group">
<input type="password" name="form-password2" placeholder="Confirme Contaseña..." class="form-control" id="form-password2">
</div>
<div data-effect="flip" class="effect-button"><input type="submit" name="Registrar" value="Registrar" class="effect-button"></input></div>
<!-- <input type="submit" name="submit" class="mybtn" value="Registrar"></input> -->
</form>
</div>
</div>
</div>
<!--Finaliza Formulario LogIn-->
</div>
</div>
<!-- Finaliza la seccion de Usuarios -->
<!-- Fin del Contenido -->
<div class="demo"><span id="demo-setting"><i class="fa fa-cog txt-color-blueDark"></i></span>
<form>
<legend class="no-padding margin-bottom-10" style="color:#6e778c;">Layout Options</legend>
<section><label><input type="checkbox" class="checkbox style-0" id="smart-fixed-header" name="subscription"><span>Fixed Header</span></label><label><input type="checkbox" class="checkbox style-0" id="smart-fixed-navigation" name="terms"><span>Fixed Navigation</span></label><label><input type="checkbox" class="checkbox style-0" id="smart-rigth-navigation" name="terms"><span>Right Navigation</span></label><label><input type="checkbox" class="checkbox style-0" id="smart-boxed-layout" name="terms"><span>Boxed Layout</span></label>
<span id="smart-bgimages" style="display: none;"></span>
</section>
<section>
<h6 class="margin-top-10 semi-bold margin-bottom-5">Clear Localstorage</h6><a id="reset-smart-widget" class="btn btn-xs btn-block btn-primary" href="javascript:void(0);"><i class="fa fa-refresh"></i> Factory Reset</a></section>
<h6 class="margin-top-10 semi-bold margin-bottom-5">Ultimo Skins</h6>
<section id="smart-styles"><a style="background-color:#23262F;" class="btn btn-block btn-xs txt-color-white margin-right-5" id="dark_theme" href="javascript:void(0);"><i id="skin-checked" class="fa fa-check fa-fw"></i> Dark Theme</a><a style="background:#E35154;" class="btn btn-block btn-xs txt-color-white"
id="red_thm" href="javascript:void(0);">Red Theme</a><a style="background:#34B077;" class="btn btn-xs btn-block txt-color-darken margin-top-5" id="green_thm" href="javascript:void(0);">Green Theme</a><a style="background:#56A5DB" class="btn btn-xs btn-block txt-color-white margin-top-5"
data-skinlogo="img/logo-pale.png" id="blue_thm" href="javascript:void(0);">Blue Theme</a><a style="background:#9C6BAD" class="btn btn-xs btn-block txt-color-white margin-top-5" id="magento_thm" href="javascript:void(0);">Magento Theme</a>
<a style="background:#FFFFFF" class="btn btn-xs btn-block txt-color-black margin-top-5" id="light_theme" href="javascript:void(0);">Light Theme</a>
</section>
</form>
</div>
<script src="js/jquery-2.1.0.js"></script>
<script src="js/Usuarios.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/common-script.js"></script>
<script src="js/jquery.slimscroll.min.js"></script>
<script src="js/jquery.sparkline.js"></script>
<script src="js/sparkline-chart.js"></script>
<script src="js/graph.js"></script>
<script src="js/edit-graph.js"></script>
<script src="plugins/kalendar/kalendar.js" type="text/javascript"></script>
<script src="plugins/kalendar/edit-kalendar.js" type="text/javascript"></script>
<script src="plugins/sparkline/jquery.sparkline.js" type="text/javascript"></script>
<script src="plugins/sparkline/jquery.customSelect.min.js"></script>
<script src="plugins/sparkline/sparkline-chart.js"></script>
<script src="plugins/sparkline/easy-pie-chart.js"></script>
<script src="plugins/morris/morris.min.js" type="text/javascript"></script>
<script src="plugins/morris/raphael-min.js" type="text/javascript"></script>
<script src="plugins/morris/morris-script.js"></script>
<script src="plugins/demo-slider/demo-slider.js"></script>
<script src="plugins/knob/jquery.knob.min.js"></script>
<script src="js/jPushMenu.js"></script>
<script src="js/side-chats.js"></script>
<script src="js/jquery.slimscroll.min.js"></script>
<script src="plugins/scroll/jquery.nanoscroller.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonimus"></script>
<script src="https://cdnj.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUHKKDx6Qin1DkWx51bBrb" crossorigin="anonimus"></script>
<script src="js/bootstrap.min.js" ></script>
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonimus"></script>
<script src="https://cdnj.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUHKKDx6Qin1DkWx51bBrb" crossorigin="anonimus"></script>
<script src="js/bootstrap.min.js" ></script>
<script src="js/jquery-2.1.0.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/common-script.js"></script>
<script src="js/jquery.slimscroll.min.js"></script>
<script src="js/script.min.js"></script>
<script src="js/animated.js" type="text/javascript"></script>
<!-- <script>
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-48105801-1', 'creativico.com');
ga('send', 'pageview');
</script> -->
<script src="js/jPushMenu.js"></script>
<script src="js/side-chats.js"></script>
</body>
</html>