本文整理汇总了PHP中Consulta::getRow方法的典型用法代码示例。如果您正苦于以下问题:PHP Consulta::getRow方法的具体用法?PHP Consulta::getRow怎么用?PHP Consulta::getRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Consulta
的用法示例。
在下文中一共展示了Consulta::getRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIDs
function getIDs()
{
$sql = "\r\n SELECT \r\n GROUP_CONCAT(id_area) \r\n FROM \r\n areas a ";
$query = new Consulta($sql);
return $query->getRow();
}
示例2: listado
function listado($ide = '', $dias = false)
{
$vencidos = false;
$page = isset($_GET['pag']) && is_numeric($_GET['pag']) && $_GET['pag'] > 0 ? $_GET['pag'] - 1 : 0;
$rows_per_page = 20;
$area_session = $_SESSION['session'][5];
$field_dias_faltantes = "\r\n DATEDIFF( \r\n ADDDATE(d.fecha_registro_documento, \r\n p.tiempo_horas_respuesta_prioridad/24 ),\r\n CURDATE() \r\n )\r\n ";
$fields_hd = "\r\n hd.id_documento as id,\r\n dr.id_documento_reporte as detalle_id,\r\n dr.ubicacion,\r\n d.fecha_registro_documento as fecha,\r\n d.asunto_documento as asunto,\r\n d.codigo_documento as codigo,\r\n td.nombre_tipo_documento as tipo,\r\n r.nombre_remitente as remitente,\r\n hd.original_historial_documento as categoria,\r\n d.numero_documento as numero,\r\n d.id_estado as id_estado,\r\n e.abrev_nombre_estado as estado,\r\n {$field_dias_faltantes} AS dias_faltantes\r\n ";
$fields_ha = "\r\n ha.id_documento as id,\t\t\t\r\n dr.id_documento as detalle_id,\t\r\n dr.ubicacion,\r\n d.fecha_registro_documento as fecha,\r\n d.asunto_documento as asunto,\r\n d.codigo_documento as codigo,\r\n td.nombre_tipo_documento as tipo,\r\n r.nombre_remitente as remitente,\r\n ha.original_historial_atencion as categoria,\r\n d.numero_documento as numero,\r\n d.id_estado as id_estado,\r\n e.abrev_nombre_estado as estado,\r\n {$field_dias_faltantes} AS dias_faltantes\r\n ";
if ($ide == '') {
$where = "WHERE\r\n (((d.id_estado = '4' OR d.id_estado = '12' OR d.id_estado = '11' \r\n OR d.id_estado = '6' OR d.id_estado = '16' OR d.id_estado = '17' \r\n OR d.id_estado = '18' OR d.id_estado = '3' OR d.id_estado = '13' \r\n OR d.id_estado = '14' OR d.id_estado = '15')";
} else {
if ($ide == "LT") {
$where = "WHERE ";
} else {
if ($ide == "atencion") {
$req = (object) $_REQUEST;
$where = "WHERE d.id_estado NOT IN(11) ";
$areas = new Areas();
$area_session = $areas->getIDs();
if (isset($req->remitente)) {
$where .= "AND ( r.abreviatura_remitente like '%{$req->remitente}%' OR r.nombre_remitente like '%{$req->remitente}%' ) ";
}
if (isset($req->area) && $req->area) {
$area_session = $req->area;
}
if (isset($req->pendientes)) {
if (isset($req->area)) {
$area_session = $req->area;
#$where .= " AND $req->area LIKE CONCAT(dr.ubicacion,'%')";
}
$where .= "AND d.id_estado IN (3,4,6,13,14,15,16,17,18) \r\n AND {$field_dias_faltantes} >=0\r\n ";
}
if (isset($req->atendidos)) {
$where .= "AND d.id_estado IN (12) ";
} else {
$where .= "AND d.id_estado NOT IN (12) ";
}
if (isset($req->vencidos)) {
$where .= "\r\n AND d.id_estado NOT IN (12) \r\n AND {$field_dias_faltantes} <0\r\n ";
$vencidos = true;
}
} else {
if (is_numeric($ide)) {
$where = "AND d.id_estado = {$ide} ";
}
}
}
/*
Tasks.
Revisar Busaqueda de documento para mostrar detalle;
Paginación.
Ordenación por Encabezados
*/
}
//Fin de if ide
$select_historial = "\r\n SELECT\r\n {$fields_hd}\r\n FROM\r\n historial_documentos AS hd\r\n INNER JOIN \r\n documentos AS d ON d.id_documento = hd.id_documento\r\n INNER JOIN \r\n estados AS e ON e.id_estado = d.id_estado\r\n \t\t\tINNER JOIN\r\n\t\t\t\t\t\t\t\tprioridades AS p ON p.id_prioridad = d.id_prioridad\r\n LEFT JOIN \r\n remitentes AS r ON r.id_remitente = d.id_remitente\r\n LEFT JOIN \r\n tipos_documento AS td ON d.id_tipo_documento = td.id_tipo_documento\r\n \t INNER JOIN\r\n\t\t\t\t\t\t\t\tdocumentos_reporte as dr ON hd.id_documento = dr.id_documento \t\r\n {$where}\r\n " . ($where != 'WHERE ' ? "AND" : "") . "\r\n (( hd.original_historial_documento = 1) OR hd.original_historial_documento = 2 )\r\n AND hd.id_area IN ({$area_session})\r\n \r\n GROUP BY id\r\n ";
$select_atencion = "\r\n SELECT\r\n {$fields_ha}\r\n FROM\r\n historial_atencion AS ha\r\n INNER JOIN \r\n documentos AS d ON ha.id_documento = d.id_documento\r\n INNER JOIN \r\n estados AS e ON d.id_estado = e.id_estado\r\n \t\t\tINNER JOIN\r\n prioridades AS p ON p.id_prioridad = d.id_prioridad\r\n LEFT JOIN \r\n tipos_documento AS td ON d.id_tipo_documento = td.id_tipo_documento\r\n LEFT JOIN \r\n remitentes AS r ON d.id_remitente = r.id_remitente\r\n \tINNER JOIN\r\n\t\t\t\t\t\t\t\tdocumentos_reporte as dr ON ha.id_documento = dr.id_documento \t\r\n {$where}\r\n " . ($where != 'WHERE ' ? "AND" : "") . "\r\n \r\n (( ha.original_historial_atencion = 1) OR ha.original_historial_atencion = 2 )\r\n AND(\r\n (ha.id_area IN ({$area_session}) AND ha.tipo_historial_atencion=0) OR\r\n (ha.id_area_destino IN ({$area_session}) AND ha.tipo_historial_atencion=1) OR\r\n (ha.id_area_destino IN ({$area_session}) AND ha.tipo_historial_atencion=2)\r\n )\r\n \r\n GROUP BY id\r\n ";
$order_limit_sql = "\r\n ORDER BY \r\n dias_faltantes DESC, categoria ASC\r\n LIMIT " . $page * $rows_per_page . ",{$rows_per_page}\r\n ";
$sql_reg = "\r\n ( {$select_historial} )\r\n UNION\r\n ( {$select_atencion} ) \r\n \r\n ";
$query_reg = new Consulta($sql_reg . $order_limit_sql);
$total_rows_query = new Consulta(" SELECT COUNT(*) FROM ( {$sql_reg} ) as total");
#echo $query_reg->SQL;
$total_rows = $total_rows_query->getRow();
?>
<?php
if ($total_rows > 0) {
?>
<?php
ob_start();
$total_pages = ceil($total_rows / $rows_per_page);
$page++;
if ($total_pages > 1) {
?>
<div class="pagination">
<span>Total de páginas: </span><strong><?php
echo $total_pages;
?>
</strong> |
<span for="toPage">Ir a Página:</span>
<select id="toPage">
<?php
for ($p = 1; $p <= $total_pages; $p++) {
?>
<option <?php
echo $p == $page ? 'selected="selected"' : '';
?>
value="<?php
echo $p;
?>
"> <?php
echo $p;
?>
</option>
<?php
}
//.........这里部分代码省略.........