Example #1
0
 public function alterar(Ticket $t)
 {
     parent::alterar($t);
     $where = "WHERE " . self::ID . " = '" . $t->getId() . "'";
     $dT = new DataHora();
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::NIVEL, $t->getNivel(), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::STATUS, $t->getStatus(), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::SATISFACAO, $t->getSatisfacao(), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::DATAHORA_ALTERACAO, $dT->mostrar("YmdHi"), $where);
 }
Example #2
0
 public function addEmail($email, $nome = '', $cidade = '', $estado = '', $area = '', $dataNasc = '')
 {
     if (empty($dataNasc)) {
         $dataNasc = new DataHora();
     }
     $this->con->executar("SELECT * FROM " . Sistema::$BDPrefixo . "mailing_pacotes_emails WHERE pacote = '" . $this->getId() . "' AND email = '" . $email . "'");
     if ($this->con->getTotal() == 0) {
         $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . "mailing_pacotes_emails(pacote, email, nome, cidade, estado, area, datanasc) VALUES('" . $this->getId() . "','" . $email . "','" . $nome . "','" . $cidade . "','" . $estado . "','" . $area . "','" . ($dataNasc ? $dataNasc->mostrar("Y-m-d") : '') . "')");
     } else {
         throw new Exception("E-mail já cadastrado");
     }
 }
