function add_lider($cedula, $nombre, $apellido, $telefono, $celular, $direccion, $email, $departamento, $municipio, $puesto, $dirPuesto, $mesa) { $daoPersona = new DAOPersona(); $daoLCandidatoL = new DAOListaCandidato_Lider(); $id = $daoPersona->agregar($cedula, $nombre, $apellido, $telefono, $celular, $direccion, $email); if (zonificar($id, $departamento, $municipio, $puesto, $dirPuesto, $mesa)) { return $daoLCandidatoL->agregarCandidato_Lider($_SESSION["user"], $id); } return FALSE; }
function add_lider($cedula, $nombre, $apellido, $telefono, $celular, $direccion, $email, $departamento, $municipio, $puesto, $dirPuesto, $mesa) { if ($departamento != "" && $municipio != "" && $puesto != "" && $dirPuesto != "" && $mesa != "" && $cedula != "" && $nombre != "" && $apellido != "") { $daoPersona = new DAOPersona(); $daoLCandidatoL = new DAOListaCandidato_Lider(); $daoLider = new DAOLider(); $oldId = $daoPersona->consultarId($cedula); if ($oldId != FALSE) { if ($daoLider->consultarIdLider($cedula, $_SESSION["user"]) != FALSE) { return "La persona que intenta agregar como lider, ya hace parte de sus lideres. Por lo tanto no se agregara."; } // echo '<script>alert("Una persona ya se encuentra registrada con ese numero de cedula, ¿Desea agregarla como lider?")</script>'; $id = $oldId; } else { $id = $daoPersona->agregar($cedula, $nombre, $apellido, $telefono, $celular, $direccion, $email); } if (zonificar($id, $departamento, $municipio, $puesto, $dirPuesto, $mesa)) { $daoLCandidatoL->agregarCandidato_Lider($_SESSION["user"], $id); return 0; } return "No se logró agregar a la persona, intente nuevamente"; } return "Digite todos los campos con obligatorios, marcados con (*)"; }
function barraEstadistica($user) { $daocandidado = new DAOCandidato(); $daoC_L = new DAOListaCandidato_Lider(); $lideres = $daoC_L->mostrarLideres($user); if (count($lideres) < 5) { for ($x = 0; $x < count($lideres); $x++) { $porcentaje = $lideres[$x][7] * 100 / $lideres[0][7]; echo '<div class="progress-group">' . '<span class="progress-text">' . $lideres[$x][1] . ' ' . $lideres[$x][2] . '</span> <span class="progress-number"><b>' . $lideres[$x][7] . '</b>/' . $daocandidado->TotalVotos($user) . '</span> <div class="progress sm"> <div class="' . $this->colorBarras($x) . '" style="width: ' . $porcentaje . '%"></div> </div> </div><!-- /.progress-group -->'; } } }