示例#1
0
<?php

// inladen van footer.html
$footer = new TemplatePower("template/files/footer.tpl");
$footer->prepare();
// Op het einde van de code zorg ik ervoor dat alles uit word geprint
$header->printToScreen();
$errors->printToScreen();
$content->printToScreen();
$footer->printToScreen();
示例#2
0
            }
            $tpl->gotoBlock("_ROOT");
        }
    } else {
        $estados = $objestados->listaEstados();
        foreach ($estados as $estado) {
            $tpl->newBlock("estado");
            $tpl->assign("id", $estado['id']);
            $tpl->assign("nombre", $estado['nombre']);
            $tpl->gotoBlock("_ROOT");
        }
    }
} else {
    //Nuevo
    $estados = $objestados->listaEstados();
    foreach ($estados as $estado) {
        $tpl->newBlock("estado");
        $tpl->assign("id", $estado['id']);
        $tpl->assign("nombre", $estado['nombre']);
        $tpl->gotoBlock("_ROOT");
    }
    $lista_eventos = $objeventos->listaEventos();
    foreach ($lista_eventos as $evento) {
        $tpl->newBlock("eventos");
        $tpl->assign("nombre", $evento['nombre']);
        $tpl->assign("id", $evento['id']);
        $tpl->gotoBlock("_ROOT");
    }
}
$tpl->printToScreen();
示例#3
0
//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();
示例#4
0
<?php

require_once 'config.inc.php';
$tpl_main = new TemplatePower('template/master.html');
$tpl_main->prepare();
// see if the login form was submitted
if (isset($_POST['login'])) {
    $user = stripslashes($_POST['username']);
    $pass = stripslashes($_POST['password']);
    $goto = $_POST['redirect'];
    if ($_AUTH->login($user, $pass)) {
        include_once $goto;
        die;
    } else {
        $tpl = new TemplatePower('template/error.html');
        $tpl->assignGlobal('error_message', 'Invalid username / password.' . $user);
    }
    // display the default login form
} else {
    $tpl = new TemplatePower('template/login.html');
    $tpl->assignGlobal('redirect', $_GET['redirect']);
}
$tpl->prepare();
$tpl->showUnAssigned(false);
$tpl_main->assign('content', $tpl->getOutputContent());
$tpl_main->showUnAssigned(false);
$tpl_main->printToScreen();
示例#5
0
            $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();
示例#6
0
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'>&nbsp;";
    $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();
}
示例#7
0
<? 
require "./clases/TemplatePower.inc.php"; 
$t = new TemplatePower("plantillas/cat_productos.tpl"); 
$t->prepare(); 
//Asignamos el valor “Material de cocina a la variable nombrecategoria en //el template
$t->assign(array(nombrecategoria => 'Material de cocina'));
//Preparamos la parte de productos 
 $nombreproducto=array("sarten","sarten","horno");
 $idproducto=range(0,3);
 $descripcionproducto=array("sarten 22cm","sarten 29cm","horno pirolitico");
	for ($i=0;i<count($nombreproducto);$i++) {
        $t->newBlock("productos");
        $t->assign(array( 
              nombreproducto => $nombreproducto[$i], 
              idproducto => $idproducto[$i], 
              descripcionproducto => $descripcionproducto[$i]
              )); 
	}
$t->printToScreen(); 
?>