if ($_POST["apellido"] != "") { $extraWhere .= " AND LOWER(p.apellido) LIKE('%" . strtolower($_POST["apellido"]) . "%')"; } if ($_POST["cedula"] != "") { $extraWhere .= " AND p.cedula LIKE('%" . $_POST["cedula"] . "%')"; } if ($_POST["cargo"] != "") { $extraWhere .= " AND p.id_cargo = " . $_POST["cargo"]; } if ($_POST["activo"] != "") { $extraWhere .= " AND p.activo = '" . $_POST["activo"] . "'"; } $query = "SELECT p.*, c.nombre AS cargo" . " FROM personal p, cargo c" . " WHERE p.id_cargo = c.id " . $extraWhere . " ORDER BY p.cedula DESC"; $totalRecords = DBUtil::getRecordCountToQuery($query); $pageRecords = DBUtil::getRecordsByPage($query, $pageNumber); $pagingDAO = new PagingDAO($pageNumber, $scriptFunction, $totalRecords); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> </head> <body> <div id="container" class="centered"> <?php if (count($pageRecords) == 0) { //no se obtuvieron registros para los criterios de busqueda ?> <span class="smallError"> <?php echo Constants::$TEXT_NO_PAGE_RECORDS;
header('Content-Type: text/html; charset=ISO-8859-1'); include_once '../classes/Constants.php'; include_once '../classes/DBUtil.php'; include_once '../classes/PagingDAO.php'; $pageNumber = $_POST[Constants::$PAGE_NUMBER]; $scriptFunction = $_POST[Constants::$SCRIPT_FUNCTION]; //obtenemos el extra where $extraWhere = ""; if ($_POST["cedula"] != "") { $extraWhere .= " AND ac.cedula LIKE ('%" . $_POST["cedula"] . "%')"; } $query = "SELECT * " . " FROM alumno_constancia ac " . " WHERE 1 = 1" . $extraWhere . " ORDER BY ac.nombre"; $maxRecordsNumbers = 50; $totalRecords = DBUtil::getRecordCountToQuery($query); $pageRecords = DBUtil::getRecordsByPage($query, $pageNumber, $maxRecordsNumbers); $pagingDAO = new PagingDAO($pageNumber, $scriptFunction, $totalRecords); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> </head> <body> <div id="container" class="centered"> <?php if (count($pageRecords) == 0) { //no se obtuvieron registros para los criterios de busqueda ?> <span class="smallError"> <?php echo Constants::$TEXT_NO_PAGE_RECORDS;