示例#1
0
<?php

importar("Utilidades.Lista.ListaEventos");
$tituloPagina = 'Utilidades > Eventos - Agenda';
$ILT = new IFAdmin(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaUtilidades/listarEventos.html"));
$ILT->trocar("linkDeletar.Evento", "?p=" . $_GET['p'] . "&a=" . $_GET['a'] . "&");
$ILT->trocar("linkBuscar.Evento", "?p=" . $_GET['p'] . "&");
if (!empty($_GET['deletar'])) {
    $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);
示例#2
0
//Add days for the beginning non-month days
for ($i = 0; $i < $wdays_counter; $i++) {
    $day = date("t", $pr_ts) - ($wdays_counter - $i) + 1;
    $i_ts = mktime(1, 1, 1, $ts_month_nr - 1, $day, $ts_year);
    echo '<td class="outsideDay" date="' . "{'day': '" . $day . "', 'month': '" . date('n', $i_ts) . "', 'year': '" . date('Y', $i_ts) . "'}" . '">' . $day . '</td>';
}
//Add month days
$row = 0;
for ($i = 1; $i <= $ts_nrodays; $i++) {
    $i_ts = mktime(1, 1, 1, $ts_month_nr, $i, $ts_year);
    $mes = strlen($ts_month_nr) == 1 ? "0" . $ts_month_nr : $ts_month_nr;
    $dia = strlen($i) == 1 ? "0" . $i : $i;
    $d = new DataHora($ts_year . $mes . $dia);
    $lE->condicoes('', $d->mostrar("Ymd"), 'data_evento');
    $stY = '';
    if ($lE->getTotal() > 0) {
        $stY = 'style="color: #FFF;"';
    }
    echo '<td' . ($i_ts == $pickedDate ? ' class="selected"' : '') . ' ' . "date=\"{'day': '" . $i . "', 'month': '" . $ts_month_nr . "', 'year': '" . $ts_year . "'}\">";
    if ($lE->getTotal() > 0) {
        echo '<a href="./?p=agenda" ' . $stY . '>' . $i . '</a>';
    } else {
        echo $i;
    }
    echo '</td>';
    if ($wdays_counter == 6 && $i - 1 != $ts_nrodays) {
        $week_num = date("W", $i_ts) + 1;
        echo "</tr>\n\t<tr>";
        $wdays_counter = -1;
        $row++;
    }