Example #1
0
 /**
  * Lista de comunicados enviados (SENT)
  */
 function listEnviados()
 {
     global $uid;
     $db = new DB();
     $sql = "SELECT consecu, fecha, asunto, tipmens, fecvence, categoria, documto_id, borrado ";
     $sql .= "FROM mensajes WHERE documto_id = '{$uid}' AND borrado = '0' ORDER BY consecu DESC ";
     if (isset($_GET['starting'])) {
         $starting = $_GET['starting'];
     } else {
         $starting = 0;
     }
     $objpag = new Pagination($sql, $starting, 20, 'index2.php?com=comunicados&do=list');
     $res = $objpag->result;
     $data = array();
     $x = 0;
     while ($line = $objpag->fetchNextObject($res)) {
         $data[$x]['consecu'] = $line->consecu;
         $data[$x]['fecha'] = $line->fecha;
         $data[$x]['asunto'] = $line->asunto;
         $data[$x]['tipmens'] = $line->tipmens;
         $data[$x]['fecvence'] = $line->fecvence;
         $data[$x]['categoria'] = $line->categoria;
         $x++;
     }
     $anchors = $objpag->anchors;
     $total = $objpag->total;
     $tpl = new Erudio_Smarty();
     $tpl->assign('com', $data);
     $tpl->assign('anchors', $anchors);
     $tpl->assign('total', $total);
     $tpl->display('comunicados/comunicadosEnviados.tpl');
 }
Example #2
0
 function listEncuestas()
 {
     global $uid, $uperms;
     $where = "";
     if (!$uperms['encuestas_w']) {
         $where = "WHERE publicado = 's'";
     }
     $db = new DB();
     $sql = "SELECT  * FROM encuestas {$where}";
     if (isset($_GET['starting'])) {
         $starting = $_GET['starting'];
     } else {
         $starting = 0;
     }
     $objpag = new Pagination($sql, $starting, 20, 'index2.php?com=encuestas&do=list');
     $res = $objpag->result;
     $data = array();
     $x = 0;
     while ($line = $objpag->fetchNextObject($res)) {
         $data[$x]['id'] = $line->id;
         $data[$x]['titulo'] = $line->titulo;
         $data[$x]['observaciones'] = $line->observaciones;
         $data[$x]['fecha'] = $line->fecha;
         $x++;
     }
     $anchors = $objpag->anchors;
     $total = $objpag->total;
     $tpl = new Elfic_Smarty();
     $tpl->assign('lista', $data);
     $tpl->assign('anchors', $anchors);
     $tpl->assign('total', $total);
     $tpl->display('encuestas/encuestasList.tpl');
 }