Example #3
0
 /**
  * 
  * RETORNA O CAMPO FORMATADO COM BASE NO TIPO E NA AÇÃO
  * @param String $key
  * @param Array $optionsField
  * @param Array $value
  * @param Integer $action ação do formulário
  * @return String
  */
 public static function getFormatField($key, $optionsField, $value, $action = 4)
 {
     if ($optionsField[$key]['type'] == 'date') {
         if ($action == 4) {
             $fieldValue = DataHora::getVisualisaDataSql($value);
         } elseif ($action == 1 || $action == 2) {
             $fieldValue = DataHora::getFormataDataSql($value);
         }
     } elseif ($optionsField[$key]['type'] == 'datetime') {
         if ($action == 4) {
             $fieldValue = DataHora::getVisualisaDataSql($value, '-', 2);
         } elseif ($action == 1 || $action == 2) {
             $fieldValue = DataHora::getFormataDataSql($value, 1);
         }
     } elseif ($optionsField[$key]['type'] == 'moeda') {
         $fieldValue = UtilString::formataValor($value, 2);
     }
     return $fieldValue;
 }
    }
    $sql .= " GROUP BY p.id";
    $con->executar($sqlT);
    $totalI = $con->getRegistro()['total'];
    $sql = str_replace("sqlI", $sqlI, $sql);
    $con->executar($sql);
    function repeatTemplateByArray($con)
    {
        global $iGR;
        while ($p = $con->getRegistro()) {
            $iGR->repetir('repetir->Produtos');
            $iGR->enterRepeticao()->trocar('codigo.Produto', $p['id']);
            $iGR->enterRepeticao()->trocar('nome.Produto', $p['nome']);
            $iGR->enterRepeticao()->trocar('imagens.Produto', $p['imagens']);
        }
    }
    $iGR->createRepeticao('repetir->Produtos');
    repeatTemplateByArray($con);
    $iGR->trocar('total.Produto', $con->getTotal());
    $iGR->trocar('total.Imagens', $totalI);
    $pronto = $iGR->concluir();
    echo $pronto;
    exit;
}
$tituloPagina = 'Relatórios > Imagens';
$iRel = new IFAdmin(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaRelatorios/imagens.html"));
$dT = new DataHora();
$iRel->trocar('data', $dT->mostrar());
$iRel->createJavaScript();
$javaScript .= $iRel->javaScript->concluir();
$includePagina = $iRel->concluir();
}
if (!empty($_POST)) {
    $erro = '';
    if (empty($_POST['titulo'])) {
        $erro = "<b>Titulo</b> não preenchido!<br><br>";
    }
    if (empty($erro)) {
        try {
            $lS = new ListaPacoteMailings();
            $lS->condicoes('', $_GET['pacote'], ListaPacoteMailings::ID);
            $s = $lS->listar();
            $s->titulo = $_POST['titulo'];
            $lS->alterar($s);
            $con = BDConexao::__Abrir();
            if (!empty($_POST['email'])) {
                $con->executar("INSERT INTO " . Sistema::$BDPrefixo . "mailing_pacotes_emails(pacote, email, nome, cidade, estado, datanasc) VALUES('" . $_GET['pacote'] . "','" . $_POST['email'] . "','" . $_POST['nome'] . "','" . $_POST['cidade'] . "','" . $_POST['uf'] . "','" . DataHora::__Create($_POST['datanasc'])->mostrar("Ymd") . "')");
            }
            if (!empty($_FILES['arquivo']['name'])) {
                if (eregi("xls", $_FILES['arquivo']['name'])) {
                    $data = new Excel();
                    $data->setOutputEncoding('CPa25a');
                    $data->read($_FILES['arquivo']['tmp_name']);
                    for ($i = 1; $i <= $data->sheets[0]['numRows']; $i++) {
                        $con->executar("SELECT * FROM " . Sistema::$BDPrefixo . "mailing_pacotes_emails WHERE pacote = '" . $_GET['pacote'] . "' AND email = '" . $data->sheets[0]['cells'][$i][1] . "'");
                        if ($con->getTotal() == 0) {
                            $con->executar("INSERT INTO " . Sistema::$BDPrefixo . "mailing_pacotes_emails(pacote, email) VALUES('" . $_GET['pacote'] . "','" . $data->sheets[0]['cells'][$i][1] . "')");
                        }
                    }
                } elseif (eregi("txt", $_FILES['arquivo']['name'])) {
                    $f = file($_FILES['arquivo']['tmp_name']);
                    for ($i = 0; $i < count($f); $i++) {
Example #6
0
     header("Location: /admin/?p=SistemaConfiguracoes&a=produtos");
 }
 $caminhoT = Sistema::$adminLayoutCaminhoDiretorio;
 $tem = new IFAdmin(new Arquivos($caminhoT . "default.html"));
 if (date("H") >= 06 && date("H") <= 11) {
     $nomeEntrada = "Bom dia";
 } elseif (date("H") >= 12 && date("H") <= 18) {
     $nomeEntrada = "Boa tarde";
 } elseif (date("H") >= 19 || date("H") <= 5) {
     $nomeEntrada = "Boa noite";
 }
 $nomeEntrada .= " " . $_SESSION['user_login'];
 $tem->trocar("nomeEntrada", $nomeEntrada);
 $tem->trocar("idEmpresa", $_SESSION['id']);
 $tem->trocar("idUsuario", $_SESSION['idUsuario']);
 $d = new DataHora();
 $tem->trocar("data", $d->diaSemanaExtenso() . ", " . $d->mostrar("d") . " de " . $d->mesExtenso() . ", " . $d->mostrar("Y"));
 $tem->condicao('condicao->1.Nivel', $_SESSION['nivel'] == 1);
 $tem->condicao('condicao->4.Nivel', $_SESSION['nivel'] == 4);
 $tem->condicao("condicaoMenu1", ereg('Produtos', $_GET['p']));
 $tem->condicao("condicaoMenu2", ereg('Utilidades', $_GET['p']));
 $tem->condicao("condicaoMenu3", ereg('Configuracoes', $_GET['p']));
 $tem->condicao("condicaoMenu4", ereg('Clientes', $_GET['p']));
 $tem->condicao("condicaoMenu5", ereg('Pedidos', $_GET['p']));
 $tem->condicao("condicaoMenu6", ereg('Relatorios', $_GET['p']));
 $includePagina = true;
 $tem->condicao("condicaoCorpo", !empty($_GET['p']) && !empty($_GET['a']));
 if (!empty($_GET['p']) && !empty($_GET['a'])) {
     $p = $_GET['p'] . "/" . $_GET['a'];
     include $p . ".php";
 }
Example #7
0
?>
	</tr>
	<tr class="firstRow"><?php 
//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>";
                if ($p->getEndereco()->getTotal() > 0) {
                    $end = $p->getEndereco()->listar();
                    $iGR->enterRepeticao()->trocar('logradouro.Endereco.Cliente', $end->logradouro);
                    $iGR->enterRepeticao()->trocar('numero.Endereco.Cliente', $end->numero);
                    $iGR->enterRepeticao()->trocar('bairro.Endereco.Cliente', $end->bairro);
                    $iGR->enterRepeticao()->trocar('cidade.Endereco.Cliente', $end->cidade);
                    $iGR->enterRepeticao()->trocar('estado.Endereco.Cliente', $end->estado);
                    $iGR->enterRepeticao()->trocar('cep.Endereco.Cliente', $end->getCep());
                }
                if ($p->getEmail()->getTotal() > 0) {
                    $email = $p->getEmail()->listar();
                    $iGR->enterRepeticao()->trocar('email.Email.Cliente', $email->email);
                }
                $iGR->enterRepeticao()->trocar('moeda', "R\$");
                $iGR->enterRepeticao()->trocar('valorCompras.Cliente', Numero::__CreateNumero($rs['valorcompras'])->moeda());
            }
        }
    }
    $iGR->createRepeticao('repetir->Clientes');
    repeatTemplateByArray($con);
    $pronto = $iGR->concluir();
    echo $pronto;
    exit;
}
$tituloPagina = 'Relatórios > Clientes';
$iRel = new IFAdmin(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaRelatorios/clientes.html"));
$dT = new DataHora();
$iRel->trocar('data', $dT->mostrar("d/m"));
$iRel->createJavaScript();
$javaScript .= $iRel->javaScript->concluir();
$includePagina = $iRel->concluir();