当前位置: 首页>>代码示例>>PHP>>正文


PHP TemplatePower::newBlock方法代码示例

本文整理汇总了PHP中TemplatePower::newBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplatePower::newBlock方法的具体用法?PHP TemplatePower::newBlock怎么用?PHP TemplatePower::newBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TemplatePower的用法示例。


在下文中一共展示了TemplatePower::newBlock方法的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;
 }
开发者ID:TRexSoftware,项目名称:laboratorio_progIII,代码行数:33,代码来源:controller.Usuario.php

示例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();
 }
开发者ID:TRexSoftware,项目名称:laboratorio_progIII,代码行数:34,代码来源:controller.Reserva.php

示例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;
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:43,代码来源:galaxy-functions.php

示例4: 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();
 }
开发者ID:TRexSoftware,项目名称:laboratorio_progIII,代码行数:41,代码来源:controller.Hoteles.php

示例5: 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;
}
开发者ID:nshong,项目名称:processmaker,代码行数:24,代码来源:skinsExport.php

示例6:

    $action = NULL;
}
switch ($action) {
    case "toevoegen":
        if (!empty($_POST['username']) && !empty($_POST['Text'])) {
            // insert
            // insert
            $insert_comment = $db->prepare("INSERT INTO comments SET\n                  Username = :username,\n                  Text = :text,\n                  Accounts_idAccounts = :accountid");
            $insert_comment->bindParam(":username", $_POST['username']);
            $insert_comment->bindParam(":text", $_POST['Text']);
            $insert_comment->bindValue(":accountid", 4);
            $insert_comment->execute();
            $userid = $db->lastInsertId();
        } else {
            // formulier
            $content->newBlock("COMMENTFORM");
            $content->assign("ACTION", "index.php?pageid=10&action=toevoegen");
            $content->assign("BUTTON", "Toevoegen Comment");
        }
        break;
    case "wijzigen":
        if (isset($_POST['accountid'])) {
            $update_comment = $db->prepare("UPDATE comments\n                                          SET Text = :text\n                                          WHERE  idComments=:commentid");
            $update_comment->bindParam(":text", $_POST['Text']);
            $update_comment->bindParam(":commentid", $_POST['commentid']);
            $update_comment->execute();
            $content->newBlock("MELDING");
            $content->assign("MELDING", "comment is gewijzigd");
        } else {
            $get_comment = $db->prepare("SELECT comments.*, accounts.* FROM comments, accounts\n                                      WHERE idComments = :commentid\n                                      ");
            $get_comment->bindParam(":commentid", $_GET['commentid']);
开发者ID:Randellrc,项目名称:Portfolio-website,代码行数:31,代码来源:admin_comment.php

示例7: foreach

}
if ($id_codigo != '') {
    //Editar
    $tpl->assign("discodigo", "disabled='disabled'");
    $tpl->assign("id_codigo", $id_codigo);
    $objcodigo->setID($id_codigo);
    $codigo = $objcodigo->codigoByid();
    /*
    echo "<pre>";
        print_r($codigo);
    echo "</pre>";
    */
    $tpl->assign("pulsera", $codigo['codigo_pulsera']);
    $lista_eventos = $objeventos->listaEventos();
    foreach ($lista_eventos as $evento) {
        $tpl->newBlock("eventos");
        $tpl->assign("nombre", $evento['nombre']);
        $tpl->assign("id", $evento['id']);
        if ($evento['id'] == $codigo['id_evento']) {
            $tpl->assign("seleve", "selected='selected'");
        }
        $tpl->gotoBlock("_ROOT");
    }
    if ($codigo['tipo_entrada'] == 1) {
        $tpl->assign("atotal", "selected='selected'");
    } else {
        $tpl->assign("adias", "selected='selected'");
    }
    $tpl->assign("dias_valido", $codigo['dias_valido']);
    if ($codigo['id_asociado'] != '') {
        //Tiene un asociado
开发者ID:huicochea,项目名称:ciclodeideas,代码行数:31,代码来源:formCodigos.php

示例8: createPropelClasses


//.........这里部分代码省略.........
                        $aColumn['setFunction'] = '// Since the native PHP type for this column is integer,
   // we will cast the input value to an int (if it is not).
   if ($v !== null && !is_int($v) && is_numeric($v)) {
     $v = (int) $v;
   }
   if ($this->' . $aColumn['var'] . ' !== $v || $v === 1) {
     $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";
开发者ID:rrsc,项目名称:processmaker,代码行数:67,代码来源:AdditionalTables.php

示例9: 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");
开发者ID:Randellrc,项目名称:Portfolio-website,代码行数:31,代码来源:login.php

示例10: header

//primero comprobamos que el usuario NO este logeado, si esta logeado redirigimos a index.php
if (isset($_SESSION['logueado'])) {
    header("Location: index.php");
    exit;
}
if (isset($_GET['token'])) {
    $token = $_GET['token'];
    //en caso de que haya un token en la querystring gestionamos el proceso para nueva contraseña
    //debemos comprobar que el toquen sea valido, sino mostramos un mensaje de error
    $fecha = new DateTime(date("Y-m-d H:m:s"));
    $fecha->modify("-1 day");
    $query = "SELECT token, usuarios.usuario FROM usuarios_recuperar_clave, usuarios\n                WHERE token='{$token}' \n                AND fecha>'" . $fecha->format("Y-m-d H:m:s") . "'\n                AND usuarios_recuperar_clave.idusuario = usuarios.idusuario";
    $datos = mysql_fetch_assoc(mysql_query($query));
    if (!$datos) {
        //token invalido o no presente en la base de datos
        $tplClave->newBlock("errortoken");
        $tplClave->newBlock("generar_token");
    } else {
        //token valido
        $tplClave->newBlock("nueva_clave");
        //mostramos el usuario para el cual se va a asignar la nueva clave
        $tplClave->assign("user", $datos['usuario']);
        $tplClave->assign("token", $datos['token']);
    }
} else {
    //comprobamos si ha ocurrido un error durante la recepcion del formulario para generar el token
    if (isset($_GET['error'])) {
        $tplClave->newBlock("error" . $_GET['error']);
    }
    //si no hay token mostramos el html para que se pueda recuperar la contraseña
    $tplClave->newBlock("generar_token");
开发者ID:aremis1984,项目名称:gicorec,代码行数:31,代码来源:recuperar_clave.php

示例11: 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();
开发者ID:Welck,项目名称:techradar,代码行数:31,代码来源:chartdata.php

示例12: TemplatePower

<?php

$errors = new TemplatePower('../html/errors.tpl');
$errors->prepare();
try {
    $db = new PDO('mysql:host=localhost;dbname=mydb;charset=utf8', 'root', '');
    $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $error) {
    //print "er is een error: ".$error->getFile()." ".$error->getLine();
    $errors->newBlock("ERRORS");
    $errors->assign("ERROR", "er is een error: " . $error->getFile() . " " . $error->getLine());
}
开发者ID:abdulkadirekici,项目名称:Project-PHP-website,代码行数:13,代码来源:database.php

示例13: TemplatePower

<?php

//llamamos al contructor de la plantilla y la preparamos para mostrar
$tplPacientes = new TemplatePower("plantilla/pacientes.html");
$tplPacientes->prepare();
//creamos el mensaje a mostrar en función de la acción realizada
$tplPacientes->assign("titulo", "Pacientes");
if (isset($_GET['msg'])) {
    $tplPacientes->newBlock('notificacion_ok');
    switch ($_GET['msg']) {
        case 'pac_add':
            $msg = 'Paciente añadido con éxito';
            break;
        case 'pac_del':
            $msg = 'Paciente eliminado con éxito';
            break;
        case 'pac_edit':
            $msg = 'Paciente editado con éxito';
            break;
        case 'pac_noedit':
            $msg = 'No se ha modificado nigún campo';
            break;
        default:
            $msg = '';
            break;
    }
    $tplPacientes->assign("msg", $msg);
}
if (isset($_POST) && isset($_POST['buscar'])) {
    //gestionamos el buscar
    $query = "SELECT DISTINCT * FROM pacientes \r\n        WHERE historia LIKE '%" . $_POST['buscar'] . "%'\r\n        OR nombre_pac LIKE '%" . $_POST['buscar'] . "%'\r\n        OR especie LIKE '%" . $_POST['buscar'] . "%'     \r\n        OR edad LIKE '%" . $_POST['buscar'] . "%'\r\n        OR sexo LIKE '%" . $_POST['buscar'] . "%'\r\n        OR raza LIKE '%" . $_POST['buscar'] . "%'    \r\n        OR dni_propietario LIKE '%" . $_POST['buscar'] . "%'\r\n        OR remitente LIKE '%" . $_POST['buscar'] . "%'\r\n        OR clinica_remitente LIKE '%" . $_POST['buscar'] . "%'\r\n        OR tel_remitente LIKE '%" . $_POST['buscar'] . "%' \r\n        OR mail_remitente LIKE '%" . $_POST['buscar'] . "%'    \r\n            ORDER BY especie";
开发者ID:aremis1984,项目名称:gicorec,代码行数:31,代码来源:pacientes.php

示例14: header

 $pagina = $_GET['pagina'];
 $class_inferior = "";
 //print_r($_SESSION);echo usuario_logeado(); exit();
 if (!usuario_logeado() && $pagina != "" && $pagina != "login" && $pagina != "recuperar_clave") {
     header("Location: /gicorec/index.php");
     exit;
 }
 //en función de la página solicitada para mostrar incluimos un archivo de control u otro
 switch ($pagina) {
     case 'principal':
         include_once 'principal.php';
         $class_inferior = "center";
         break;
     case 'pacientes':
         include_once 'pacientes.php';
         $tplIndex->newBlock("menu_principal_link");
         break;
     case 'login':
         include_once 'login.php';
         break;
     case 'almacen':
         include_once 'almacen.php';
         $tplIndex->newBlock("menu_principal_link");
         break;
     case 'cirugias':
         include_once 'cirugias.php';
         $tplIndex->newBlock("menu_principal_link");
         break;
     case 'agenda':
         include_once 'agenda.php';
         $tplIndex->newBlock("menu_principal_link");
开发者ID:aremis1984,项目名称:gicorec,代码行数:31,代码来源:index.php

示例15: 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();
 }
开发者ID:TRexSoftware,项目名称:laboratorio_progIII,代码行数:11,代码来源:controller.Administrador.php


注:本文中的TemplatePower::newBlock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。