<?php require_once 'includes.php'; $session = new Session(); if (!$session->isRegistered('user')) { header('Location: index.php'); exit; } $tpl = new Template(); $tpl->assign('system_name', $systemName); $tpl->assign('system_version', $systemVersion); $user = $session->get('user'); $tpl->assign('user_id', $user['user_id']); $tpl->assign('user_name', $user['name']); $tpl->assign('user_email', $user['email']); $tpl->assign('user_status', $user['status']); $tpl->assign('user_photo', $user['photo']); if ($user['level'] == 1) { $tpl->block('administrator'); } $tpl->show();
//INSTACIA CLASSES $obj = new Publicacao(); $grupo = $obj::ID_GRUPO_PARTICIPE; $tpl = new Template("view/publicacao/portal_list.html"); //$tpl->GRUPO = $obj->get_pasta_grupo($grupo); $pesquisa = ""; $pagina = isset($_REQUEST['pagina']) ? $_REQUEST['pagina'] : 1; $totalPesquisa = $obj->recuperaTotal($pesquisa, $grupo); $configPaginacao = $obj->paginar($totalPesquisa, $pagina); $alist = $obj->listar($configPaginacao['primeiroRegistro'], $configPaginacao['quantidadePorPagina'], $pesquisa, $grupo); if (count($alist) > 0) { foreach ($alist as $key => $publicacao) { $tpl->ID_PUB = $obj->md5_encrypt($publicacao->id); $tpl->DATA_ITEM = $obj->getData($publicacao->data); $tpl->TITULO_ITEM = $publicacao->titulo; $tpl->block("BLOCK_ITEM"); } } $tpl->paginar_class = 'paginar'; $tpl->TOTAL_PAGINAS = $configPaginacao['totalPaginas']; $tpl->PAGINA_ANTERIOR = $configPaginacao['paginaAnterior']; $tpl->PROXIMA_PAGINA = $configPaginacao['proximaPagina']; $tpl->PAGINA = $pagina; if ($configPaginacao['totalPaginas'] > 1) { $tpl->block("BLOCK_PAGINACAO"); } $tpl->show(); exit; ?>
$consTotal; $pagoTotal; $consAnoTotal; $pagoAnoTotal; $x = 0; while ($tipos = mysql_fetch_array($queryTipos)) { $consTotal[$x] = 0; $pagoTotal[$x] = 0; $consAnoTotal[$x] = 0; $pagoAnoTotal[$x] = 0; $ucTipo = new UnidadeConsumidora(0, null, null, null, null, null, null, null, null, null, null, $tipos['tipo']); $tpl->TIPO_NOME = $ucTipo->getTipoNome(); $tpl->ANO = $anoAtual; $tpl->MEDIDA = $ucTipo->getTipoMedida(); $tpl->TIPO_ID = $tipos['tipo']; $tpl->block("EACH_TIPOBUTTON"); if ($tipos['tipo'] == $tipoId) { //FAZER APARECER UCS E SEUS RESULTADOS $ucqtd = 0; foreach ($ucTipo->getMesmoTipo() as $res) { //$tpl->UCID = $res; $uc = new UnidadeConsumidora($res); $tpl->UCRGI = $uc->get('rgi'); $tpl->UCCHAVE = sha1($uc->get('id')); $tpl->UCNOME = $uc->getNome(); $tpl->UCEND = $uc->getEndereco(); $tpl->UCCID = $uc->getCidadeNome(); $tpl->UCSIGLA = $uc->get('uo')->getSigla(); $tpl->EMPRESA = $uc->get('empresa')->getNome(); $tpl->STATUS = $uc->getAtivoText(); $totalAno = $uc->somaValorNotas($anoAtual);
redirectByPermission(0); // SETAR PERMISSÃO DA PÁGINA $tpl = new Template('html_libs/ucResumo.html'); if (isset($_GET['chave'])) { $chave = mysql_real_escape_string($_GET['chave']); if (strlen($chave) == 40) { $queryVerif = mysql_query("SELECT id FROM daee_uddc WHERE SHA1(id) = '" . $_GET['chave'] . "'"); if (mysql_num_rows($queryVerif) == 1) { $id = mysql_fetch_array($queryVerif)['id']; $uc = new UnidadeConsumidora($id); /********************************* MOSTRAR INFORMAÇÕES DO RELATÓRIO *********************************/ $hasConsumo = $uc->hasConsumo(); if ($hasConsumo) { $tpl->block('SHOW_HEADER_CONS'); } $distinct_sql = "SELECT DISTINCT(ano_ref) FROM daee_notas WHERE uc = {$id} ORDER BY ano_ref ASC"; $distinct_query = mysql_query($distinct_sql); $exArray; $exArrayIndex = 0; while ($ano = mysql_fetch_array($distinct_query)) { $tpl->ANO = $ano = $ano['ano_ref']; $exercicio = $uc->getExercicioMensal($ano); $tpl->MESESPG = $meses_count = count($exercicio); $totCons = $totPago = 0; foreach ($exercicio as $mes) { if ($hasConsumo) { $totCons += $mes['consumo']; } $totPago += $mes['valor'];
//Cpf $tpl->CAMPOOCULTO_NOME = "c"; $tpl->CAMPOOCULTO_VALOR = "{$cpf}"; $tpl->block("BLOCK_CAMPOOCULTO"); //Resposta $tpl->CAMPOOCULTO_NOME = "r"; $tpl->CAMPOOCULTO_VALOR = "{$resposta}"; $tpl->block("BLOCK_CAMPOOCULTO"); //E-mail md5 $tpl->CAMPOOCULTO_NOME = "e"; $tpl->CAMPOOCULTO_VALOR = "{$emailmd5}"; $tpl->block("BLOCK_CAMPOOCULTO"); $tpl->show(); //BOTÕES DO FINAL DO FORMULÁRIO $tpl2 = new Template("templates/botoes1.html"); $tpl2->block("BLOCK_LINHAHORIZONTAL_EMCIMA"); //Salvar $tpl2->block("BLOCK_BOTAOPADRAO_SUBMIT"); $tpl2->block("BLOCK_BOTAOPADRAO_CONTINUAR"); $tpl2->block("BLOCK_BOTAOPADRAO"); $tpl->block("BLOCK_CONTEUDO"); $tpl2->block("BLOCK_COLUNA"); $tpl2->block("BLOCK_LINHA"); $tpl2->block("BLOCK_BOTOES"); $tpl2->show(); } else { echo 'Por favor, não tente recuperar a senha através métodos não padrões!'; } ?> </div>
<?php //--------------------------FICOU NO ESTOQUE ------------------------------------- $tpl3 = new Template("templates/lista1.html"); //TÃtulo $tpl3_tit = new Template("templates/tituloemlinha_1.html"); $tpl3_tit->LISTA_TITULO = "FICOU NO ESTOQUE"; $tpl3_tit->block("BLOCK_TITULO"); $tpl3_tit->show(); //Ficou no estoque - Listagem - Cabeçalho $tpl3->CABECALHO_COLUNA_TAMANHO = ""; $tpl3->CABECALHO_COLUNA_COLSPAN = "2"; $tpl3->CABECALHO_COLUNA_NOME = "PRODUTO"; $tpl3->block(BLOCK_LISTA_CABECALHO); $tpl3->CABECALHO_COLUNA_TAMANHO = "150px"; $tpl3->CABECALHO_COLUNA_COLSPAN = "2"; $tpl3->CABECALHO_COLUNA_NOME = "QUANTIDADE"; $tpl3->block(BLOCK_LISTA_CABECALHO); $tpl3->CABECALHO_COLUNA_TAMANHO = "150px"; $tpl3->CABECALHO_COLUNA_COLSPAN = ""; $tpl3->CABECALHO_COLUNA_NOME = "VAL. UNI."; $tpl3->block(BLOCK_LISTA_CABECALHO); $tpl3->CABECALHO_COLUNA_TAMANHO = "150px"; $tpl3->CABECALHO_COLUNA_COLSPAN = ""; $tpl3->CABECALHO_COLUNA_NOME = "VALOR TOTAL"; $tpl3->block(BLOCK_LISTA_CABECALHO); $tpl3->CABECALHO_COLUNA_TAMANHO = ""; $tpl3->CABECALHO_COLUNA_COLSPAN = ""; $tpl3->CABECALHO_COLUNA_NOME = "LOTE"; $tpl3->block(BLOCK_LISTA_CABECALHO); $tpl3->CABECALHO_COLUNA_TAMANHO = "";
if ($nome == $nome2) { $linhatot = 1; } else { $linhatot = 0; } if ($linhas > $linhatot) { $tpl_notificacao = new Template("templates/notificacao.html"); $tpl_notificacao->ICONES = $icones; $tpl_notificacao->MOTIVO_COMPLEMENTO = "nome"; $tpl_notificacao->DESTINO = "cidades.php"; $tpl_notificacao->block("BLOCK_ERRO"); $tpl_notificacao->block("BLOCK_NAOEDITADO"); $tpl_notificacao->block("BLOCK_MOTIVO_JAEXISTE"); $tpl_notificacao->block("BLOCK_BOTAO_VOLTAR"); $tpl_notificacao->show(); } else { $sql = "\n UPDATE\n cidades\n SET\n cid_nome='{$nome}',\n\tcid_estado='{$estado}'\t\n WHERE\n cid_codigo = '{$codigo}'\n "; if (!mysql_query($sql)) { die("Erro: " . mysql_error()); } $tpl_notificacao = new Template("templates/notificacao.html"); $tpl_notificacao->ICONES = $icones; $tpl_notificacao->MOTIVO_COMPLEMENTO = ""; $tpl_notificacao->DESTINO = "cidades.php"; $tpl_notificacao->block("BLOCK_CONFIRMAR"); $tpl_notificacao->block("BLOCK_EDITADO"); $tpl_notificacao->block("BLOCK_BOTAO"); $tpl_notificacao->show(); } } include "rodape.php";
<?php require "src/scripts/conecta.php"; require "src/scripts/restrito.php"; include "src/scripts/functions.php"; require "src/classes/Template.class.php"; include_once "src/classes/Users.class.php"; include_once "src/classes/Notas.class.php"; include_once "src/classes/Contratos.class.php"; //redirectByPermission(2); // SETAR PERMISSÃO DA PÁGINA $inicio = execucao(); $tpl = new Template('html_libs/template_ope.html'); $tpl->addFile("JSCRIPT", 'cssjs_libs/js_parts/js_ope_editarNota.html'); $tpl->addFile("MENU", 'html_libs/ope_secondMenu.html'); $tpl->addFile("CONTEUDO", 'html_libs/ope_editarNota.html'); $tpl->block('EDITAR_MENU'); $nivel = $_SESSION['nivel']; /*************************************** RECEBER DADOS POR $_POST ***************************************/ if (getenv("REQUEST_METHOD") == "POST") { $invalid = 0; $alerta = "Erro: "; if (!isset($_POST['editar'])) { $invalid++; $alerta .= "Escolha um campo a ser editado."; } if ($_POST['editar'] == "numero" && $_POST['novo-numero'] == "") { $invalid++; $alerta .= "Digite um número de nota válido."; }
//Filtro fornecedor $sql1 = "\n SELECT DISTINCT\n pes_nome,pes_codigo\n FROM\n estoque\n join pessoas on (etq_fornecedor=pes_codigo) \n WHERE\n etq_quiosque={$usuario_quiosque}\n ORDER BY\n pes_nome\n"; $query1 = mysql_query($sql1); if (!$query1) { die("Erro SQL:" . mysql_error()); } while ($dados1 = mysql_fetch_array($query1)) { $fornecedor_codigo = $dados1['pes_codigo']; $tpl->FORNECEDOR_CODIGO = $fornecedor_codigo; $tpl->FORNECEDOR_NOME = $dados1['pes_nome']; if ($fornecedor_codigo == $filtro_fornecedor) { $tpl->FORNECEDOR_SELECIONADO = " selected "; } else { $tpl->FORNECEDOR_SELECIONADO = " "; } $tpl->block("BLOCK_FILTRO_FORNECEDOR"); } $tpl->block("BLOCK_FILTRO"); } else { $filtro_fornecedor = $usuario_codigo; } if ($filtro_fornecedor != "") { $sql_filtro = $sql_filtro . " and etq_fornecedor= {$filtro_fornecedor} "; } //SQL principal $sql = "\nSELECT DISTINCT\n pes_nome,pes_codigo,pes_id,round(sum(etq_quantidade*etq_valorunitario),2) as tot\nFROM\n estoque\n join pessoas on (etq_fornecedor=pes_codigo) \nWHERE\n etq_quiosque='{$usuario_quiosque}' \n {$sql_filtro}\nGROUP BY\n pes_codigo\nORDER BY \n pes_nome\n"; //Pagina��o //Executa primeiro o SQL sem a pagina��o para pegar o valor total do estoque //que ser� mostrado no rodap� da ultima pagina $query = mysql_query($sql); if (!$query) {
$tpl_titulo->NOME_ARQUIVO_ICONE = "../pessoas2/vendedor.png"; $tpl_titulo->show(); $tpl = new Template("templates/listagem_2.html"); $tpl->ICONE_ARQUIVO = $icones; $quiosque = $_GET['quiosque']; //Campo Quiosque no Topo $tpl->CAMPO_TITULO = "Quiosque"; $sql = "SELECT qui_nome FROM quiosques WHERE qui_codigo={$quiosque}"; $query = mysql_query($sql); if (!$query) { die("Erro1: " . mysql_error()); } $dados = mysql_fetch_assoc($query); $tpl->CAMPO_VALOR = $dados['qui_nome']; $tpl->CAMPO_TAMANHO = ""; $tpl->block("BLOCK_FILTRO_CAMPO_DESABILITADO"); $tpl->block("BLOCK_FILTRO_CAMPO"); $tpl->block("BLOCK_FILTRO_COLUNA"); if ($permissao_quiosque_definirvendedores == 1 && $quiosque == $usuario_quiosque || $usuario_grupo == 1) { $tpl->LINK = "vendedores_cadastrar.php?quiosque={$quiosque}&operacao=cadastrar"; $tpl->BOTAO_NOME = "INCLUIR VENDEDOR"; $tpl->block("BLOCK_AUTOFOCO"); $tpl->block("BLOCK_RODAPE_BOTAO_MODELO"); } $tpl->block("BLOCK_FILTRO_COLUNA"); $tpl->block("BLOCK_FILTRO"); //LISTAGEM INICIO //Cabe�alho $tpl->CABECALHO_COLUNA_TAMANHO = ""; $tpl->CABECALHO_COLUNA_COLSPAN = ""; $tpl->CABECALHO_COLUNA_NOME = "ID";
<a data-dismiss="alert" class="close">×</a> <?php echo $password_hints; ?> </div> <?php } echo form_open($this->uri->uri_string(), array('class' => 'form-horizontal', 'autocomplete' => 'off')); ?> <fieldset> <legend><?php echo lang('us_account_details'); ?> </legend> <?php Template::block('user_fields', 'user_fields', $fieldData); ?> </fieldset> <?php $canManageUser = false; if (!isset($user)) { $canManageUser = true; } elseif ($this->auth->has_permission('Permissions.' . ucfirst($user->role_name) . '.Manage')) { $canManageUser = true; } if ($canManageUser && $this->auth->has_permission('Bonfire.Roles.Manage')) { ?> <fieldset> <legend><?php echo lang('us_role'); ?>
$tpl_titulo->NOME_ARQUIVO_ICONE = "entradas.png"; $tpl_titulo->show(); //Inicio da exclusão de entradas $tpl = new Template("templates/notificacao.html"); $tpl->ICONES = $icones; $tpl->DESTINO = "entradas.php"; //Verifica se ja foi efetuado Saídas quaisquer para o lote/entrada em questão $sql3 = "SELECT * FROM saidas_produtos WHERE saipro_lote={$entrada}"; $query3 = mysql_query($sql3); if (!$query3) { die("Erro SQL: " . mysql_error()); } $linhas = mysql_num_rows($query3); //Se já houve Saídas referentes a esta entrada então não pode-se exclui-la if ($linhas > 0) { $tpl->block("BLOCK_ERRO"); $tpl->block("BLOCK_NAOAPAGADO"); $tpl->MOTIVO_COMPLEMENTO = "Já aconteceram vendas de produtos pertencentes a esta entrada/lote"; $tpl->block("BLOCK_BOTAO_VOLTAR"); } else { //Excluir do estoque todos os produtos da entrada $sql = "DELETE FROM estoque WHERE etq_lote={$entrada}"; $query = mysql_query($sql); if (!$query) { die("Erro SQL: " . mysql_error()); } //Excluir intens da entrada primeiro $sql1 = "DELETE FROM entradas_produtos WHERE entpro_entrada='{$entrada}'"; $query1 = mysql_query($sql1); $query1 = mysql_query($sql1); if (!$query1) {
$tpl4->COLUNA_LINK_ARQUIVO = "saidas_ver.php?codigo={$saida}&tiposaida={$tiposaida}&ope=4"; $tpl4->COLUNA_LINK_TARGET = "_blank"; $tpl4->block("BLOCK_COLUNA_LINK"); $tpl4->block("BLOCK_BOTAOPADRAO_SIMPLES"); $tpl4->block("BLOCK_BOTAOPADRAO_IMPRIMIR"); $tpl4->block("BLOCK_BOTAOPADRAO"); $tpl->block("BLOCK_CONTEUDO"); $tpl4->block("BLOCK_COLUNA"); $tpl4->block("BLOCK_LINHA"); $tpl4->block("BLOCK_BOTOES"); $tpl4->show(); } if ($botaofechar == 1) { $tpl4 = new Template("templates/botoes1.html"); //Botão Fechar $tpl4->block("BLOCK_LINHAHORIZONTAL_EMCIMA"); $tpl4->block("BLOCK_COLUNA_LINK_FECHAR"); $tpl4->COLUNA_LINK_ARQUIVO = ""; $tpl4->block("BLOCK_COLUNA_LINK"); $tpl4->block("BLOCK_BOTAOPADRAO_SIMPLES"); $tpl4->block("BLOCK_BOTAOPADRAO_FECHAR"); $tpl4->block("BLOCK_BOTAOPADRAO_AUTOFOCO"); $tpl4->block("BLOCK_BOTAOPADRAO"); $tpl->block("BLOCK_CONTEUDO"); $tpl4->block("BLOCK_COLUNA"); $tpl4->block("BLOCK_LINHA"); $tpl4->block("BLOCK_BOTOES"); $tpl4->show(); } ?> <!--sai_totalbruto,
if (strlen($texto) % 2 != 0) { $texto = "0" . $texto; } while (strlen($texto) > 0) { $i = round(esquerda($texto, 2)); $texto = direita($texto, strlen($texto) - 2); $f = $barcodes[$i]; for ($i = 1; $i < 11; $i += 2) { if (substr($f, $i - 1, 1) == "0") { $f1 = $fino; } else { $f1 = $largo; } $tpl->F1 = $f1; $tpl->ALTURA = $altura; $tpl->block("BLOCK_1"); $tpl->block("BLOCK_ITEM"); if (substr($f, $i, 1) == "0") { $f2 = $fino; } else { $f2 = $largo; } $tpl->F2 = $f2; $tpl->ALTURA = $altura; $tpl->block("BLOCK_2"); $tpl->block("BLOCK_ITEM"); } } $tpl->LARGO = $largo; $tpl->FINO = $fino; $tpl->VALOR = $valor;
} if ($passo == 2) { //Verifica se o consumidor possui vendas incompleta if ($consumidor != "") { // Se for uma devolução, então não realizar essa verificação $sql4 = "SELECT * from saidas WHERE sai_status=2 and sai_consumidor= {$consumidor} and sai_codigo not in ({$saida})"; if (!($query4 = mysql_query($sql4))) { die("Erro 4:" . mysql_error()); } $linhas4 = mysql_num_rows($query4); //print_r($_REQUEST); if ($linhas4 > 0 && $operacao == 1 && $consumidor != 0) { $tpl = new Template("templates/notificacao.html"); $tpl->ICONES = $icones; //$tpl->MOTIVO_COMPLEMENTO = ""; $tpl->block("BLOCK_ATENCAO"); $tpl->LINK = "saidas_cadastrar.php?codigo={$saida}&operacao=2&tiposaida=1&id={$id}"; $vendas_incompletas = "<br> <i>"; while ($dados4 = mysql_fetch_assoc($query4)) { $vendainc_codigo = $dados4["sai_codigo"]; $vendainc_data = converte_data($dados4["sai_datacadastro"]); $vendainc_hora = converte_hora($dados4["sai_horacadastro"]); $vendas_incompletas = $vendas_incompletas . "Nº {$vendainc_codigo}, Data: {$vendainc_data} {$vendainc_hora}<br>"; } $vendas_incompletas = $vendas_incompletas . "</i><br>"; $tpl->MOTIVO = "\n Este consumidor possui vendas incompletas!<br>\n {$vendas_incompletas}\n "; $tpl->block("BLOCK_MOTIVO"); $tpl->PERGUNTA = "Deseja continuar assim mesmo?"; $tpl->block("BLOCK_PERGUNTA"); $tpl->NAO_LINK = "saidas.php"; $tpl->block("BLOCK_BOTAO_NAO_LINK");
exit; } include "includes.php"; //Template de Título e Sub-título $tpl_titulo = new Template("templates/titulos.html"); $tpl_titulo->TITULO = "CAIXAS"; $tpl_titulo->SUBTITULO = "CADASTRO/EDIÇÃO"; $tpl_titulo->ICONES_CAMINHO = "{$icones}"; $tpl_titulo->NOME_ARQUIVO_ICONE = "caixas.png"; $tpl_titulo->show(); $tpl = new Template("templates/listagem_2.html"); //Botão Cadastrar if ($usuario_grupo != 4) { $tpl->LINK = "caixas_cadastrar.php?operacao=cadastrar"; $tpl->BOTAO_NOME = "CADASTRAR"; $tpl->block("BLOCK_AUTOFOCO"); //$tpl->block("BLOCK_RODAPE_BOTAO_MODELO_DESABILITADO"); $tpl->block("BLOCK_RODAPE_BOTAO_MODELO"); $tpl->block("BLOCK_FILTRO_COLUNA"); $tpl->block("BLOCK_FILTRO"); } //Nome $tpl->CABECALHO_COLUNA_TAMANHO = ""; $tpl->CABECALHO_COLUNA_COLSPAN = ""; $tpl->CABECALHO_COLUNA_NOME = "NOME"; $tpl->block("BLOCK_LISTA_CABECALHO"); //Local $tpl->CABECALHO_COLUNA_TAMANHO = ""; $tpl->CABECALHO_COLUNA_COLSPAN = ""; $tpl->CABECALHO_COLUNA_NOME = "LOCAL"; $tpl->block("BLOCK_LISTA_CABECALHO");
$tpl8->COOPERATIVA = "O USUÁRIO ROOT NÃO PERTENCE A NENHUMA COOPERATIVA"; $tpl8->QUIOSQUE = "USUÁRIO ROOT"; $tpl8->USUARIO_NOME = ""; $tpl8->CODIGO_USUARIO = ""; } else { $tpl8->COOPERATIVA = "{$usuario_cooperativanomecompleto}"; $tpl8->QUIOSQUE = $usuario_quiosquenome; $tpl8->USUARIO_NOME = $usuario_nome; $tpl8->CODIGO_USUARIO = $usuario_codigo; } if ($usuario_caixa != 0) { if ($usuario_grupo == 1 || $usuario_grupo == 3) { //$tpl8->block("BLOCK_DESASSOCIAR_CAIXA"); } $tpl8->CAIXAUSUARIO = "{$usuario_caixa_nome}"; $tpl8->block("BLOCK_NOME_CAIXA"); } $tpl8->block("BLOCK_NOME_QUIOSQUE_COOPERATIVA"); //Configurações if ($usuario_grupo == 1 || $usuario_grupo == 7) { $tpl8->block("BLOCK_CONFIGURACOES"); } //Grupo de permissão if ($usuario_grupo == 0) { //$tpl8->USUARIO_TIPO_ARQUIVO = "../geral/info.png"; $tpl8->USUARIO_GRUPO = "Desconhecido"; } else { $tpl8->USUARIO_GRUPO = $permissao_nome; } //Caixa Abrir Encerrar e Vendas if ($usuario_grupo == 4) {
$cooperativa = $usuario_cooperativa; } //Template de Título e Sub-título $tpl_titulo = new Template("templates/titulos.html"); $tpl_titulo->TITULO = "QUIOSQUES"; $tpl_titulo->SUBTITULO = "CADASTRO/EDIÇÃO"; $tpl_titulo->ICONES_CAMINHO = "{$icones}"; $tpl_titulo->NOME_ARQUIVO_ICONE = "quiosques.png"; $tpl_titulo->show(); //Verifica se foi selecionado pelo menos um tipo de negociacao if (empty($tiponegociacao)) { $tpl_notificacao = new Template("templates/notificacao.html"); $tpl_notificacao->ICONES = $icones; $tpl_notificacao->MOTIVO_COMPLEMENTO = "É necessário selecionar pelo menos um tipo de negociação!"; //$tpl_notificacao->DESTINO = "produtos.php"; $tpl_notificacao->block("BLOCK_ERRO"); $tpl_notificacao->block("BLOCK_NAOEDITADO"); //$tpl_notificacao->block("BLOCK_MOTIVO_JAEXISTE"); $tpl_notificacao->block("BLOCK_BOTAO_VOLTAR"); $tpl_notificacao->show(); exit; } if ($codigo == "") { $idunico = uniqid(); $sql = " INSERT INTO quiosques (qui_nome,qui_cidade,qui_cep,qui_bairro,qui_vila,qui_endereco,qui_numero,qui_complemento,qui_referencia,qui_fone1,qui_fone2,qui_email,qui_obs,qui_datacadastro,qui_horacadastro,qui_cooperativa,qui_usuario,qui_idunico)\n\tVALUES ('{$nome}','{$cidade}','{$cep}','{$bairro}','{$vila}','{$endereco}','{$numero}','{$complemento}','{$referencia}','{$fone1}','{$fone2}','{$email}','{$obs}','{$datacadastro}','{$horacadastro}','{$cooperativa}','{$usuario_codigo}','{$idunico}');"; $query = mysql_query($sql); if (!$query) { die("Erro SQL"); } $ultimo = mysql_insert_id(); $quiosque = $ultimo;
?> </div> <!-- END OF nav-collapse --> </div><!-- /container --> <div style="clearfix"></div> </div><!-- /topbar-inner --> </div><!-- /topbar --> <div class="subnav navbar-fixed-top" > <div class="container-fluid"> <?php if (isset($toolbar_title)) { ?> <h1><?php echo $toolbar_title; ?> </h1> <?php } ?> <div class="pull-right" id="sub-menu"> <?php Template::block('sub_nav', ''); ?> </div> </div> </div>
$sql = "SELECT * FROM cidades join estados on (cid_estado=est_codigo) WHERE cid_codigo='{$cidade}'"; $query = mysql_query($sql); if (!$query) { die("Erro: " . mysql_error()); } while ($dados = mysql_fetch_array($query)) { $estado = $dados["cid_estado"]; $pais = $dados["est_pais"]; } } //Estrutura dos campos de cadastro $tpl1 = new Template("templates/cadastro_edicao_detalhes_2.html"); $tpl1->LINK_DESTINO = "quiosques_cadastrar2.php"; //Chama o arquivo javascript $tpl1->JS_CAMINHO = "quiosques_cadastrar.js"; $tpl1->block("BLOCK_JS"); //Nome $tpl1->TITULO = "Nome"; $tpl1->block("BLOCK_TITULO"); $tpl1->CAMPO_QTD_CARACTERES = ""; $tpl1->CAMPO_TIPO = "text"; $tpl1->CAMPO_NOME = "nome"; $tpl1->CAMPO_DICA = ""; $tpl1->CAMPO_ID = ""; $tpl1->CAMPO_TAMANHO = "35"; $tpl1->CAMPO_VALOR = $nome; $tpl1->CAMPO_QTD_CARACTERES = 70; $tpl1->block("BLOCK_CAMPO_HISTORICO_DESATIVADO"); $tpl1->block("BLOCK_CAMPO_AUTOSELECIONAR"); $tpl1->block("BLOCK_CAMPO_NORMAL"); if ($operacao == 'ver') {
$obj = new Documento(); $grupo = $obj::ID_GRUPO_ATAS; $tpl = new Template("view/servicos/list.html"); $tpl->GRUPO = $obj->get_pasta_grupo($grupo); $user = $_SESSION['zurc.userPerfilId'] != Perfil::SINDICO ? $_SESSION['zurc.userId'] : ""; $pesquisa = isset($_REQUEST['pesquisa']) ? $_REQUEST['pesquisa'] : ""; $pagina = isset($_REQUEST['pagina']) ? $_REQUEST['pagina'] : "1"; $totalPesquisa = $obj->recuperaTotal($pesquisa, $grupo, $user); $configPaginacao = $obj->paginar($totalPesquisa, $pagina); $alist = $obj->listar($configPaginacao['primeiroRegistro'], $configPaginacao['quantidadePorPagina'], $pesquisa, $grupo, $user); if (count($alist) > 0) { foreach ($alist as $key => $publicacao) { $tpl->nome = $publicacao->titulo; $tpl->data = $obj->getData($publicacao->data); $tpl->ID_HASH = $obj->md5_encrypt($publicacao->id); $tpl->block("BLOCK_ITEM_LISTA"); } } $tpl->paginar_class = 'paginar'; $tpl->TOTAL_PAGINAS = $configPaginacao['totalPaginas']; $tpl->PAGINA_ANTERIOR = $configPaginacao['paginaAnterior']; $tpl->PROXIMA_PAGINA = $configPaginacao['proximaPagina']; $tpl->PAGINA = $pagina; if ($configPaginacao['totalPaginas'] > 1) { $tpl->block("BLOCK_PAGINACAO"); } $tpl->show(); exit; ?>
} $tipopagina = "produtos"; include "includes.php"; //Template de TÃtulo e Sub-tÃtulo $tpl_titulo = new Template("templates/titulos.html"); $tpl_titulo->TITULO = "TIPO DE CONTAGEM"; $tpl_titulo->SUBTITULO = "LISTA DE TIPOS DE CONTAGEM DE PRODUTOS"; $tpl_titulo->ICONES_CAMINHO = "{$icones}"; $tpl_titulo->NOME_ARQUIVO_ICONE = "produtos.png"; $tpl_titulo->show(); $tpl = new Template("tipo_contagem.html"); $tpl->ICONES_CAMINHO = "{$icones}"; $filtronome = $_POST["filtronome"]; $tpl->FILTRO_NOME = $filtronome; if ($permissao_tipocontagem_cadastrar == 1) { $tpl->block("BLOCK_BOTAO_CADASTRAR"); } //SQL principal $sql = "\nSELECT \n *\nFROM\n produtos_tipo \nWHERE\n (protip_cooperativa='0' OR protip_cooperativa={$usuario_cooperativa}) AND\n protip_nome like '%{$filtronome}%'\nORDER BY\n protip_nome\n"; //Paginação $query = mysql_query($sql); if (!$query) { die("Erro SQL Principal Paginação:" . mysql_error()); } $linhas = mysql_num_rows($query); $por_pagina = $usuario_paginacao; $paginaatual = $_POST["paginaatual"]; $paginas = ceil($linhas / $por_pagina); //Se é a primeira vez que acessa a pagina então começar na pagina 1 if ($paginaatual == "" || $paginas < $paginaatual || $paginaatual <= 0) { $paginaatual = 1;
$tpl->COLUNA_ALINHAMENTO = "right"; $tpl->TEXTO_VALOR = "Email: "; $tpl->block("BLOCK_TEXTO"); $tpl->block("BLOCK_CONTEUDO"); $tpl->block("BLOCK_COLUNA"); $tpl->COLUNA_ALINHAMENTO = "left"; $tpl->CAMPO_ESTILO = "width:300px"; $tpl->block("BLOCK_CAMPO_ESTILO"); $tpl->CAMPO_TIPO = "text"; $tpl->CAMPO_NOME = "email"; $tpl->CAMPO_TAMANHO = ""; $tpl->CAMPO_VALOR = "{$email}"; $tpl->block("BLOCK_CAMPO_DESABILITADO"); $tpl->block("BLOCK_CAMPO_PADRAO"); $tpl->block("BLOCK_CAMPO"); $tpl->block("BLOCK_CONTEUDO"); $tpl->block("BLOCK_COLUNA"); $tpl->block("BLOCK_LINHA"); $tpl->show(); //Botão voltar $tpl = new Template("templates/botoes1.html"); $tpl->block("BLOCK_COLUNA_LINK_VOLTAR"); $tpl->block("BLOCK_COLUNA_LINK"); $tpl->block("BLOCK_BOTAOPADRAO_SIMPLES"); $tpl->block("BLOCK_BOTAOPADRAO_VOLTAR"); $tpl->block("BLOCK_BOTAOPADRAO"); $tpl->block("BLOCK_COLUNA"); $tpl->block("BLOCK_LINHA"); $tpl->block("BLOCK_BOTOES"); $tpl->show(); include "baixo.php";
$tpl4->COLUNA_TAMANHO = "100%"; $tpl4->COLUNA_ALINHAMENTO = "right"; $tpl4->block("BLOCK_COLUNA_LINK"); $tpl4->block("BLOCK_BOTAOPADRAO_SIMPLES"); $tpl4->block("BLOCK_BOTAOPADRAO_AUTOFOCO"); $tpl4->block("BLOCK_BOTAOPADRAO_CADASTRAR"); $tpl4->block("BLOCK_BOTAOPADRAO"); $tpl4->block("BLOCK_COLUNA"); } $tpl4->block("BLOCK_LINHA"); $tpl4->block("BLOCK_BOTOES"); $tpl4->block("BLOCK_LINHAHORIZONTAL_EMBAIXO"); $tpl4->show(); //Listagem $tpl2 = new Template("templates/lista2.html"); $tpl2->block("BLOCK_TABELA_CHEIA"); $tpl2->CABECALHO_COLUNA_COLSPAN = ""; $tpl2->CABECALHO_COLUNA_TAMANHO = ""; $tpl2->CABECALHO_COLUNA_NOME = "Nº"; $tpl2->block("BLOCK_CABECALHO_COLUNA"); $tpl2->CABECALHO_COLUNA_COLSPAN = "2"; $tpl2->CABECALHO_COLUNA_TAMANHO = ""; $tpl2->CABECALHO_COLUNA_NOME = "DATA"; $tpl2->block("BLOCK_CABECALHO_COLUNA"); $tpl2->CABECALHO_COLUNA_COLSPAN = ""; $tpl2->CABECALHO_COLUNA_TAMANHO = ""; $tpl2->CABECALHO_COLUNA_NOME = "MOTIVO"; $tpl2->block("BLOCK_CABECALHO_COLUNA"); $tpl2->CABECALHO_COLUNA_COLSPAN = ""; $tpl2->CABECALHO_COLUNA_TAMANHO = ""; $tpl2->CABECALHO_COLUNA_NOME = "DESCRIÇÃO";
$z = 0; if (count($uoTipoServicos) > 0) { foreach ($uoTipoServicos as $tipo) { $ucTipo = new UnidadeConsumidora(0, null, null, null, null, null, null, null, null, null, null, $tipo); $mesmoTipo = $uo->getUcPorTipo($tipo); $tpl->TIPOSSERVICOS .= "<br /> - <b><font color='navy'>" . $ucTipo->getTipoNome() . "</font></b>: <a href='udd_uoCharts.php?chave=" . $_GET['chave'] . "&svc={$tipo}&start=" . $anoAtual . "'>"; $tpl->TIPOSSERVICOS .= "Relatório " . $anoAtual . " de " . count($mesmoTipo) . " UC(s)</a>"; $tpl->TIPOSERVICO = $ucTipo->getTipoNome(); $tpl->CHART_VALOR = $uo->getTotalPorTipo($tipo, $anoAtual); if ($z < count($uoTipoServicos)) { $tpl->COMA1 = ","; } else { $tpl->COMA1 = ""; } $z++; $tpl->block('EACH_CHART_SERVICO'); $tipoVal[$tipo]['nome'] = $ucTipo->getTipoNome(); $tipoVal[$tipo]['mes'][1] = 0; $tipoVal[$tipo]['mes'][2] = 0; $tipoVal[$tipo]['mes'][3] = 0; $tipoVal[$tipo]['mes'][4] = 0; $tipoVal[$tipo]['mes'][5] = 0; $tipoVal[$tipo]['mes'][6] = 0; $tipoVal[$tipo]['mes'][7] = 0; $tipoVal[$tipo]['mes'][8] = 0; $tipoVal[$tipo]['mes'][9] = 0; $tipoVal[$tipo]['mes'][10] = 0; $tipoVal[$tipo]['mes'][11] = 0; $tipoVal[$tipo]['mes'][12] = 0; } }
podemos então excluir o fechamento, mas devemos lembrar de excluir primeiro as taxas do fechamento para depois excluir o fechamento em questão, dessa forma não deixamos lixo no banco. Ao excluir devemos considerar algumas regras */ $codigo = $_REQUEST["codigo"]; //Altera todos os produtos vendidos que foram acertados para 'n�o acertados' $sql = "\n UPDATE\n saidas_produtos \n SET \n saipro_fechado='0'\n WHERE \n saipro_fechado='{$codigo}'\n "; $query = mysql_query($sql); if (!$query) { die("Erro SQL: " . mysql_error()); } //Deleta todoa as taxas do fechamento para depois excluir o fechamento $sql = "\n DELETE FROM fechamentos_taxas \n WHERE fchtax_fechamento={$codigo}\n"; $query = mysql_query($sql); if (!$query) { die("Erro SQL: " . mysql_error()); } //Deleta o fechamento $sql = "\n DELETE FROM fechamentos \n WHERE fch_codigo={$codigo}\n"; $query = mysql_query($sql); if (!$query) { die("Erro SQL: " . mysql_error()); } $tpl6 = new Template("templates/notificacao.html"); $tpl6->ICONES = $icones; $tpl6->block("BLOCK_CONFIRMAR"); $tpl6->block("BLOCK_APAGADO"); $tpl6->DESTINO = "acertos_revenda.php"; $tpl6->block("BLOCK_BOTAO"); $tpl6->show(); include "rodape.php";
<?php require "src/scripts/conecta.php"; require "src/scripts/restrito.php"; include "src/scripts/functions.php"; require "src/classes/Template.class.php"; include_once "src/classes/Users.class.php"; include "src/classes/Contratos.class.php"; redirectByPermission(2); // SETAR PERMISSÃO DA PÁGINA $tpl = new Template('html_libs/template_ope.html'); $tpl->addFile("MENU", 'html_libs/ope_secondMenu.html'); $tpl->addFile("CONTEUDO", 'html_libs/ope_index.html'); $tpl->block('SHOW_1STBUTTON'); $nivel = $_SESSION['nivel']; if (isset($_GET['data_ref']) && (strlen($_GET['data_ref']) >= 6 && strlen($_GET['data_ref']) <= 7)) { $mes = explode("-", $_GET['data_ref']); $mes_ant = $mes[0]; $ano = $mes[1]; $tpl->MES_ANT = getMesNome($mes_ant, false); $tpl->ANO = $ano; } else { $mes_ant = Date('n') > 1 ? Date('n') - 1 : 12; $ano = Date('n') > 1 ? Date('Y') : Date('Y') - 1; $tpl->MES_ANT = getMesNome($mes_ant, false); $tpl->ANO = $ano; } for ($i = 1; $i <= 12; $i++) { $tpl->MESREF = $i . "-" . Date('Y'); $tpl->MESANOREF = getMesNome($i) . "/" . Date('y'); $tpl->block('EACH_MESMENU');
while ($dados = mysql_fetch_assoc($query)) { $taxa = $dados["quitax_taxa"]; $taxaref = $dados["quitax_valor"]; $taxavalor = $valorbruto * $taxaref / 100; $sql5 = "\n INSERT INTO\n acertos_taxas (\n acetax_acerto,\n acetax_taxa,\n acetax_referencia,\n acetax_valor\n )\n VALUES (\n '{$ultimo}',\n '{$taxa}',\n '{$taxaref}',\n '{$taxavalor}'\n )"; $query5 = mysql_query($sql5); if (!$query5) { die("Erro5:" . mysql_error()); } } //Atribuir como acertado os produtos vendidos $sql8 = "\nUPDATE\n saidas_produtos \n join produtos on (saipro_produto=pro_codigo)\n join produtos_tipo on (pro_tipocontagem=protip_codigo) \n join entradas on (saipro_lote=ent_codigo)\n join saidas on (sai_codigo=saipro_saida)\nSET \n saipro_acertado='{$ultimo}'\nWHERE \n saipro_acertado=0 and\n ent_fornecedor={$fornecedor} and\n sai_datacadastro BETWEEN '{$datade}' AND '{$dataate}' and\n ent_quiosque={$usuario_quiosque} and\n ent_tiponegociacao=1 and\n sai_tipo=1 and\n sai_status=1\n"; $query8 = mysql_query($sql8); if (!$query8) { die("Erro8:" . mysql_error()); } $tpl6 = new Template("templates/notificacao.html"); $tpl6->ICONES = $icones; $tpl6->block("BLOCK_CONFIRMAR"); //$tpl6->block("BLOCK_CADASTRADO"); $tpl6->MOTIVO = "O acerto foi registrado com sucesso!"; $tpl6->LINK = "acertos_cadastrar3.php?codigo={$ultimo}&operacao=imprimir"; $tpl6->block("BLOCK_MOTIVO"); $tpl6->PERGUNTA = "Deseja imprimir o relatórios do acerto?"; $tpl6->block("BLOCK_PERGUNTA"); $tpl6->NAO_LINK = "acertos.php"; $tpl6->LINK_TARGET = "_blank"; $tpl6->block("BLOCK_BOTAO_NAO_LINK"); $tpl6->block("BLOCK_BOTAO_SIMNAO"); $tpl6->show(); include "rodape.php";
$sigla = $dados["protip_sigla"]; } $data = desconverte_data($_POST["data"]); $hora = $_POST["hora"]; $tpl_titulo = new Template("templates/titulos.html"); $tpl_titulo->TITULO = "ENTRADAS"; $tpl_titulo->SUBTITULO = "IMPRIMIR ETIQUETAS GRANDE"; $tpl_titulo->ICONES_CAMINHO = "{$icones}"; $tpl_titulo->NOME_ARQUIVO_ICONE = "etiquetas.png"; $tpl_titulo->show(); $tpl1 = new Template("templates/cadastro_edicao_detalhes_2.html"); $tpl1->LINK_DESTINO = "entradas_etiquetao2.php"; $tpl1->LINK_TARGET = "_blank"; //Lote $tpl1->TITULO = "Lote"; $tpl1->block("BLOCK_TITULO"); $tpl1->CAMPO_QTD_CARACTERES = ""; $tpl1->CAMPO_TIPO = "text"; $tpl1->CAMPO_NOME = "lote"; $tpl1->CAMPO_DICA = ""; $tpl1->CAMPO_ID = ""; $tpl1->CAMPO_TAMANHO = ""; $tpl1->CAMPO_VALOR = $lote; $tpl1->CAMPO_QTD_CARACTERES = ""; $tpl1->block("BLOCK_CAMPO_NORMAL"); $tpl1->block("BLOCK_CAMPO_DESABILITADO"); $tpl1->block("BLOCK_CAMPO"); $tpl1->block("BLOCK_CONTEUDO"); $tpl1->block("BLOCK_ITEM"); //Fornecedor $tpl1->TITULO = "Fornecedor";
} else { $nome = "Não"; } } $tpl_campos->CAMPO_VALOR = "{$nome}"; $tpl_campos->CAMPO_QTDCARACTERES = ""; $tpl_campos->block("BLOCK_CAMPO_DESABILITADO"); $tpl_campos->block("BLOCK_CAMPO_PADRAO"); $tpl_campos->block("BLOCK_CAMPO"); $tpl_campos->block("BLOCK_CONTEUDO"); $tpl_campos->block("BLOCK_COLUNA"); $tpl_campos->block("BLOCK_LINHA"); $tpl_campos->show(); //Listagem $tpl_lista = new Template("../templates/lista2.html"); $tpl_lista->block("BLOCK_TABELA_CHEIA"); //Cabeçalho $tpl_lista->TEXTO = "SAÍDA"; $tpl_lista->COLUNA_ALINHAMENTO = "center"; $tpl_lista->COLUNA_TAMANHO = ""; $tpl_lista->COLUNA_COLSPAN = ""; $tpl_lista->block("BLOCK_COLUNA_PADRAO"); $tpl_lista->block("BLOCK_TEXTO"); $tpl_lista->block("BLOCK_CONTEUDO"); $tpl_lista->block("BLOCK_COLUNA"); $tpl_lista->TEXTO = "DATA"; $tpl_lista->COLUNA_ALINHAMENTO = "center"; $tpl_lista->COLUNA_TAMANHO = ""; $tpl_lista->COLUNA_COLSPAN = "2"; $tpl_lista->block("BLOCK_COLUNA_PADRAO"); $tpl_lista->block("BLOCK_TEXTO");