Esempio n. 1
0
<?php

include_once '../lib/check_login.php';
if (!checkLogin()) {
    header("location: ../view/index.php");
}
require_once '../controller/PoloController.php';
require_once "../lib/raelgc/view/Template.php";
use raelgc\view\Template;
$tpl = new Template("../view/polos.html");
$poloController = new PoloController();
$polos = $poloController->read();
foreach ($polos as $t) {
    $tpl->ID_POLO = $t->getId();
    $tpl->POLO_NOME = $t->getNome();
    $tpl->POLO_ESTADO = $t->getEstado();
    $tpl->POLO_CIDADE = $t->getCidade();
    $tpl->block("BLOCK_POLO");
}
$tpl->show();
Esempio n. 2
0
<?php

include_once '../lib/check_login.php';
if (!checkLogin()) {
    header("location: ../view/index.php");
}
require_once '../controller/PoloController.php';
require_once "../lib/raelgc/view/Template.php";
use raelgc\view\Template;
$tpl = new Template("../view/editaPolo.html");
$poloController = new PoloController();
$polo = $poloController->getById($_GET['id']);
$tpl->NOME_POLO = $polo->getNome();
$tpl->CIDADE_POLO = $polo->getCidade();
$tpl->ESTADO_POLO = $polo->getEstado();
$tpl->ID_POLO = $polo->getId();
$tpl->show();