-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
116 lines (98 loc) · 5.31 KB
/
index.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
<!DOCTYPE html>
<?php
include './validarRut.php';
include './conexion.php';
?>
<html>
<head>
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Sistema de Votacion</title>
<!<!-- Bootstrap version online -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<!<!-- Bootstrap version offline -->
<link rel="stylesheet" href="/css/bootstrap.min.css" type="text/css"/>
</head>
<body>
<div class="form-group">
<h1>FORMULARIO DE VOTACIÓN</h1>
<form class="form-horizontal" action="vista-datos.php" method="POST" >
<?php
$medios = array();
if(isset($_POST['medios'])) {
$medios = $_POST['medios'];
} else {
$medios = [];
}
if($medios == "" || count($medios) < 2) {
array_push("Selecciona al menos 2 opciones");
}
?>
<div class="form-group">
<p>
<label class="col-lg-4 control-label" for="nombre">Nombre y Apellido <span></span></label>
<div class="col-lg-4">
<input type="text" class="form-control" name="txtNombre" required />
</div>
</p>
</div>
<div class="form-group">
<label class="col-lg-4 control-label" for="alias">Alias <span></span></label>
<div class="col-lg-4">
<input type="text" class="form-control" name="txtAlias" />
</div>
</div>
<div class="form-group">
<label class="col-lg-4 control-label" for="rut">Rut <span></span></label>
<div class="col-lg-4">
<input type="text" class="form-control" name="txtRut" />
</div>
</div>
<div class="form-group">
<label class="col-lg-4 control-label" for="email">Email <span></span></label>
<div class="col-lg-4">
<input type="text" class="form-control" name="txtEmail" />
</div>
</div>
<div class="form-group">
<label class="col-lg-4 control-label" for="region">Región <span></span></label>
<div class="col-lg-4">
<select class="form-control" id="regiones" name="cmbRegion"></select>
</div>
</div>
<div class="form-group">
<label class="col-lg-4 control-label" for="comuna">Comuna <span></span></label>
<div class="col-lg-4">
<select class="form-control" id="comunas" name="cmbComuna"></select>
</div>
</div>
<div class="form-group">
<label class="col-lg-4 control-label" for="candidato">Candidato <span></span></label>
<div class="col-lg-4">
<select class="form-control" name="cmbCandidato"></select>
</div>
</div>
<div class="form-group">
<label class="col-lg-4 control-label" for="entero">Como se entero de nosotros <span></span></label>
<div class="col-lg-4">
<input type="checkbox" name="medios[]" value="web" <?php if(in_array("web", $medios)) echo "check"?>/> Web
<input type="checkbox" name="medios[]" value="tv"/> TV
<input type="checkbox" name="medios[]" value="rrss"/> Redes Sociales
<input type="checkbox" name="medios[]" value="amigo"/> Amigo
</div>
</div>
<div class="form-group">
<div class="col-lg-4">
<input class="btn btn-primary" type="submit" />
</div>
</div>
</form>
</div>
<!<!-- Scripts online -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns" crossorigin="anonymous"></script>
<!<!-- Scripts offline -->
<script src="js/jquery-3.5.1.slim.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/validaciones/regionesYComunas.js"></script>
</body>
</html>