function get_totalPorProceso() { $objDB = new DBConexion(); $queryDen = "SELECT count(id_denuncia) " . "AS total_denuncias " . "FROM denuncias " . "WHERE fecha_tope_entrega " . "BETWEEN now() AND DATE_ADD(now(),INTERVAL 5 DAY) "; $rsDen = $objDB->getRecord($queryDen); $querySol = "SELECT count(id_solicitud) " . "AS total_solicitudes " . "FROM solicitudes " . "WHERE fecha_tope_entrega " . "BETWEEN now() AND DATE_ADD(now(),INTERVAL 5 DAY) "; $rsSol = $objDB->getRecord($querySol); $queryRec = "SELECT count(id_reclamo) " . "AS total_reclamos " . "FROM reclamos " . "WHERE fecha_tope_entrega " . "BETWEEN now() AND DATE_ADD(now(),INTERVAL 5 DAY) "; $rsRec = $objDB->getRecord($queryRec); $totalPorProceso = array(denuncias => $rsDen['total_denuncias'], solicitudes => $rsSol['total_solicitudes'], reclamos => $rsRec['total_reclamos']); return $totalPorProceso; }
function get_totalPorProcesoPorFecha($fechaInicial, $fechaFinal) { $objDB = new DBConexion(); $queryDen = "SELECT count(id_denuncia) " . "AS total_denuncias " . "FROM denuncias " . "WHERE fecha_registro " . "BETWEEN '{$fechaInicial}' AND '{$fechaFinal}'"; $rsDen = $objDB->getRecord($queryDen); $querySol = "SELECT count(id_solicitud) " . "AS total_solicitudes " . "FROM solicitudes " . "WHERE fecha_registro " . "BETWEEN '{$fechaInicial}' AND '{$fechaFinal}'"; $rsSol = $objDB->getRecord($querySol); $queryRec = "SELECT count(id_reclamo) " . "AS total_reclamos " . "FROM reclamos " . "WHERE fecha_registro " . "BETWEEN '{$fechaInicial}' AND '{$fechaFinal}'"; $rsRec = $objDB->getRecord($queryRec); $totalPorProceso = array(denuncias => $rsDen['total_denuncias'], solicitudes => $rsSol['total_solicitudes'], reclamos => $rsRec['total_reclamos']); return $totalPorProceso; }
function getComunidad($id_comunidad) { $objDB = new DBConexion(); $query = "SELECT comunidad " . "FROM comunidades " . "WHERE id_comunidad = {$id_comunidad}"; $rs = $objDB->getRecord($query); return $rs['comunidad']; }
function getIdUsuario($usuario) { $objDB = new DBConexion(); $query = "SELECT id_usuario " . "FROM usuarios " . "WHERE nombre = '{$usuario}'"; $rs = $objDB->getRecord($query); return $rs['id_usuario']; }
header("Location:usuarios/index.php"); } else { include './spoon/spoon.php'; $objDB = new DBConexion(); if (isset($_GET['year']) && !empty($_GET['year'])) { $year = $_GET['year']; } if (isset($_GET['atenciones']) && !empty($_GET['atenciones'])) { $atenciones = $_GET['atenciones']; } if (isset($atenciones)) { /* * Obtener total atenciones */ $queryA = "SELECT count(id_atencion) AS total_atenciones " . "FROM atenciones " . "WHERE year = '{$year}'"; $rsA = $objDB->getRecord($queryA); $totAtenciones = $rsA['total_atenciones']; $cols = array(array("label" => "Atenciones", "type" => "string"), array("label" => "Total", "type" => "number")); $rows = array(array("c" => array(array("v" => "Atenciones"), array("v" => $totAtenciones)))); $data = array("cols" => $cols, "rows" => $rows); echo json_encode($data); } else { /* * Obtener total denuncias */ $queryD = "SELECT count(id_denuncia) AS total_denuncias " . "FROM denuncias " . "WHERE year = '{$year}'"; $rsD = $objDB->getRecord($queryD); /* * Obtener total solicitudes */ $queryS = "SELECT count(id_solicitud) AS total_solicitudes " . "FROM solicitudes " . "WHERE year = '{$year}'";
} if ($_GET['opcion'] == "actualizar") { $boton = "Guardar cambios"; } /** * Consulto a la base de datos si se solicita detalles o actualizar */ include '../spoon/spoon.php'; if (isset($_GET['id'])) { $id_denuncia = $_GET['id']; $query = "SELECT * " . "FROM denuncias " . "INNER JOIN ciudadanos " . "ON denuncias.id_denunciante = ciudadanos.id_ciudadano " . "WHERE denuncias.id_denuncia = {$id_denuncia}"; } else { $query = "SELECT MAX(id_denuncia) + 1 AS last_id_denuncia" . "FROM denuncias "; } $objDB = new DBConexion(); $rs = $objDB->getRecord($query); $year = date("Y"); $estatus = array(1 => "Aceptada", 2 => "Valoración", 3 => "Auditoría", 4 => "Notificada", 5 => "Rechazada", 6 => "CGR", 7 => "Por soportes"); } ?> <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Registre </title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="../bootstrap/css/bootstrap.css" type="text/css" media="screen" /> <link href="../jquery-ui-1.11.3.custom/jquery-ui.css" rel="stylesheet"> <!--DataTables CSS-->
function get_fulldetails($tabla, $proceso, $id_proceso, $codigo_proceso) { include 'spoon/spoon.php'; $objDB = new DBConexion(); // if (isset($_POST['id_proceso'])){ // $id_proceso = $_POST['id_proceso']; // $proceso = $_POST['proceso']; // $tabla = $_POST['tabla'];} $query = "SELECT *, " . $tabla . ".fecha_registro AS fecha_registro_proceso " . "FROM " . $tabla . " " . "INNER JOIN ciudadanos " . "ON " . $tabla . ".id_ciudadano = ciudadanos.id_ciudadano " . "INNER JOIN usuarios " . "ON " . $tabla . ".idusuario = usuarios.id_usuario " . "WHERE " . $tabla . ".id_" . $proceso . " = {$id_proceso}"; // $query = "SELECT * " // . "FROM denuncias " // . "WHERE id_denuncia = $id_proceso"; $rs = $objDB->getRecord($query); // $proceso = $_POST['proceso']; setlocale(LC_TIME, 'es_VE.UTF-8'); date_default_timezone_set('America/Caracas'); $fecha = strftime("%A %d de %B de %Y", strtotime($rs['fecha_registro_proceso'])); $html = '<h5 style="text-align:right; "><strong>Registrada el, ' . $fecha . '</strong></h5><br><br>'; // '<br><br><br><h1 style="text-align:center;">Recepción de ' . $proceso . '</h1><br><br><br><br><br><br><br><br>' $html .= '<p style="text-align:justify;"><b>Narración de los hechos:</b> ' . trim($rs['narracion_hechos']) . '</p><br>'; $html .= '<p style="text-align:justify;"><b>Observaciones:</b> ' . trim($rs['observaciones']) . '</p><br>'; // $last_id = ucfirst(substr($proceso,0,1)) . '-' . str_pad($id_proceso, 3, "0", STR_PAD_LEFT) . '-' . $rs['year'] ; //$pdf->writeHTML(ucfirst(substr($proceso,0,1)) . '-' . $last_id, true, 0, true, 0, ''); //$html.= '<b>' . $last_id . '</b>'; $html .= '<div style="width:100%; "><div style="float: left;width:55%; "><h4>Datos del Ciudadano</h4><hr style="margin-bottom: 5px; margin-top: 5px;">'; $html .= '<p><b>Cédula:</b> ' . number_format($rs['cedula'], 0, ',', '.') . '</p>'; $html .= '<p><b>Nombre:</b> ' . $rs['apellidos']; $html .= ', ' . $rs['nombres'] . '</p>'; $html .= '<p><b>Teléfonos:</b> ' . $rs['telefonos'] . '</p>'; $html .= '<p><b>Correo:</b> ' . $rs['correo'] . '</p>'; $html .= '<p><b>Dirección:</b> ' . $rs['direccion'] . '</p></div>'; // //$html.= number_format($rs['cedula'],0,',','.'); //$html.= $rs['apellidos'] . ', ' . $rs['nombres']; $html .= '<div style="float:left; width:45%; "><h4>Recibido en la OAC por el Funcionario:</h4><hr style="margin-bottom: 5px; margin-top: 5px;"> <b>' . $rs['nombre'] . '</b></div></div>'; //$html.='<p style="text-align:right;"><a href="">Ver histórico</a></p>' ; /* * Consulta que devuelve el histórico de cambios de estatus de los procesos */ $queryD = "SELECT * " . "FROM detalles_procesos " . "WHERE codigo_proceso ='{$codigo_proceso}'"; $rsD = $objDB->getRecords($queryD); $html .= '<div style="margin-top: 250px" class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> <div class="panel panel-default"> <div class="panel-heading" role="tab" id="headingOne"> <h4 style="text-align: right;" class="panel-title"> <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="false" aria-controls="collapseOne"> Histórico de cambios </a> </h4> </div> <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne"> <div class="panel-body"> <div><div style="width:25%; float:left"> Fecha</div><div style="width:25%; float:left">Estatus</div><div style="width:25%; float:left">Observaciones</div><div style="width:25%; float:left">Funcionario</div></div>'; foreach ($rsD as $value) { $html .= '<div style="clear:both;"><div style="width:25%; float:left">' . $value['fecha'] . '</div><div style="width:25%; float:left">' . $value['estatus'] . '</div><div style="width:25%; float:left">' . $value['observacion'] . '</div><div style="width:25%; float:left;">' . $value['funcionario'] . '</div></div>' . "\n"; } $html .= '</div> </div> </div> </div>'; return $html; }