示例#1
0
importar("Utilidades.Lista.ListaEventos");
$tituloPagina = 'Utilidades > Eventos - Agenda > Alterar';
$iAT = new IFAdmin(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaUtilidades/evento.html"));
$lI = new ListaIdiomas();
if (!empty($_POST)) {
    $erro = '';
    if (empty($_POST['titulo'])) {
        $erro = "<b>Titulo</b> não preenchido!<br><br>";
    }
    if (empty($_POST['url'])) {
        $erro = "<b>URL</b> não preenchido!<br><br>";
    }
    if (empty($erro)) {
        $lE = new ListaEventos();
        $lE->condicoes('', $_GET['evento'], ListaEventos::ID);
        $eve = $lE->listar();
        $eve->getTexto()->titulo = $_POST['titulo'];
        $eve->local = $_POST['local'];
        $eve->getURL()->setURL($_POST['url']);
        $eve->getTexto()->texto = html_entity_decode($_POST['texto']);
        $eve->setData(new DataHora($_POST['data']));
        if (!empty($_FILES['imagem']['name'])) {
            $eve->getTexto()->getImagem()->setImage(new Image(Arquivos::__OpenArquivoByTEMP($_FILES['imagem'])));
        }
        $lE->alterar($eve);
        $lT = new listaTextos();
        while ($i = $lI->listar()) {
            $t = $i->getTraducaoById(ListaTextos::TITULO, $lT->getTabela(), $eve->getTexto()->getId());
            if ($t->getId()) {
                $t->conteudo = $eve->getTexto()->titulo;
                $t->traducao = $_POST['ititulo'][$i->getId()];
示例#2
0
    $lT = new ListaEventos();
    $lT->condicoes('', $_GET['deletar'], ListaEventos::ID);
    if ($lT->getTotal() > 0) {
        try {
            $lT->deletar($lT->listar());
            $javaScript .= Aviso::criar("Evento removido com sucesso!");
        } catch (Exception $e) {
            $javaScript .= Aviso::criar($e->getMessage());
        }
    }
}
$lT = new ListaEventos();
$ILT->createRepeticao("repetir->Eventos");
if (!empty($_GET['busca'])) {
    $lT->condicoes('', "%" . $_GET['busca'] . "%", 'empresa', 'LIKE');
}
$ILT->condicao("condicaoBusca", !empty($_SESSION['nivel']));
$ILT->trocar("linkCadastrar.Evento", "?p=" . $_GET['p'] . "&a=cadastrarEvento");
while ($eve = $lT->listar("DESC", ListaEventos::DATA)) {
    $ILT->repetir();
    $ILT->enterRepeticao()->condicao("condicaoRemover", !empty($_SESSION['nivel']));
    $bgColor = $lT->getParametros() % 2 == 0 ? '#FFFFFF' : '#EAEAEA';
    $ILT->enterRepeticao()->trocar("bgColorEmpresa", $bgColor);
    $ILT->enterRepeticao()->trocar("id.Evento", $eve->getId());
    $ILT->enterRepeticao()->trocar("titulo.Evento", $eve->getTexto()->titulo);
    $ILT->enterRepeticao()->trocar("linkAlterar.Evento", "?p=" . $_GET['p'] . "&a=alterarEvento&evento=" . $eve->getId());
    $ILT->enterRepeticao()->condicao("condicaoVisualizar", $eve->tipo == 1);
}
$ILT->trocar("linkVoltar", "?p=" . $_GET['p'] . "&a=utilidades");
$botoes = $ILT->cutParte('botoes');
$includePagina = $ILT->concluir();