function load_tabla_voters($user) { if ($_SESSION['tipo'] == 1) { $daoCandidato = new DAOCandidato(); echo '<thead><tr> <th class="text-center"><strong>Acción</strong></th> <td class="text-center"><strong>Cédula de ciudadanía</strong></td> <td class="text-center"><strong>Nombre</strong></td> <td class="text-center"><strong>Apellidos</strong></td> <td class="text-center"><strong>Departamento</strong></td> <td class="text-center"><strong>Municipio</strong></td> <td class="text-center"><strong>Puesto</strong></td> <td class="text-center"><strong>Mesa</strong></td> </tr></thead>'; $lista = $daoCandidato->mostrarVotantes($user); for ($x = 0; $x < count($lista); $x++) { echo ' <tr> <td><label onclick="alerta();"><span class="glyphicon glyphicon-eye-open"></span></label></td> <td>' . $lista[$x][0] . '</td> <td>' . $lista[$x][1] . '</td> <td>' . $lista[$x][2] . '</td> <td>' . $lista[$x][3] . '</td> <td>' . $lista[$x][4] . '</td> <td>' . $lista[$x][5] . '</td> <td>' . $lista[$x][6] . '</td> </tr>'; } echo '</tbody>'; } if ($_SESSION['tipo'] == 2) { $daoL_V = new DAOListaLider_Votante(); echo '<thead><tr> <th class="text-center"><strong></strong></th> <th class="text-center"><strong>Acción</strong></th> <td class="text-center"><strong>Cédula de ciudadanía</strong></td> <td class="text-center"><strong>Nombre</strong></td> <td class="text-center"><strong>Apellidos</strong></td> <td class="text-center"><strong>Departamento</strong></td> <td class="text-center"><strong>Municipio</strong></td> <td class="text-center"><strong>Puesto</strong></td> <td class="text-center"><strong>Mesa</strong></td> </tr></thead>'; $lista = $daoL_V->mostrarVotantesLider($user); for ($x = 0; $x < count($lista); $x++) { echo ' <tr> <td><div class="checkbox" style="margin: 0px;"> <label> <input type="checkbox" name="del" data-col="' . $lista[$x][0] . '"> </label> </div> </td> <td><label onclick="alerta();"><span class="glyphicon glyphicon-eye-open"></span></label></td> <td>' . $lista[$x][0] . '</td> <td>' . $lista[$x][1] . '</td> <td>' . $lista[$x][2] . '</td> <td>' . $lista[$x][3] . '</td> <td>' . $lista[$x][4] . '</td> <td>' . $lista[$x][5] . '</td> <td>' . $lista[$x][6] . '</td> </tr>'; } echo '</tbody>'; } }
function conteo_Candidato_Mesa($puesto, $id_candidato) { $DAOCandidato = new DAOCandidato(); $lista = $DAOCandidato->mostrarVotantes($id_candidato); $p = 0; for ($x = 0; $x < count($lista); $x++) { $consulta = "SELECT puesto_votacion.mesa FROM `zonificacion`, `puesto_votacion`, `persona` WHERE zonificacion.id_votante=persona.id AND zonificacion.id_puesto=puesto_votacion.id_puesto_votacion AND persona.cedula='" . $lista[$x][0] . "' AND puesto_votacion.puesto = '" . $puesto . "'"; $resultado = $this->conexion->consultar_servidor($consulta); if (!empty($resultado)) { $listaaux = mysql_fetch_array($resultado); $lista2[$p][0] = $listaaux[0]; $p = $p + 1; } } $p = 0; for ($x = 0; $x < count($lista2); $x++) { if ($lista2[$x][0] != "") { $lista4[$p][0] = $lista2[$x][0]; $p = $p + 1; } } $lista2 = $lista4; if (empty($lista2)) { $lista2[0][0] = "no"; $lista2[0][1] = "no"; return $lista2; } $p = 0; for ($x = 0; $x < count($lista2); $x++) { $aux = 1; for ($j = $x + 1; $j < count($lista2); $j++) { if ($lista2[$j][0] == $lista2[$x][0]) { $aux = 0; } } if ($aux != 0) { $lista3[$p][0] = $lista2[$x][0]; $p++; } } for ($x = 0; $x < count($lista3); $x++) { $aux = 0; for ($j = 0; $j < count($lista2); $j++) { if ($lista3[$x][0] == $lista2[$j][0]) { $aux = $aux + 1; $lista3[$x][1] = $aux; } } } for ($x = 0; $x < count($lista3); $x++) { for ($j = $x + 1; $j < count($lista3); $j++) { if ($lista3[$x][1] > $lista3[$j][1]) { $aux = $lista3[$x][1]; $lista3[$x][1] = $lista3[$j][1]; $lista3[$j][1] = $aux; $aux = $lista3[$x][0]; $lista3[$x][0] = $lista3[$j][0]; $lista3[$j][0] = $aux; } } } $this->conexion->cerrar_conexion(); return $lista3; }