本文整理汇总了PHP中TemplatePower::assign方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplatePower::assign方法的具体用法?PHP TemplatePower::assign怎么用?PHP TemplatePower::assign使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TemplatePower
的用法示例。
在下文中一共展示了TemplatePower::assign方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
}
示例2: 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;
}
示例3: makePlanetTooltip
function makePlanetTooltip($options, $actions, $actionName = 'missiontype')
{
global $lang;
if (!$options or !is_array($options)) {
return false;
}
$tp = new TemplatePower(PATH . TEMPLATE_DIR . TEMPLATE_NAME . "/planet_actions.tpl");
$tp->prepare();
switch ($options[type]) {
case "planet":
$tp->newBlock("planet");
break;
case "moon":
$tp->newBlock("moon");
break;
case "debris":
$tp->newBlock("debris");
break;
case "ally":
$tp->newBlock("ally");
break;
default:
return false;
break;
}
$actionName = $lang[$actionName];
foreach ($options as $k => $v) {
$tp->assign($k, $v);
}
if ($actions and is_array($actions)) {
foreach ($actions[id] as $k => $actionId) {
//echo $actionId . "<-- <br>";
$tp->newBlock($options[type] . "_actions");
$tp->assign("action_name", $actionName[$actionId]);
$tp->assign("action_link", $actions[alink][$k]);
}
}
$tool = $tp->getOutputContent();
$find = array('"', "'", "\n", "\r");
$rep = array('\\"', "\\'", "", "");
$tool = str_replace($find, $rep, $tool);
return $tool;
}
示例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: _extjs
private function _extjs()
{
G::LoadClass('serverConfiguration');
$oServerConf =& serverConf::getSingleton();
$oHeadPublisher =& headPublisher::getSingleton();
if ($oHeadPublisher->extJsInit === true) {
$header = $oHeadPublisher->getExtJsVariablesScript();
$styles = $oHeadPublisher->getExtJsStylesheets($this->cssFileName);
$body = $oHeadPublisher->getExtJsScripts();
//default
$templateFile = G::ExpandPath("skinEngine") . 'base' . PATH_SEP . 'extJsInitLoad.html';
//Custom skins
if (defined('PATH_CUSTOM_SKINS') && is_dir(PATH_CUSTOM_SKINS . $this->mainSkin)) {
$templateFile = PATH_CUSTOM_SKINS . $this->mainSkin . PATH_SEP . 'extJsInitLoad.html';
}
//Skin uxs - simplified
if (!isset($_SESSION['user_experience'])) {
$_SESSION['user_experience'] = 'NORMAL';
}
if ($_SESSION['user_experience'] != 'NORMAL') {
$templateFile = is_dir(PATH_CUSTOM_SKINS . 'uxs') ? PATH_CUSTOM_SKINS . 'simplified' . PATH_SEP . 'extJsInitLoad.html' : $templateFile;
}
} else {
$styles = "";
$header = $oHeadPublisher->getExtJsStylesheets($this->cssFileName);
$header .= $oHeadPublisher->includeExtJs();
$body = $oHeadPublisher->renderExtJs();
$templateFile = $this->layoutFile['dirname'] . PATH_SEP . $this->layoutFileExtjs['basename'];
}
$template = new TemplatePower($templateFile);
$template->prepare();
$template->assign('header', $header);
$template->assign('styles', $styles);
$template->assign('bodyTemplate', $body);
$doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
$meta = null;
$dirBody = null;
if (isset($_SERVER["HTTP_USER_AGENT"]) && preg_match("/^.*\\(.*MSIE (\\d+)\\..+\\).*\$/", $_SERVER["HTTP_USER_AGENT"], $arrayMatch)) {
$ie = intval($arrayMatch[1]);
$swTrident = preg_match("/^.*Trident.*\$/", $_SERVER["HTTP_USER_AGENT"]) ? 1 : 0;
//Trident only in IE8+
$sw = 1;
if (($ie == 7 && $swTrident == 1 || $ie == 8) && !preg_match("/^ux.+\$/", SYS_SKIN)) {
//IE8
$sw = 0;
}
if ($sw == 1) {
if ($ie == 10) {
$ie = 8;
}
$doctype = null;
$meta = "<meta http-equiv=\"X-UA-Compatible\" content=\"IE={$ie}\" />";
}
}
$serverConf =& serverConf::getSingleton();
if ($serverConf->isRtl(SYS_LANG)) {
$dirBody = "dir=\"RTL\"";
}
$template->assign("doctype", $doctype);
$template->assign("meta", $meta);
$template->assign("dirBody", $dirBody);
echo $template->getOutputContent();
}
示例6: BaseDatos
session_start();
include "inc.includes.php";
$db = new BaseDatos($config['dbhost'], $config['dbuser'], $config['dbpass'], $config['db']);
$tpl = new TemplatePower("templates/index.html");
$tpl->prepare();
$tpl->gotoBlock("_ROOT");
//isset determina si una variable esta definida o es null
//$_REQUEST tiene el contenido de get y post
if (!isset($_REQUEST["action"]) || $_REQUEST["action"] == "") {
$tpl->newBlock("contenido");
$mhotels = new MHotels();
$result = $mhotels->allhoteles();
if ($result['found']) {
foreach ($result['result'] as $r) {
$tpl->newblock("hotels");
$tpl->assign("idHotel", $r['id_hotel']);
$tpl->assign("name", $r['nom_hotel']);
$tpl->assign("prov", $r['provincia']);
$tpl->assign("local", $r['localidad']);
$tpl->assign("calle", $r['calle']);
$tpl->assign("ncalle", $r['nro_calle']);
$tpl->assign("tel", $r['telefono']);
$tpl->assign("precio", $r['precio_persona']);
}
} else {
$tpl->newblock("no_hotels");
}
$webapp = $tpl->getOutputContent();
} else {
if (!strpos($_REQUEST["action"], "::")) {
$_REQUEST["action"] .= "::main";
示例7: TemplatePower
<?php
//llamamos al constructor de la plantilla y la preparamos para ser mostrada
$tplCitaRealizar = new TemplatePower("plantilla/cita_realizar.html");
$tplCitaRealizar->prepare();
$citaId = addslashes($_GET['id']);
$query = "SELECT pacientes.nombre_pac, pacientes.historia, citas.fecha, citas.hora, usuarios.nombre \r\n FROM pacientes, citas\r\n LEFT JOIN usuarios\r\n ON citas.responsable=usuarios.usuario\r\n WHERE citas.id_cita='{$citaId}'\r\n AND citas.mascota=pacientes.id_pac";
$rec = mysql_query($query);
$datosCita = mysql_fetch_assoc($rec);
//si no hay datos de la cita indicada lo envio a index
if (!$datosCita) {
echo "NO EXISTEN CITAS";
exit;
header("Location: /gicorec/index.php");
exit;
}
$tplCitaRealizar->assign("nombre_mascota", $datosCita['nombre_pac']);
$tplCitaRealizar->assign("historia", $datosCita['historia']);
$tplCitaRealizar->assign("fecha", $datosCita['fecha']);
$tplCitaRealizar->assign("hora", $datosCita['hora']);
$tplCitaRealizar->assign("vet_responsable", $datosCita['nombre']);
$tplCitaRealizar->assign("id_cita", $citaId);
//imprimimos por pantalla
$tplIndex->assign("contenido", $tplCitaRealizar->getOutputContent());
示例8: TemplatePower
}
$oTemplatePower = new TemplatePower($fileGetStart);
$oTemplatePower->prepare();
/*
$oTemplatePower->newBlock('users');
$oTemplatePower->assign('USR_UID', $aUser['USR_UID']);
$oTemplatePower->assign('USR_FULLNAME', $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')');
*/
$userName = 'admin';
$userPass = "The password introduced at the time of installing the application. (If you did not change the password by default is {$userName})";
if (isset($_SESSION['NW_PASSWORD'])) {
if ($_SESSION['NW_PASSWORD'] != '') {
$userPass = $_SESSION['NW_PASSWORD'];
}
}
require_once 'classes/model/Users.php';
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
$oCriteria->add(UsersPeer::USR_UID, '00000000000000000000000000000001', Criteria::IN);
$oDataset = UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$aData = array();
if ($oDataset->next()) {
$aData = $oDataset->getRow();
$userName = $aData['USR_USERNAME'];
}
$oTemplatePower->assign("URL_MABORAK_JS", G::browserCacheFilesUrl("/js/maborak/core/maborak.js"));
$oTemplatePower->assign("name", $userName);
$oTemplatePower->assign("pass", $userPass);
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
G::RenderPage('publish', 'raw');
示例9: createPropelClasses
/**
* DEPRECATED createPropelClasses()
*
* Don't use this method, it was left only for backward compatibility
* for some external plugins that still is using it
*/
public function createPropelClasses($sTableName, $sClassName, $aFields, $sAddTabUid, $connection = 'workflow')
{
try {
/* $aUID = array('FLD_NAME' => 'PM_UNIQUE_ID',
'FLD_TYPE' => 'INT',
'FLD_KEY' => 'on',
'FLD_SIZE' => '11',
'FLD_NULL' => '',
'FLD_AUTO_INCREMENT' => 'on');
array_unshift($aFields, $aUID); */
$aTypes = array(
'VARCHAR' => 'string',
'TEXT' => 'string',
'DATE' => 'int',
'INT' => 'int',
'FLOAT' => 'double'
);
$aCreoleTypes = array(
'VARCHAR' => 'VARCHAR',
'TEXT' => 'LONGVARCHAR',
'DATE' => 'TIMESTAMP',
'INT' => 'INTEGER',
'FLOAT' => 'DOUBLE'
);
if ($sClassName == '') {
$sClassName = $this->getPHPName($sTableName);
}
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
if (!file_exists($sPath)) {
G::mk_dir($sPath);
}
if (!file_exists($sPath . 'map')) {
G::mk_dir($sPath . 'map');
}
if (!file_exists($sPath . 'om')) {
G::mk_dir($sPath . 'om');
}
$aData = array();
$aData['pathClasses'] = substr(PATH_DB, 0, -1);
$aData['tableName'] = $sTableName;
$aData['className'] = $sClassName;
$aData['connection'] = $connection;
$aData['GUID'] = $sAddTabUid;
$aData['firstColumn'] = isset($aFields[0])
? strtoupper($aFields[0]['FLD_NAME'])
: ($aFields[1]['FLD_NAME']);
$aData['totalColumns'] = count($aFields);
$aData['useIdGenerator'] = 'false';
$oTP1 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'Table.tpl');
$oTP1->prepare();
$oTP1->assignGlobal($aData);
file_put_contents($sPath . $sClassName . '.php', $oTP1->getOutputContent());
$oTP2 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'TablePeer.tpl');
$oTP2->prepare();
$oTP2->assignGlobal($aData);
file_put_contents($sPath . $sClassName . 'Peer.php', $oTP2->getOutputContent());
$aColumns = array();
$aPKs = array();
$aNotPKs = array();
$i = 0;
foreach ($aFields as $iKey => $aField) {
$aField['FLD_NAME'] = strtoupper($aField['FLD_NAME']);
if ($aField['FLD_TYPE'] == 'DATE') {
$aField['FLD_NULL'] = '';
}
$aColumn = array(
'name' => $aField['FLD_NAME'],
'phpName' => $this->getPHPName($aField['FLD_NAME']),
'type' => $aTypes[$aField['FLD_TYPE']],
'creoleType' => $aCreoleTypes[$aField['FLD_TYPE']],
'notNull' => ($aField['FLD_NULL'] == 'on' ? 'true' : 'false'),
'size' => (($aField['FLD_TYPE'] == 'VARCHAR')
|| ($aField['FLD_TYPE'] == 'INT')
|| ($aField['FLD_TYPE'] == 'FLOAT') ? $aField['FLD_SIZE'] : 'null'),
'var' => strtolower($aField['FLD_NAME']),
'attribute' => (($aField['FLD_TYPE'] == 'VARCHAR')
|| ($aField['FLD_TYPE'] == 'TEXT')
|| ($aField['FLD_TYPE'] == 'DATE')
? '$' . strtolower($aField['FLD_NAME']) . " = ''"
: '$' . strtolower($aField['FLD_NAME']) . ' = 0'),
'index' => $i,
);
if ($aField['FLD_TYPE'] == 'DATE') {
$aColumn['getFunction'] = '/**
* Get the [optionally formatted] [' . $aColumn['var'] . '] column value.
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the integer unix timestamp will be returned.
* @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
* @throws PropelException - if unable to convert the date/time to timestamp.
*/
public function get' . $aColumn['phpName'] . '($format = "Y-m-d")
//.........这里部分代码省略.........
示例10: TemplatePower
<?php
$content = new TemplatePower("template/files/login.tpl");
$content->prepare();
if (isset($_SESSION['accountid'])) {
// is al ingelogd, dus niks doen
$content->newBlock("MELDING");
$content->assign("MELDING", "Je bent al ingelogd");
} else {
if (!empty($_POST['gnaam']) and !empty($_POST['password'])) {
// formulier is verstuurd
$check_user = $db->prepare("SELECT count(*) FROM accounts a, users u\n WHERE a.Users_idUsers = u.idUsers\n AND a.Username = :username\n AND a.Password = :password");
$check_user->bindParam(":username", $_POST['gnaam']);
$password = sha1($_POST['password']);
$check_user->bindParam(":password", $password);
$check_user->execute();
if ($check_user->fetchColumn() == 1) {
// gebruiker gevonden
$get_user = $db->prepare("SELECT a.*, u.* FROM accounts a, users u\n WHERE a.Users_idUsers = u.idUsers\n AND a.Username = :username\n AND a.Password = :password");
$get_user->bindParam(":username", $_POST['gnaam']);
$get_user->bindParam(":password", $password);
$get_user->execute();
$user = $get_user->fetch(PDO::FETCH_ASSOC);
$_SESSION['accountid'] = $user['idAccounts'];
$_SESSION['username'] = $user['Username'];
$_SESSION['roleid'] = $user['Role_idRole'];
$content->newBlock("MELDING");
$content->assign("MELDING", "Je bent ingelogd");
} else {
// gebruiker niet gevonden: combinatie username + password klopt niet
$errors->newBlock("ERRORS");
示例11: TemplatePower
<?php
$tpl = new TemplatePower('template/eventos/consultaEventos.tpl');
$tpl->prepare();
foreach ($_POST as $nombre_campo => $valor) {
$asignacion = '$' . $nombre_campo . '=\'' . $valor . '\';';
if (!is_numeric($nombre_campo)) {
eval($asignacion);
}
}
$eventos = new Eventos($conn);
$lista_eventos = $eventos->listaEventos();
foreach ($lista_eventos as $evento) {
$tpl->newBlock("eventos");
$tpl->assign("nombre", $evento['nombre']);
$tpl->assign("f_inicio", $evento['f_inicio']);
$tpl->assign("f_fin", $evento['f_fin']);
$tpl->assign("logotipo", $evento['logotipo']);
$tpl->assign("descripcion", $evento['descripcion']);
$tpl->assign("id", $evento['id']);
$tpl->gotoBlock("_ROOT");
}
//$tpl->assign('anterior', $anterior);
//$tpl->assign('siguiente', $siguiente);
$tpl->printToScreen();
?>
示例12: mysqli
$tpl->prepare();
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "grid_imo";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM news";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while ($row = $result->fetch_assoc()) {
$tpl->newBlock("News");
$title = $row["title"];
$news_content = $row["text"];
$tpl->assign("news_title", "{$title}");
$tpl->assign("news_content", "{$news_content}");
$tpl->gotoBlock("_ROOT");
}
} else {
$tpl->newBlock("News");
$tpl->assign("news_title", "Geen nieuws beschikbaar.");
$tpl->assign("news_content", "Er is op dit moment geen nieuws aanwezig.");
$tpl->gotoBlock("_ROOT");
}
$tpl->printToScreen();
$conn->close();
示例13: empty
$system = 1;
}
if ($system > MAX_SYSTEM_IN_GALAXY) {
$system = MAX_SYSTEM_IN_GALAXY;
}
}
$position[galaxy] = empty($galaxy) ? $planetrow['galaxy'] : $galaxy;
$position[system] = empty($system) ? $planetrow['system'] : $system;
$position[planet] = empty($planet) ? $planetrow['planet'] : $planet;
$position[planet_type] = empty($planet_type) ? $planetrow['planet_type'] : $planet_type;
$tp = new TemplatePower($ugamela_root_path . TEMPLATE_DIR . TEMPLATE_NAME . "/galaxy_body_new.tpl");
$tp->prepare();
// MOVEMENT BLOCK
$tp->newBlock("movement");
foreach ($position as $name => $trans) {
$tp->assign($name, $trans);
}
// SHORT DEFINITION
$g = $position[galaxy];
$s = $position[system];
// GALAXY TABLE BLOCK
// PREPARE THE $galaxy:$system
$lang['Solar_system_at'] = $lang['Solar_system'] . " " . $g . ":" . $s;
// PLANET INFORMATION
$sql = "SELECT \r\n\t\t\t\tl.temp_min, l.diameter, l.name as moon_name,\r\n\t\t\t\tg.*, g.metal as debris_metal, g.crystal as debris_crystal, g.planet as planetpos,\r\n\t\t\t\tp.*, p.name as planet_name,\r\n\t\t\t\tu.*,\r\n\t\t\t\ts.total_points, s.total_rank,\r\n\t\t\t\ta.ally_tag, a.ally_name, a.ally_web, a.ally_members\r\n\t\t\tFROM {{table}}planets as p\r\n\t\t\t\t\r\n\t\t\t\tLEFT JOIN {{table}}galaxy as g ON g.id_planet = p.id\r\n\t\t\t\tLEFT JOIN {{table}}users as u ON u.id = p.id_owner\r\n\t\t\t\tLEFT JOIN {{table}}alliance as a ON a.id = u.ally_id\r\n\t\t\t\tLEFT JOIN {{table}}planets as l ON l.id = g.id_luna AND l.planet_type = 3\r\n\t\t\t\tLEFT JOIN {{table}}statpoints as s ON s.id_owner = u.id AND stat_type = 1 AND stat_code = 1 \r\n\t\t\t\t\r\n\t\t\tWHERE \r\n\t\t\t\t\tg.galaxy = {$g} \r\n\t\t\t\tAND g.system = {$s} \r\n\t\t\tORDER BY g.planet ASC";
$rs = doquery($sql, '');
if ($temprow = mysql_fetch_assoc($rs)) {
do {
$planetsrow[$temprow[planetpos]] = $temprow;
} while ($temprow = mysql_fetch_assoc($rs));
}
示例14: TemplatePower
<?php
/* $Id: host_view.php 1831 2008-09-26 12:18:54Z carenas $ */
$tpl = new TemplatePower(template("host_view.tpl"));
$tpl->assignInclude("extra", template("host_extra.tpl"));
$tpl->prepare();
$tpl->assign("cluster", $clustername);
$tpl->assign("host", $hostname);
$tpl->assign("node_image", node_image($metrics));
$tpl->assign("sort", $sort);
$tpl->assign("range", $range);
if ($hosts_up) {
$tpl->assign("node_msg", "This host is up and running.");
} else {
$tpl->assign("node_msg", "This host is down.");
}
$cluster_url = rawurlencode($clustername);
$tpl->assign("cluster_url", $cluster_url);
$tpl->assign("graphargs", "h={$hostname}&{$get_metric_string}&st={$cluster['LOCALTIME']}");
# For the node view link.
$tpl->assign("node_view", "./?p=2&c={$cluster_url}&h={$hostname}");
# No reason to go on if this node is down.
if ($hosts_down) {
$tpl->printToScreen();
return;
}
$tpl->assign("ip", $hosts_up['IP']);
$tpl->newBlock('columns_dropdown');
$tpl->assign("metric_cols_menu", $metric_cols_menu);
$g_metrics_group = array();
foreach ($metrics as $name => $v) {
示例15: TemplatePower
<?php
//Ver. 1.1 Ago-13
$tpl = new TemplatePower('template/eventos/formaEventos.tpl');
$tpl->prepare();
$eventos = new Eventos($conn);
if (!empty($_GET['id_evento'])) {
$id_evento = $_GET['id_evento'];
} else {
$id_evento = '';
}
if ($id_evento != '') {
//Editar
$tpl->assign("titulo", "Edita evento");
$eventos->setID($id_evento);
$datos_evento = $eventos->eventoByid();
$tpl->assign("nombrevento", $datos_evento['nombre']);
$tpl->assign("descripcion", $datos_evento['descripcion']);
$tpl->assign("f_ini", $datos_evento['f_inicio']);
$tpl->assign("f_fin", $datos_evento['f_fin']);
$tpl->assign("id", $id_evento);
} else {
//Nuevo
$tpl->assign("titulo", "Alta evento");
}
$tpl->printToScreen();