Example #3
0
 /**
  * @desc Construye listado de usuarios e imprime template
  * @param $search
  * @return void (imprime plantilla)
  */
 function listAll($search = "", $grupo = "")
 {
     $where = "";
     if ($search != "") {
         $where .= "AND nombres LIKE '%{$search}%' OR apellidos LIKE '%{$search}%' ";
     }
     if ($grupo != "") {
         $where .= "AND id IN (SELECT usuario_id " . "FROM usuarios_grupos_links WHERE usuarios_grupo_id = {$grupo}) ";
     }
     $db = new DB();
     $sql = "SELECT * FROM usuarios ";
     $sql .= "WHERE id > 0 " . $where;
     $sql .= " ORDER BY nombres ASC";
     if (isset($_GET['starting'])) {
         $starting = $_GET['starting'];
     } else {
         $starting = 0;
     }
     $objpag = new Pagination($sql, $starting, 20, 'index2.php?com=usuarios&do=search');
     $res = $objpag->result;
     $data = array();
     $i = 0;
     while ($line = $objpag->fetchNextObject($res)) {
         $data[$i]['id'] = $line->id;
         $data[$i]['nombres'] = $line->nombres;
         $data[$i]['apellidos'] = $line->apellidos;
         $data[$i]['email'] = $line->email;
         $data[$i]['creado'] = $line->creado;
         $data[$i]['modificado'] = $line->modificado;
         $data[$i]['ultimoingreso'] = $line->ultimoingreso;
         $data[$i]['activo'] = $this->getIcon($line->activo);
         $data[$i]['esadmin'] = $this->getIcon($line->esadmin);
         $i++;
     }
     $anchors = $objpag->anchors;
     $total = $objpag->total;
     $tpl = new Elfic_Smarty();
     $g = new Grupos();
     $tpl->assign('grupos', $g->getGruposArray());
     $tpl->assign('grupo_id', $grupo);
     $tpl->assign('u', $data);
     $tpl->assign('anchors', $anchors);
     $tpl->assign('total', $total);
     $tpl->display('usuarios/usuariosList.tpl');
 }
 function _buildReport($mid = "", $full = 0)
 {
     if ($mid != "") {
         $and = "AND u.municipio_id = {$mid} ";
     }
     $sql = "SELECT u.id, u.name, u.username, u.email, u.usertype, u.block, u.sendEmail, ";
     $sql .= "u.gid, u.registerDate, u.lastvisitDate, u.cedula, u.perfil, u.pais, ";
     $sql .= "u.departamento, u.id_municipio, vereda, u.direccion, u.info_dir, ";
     $sql .= "u.telefono, u.celular, u.fax, u.visito, u.aprobo, m.municipio, d.departamento ";
     $sql .= "FROM mmb_users u ";
     $sql .= "INNER JOIN municipio m ON m.id_municipio = u.id_municipio ";
     $sql .= "INNER JOIN departamento d ON d.id_departamento = u.departamento ";
     $sql .= "WHERE u.perfil IN(2,4,6,7) " . $and;
     $sql .= " ORDER BY u.registerDate DESC";
     if (isset($_GET['starting'])) {
         $starting = $_GET['starting'];
     } else {
         $starting = 0;
     }
     $objpag = new Pagination($sql, $starting, 100, 'index2.php?com=reportes&do=usuarios');
     $res = $objpag->result;
     if ($full == 1) {
         $db = new DB();
         $res = $db->query($sql);
     }
     $d = array();
     $x = 0;
     $line = "";
     while ($line = $objpag->fetchNextObject($res)) {
         $d[$x]['id'] = $line->id;
         $d[$x]['name'] = $line->name;
         $d[$x]['username'] = $line->username;
         $d[$x]['perfil'] = Usuarios::getNombrePerfil($line->perfil);
         $d[$x]['municipio'] = $line->municipio;
         $d[$x]['departamento'] = $line->departamento;
         $d[$x]['productos'] = $this->getProductos($line->id);
         $d[$x]['registerDate'] = $line->registerDate;
         $x++;
     }
     $this->anchors = $objpag->anchors;
     $this->total = $objpag->total;
     return $d;
 }
Example #5
0
 function listAsistenciaFuncionarios($funcionario = "")
 {
     global $uid, $uperms;
     $and = "";
     if (!$uperms['asistencia_w']) {
         $and = "AND usuario_id = {$uid} ";
     }
     if ($funcionario != '') {
         $and .= "AND a.usuario_id = {$funcionario} ";
     }
     $db = new DB();
     $sql = "SELECT  a.id, a.usuario_id, a.entrada, a.salida, a.comentarios, " . "CONCAT(u.nombres, ' ', u.apellidos) AS funcionario " . "FROM " . TBL_ASISTENCIA . " a INNER JOIN " . TBL_USUARIOS . " u ON u.id = a.usuario_id " . "WHERE a.id > 0 {$and} AND a.id NOT IN (SELECT asistencias_id FROM asistencias_tutores " . "WHERE asistencias_id = a.id)";
     if (isset($_GET['starting'])) {
         $starting = $_GET['starting'];
     } else {
         $starting = 0;
     }
     $objpag = new Pagination($sql, $starting, 20, 'index2.php?com=asistencia&do=list_fun');
     $res = $objpag->result;
     $data = array();
     $x = 0;
     while ($line = $objpag->fetchNextObject($res)) {
         $data[$x]['id'] = $line->id;
         $data[$x]['usuario_id'] = $line->usuario_id;
         $data[$x]['funcionario'] = $line->funcionario;
         $data[$x]['entrada'] = $line->entrada;
         $data[$x]['salida'] = $line->salida;
         $data[$x]['comentarios'] = $line->comentarios;
         $x++;
     }
     $anchors = $objpag->anchors;
     $total = $objpag->total;
     $tpl = new Elfic_Smarty();
     $tpl->assign('funcionarios', Grupos::getUsuariosGrupo(3));
     $tpl->assign('sel_func', $funcionario);
     $tpl->assign('lista', $data);
     $tpl->assign('anchors', $anchors);
     $tpl->assign('total', $total);
     $tpl->display('asistencia/asistenciaFuncionariosList.tpl');
 }
