本文整理汇总了PHP中Pager_Wrapper_MDB2函数的典型用法代码示例。如果您正苦于以下问题:PHP Pager_Wrapper_MDB2函数的具体用法?PHP Pager_Wrapper_MDB2怎么用?PHP Pager_Wrapper_MDB2使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Pager_Wrapper_MDB2函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listar
/**
* Funcion que muestra el listado de manuales
* @return void
*/
function listar()
{
global $db;
$show = false;
$display = "style=\"display:none;\"";
// Database connection
$odbconn = MDB2::connect($db['dsn'], $db['opts']);
$odbconn->setFetchMode(MDB2_FETCHMODE_ASSOC);
$sql = "SELECT *\n FROM {$this->tabla}\n WHERE 1=1 ";
if (isset($_REQUEST['buscar'])) {
if ($_REQUEST['palabra']) {
$sql .= " AND( upper(nombre) LIKE '%" . strtoupper($_REQUEST['palabra']) . "%' \n OR codigo LIKE '%{$_REQUEST['palabra']}%'\n OR cups LIKE '%{$_REQUEST['palabra']}%') ";
$show = true;
}
if ($_REQUEST['manual']) {
$sql .= " AND manual = '{$_REQUEST['manual']}' ";
$show = true;
}
}
if ($show === true) {
$display = "style=\"display:inline;\"";
}
$pager_options = array('mode' => 'Sliding', 'perPage' => 16, 'delta' => 2, 'extraVars' => array('a' => $_REQUEST['a']));
$data = Pager_Wrapper_MDB2($odbconn, $sql, $pager_options);
// Variable para el template
$Manual = new Manual();
$smanual = $Manual->lista();
$manual = arregloLista($smanual);
$idmanual = isset($_REQUEST['manual']) ? $_REQUEST['manual'] : '';
// Mensaje a mostrar en el template
$msj = flashData();
include getTemplate('tarifa.lista.php');
return;
}
示例2: listar
/**
* Funcion que muestra el listado de medicamentos
* @return void
*/
function listar()
{
global $db;
// Database connection
$odbconn = MDB2::connect($db['dsn'], $db['opts']);
$odbconn->setFetchMode(MDB2_FETCHMODE_ASSOC);
$sql = "SELECT *\n FROM {$this->tabla}\n WHERE 1=1 ";
if (isset($_REQUEST['buscar'])) {
if ($_REQUEST['palabra']) {
$sql .= " AND( upper(generico) LIKE '%" . strtoupper($_REQUEST['palabra']) . "%' \n OR codigo LIKE '%{$_REQUEST['palabra']}%'\n )";
$show = true;
}
if ($_REQUEST['forma']) {
$sql .= " AND codformfarm = '{$_REQUEST['forma']}' ";
$show = true;
}
}
$pager_options = array('mode' => 'Sliding', 'perPage' => 16, 'delta' => 2, 'extraVars' => array('a' => $_REQUEST['a']));
$data = Pager_Wrapper_MDB2($odbconn, $sql, $pager_options);
// Variables usadas en el template
$ltipo = $this->listaTipoForma();
$tipo = arregloLista($ltipo);
$idforma = isset($_REQUEST['forma']) ? $_REQUEST['forma'] : '';
include getTemplate('medicamento.lista.php');
return;
}
示例3: listar
/**
* Funcion que muestra el listado de medicamentos
* @return void
*/
function listar()
{
global $db;
$titulo = '';
if ($_REQUEST['tipo'] == '1') {
$titulo = 'MEDICAMENTOS';
} elseif ($_REQUEST['tipo'] == '2') {
$titulo = 'LABORATORIO';
} elseif ($_REQUEST['tipo'] == '3') {
$titulo = 'IMAGENOLOGIA';
} elseif ($_REQUEST['tipo'] == '4') {
$titulo = 'PROCEDIMIENTO';
}
// Database connection
$odbconn = MDB2::connect($db['dsn'], $db['opts']);
$odbconn->setFetchMode(MDB2_FETCHMODE_ASSOC);
$sql = "SELECT *\n FROM {$this->tabla}\n WHERE tipo = '{$_REQUEST['tipo']}'\n ";
if (isset($_REQUEST['buscar'])) {
if ($_REQUEST['palabra']) {
$sql .= " AND( upper(nombre) LIKE '%" . strtoupper($_REQUEST['palabra']) . "%')";
$show = true;
}
}
$sql .= " ORDER BY id ASC";
$pager_options = array('mode' => 'Sliding', 'perPage' => 16, 'delta' => 2, 'extraVars' => array('a' => $_REQUEST['a']));
$data = Pager_Wrapper_MDB2($odbconn, $sql, $pager_options);
// Mensaje a mostrar en el template
$msj = flashData();
// Variables usadas en el template
include getTemplate('sugerencia.lista.php');
return;
}
示例4: listar
/**
* Funcion que muestra el listado de botones
* @return void
*/
function listar()
{
global $db;
// Database connection
$odbconn = MDB2::connect($db['dsn'], $db['opts']);
$odbconn->setFetchMode(MDB2_FETCHMODE_ASSOC);
$sql = "SELECT *\n FROM {$this->tabla}\n ";
$pager_options = array('mode' => 'Sliding', 'perPage' => 16, 'delta' => 2, 'extraVars' => array('a' => $_REQUEST['a']));
$data = Pager_Wrapper_MDB2($odbconn, $sql, $pager_options);
include getTemplate('boton.lista.php');
return;
}
示例5: listar
/**
* Funcion que muestra el listado de Perfiles
* @return void
*/
function listar()
{
global $db;
// Database connection
$odbconn = MDB2::connect($db['dsn'], $db['opts']);
$odbconn->setFetchMode(MDB2_FETCHMODE_ASSOC);
$sql = "SELECT id,ARRAY_TO_STRING(ARRAY[nombre1, nombre2, apellido1,apellido2], ' ') as nombre \n FROM usuario\n WHERE activo = '1'\n AND tipo = '1'";
$pager_options = array('mode' => 'Sliding', 'perPage' => 16, 'delta' => 2, 'extraVars' => array('a' => $_REQUEST['a']));
$data = Pager_Wrapper_MDB2($odbconn, $sql, $pager_options);
// Mensaje a mostrar en el template
$msj = flashData();
include getTemplate('medico.lista.php');
return;
}
示例6: listar
/**
* Funcion que muestra el listado de Perfiles
* @return void
*/
function listar()
{
global $db;
// Database connection
$odbconn = MDB2::connect($db['dsn'], $db['opts']);
$odbconn->setFetchMode(MDB2_FETCHMODE_ASSOC);
$sql = "SELECT * FROM horario \n WHERE estado = '1'\n Order by id";
$pager_options = array('mode' => 'Sliding', 'perPage' => 5, 'delta' => 2, 'extraVars' => array('a' => $_REQUEST['a']));
$data = Pager_Wrapper_MDB2($odbconn, $sql, $pager_options);
// Mensaje a mostrar en el template
$msj = flashData();
// templates
include getTemplate('horario.lista.php');
return;
}
示例7: listar
/**
* Funcion que muestra el listado de manuales
* @return void
*/
function listar()
{
global $db;
// Database connection
$odbconn = MDB2::connect($db['dsn'], $db['opts']);
$odbconn->setFetchMode(MDB2_FETCHMODE_ASSOC);
$sql = "SELECT *\n FROM {$this->tabla}\n ";
$pager_options = array('mode' => 'Sliding', 'perPage' => 16, 'delta' => 2, 'extraVars' => array('a' => $_REQUEST['a']));
$data = Pager_Wrapper_MDB2($odbconn, $sql, $pager_options);
$Costo = new Costo();
$costo = arregloLista($Costo->lista());
// Mensaje a mostrar en el template
$msj = flashData();
include getTemplate('costosub.lista.php');
return;
}
示例8: listar
/**
* Funcion que muestra el listado de admisiones
* @return void
*/
function listar()
{
global $db;
$show = false;
$display = "style=\"display:none;\"";
// Database connection
$odbconn = MDB2::connect($db['dsn'], $db['opts']);
$odbconn->setFetchMode(MDB2_FETCHMODE_ASSOC);
/*$sql = "SELECT a.id, a.id_paciente,a.codigo_prestador,a.prefijo_centro,a.numero_documento,
a.codigo_eps,a.fecha_ingreso,a.fecha_egreso,a.id_medico,
ARRAY_TO_STRING(ARRAY[p.nombre1,p.nombre2,p.apellido1,p.apellido2], ' ') as paciente_nombre,
ARRAY_TO_STRING(ARRAY[m.nombre1,m.nombre2,m.apellido1,m.apellido2], ' ') as medico_nombre
FROM admision a,paciente p, medico m
WHERE p.id = a.id_paciente
AND a.id_medico = m.id
*/
$sql = "SELECT a.id, a.id_paciente,a.codigo_prestador,a.prefijo_centro,a.numero_documento,\n a.codigo_eps,a.fecha_ingreso,a.fecha_egreso,a.id_medico, \n ARRAY_TO_STRING(ARRAY[p.nombre1,p.nombre2,p.apellido1,p.apellido2], ' ') as paciente_nombre,\n ARRAY_TO_STRING(ARRAY[m.nombre1,m.nombre2,m.apellido1,m.apellido2], ' ') as medico_nombre\n FROM admision a,paciente p, usuario m\n WHERE p.id = a.id_paciente\n AND a.id_medico = m.id\n ";
if (isset($_REQUEST['buscar'])) {
if ($_REQUEST['palabra']) {
$sql .= " AND( CAST(a.id AS TEXT) LIKE '%{$_REQUEST['palabra']}%' \n OR p.numero_documento LIKE '%{$_REQUEST['palabra']}%') ";
$show = true;
}
if ($_REQUEST['id_medico']) {
$sql .= " AND m.id = '{$_REQUEST['id_medico']}' ";
$show = true;
}
if ($_REQUEST['fecha_inicial'] && $_REQUEST['fecha_final']) {
$sql .= " AND a.fecha_ingreso BETWEEN '" . toYMD($_REQUEST['fecha_inicial']) . "' AND '" . toYMD($_REQUEST['fecha_final']) . "' ";
$show = true;
}
}
if ($show === true) {
$display = "style=\"display:inline;\"";
}
$pager_options = array('mode' => 'Sliding', 'perPage' => 16, 'delta' => 2, 'extraVars' => array('a' => $_REQUEST['a']));
$data = Pager_Wrapper_MDB2($odbconn, $sql, $pager_options);
// Variables para la vista
$medicos = $this->Medico->lista();
$idmedico = isset($_REQUEST['id_medico']) ? $_REQUEST['id_medico'] : '';
$pagina = urlencode("app/admision/admision.php?a=listar");
include getTemplate('admision.lista.php');
return;
}
示例9: listar
/**
* Funcion que muestra el listado de Perfiles
* @return void
*/
function listar()
{
global $db;
// Database connection
$odbconn = MDB2::connect($db['dsn'], $db['opts']);
$odbconn->setFetchMode(MDB2_FETCHMODE_ASSOC);
$sql = "SELECT * FROM usuario";
$pager_options = array('mode' => 'Sliding', 'perPage' => 16, 'delta' => 2, 'extraVars' => array('a' => $_REQUEST['a']));
$paged_data = Pager_Wrapper_MDB2($odbconn, $sql, $pager_options);
$perfil = $odbconn->queryAll("SELECT id_rol, nombre FROM rol");
foreach ($perfil as $valor) {
$lperfil[$valor['id_rol']] = $valor['nombre'];
}
// templates
//include (getTemplate('fheader.php'));
include getTemplate('usuario.lista.php');
//include (getTemplate('ffooter.php'));
return;
}
示例10: listar
/**
* Funcion que muestra el listado de medicamentos
* @return void
*/
function listar()
{
global $db;
// Database connection
$odbconn = MDB2::connect($db['dsn'], $db['opts']);
$odbconn->setFetchMode(MDB2_FETCHMODE_ASSOC);
$sql = "SELECT *\n FROM {$this->tabla}\n WHERE 1=1 ";
if (isset($_REQUEST['buscar'])) {
if ($_REQUEST['palabra']) {
$sql .= " AND( upper(nombre) LIKE '%" . strtoupper($_REQUEST['palabra']) . "%')";
$show = true;
}
}
$sql .= " ORDER BY id ASC";
$pager_options = array('mode' => 'Sliding', 'perPage' => 16, 'delta' => 2, 'extraVars' => array('a' => $_REQUEST['a']));
$data = Pager_Wrapper_MDB2($odbconn, $sql, $pager_options);
// Mensaje a mostrar en el template
$msj = flashData();
// Variables usadas en el template
include getTemplate('dosis.lista.php');
return;
}
示例11: logger
}
//loggolas
logger($page . '_' . $sub_act);
header('Location: admin.php?p=' . $module_name . '&act=' . $page . '&field=' . $field . '&ord=' . $ord . '&pageID=' . $page_id . '&cat_fil=' . $cat_fil);
exit;
}
//torles vege
/**
* ha a listat mutatjuk
*/
if ($sub_act == "lst") {
//lekerdezzuk az mit hirek listajat
$query = "\n\t\tSELECT id AS cid, title, mainsection, createdate, modifieddate, lead \n\t\tFROM iShark_Mti_News \n\t\t{$catfilt}\n\t\t{$fieldorder} {$order}\n\t";
//lapozo
require_once 'Pager/Pager.php';
$paged_data = Pager_Wrapper_MDB2($mdb2, $query, $pagerOptions);
//ha vannak kategoriak
if (!empty($_SESSION['site_category'])) {
$all_select = array('all' => $locale->get('mtinews_field_news_list_allfilter'));
$query_cat = "\n\t\t\tSELECT mainsection \n\t\t\tFROM iShark_Mti_News \n\t\t\tGROUP BY mainsection\n\t\t\tORDER BY mainsection\n\t\t";
$result_cat =& $mdb2->query($query_cat);
$row_cat = $result_cat->fetchCol();
$tpl->assign('category_list', $all_select + $row_cat);
}
//atadjuk a smarty-nak a kiirando cuccokat
$tpl->assign('page_data', $paged_data['data']);
$tpl->assign('page_list', $paged_data['links']);
$tpl->assign('back_arrow', 'admin.php');
//megadjuk a tpl file nevet, amit atadunk az admin.php-nek
$acttpl = 'contents_mtinews_list';
}
示例12: elseif
} elseif ($tri == "date") {
$req .= ' ORDER BY time DESC ';
}
} else {
$req .= ' ORDER BY time DESC';
}
$requete = "SELECT DISTINCT tag, time, user, owner, body FROM " . $this->config["table_prefix"] . "pages" . $req_from . " WHERE latest = 'Y' and comment_on = '' " . $req;
require_once 'tools/tags/libs/MDB2.php';
$dsn = array('phptype' => 'mysql', 'username' => $this->config["mysql_user"], 'password' => $this->config["mysql_password"], 'hostspec' => $this->config["mysql_host"], 'database' => $this->config["mysql_database"]);
// create MDB2 instance
$db =& MDB2::connect($dsn);
if (!empty($nb)) {
require_once 'tools/tags/libs/Pager/Pager_Wrapper.php';
//this file
$pagerOptions = array('mode' => 'Sliding', 'delta' => 2, 'perPage' => $nb);
$paged_data = Pager_Wrapper_MDB2($db, $requete, $pagerOptions);
//$paged_data['page_numbers']; //array('current', 'total');
} else {
$paged_data['data'] = $db->queryAll($requete, null, MDB2_FETCHMODE_ASSOC);
}
$text = '';
foreach ($paged_data['data'] as $microblogpost) {
if (!file_exists('tools/tags/presentation/' . $template)) {
exit('Le fichier template du formulaire de microblog "tools/tags/presentation/' . $template . '" n\'existe pas. Il doit exister...');
} elseif ($this->tag != $microblogpost['tag']) {
include_once 'tools/tags/libs/squelettephp.class.php';
$valtemplate = array();
$squel = new SquelettePhp('tools/tags/presentation/' . $template);
$valtemplate['class'] = $class;
$valtemplate['lien'] = $this->href('', $microblogpost['tag']);
$valtemplate['nompage'] = $microblogpost['tag'];
示例13: listaConsulta
function listaConsulta()
{
global $db;
// Database connection
$odbconn = MDB2::connect($db['dsn'], $db['opts']);
$odbconn->setFetchMode(MDB2_FETCHMODE_ASSOC);
$sql = "SELECT * FROM historia_consulta \n WHERE id_paciente = '{$_REQUEST['id_paciente']}'";
$pager_options = array('mode' => 'Sliding', 'perPage' => 1, 'delta' => 2, 'prevImg' => '<img src="tpl/img/atras.png" width="24" height="24" />', 'nextImg' => '<img src="tpl/img/adelante.png" width="24" height="24" />', 'extraVars' => array('a' => $_REQUEST['a']));
$data = Pager_Wrapper_MDB2($odbconn, $sql, $pager_options);
$con = $data['data'][0];
if (count($data['data'])) {
// Datos de los antecedentes
$sql = "SELECT * FROM historia_antecedentes\n WHERE id_admision = '{$con['id_admision']}'";
$ant = $this->queryRow($sql);
// Datos del paciente
$paciente = $this->Paciente->getPaciente($con['id_paciente']);
// Datos del medico
$medico = $this->Medico->getMedico($con['id_medico']);
// Tipo diagnostico
$sql = "SELECT codigo,nombre FROM tipo_diagnostico";
$tipos = $this->queryAll($sql, 'normal');
$tipo = arregloLista($tipos);
// Finalidad
$sql = "SELECT codigo,nombre FROM tipo_finalidad";
$lfin = $this->queryAll($sql, 'normal');
$fin = arregloLista($lfin);
// Causa externa
$sql = "SELECT codigo,nombre FROM tipo_causa_externa";
$lcausa = $this->queryAll($sql, 'normal');
$causa = arregloLista($lcausa);
}
include getTemplate('consulta.lista.detalle.php');
return;
}
示例14: getList
/**
* retrieves a list from a database
* @param array $searchcriteria supplied criteria
* @param integer $pagesize size of result
* @param integer $page offset
* @param integer $order type of order
* @return array
*/
public function getList($searchcriteria = NULL, $pagesize = 0, $page = 1, $order = NULL)
{
$sqlParser = clone $this->sqlParser;
$sqlParser->parseCriteria($searchcriteria);
$this->parseCriteria($sqlParser, $searchcriteria);
$sqlParser->setOrderby($this->getOrder($order));
$query = $sqlParser->getSql(SqlParser::SEL_LIST);
//if($sqlParser->getTable() == 'siteplugin') echo $query."<br />\n";
//if($sqlParser->getTable() == 'users') Utils::debug($query);
$db = $this->getDb();
$this->pagerUrl->setParameter($this->getPagerKey(), '%d', false);
//Pager replaces "%d" with the page number
$this->pagerOptions['perPage'] = $pagesize;
$this->pagerOptions['currentPage'] = $page;
$this->pagerOptions['fileName'] = $this->pagerUrl->getUrl(false);
$res = Pager_Wrapper_MDB2($db, $query, $this->pagerOptions, $pagesize == 0);
if ($db->isError($res)) {
throw new Exception($res->getDebugInfo());
}
// do postprocessing
foreach ($res['data'] as &$item) {
if (!$item) {
continue;
}
$item['formatName'] = $this->formatName($item);
$item = $this->handlePostGetList($item);
}
return $res;
}
示例15: reporteCitas
/**
*
*/
function reporteCitas()
{
global $db;
// Database connection
$odbconn = MDB2::connect($db['dsn'], $db['opts']);
$odbconn->setFetchMode(MDB2_FETCHMODE_ASSOC);
$sql = "SELECT p.nombre1,p.nombre2,p.apellido1,p.apellido2,p.numero_documento,c.fecha,c.hora,c.id,c.estado,\n p.direccion, p.telefono, p.tipo_identificacion\n FROM paciente p,cita c\n WHERE c.id_paciente = p.id\n AND c.id_medico = '14'\n AND c.fecha BETWEEN '" . toYMD($_REQUEST['fecha_inicial']) . "' AND '" . toDMY($_REQUEST['fecha_final']) . "'\n AND c.estado = '1'";
$pager_options = array('mode' => 'Sliding', 'perPage' => 15, 'delta' => 2, 'extraVars' => array('a' => $_REQUEST['a']));
$data = Pager_Wrapper_MDB2($odbconn, $sql, $pager_options);
// Mensaje a mostrar en el template
$msj = flashData();
// Muestra el template
include getTemplate('cita.reporte.php');
return;
}