本文整理汇总了PHP中TemplatePower::gotoBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplatePower::gotoBlock方法的具体用法?PHP TemplatePower::gotoBlock怎么用?PHP TemplatePower::gotoBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TemplatePower
的用法示例。
在下文中一共展示了TemplatePower::gotoBlock方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registrar
public function registrar()
{
$proteccion = new Proteccion();
$nombre = $proteccion->html($_POST['nombre']);
$apellido = $proteccion->html($_POST['apellido']);
$sexo = $proteccion->html($_POST['sexo']);
$fecha_nacimiento = $proteccion->html($_POST['fecha_nacimiento']);
$direccion = $proteccion->html($_POST['direccion']);
$email = $proteccion->html($_POST['email']);
$dni = $proteccion->html($_POST['dni']);
$pass = $proteccion->html($_POST['password']);
$persona = new Usuario($email, $pass);
$existe = $persona->existe();
if ($existe) {
$tp = new TemplatePower("templates/registro.html");
$tp->prepare();
$tp->gotoBlock("_ROOT");
$tp->newblock("no_registro");
$tp->assign("usuario", $email);
$webapp = $tp->getOutputContent();
} else {
$persona->setDatosUsuario($nombre, $apellido, $sexo, $fecha_nacimiento, $direccion, $dni);
$persona->insertar();
$_SESSION['user'] = $email;
$tp = new TemplatePower("templates/index.html");
$tp->prepare();
$tp->gotoBlock("_ROOT");
$tp->newBlock("sesion");
$tp->assign("usuario", $_SESSION['user']);
$webapp = $tp->getOutputContent();
}
echo $webapp;
}
示例2: consultarReserva
public function consultarReserva()
{
$proteccion = new Proteccion();
$cod_reserva = $proteccion->html($_POST['cod_reserva']);
$reserva = new Reserva();
$result = $reserva->BuscarReserva($cod_reserva);
foreach ($result['result'] as $r) {
$cod_reserva = $r['cod_reserva'];
}
$nom_hotel = $r['nom_hotel'];
$nombre = $r['nombre'];
$apellido = $r['apellido'];
$email = $r['email'];
$fec_llegada = $r['fec_llegada'];
$fec_salida = $r['fec_salida'];
$fec_reserva = $r['fec_reserva'];
$piso = $r['piso'];
$ubicacion = $r['ubicacion'];
$tp = new TemplatePower("templates/reserva.html");
$tp->prepare();
$tp->gotoBlock("_ROOT");
$tp->newBlock("generarreserva");
$tp->assign("cod_reserva", $cod_reserva);
$tp->assign("nom_hotel", $nom_hotel);
$tp->assign("nombre", $nombre);
$tp->assign("apellido", $apellido);
$tp->assign("email", $email);
$tp->assign("fec_llegada", $fec_llegada);
$tp->assign("fec_salida", $fec_salida);
$tp->assign("fec_reserva", $fec_reserva);
$tp->assign("piso", $piso);
$tp->assign("ubicacion", $ubicacion);
echo $tp->getOutputContent();
}
示例3: hotel
function hotel($idHotel)
{
$mhotels = new MHotels();
$result = $mhotels->buscar_id($idHotel);
foreach ($result['result'] as $r) {
$nombreHotel = $r['nom_hotel'];
$prov = $r['provincia'];
$local = $r['localidad'];
$calle = $r['calle'];
$ncalle = $r['nro_calle'];
$tel = $r['telefono'];
$precio = $r['precio_persona'];
$cant_imagenes = $r['cant_imagenes'];
$descripcion = $r['descripcion'];
}
$tp = new TemplatePower("templates/hotel.html");
$tp->prepare();
$tp->gotoBlock("_ROOT");
$tp->assign("nombre", $nombreHotel);
for ($i = 1; $i <= $cant_imagenes; $i++) {
$tp->newBlock("imagenes");
$tp->assign("nombre", $nombreHotel);
$tp->assign("numero", $i);
}
$tp->gotoBlock("_ROOT");
$tp->assign("descripcion", $descripcion);
$tp->assign("prov", $prov);
$tp->assign("local", $local);
$tp->assign("calle", $calle);
$tp->assign("ncalle", $ncalle);
$tp->assign("tel", $tel);
$tp->assign("precio", $precio);
if (isset($_SESSION['user'])) {
$tp->newBlock("reservar");
$tp->assign("idHotel", $idHotel);
}
if (!isset($_SESSION['user'])) {
$tp->newBlock("iniciarSesion");
}
echo $tp->getOutputContent();
}
示例4: savePluginFile
function savePluginFile($tplName, $fileName, $fields)
{
$pluginTpl = PATH_GULLIVER_HOME . 'bin' . PATH_SEP . 'tasks' . PATH_SEP . 'templates' . PATH_SEP . $tplName . '.tpl';
$template = new TemplatePower($pluginTpl);
$template->prepare();
if (is_array($fields)) {
foreach ($fields as $block => $data) {
$template->gotoBlock("_ROOT");
if (is_array($data)) {
foreach ($data as $rowId => $row) {
$template->newBlock($block);
foreach ($row as $key => $val) {
$template->assign($key, $val);
}
}
} else {
$template->assign($block, $data);
}
}
}
$content = $template->getOutputContent();
$iSize = file_put_contents($fileName, $content);
return $iSize;
}
示例5: foreach
$oTemplatePower->assign('USR_UID', $aUser['USR_UID']);
$oTemplatePower->assign('USR_FULLNAME', $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')');
}
}
}
$aAux1 = $oTasks->getUsersOfTask($aRow['TAS_UID'], 1);
foreach ($aAux1 as $aUser) {
if (!in_array($aUser['USR_UID'], $aUsers)) {
$aUsers[] = $aUser['USR_UID'];
$aData = $oUser->load($aUser['USR_UID']);
$oTemplatePower->newBlock('users');
$oTemplatePower->assign('USR_UID', $aUser['USR_UID']);
$oTemplatePower->assign('USR_FULLNAME', $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')');
}
}
$oTemplatePower->gotoBlock('cases');
$oTemplatePower->assign('ID_STATUS', G::LoadTranslation('ID_TO_DO'));
$oTemplatePower->assign('ID_NO_REASSIGN', G::LoadTranslation('ID_NO_REASSIGN'));
$oDataset->next();
}
$oDataset = ApplicationPeer::doSelectRS($oCriteriaDraft);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$c++;
$oTemplatePower->newBlock('cases');
$aKeys = array_keys($aRow);
foreach ($aKeys as $sKey) {
$oTemplatePower->assign($sKey, $aRow[$sKey]);
}
$aUsers = array($_GET['USR_UID']);
示例6: foreach
}
if (is_array($value)) {
foreach ($value as $key1 => $value1) {
if (is_array($value1)) {
foreach ($value1 as $key2 => $value2) {
if (isset($form) && isset($form->fields[$key]->fields[$key2])) {
$label = $form->fields[$key]->fields[$key2]->label . ' (' . $key . '[' . $key1 . '][' . $key2 . '])';
} else {
$label = $key . '[' . $key1 . ']' . '[' . $key2 . ']';
}
$tpl->newBlock("FIELDLOG");
$tpl->assign("fieldName", $label);
$tpl->assign("previous", isset($historyData[$tableNameA][$key][$key1][$key2]) ? $historyData[$tableNameA][$key][$key1][$key2] : "");
$tpl->assign("actual", $value2);
$count++;
}
}
}
}
}
$tpl->gotoBlock("DYNLOG");
$tpl->assign("dynChanges", G::LoadTranslation("ID_FIELDS_CHANGED_NUMBER") . " (" . $count . ")");
$tpl->assign("count", $count + 1);
}
if (!isset($changedValues)) {
$tpl->newBlock("NORESULTS");
$tpl->assign("noResults", G::LoadTranslation("ID_NO_RECORDS_FOUND"));
}
$_SESSION['HISTORY_DATA'] = $historyData;
$tpl->gotoBlock("_ROOT");
$tpl->printToScreen();
示例7: TemplatePower
//Name: index.php
//Function: code for converting the chart data and seeding the html
//Last Modified: 10-02-2016
//By: Arno Inen
//General Modification: debugging
//Requires:
//-TemplatePower
//-Canvas.js
//Includes/requires
include_once 'class.TemplatePower.inc.php';
//Call template engine
$template_url = "./templates/";
$template = new TemplatePower($template_url . "chart.html");
$template->prepare();
//Functions
////Main Code
$json = file_get_contents('http://www.mixtup.nl/dev/techradar/data.json');
$data_array = json_decode($json);
$counter = 0;
//var_dump($data_array);
$totalObjects = count($data_array);
while ($counter < $totalObjects - 1) {
$template->newBlock("data_row");
$template->assign("date", $data_array[$counter]->{'x'});
$template->assign("ycoord", $data_array[$counter]->{'y'});
$counter++;
}
$template->gotoBlock("_ROOT");
$template->assign("finaldate", $data_array[$counter]->{'x'});
$template->assign("finalycoord", $data_array[$counter]->{'y'});
$template->printToScreen();
示例8:
include_once 'propietarios.php';
$tplIndex->newBlock("menu_principal_link");
break;
case 'recuperar_clave':
include_once 'recuperar_clave.php';
break;
case 'casos':
include_once 'casos.php';
$tplIndex->newBlock("menu_principal_link");
break;
case 'nuevo_usuario':
include_once 'nuevo_usuario.php';
$tplIndex->newBlock("menu_principal_link");
break;
default:
if ($_SESSION['logueado'] == 1) {
include_once 'principal.php';
$class_inferior = "center";
} else {
include_once 'login.php';
}
break;
}
$tplIndex->gotoBlock(TP_ROOTBLOCK);
$tplIndex->assign("menu_inferior_class", $class_inferior);
if ($_SESSION['logueado'] == 1) {
$tplIndex->newBlock("log_out");
}
}
//imprimimos por pantalla
$tplIndex->printToScreen();
示例9: bajau
public function bajau($email)
{
global $db;
$tp = new TemplatePower("templates/BajaUsuario.html");
$tp->prepare();
$tp->gotoBlock("_ROOT");
$sql = "delete from usuario where(email='{$email}')";
$db->ejecutar($sql);
$tp->newBlock("mensaje");
echo $tp->getOutputContent();
}
示例10: searchText
function searchText($searchText)
{
global $_SESSION;
global $RBAC;
$curAuthSource = $_SESSION['CURRENT_AUTH_SOURCE'];
$dbc = new DBConnection(DB_HOST, DB_RBAC_USER, DB_RBAC_PASS, DB_RBAC_NAME);
$tpl = new TemplatePower(PATH_TPL . 'authListUsers.html');
$tpl->prepare();
$tpl->assign("STYLE_CSS", defined('STYLE_CSS') ? STYLE_CSS : 'simple');
$tpl->assign("title", 'Search Results');
//authentication source
G::LoadClassRBAC('authentication');
$obj = new authenticationSource();
$obj->SetTo($dbc);
$data = $obj->searchUsers($curAuthSource, $searchText);
if ($data['codError'] == 0 && isset($data['rows']) && !is_array($data['rows'])) {
$tpl->newBlock("empty-rows");
$tpl->assign("title", 'Search Results');
$tpl->assign("empty-rows-text", 'no records found');
$tpl->printToScreen();
die;
}
if ($data['codError'] != 0) {
$tpl->newBlock("error");
$tpl->assign("title", 'Log Error');
$tpl->assign("text", "<font color='Red'>" . $data['rows'] . "</font>");
$tpl->printToScreen();
die;
}
//build the options to create...an user, list the applications and their roles..
$ses = new DBSession($dbc);
$ses2 = new DBSession($dbc);
$dset = $ses->execute("SELECT * from APPLICATION where APP_CODE != 'RBAC' ");
$appRow = $dset->Read();
$checkboxs = "<br><input type='checkbox' @@disabled name='C-@@Y' id='C-@@Y' onclick='emptyDropdowns( \"@@X\");' ><input type='hidden' name='H-@@Y' id='H-@@Y' value='@@X' ><input type='hidden' name='E-@@Y' id='E-@@Y' value='' >";
$inputs = "<div id='D-@@Y'>@@validuser</div><input type='text' name='T-@@Y' id='T-@@Y' value=\"@@Z\" onchange='verifyUserName ( this, \"@@Y\" );' size='14' maxlength='16'> ";
$options = "<table cellpadding='0' cellspacing='0'><tr>";
$options .= "";
while (is_array($appRow)) {
$appid = $appRow['UID'];
$selectId = 'S-@@Y-' . $appid;
$dset2 = $ses2->execute('SELECT * from ROLE where ROL_APPLICATION = ' . $appid);
$rolRow = $dset2->Read();
$selectEnabled = false;
if (is_array($rolRow)) {
$options .= '<td>' . $appRow['APP_CODE'] . '<br>';
$options .= "<select name='{$selectId}' id='{$selectId}' @@disabled onchange='flipCheckbox( \"@@Y\");' >\n";
$options .= "<option value='0'>select a Role</option>";
$selectEnabled = true;
}
while (is_array($rolRow)) {
$options .= "<option value='" . $rolRow['UID'] . "'>" . $rolRow['ROL_CODE'] . "</option>";
$rolRow = $dset2->Read();
}
if ($selectEnabled) {
$options .= "</select>\n<td>";
}
$appRow = $dset->Read();
}
$options .= '</tr></table>';
$i = 0;
if (isset($data['rows'])) {
foreach ($data['rows'] as $row) {
$tpl->newBlock("users");
if (++$i % 2 == 0) {
$tpl->assign("class", 'Row2');
} else {
$tpl->assign("class", 'Row1');
}
$tpl->assign("index", $i);
$tpl->assign("dn", $row['dn']);
$tpl->assign("name", $row['attr']['givenName']);
$tpl->assign("lastname", $row['attr']['sn']);
$tpl->assign("fullname", $row['attr']['cn']);
$tpl->assign("email", $row['attr']['mail']);
$tpl->assign("uid", $row['attr']['uid']);
//verificar uid
$userid = $row['attr']['uid'];
$res = $RBAC->UserNameRepetido(0, $userid);
$input = str_replace('@@Z', $userid, str_replace('@@X', $row['dn'], str_replace('@@Y', $i, $inputs)));
$input = str_replace('@@validuser', $res == 0 ? "<font color='green'>valid user</font>" : "<font color='red'>user already used</font>", $input);
$checkbox = str_replace('@@X', $row['dn'], str_replace('@@Y', $i, $checkboxs));
$checkbox = str_replace('@@disabled', $res != 0 ? 'disabled' : '', $checkbox);
$option = str_replace('@@X', $row['dn'], str_replace('@@Y', $i, $options));
// $option = str_replace ( '@@disabled', ( $res <> 0 ? 'disabled' : ''), $option );
$tpl->assign("checkbox", $checkbox);
$tpl->assign("input", $input);
$tpl->assign("options", $option);
}
}
$tpl->gotoBlock("_ROOT");
$tpl->newBlock("start-users");
$tpl->assign("dummy", 'dummy');
$tpl->gotoBlock("_ROOT");
$tpl->newBlock("end-users");
$tpl->assign("dummy", 'dummy');
$tpl->printToScreen();
}
示例11: TemplatePower
$displayMode = 'display:none';
}
$aParametersFun = $methodParameters;
$triggerWizardTemplate = PATH_TPL . 'triggers' . PATH_SEP . 'triggers_EditWizard.html';
$template = new TemplatePower($triggerWizardTemplate);
$template->prepare();
$tds = '';
$nrows = 2;
$template->assign('LIBRARY_NAME', $libraryName);
$template->assign('LIBRARY_DESCRIPTION', $libraryDescription);
$template->assign('LIBRARY_ICON', $libraryIcon);
$template->assign('LIBRARY_CLASS', $libraryClassName);
if ($methodLink != "") {
$template->newBlock('methodLink');
$template->assign('LIBRARY_METHOD_LINK', $methodLink);
$template->gotoBlock('_ROOT');
}
$template->assign('PMFUNTION', $sNameFun);
$template->assign('PMFUNTION_LABEL', $methodLabel);
$template->assign('PMFUNTION_DESCRIPTION', $methodDescription);
$template->assign('TITLE', G::LoadTranslation('ID_TITLE'));
$template->assign('TITLE_CONTENT', $_GET['TRI_TITLE']);
$template->assign('TRI_UID', $_GET['TRI_UID']);
$template->assign('STEP_UID', $_GET['STEP_UID']);
$template->assign('ST_TYPE', $_GET['ST_TYPE']);
$template->assign('SOURCE_LINK', G::LoadTranslation('ID_TRIGGER_SOURCE_LINK'));
$template->assign('DESCRIPTION', G::LoadTranslation('ID_DESCRIPTION'));
$template->assign('DESCRIPTION_CONTENT', $_GET['TRI_DESCRIPTION']);
$template->assign('DETAILS_LABEL', G::LoadTranslation('ID_DETAILS'));
$template->assign('RETURN_TITLE', G::LoadTranslation('ID_TRIGGER_RETURN_TITLE'));
if ($bReturnValue) {
示例12: elseif
$tplAlmacen->assign('nombre', $dato['nombre']);
$tplAlmacen->assign('tel', $dato['telefono']);
$tplAlmacen->assign('dir', $dato['direccion']);
$tplAlmacen->assign('mail', $dato['mail']);
$tplAlmacen->assign('id_prov', $dato['id_prov']);
}
}
} elseif ($_GET['action'] == 'edit_prod') {
//editar un campo de un producto concreto
//obtenemos el id del elemento que queremos editar y realizamos la consulta que nos mostrará los datos existentes
$id = $_GET['id'];
$query = "SELECT id_prod, referencia, almacen.nombre, cant_min, cant_pedir, proveedores.nombre AS proveedor, precio \r\n FROM almacen, proveedores \r\n WHERE id_prod='{$id}' \r\n AND almacen.id_prov=proveedores.id_prov";
$rec = mysql_query($query);
$dato = mysql_fetch_array($rec);
//creamos el bloque de edición y cargamos los datos
$tplAlmacen->gotoBlock(TP_ROOTBLOCK);
$tplAlmacen->newBlock('edit_prod');
$tplAlmacen->assign('prod_ref', $dato['referencia']);
$tplAlmacen->assign('prod_nombre', $dato['nombre']);
$tplAlmacen->assign('prod_cant_min', $dato['cant_min']);
$tplAlmacen->assign('prod_cant_pedir', $dato['cant_pedir']);
$tplAlmacen->assign('prod_prov', $dato['proveedor']);
$tplAlmacen->assign('prod_precio', $dato['precio']);
$tplAlmacen->assign('prod_id', $dato['id_prod']);
} elseif ($_GET['action'] == 'edit_prov') {
$id = $_GET['id'];
$query = "SELECT id_prov, nombre, telefono, mail, direccion\r\n FROM proveedores \r\n WHERE id_prov='{$id}'";
$rec = mysql_query($query);
$dato = mysql_fetch_array($rec);
$tplAlmacen->gotoBlock(TP_ROOTBLOCK);
$tplAlmacen->newBlock('edit_prov');
示例13: createPropelClasses
//.........这里部分代码省略.........
$this->' . $aColumn['var'] . ' = $v;
$this->modifiedColumns[] = ' . $aData['className'] . 'Peer::' . $aColumn['name'] . ';
}';
break;
case 'FLOAT':
$aColumn['setFunction'] = 'if ($this->' . $aColumn['var'] . ' !== $v || $v === 0) {
$this->' . $aColumn['var'] . ' = $v;
$this->modifiedColumns[] = ' . $aData['className'] . 'Peer::' . $aColumn['name'] . ';
}';
break;
}
$aColumns[] = $aColumn;
if ($aField['FLD_KEY'] == 1 || $aField['FLD_KEY'] === 'on') {
$aPKs[] = $aColumn;
} else {
$aNotPKs[] = $aColumn;
}
if ($aField['FLD_AUTO_INCREMENT'] == 1 || $aField['FLD_AUTO_INCREMENT'] === 'on') {
$aData['useIdGenerator'] = 'true';
}
$i++;
}
$oTP3 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'map'
. PATH_SEP . 'TableMapBuilder.tpl');
$oTP3->prepare();
$oTP3->assignGlobal($aData);
foreach ($aPKs as $iIndex => $aColumn) {
$oTP3->newBlock('primaryKeys');
$aKeys = array_keys($aColumn);
foreach ($aKeys as $sKey) {
$oTP3->assign($sKey, $aColumn[$sKey]);
}
}
$oTP3->gotoBlock('_ROOT');
foreach ($aNotPKs as $iIndex => $aColumn) {
$oTP3->newBlock('columnsWhitoutKeys');
$aKeys = array_keys($aColumn);
foreach ($aKeys as $sKey) {
$oTP3->assign($sKey, $aColumn[$sKey]);
}
}
file_put_contents($sPath . PATH_SEP . 'map' . PATH_SEP . $sClassName
. 'MapBuilder.php', $oTP3->getOutputContent());
$oTP4 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'om' . PATH_SEP . 'BaseTable.tpl');
$oTP4->prepare();
switch (count($aPKs)) {
case 0:
$aData['getPrimaryKeyFunction'] = 'return null;';
$aData['setPrimaryKeyFunction'] = '';
break;
case 1:
$aData['getPrimaryKeyFunction'] = 'return $this->get' . $aPKs[0]['phpName'] . '();';
$aData['setPrimaryKeyFunction'] = '$this->set' . $aPKs[0]['phpName'] . '($key);';
break;
default:
$aData['getPrimaryKeyFunction'] = '$pks = array();' . "\n";
$aData['setPrimaryKeyFunction'] = '';
foreach ($aPKs as $iIndex => $aColumn) {
$aData['getPrimaryKeyFunction'] .= '$pks[' . $iIndex . '] = $this->get'
. $aColumn['phpName'] . '();' . "\n";
$aData['setPrimaryKeyFunction'] .= '$this->set' . $aColumn['phpName']
. '($keys[' . $iIndex . ']);' . "\n";
}
$aData['getPrimaryKeyFunction'] .= 'return $pks;' . "\n";
break;
}
示例14: Productos
$producto = new Productos($conn);
$pedidos = new Pedido($conn);
if ($acc == 'add') {
$productos = $producto->ConsultaProductos();
foreach ($productos as $value) {
$tpl->newBlock('productos');
if ($value['activo'] == 1) {
$tpl->assign('nom_producto', $value['nombre']);
$tpl->assign('id_producto', $value['id']);
$tpl->assign('simbolo', $value['simbolo'] . ':' . $value['descripcion'] . ':' . $value['item']);
} else {
$tpl->assign('nom_producto', $value['nombre']);
$tpl->assign('id_producto', $value['id']);
$tpl->assign('dis', 'disabled');
}
$tpl->gotoBlock('_ROOT');
}
$tpl->assign('titulo', "Registro de Información");
$tpl->assign('activo', "checked");
$tpl->printToScreen();
}
if ($acc == 'edit') {
$producto2 = new Productos($conn);
$tpl->assign('titulo', "Editar Información");
$id = $_GET['id'];
$tpl->assign('id', $id);
$pedidos->setId($id);
$producto = $pedidos->consultaPedidoById();
$productos = $producto2->ConsultaProductos();
foreach ($productos as $value) {
$tpl->newBlock('productos');
示例15: while
//seleccionamos el listado de veterinarios para generar el listado a la hora de añadir una cita
$query = "SELECT usuario, nombre FROM usuarios";
$result = mysql_query($query);
while ($tArray = mysql_fetch_assoc($result)) {
$tplAgenda->newBlock("add_veterinario_option");
$tplAgenda->assign("vet_id", $tArray["usuario"]);
$tplAgenda->assign("vet_nombre", $tArray['nombre']);
}
$query = 'SELECT * FROM citas, pacientes
LEFT JOIN
propietarios
ON pacientes.dni_propietario=propietarios.dni
WHERE mascota=pacientes.id_pac
ORDER BY citas.fecha DESC';
$result = mysql_query($query);
$tplAgenda->gotoBlock(TP_ROOTBLOCK);
$tplAgenda->newBlock('lista');
if (mysql_error()) {
echo mysql_error();
} else {
while ($row = mysql_fetch_assoc($result)) {
//mostramos la fecha en formato dd-mm-yyyy y la hora en hh:mm
$fecha = new DateTime($row['fecha'] . " " . $row['hora']);
if ($row["estado"] == 'pendiente') {
$tplAgenda->newBlock('citas_pendientes_row');
$tplAgenda->assign('historia', $row['historia']);
$tplAgenda->assign('nombre', $row['nombre_pac']);
$tplAgenda->assign('especie', $row['especie']);
$tplAgenda->assign('propietario', $row['nombre']);
$tplAgenda->assign('telefono', $row['telefono']);
$tplAgenda->assign('fecha', $fecha->format("d-m-Y"));