Example #6
0
 public function listar($curso = "", $tutor = "")
 {
     global $uid, $uperms, $starting;
     $and = "";
     if (!$uperms['evaluacion_w']) {
         $and .= "AND e.estudiante_id = '{$uid}'";
     }
     if ($curso != "") {
         $and .= "AND ct.nombre LIKE  '%{$curso}%' ";
     }
     if ($tutor != "") {
         $and .= "AND t.nombres LIKE  '%{$tutor}%' OR t.apellidos LIKE '%{$tutor}%' ";
     }
     $db = new DB();
     $sql = "SELECT e.id, e.estudiante_id, e.tutor_id, e.curso_id, e.concepto_tutor, " . "CONCAT(u.nombres, ' ', u.apellidos) AS estudiante, ct.nombre, ct.nombre AS catedra, " . "CONCAT(t.nombres, ' ', t.apellidos) AS tutor " . "FROM  eval_tutores_estu e " . "INNER JOIN usuarios u ON e.estudiante_id = u.id " . "INNER JOIN usuarios t ON e.tutor_id = t.id " . "INNER JOIN cursos c ON e.curso_id = c.id " . "INNER JOIN catedra ct ON c.catedra_id = ct.id " . $and . " ORDER BY e.id DESC";
     $objpag = new Pagination($sql, $starting, 20, 'index2.php?com=evaluacion');
     $res = $objpag->result;
     $data = array();
     $x = 0;
     while ($line = $objpag->fetchNextObject($res)) {
         $data[$x]['id'] = $line->id;
         $data[$x]['estudiante_id'] = $line->estudiante_id;
         $data[$x]['estudiante'] = $line->estudiante;
         $data[$x]['curso_id'] = $line->curso_id;
         $data[$x]['curso'] = $line->catedra;
         $data[$x]['tutor_id'] = $line->tutor_id;
         $data[$x]['tutor'] = Utils::getNombreUsuario($line->tutor_id);
         $data[$x]['concepto'] = $line->concepto_tutor;
         $x++;
     }
     $anchors = $objpag->anchors;
     $total = $objpag->total;
     $tpl = new Elfic_Smarty();
     $tpl->assign('data', $data);
     $tpl->assign('anchors', $anchors);
     $tpl->assign('total', $total);
     $tpl->display('evaluacion' . DS . 'evaluacionList.tpl');
 }
Example #7
0
 public function listAll($curso = "")
 {
     global $uid, $uperms;
     $and = "";
     if (!$uperms['cursos_w']) {
         $and .= "AND c.tutor_id = '{$uid}' ";
     }
     if ($curso != "") {
         $and .= "AND ct.nombre LIKE '%{$curso}%' ";
     }
     $db = new DB();
     $sql = "SELECT c.id, c.grupo, c.dia, c.hora, c.estado, ct.nombre, c.tutor_id, " . "CONCAT(p.anio,'-',p.semestre) AS periodo, " . "pr.programa, CONCAT(u.nombres, ' ', u.apellidos) AS tutor FROM cursos c " . "INNER JOIN catedra ct ON c.catedra_id = ct.id " . "INNER JOIN periodos p ON c.periodo_id = p.id " . "INNER JOIN programas pr ON ct.programas_id = pr.id " . "INNER JOIN usuarios u ON c.tutor_id = u.id " . "WHERE c.id > 0 {$and}";
     if (isset($_GET['starting'])) {
         $starting = $_GET['starting'];
     } else {
         $starting = 0;
     }
     $objpag = new Pagination($sql, $starting, 20, 'index2.php?com=cursos&do=search');
     $res = $objpag->result;
     $data = array();
     $x = 0;
     while ($line = $objpag->fetchNextObject($res)) {
         $data[$x]['id'] = $line->id;
         $data[$x]['programa'] = $line->programa;
         $data[$x]['grupo'] = $line->grupo;
         $data[$x]['curso'] = $line->nombre;
         $data[$x]['periodo'] = $line->periodo;
         $data[$x]['tutor'] = $line->tutor;
         $data[$x]['tutor_id'] = $line->tutor_id;
         $data[$x]['dia'] = CatManUtils::getDiaNombre($line->dia);
         $data[$x]['hora'] = $line->hora;
         $data[$x]['agenda'] = $this->siTieneAgenda($line->id);
         $data[$x]['estado'] = Elfic::getBlockIcon($line->estado);
         $x++;
     }
     $anchors = $objpag->anchors;
     $total = $objpag->total;
     $tpl = new Elfic_Smarty();
     $tpl->assign('data', $data);
     $tpl->assign('anchors', $anchors);
     $tpl->assign('total', $total);
     $tpl->display('cursos/cursosList.tpl');
 }