<?php include_once '../lib/check_login.php'; if (!checkLogin()) { header("location: ../view/index.php"); } require_once '../controller/CursoController.php'; require_once '../controller/TutorController.php'; require_once "../lib/raelgc/view/Template.php"; use raelgc\view\Template; $tpl = new Template("../view/addDisciplina.html"); $cursoController = new CursoController(); $tutorController = new TutorController(); $cursos = $cursoController->read(); $tutors = $tutorController->read(); foreach ($cursos as $t) { $tpl->ID_CURSO = $t->getId(); $tpl->NOME_CURSO = $t->getNome(); $tpl->block("BLOCK_CURSO"); } foreach ($tutors as $p) { $tpl->ID_TUTOR = $p->getTutorId(); $tpl->NOME_TUTOR = $p->getNome(); $tpl->block("BLOCK_TUTOR"); } $tpl->show();
<?php include_once '../lib/check_login.php'; if (!checkLogin()) { header("location: ../view/index.php"); } require_once '../controller/TutorController.php'; require_once "../lib/raelgc/view/Template.php"; use raelgc\view\Template; $tpl = new Template("../view/editaTutor.html"); $tutorController = new TutorController(); $tutor = $tutorController->getById($_GET['id']); $tpl->NOME_TUTOR = $tutor->getNome(); $tpl->SOBRENOME_TUTOR = $tutor->getSobrenome(); $tpl->EMAIL_TUTOR = $tutor->getEmail(); $tpl->CPF_TUTOR = $tutor->getCpf(); $tpl->ID_TUTOR = $tutor->getTutorId(); $tpl->ID_PESSOA = $tutor->getId(); $titulacao = $tutorController->getTitulacoes(); $formacao = $tutorController->getFormacoes(); foreach ($titulacao as $t) { $tpl->ID_TITULACAO = $t['id_titulacao']; $tpl->NOME_TITULACAO = $t['descricao']; if ($t['id_titulacao'] == $tutor->getTitulacao()['id']) { $tpl->SELECTED = "selected"; } else { $tpl->clear("SELECTED"); } $tpl->block("BLOCK_TITULACAO"); } foreach ($formacao as $p) {
<?php include_once '../lib/check_login.php'; if (!checkLogin()) { header("location: ../view/index.php"); } require_once '../controller/TutorController.php'; require_once "../lib/raelgc/view/Template.php"; use raelgc\view\Template; $tpl = new Template("../view/addTutor.html"); $tutorController = new TutorController(); $titulacao = $tutorController->getTitulacoes(); $formacao = $tutorController->getFormacoes(); foreach ($titulacao as $t) { $tpl->ID_TITULACAO = $t['id_titulacao']; $tpl->NOME_TITULACAO = $t['descricao']; $tpl->block("BLOCK_TITULACAO"); } foreach ($formacao as $p) { $tpl->ID_FORMACAO = $p['id_formacao']; $tpl->NOME_FORMACAO = $p['descricao']; $tpl->block("BLOCK_FORMACAO"); } $tpl->show();