Exemplo n.º 1
0
    $db->executa("update comandas set com_vltotal =" . $db->vlt["vltotal"] . " where com_id = " . $_POST["com_id"]);
    $nota = new atendimento($_POST["com_id"], $db);
    $nota->emite();
    echo "<script>parent.location.href='ate_mapamesas.php';</script>";
}
if (isset($_POST["btnexcluir"])) {
    $db->executa("delete from comandas where com_id= " . $_POST["com_id"]);
    echo "<script>parent.location.href='ate_mapamesas.php';</script>";
}
$form->Makeform("form1", "post", "", "", "", true, "Pedido");
if ($_GET["cli_id"] != '') {
    $db->executa($db->getJoinRecord("clientes(+)ruas|cli_ruaid=rua_id\n\t\t                                     (+)bairros|bai_id=cli_baiid", "cli_id=" . $_GET["cli_id"], '', 0), true, "cli");
}
$form->linha(true);
$comanda = $comanda == '' ? $_POST["com_id"] : $comanda;
$form->Append("<input type='hidden' value='" . $comanda . "' name='com_id'>");
$form->Append("<input type='hidden' value='" . $gravado . "' name='gravado'>");
$form->AbreCelula("Item");
$form->FrmInput("", "cti_proid", 8, 7, "Código do item", '', $_POST["cti_proid"], 'onBlur="document.form1.submit()"', 0);
if ($_POST["cti_proid"] != '') {
    $db->executa($db->getAll("produtos", "pro_id=" . $_POST["cti_proid"], '', 0), true, 'pro');
    if ($db->num_rows > 0) {
        $hab1 = 1;
        $form->Append("&nbsp;&nbsp;<span style='color:blue;font-size:12pt;font-weight:bold'>" . $db->pro["pro_nome"] . "</span></td>");
        $rs = $db->executa($db->getAll("produtos_itens", "ite_proid=" . $db->pro["pro_id"], '', 0));
        $form->FechaCelula();
        $form->linha(false, true);
        $form->Append("<td>&nbsp;</td><td colspan='10'>");
        $form->Append("<table><tr><td valign='top'>");
        $j = 1;
        while ($ln = $db->fetch_array($rs)) {
Exemplo n.º 2
0
  	
  }
 </script> 
</head>
<body bgcolor="#EAE5DA" oncontextmenu='return false'>
<center>
<?php 
$form->Makeform("form1", "post", "", "", "", true, "Adicionar");
$form->linha(true);
$form->AbreCelula("Item");
$form->FrmInput("", "cti_proid", 8, 7, "Código do item", '', $_POST["cti_proid"], 'onBlur="document.form1.submit()"', 0);
if ($_POST["cti_proid"] != '') {
    $db->executa($db->getAll("produtos", "pro_id=" . $_POST["cti_proid"], '', 0), true, 'pro');
    if ($db->num_rows > 0) {
        $hab = 1;
        $form->Append("</td><td style='color:blue;font-size:12pt;font-weight:bold'>" . $db->pro["pro_nome"] . "</td>");
        $rs = $db->executa($db->getAll("produtos_itens", "ite_proid=" . $db->pro["pro_id"], '', 0));
        $form->FechaCelula();
        $form->linha(false, true);
        $form->Append("<td>&nbsp;</td><td colspan='10'>");
        $form->Append("<table><tr><td valign='top'>");
        $j = 1;
        while ($ln = $db->fetch_array($rs)) {
            if ($j == 5) {
                $form->Append("</td><td valign='top'>");
                $j = 1;
            }
            $form->Append("<input type='checkbox' name='itens[]' id='item" . $ln["ite_id"] . "' value='" . $ln["ite_produto"] . "'>\n\t  \t              <label for='item" . $ln["ite_id"] . "'><b>" . $ln["ite_produto"] . "</b></label><br>");
            $j++;
        }
        $rs = $db->executa($db->getall("catprodutos_itens", "cpi_catid=" . $db->pro["pro_catid"], '', 0));
Exemplo n.º 3
0
<?php

require_once "libs/fc_sessoes.php";
require_once "libs/form2.class";
require_once "libs/funcoes.php";
require_once "libs/class_dbgrid.php";
require_once "libs/classes.class";
require_once "libs/class_interface.php";
require "classes/class_atendimento.php";
$db = new db();
$fc = "function mostra_comanda(com_id){\n\n\turl = 'ate_mostracomanda.php?com_id='+com_id;\n\tconsulta.location.href=url;\n\twinList['consulta'].open();\n\n}\nfunction nova_comanda(mesa){\n\n\turl = 'ate_novacomanda.php?mes_id='+mesa;\n\tcomanda.location.href=url;\n\twinList['comanda'].open();\n\n}";
$form = new form($fc);
$form->MakeForm("form", "post", '', '', '', true, "Mapa Mesas");
$form->linha(true);
$form->Append("<td><Table  style='background-color:white;border:2px inset black'>");
$rs = $db->executa("select * from mesas order by mes_id");
$i = 0;
$form->Append("<tr>");
while ($ln = $db->fetch_array($rs)) {
    $img = "mesa_liberada.gif";
    $event = "ondblclick='nova_comanda(" . $ln["mes_id"] . ")'";
    if ($i == 6) {
        $i = 0;
        $form->Append("</tr><tr>");
    }
    $sql = "select com_id from comandas where com_mesid = " . $ln["mes_id"] . "\n\t and com_dtcomanda = current_date and com_aberta = 1";
    $db->executa($sql, true, "mes");
    if ($db->num_rows > 0) {
        $img = "mesa_em_uso.gif";
        $event = "ondblclick='mostra_comanda(" . $db->mes["com_id"] . ")'";
    }
Exemplo n.º 4
0
    fputs($rsc, "?>");
    fclose($rsc);
    $_POST["criar"] = '';
}
$form->Makeform("form1", "post", "", "", "", true, "Criar Programa");
$form->linha(true);
$form->FrmInput("Nome Programa:", "pro_nomeprog", 0, '50', '', "E", $_POST["pro_nomeprog"]);
$form->linha(false, true);
$form->FrmInput("Texto de Identificação:", "pro_textoidf", 0, '50', '', "", $_POST["pro_textoidf"]);
$form->linha(false, true);
$form->FrmSelect("Modulo:", "pro_modulo", true, "sis_modulos", "mod_nome", "mod_nome", '', "-1", true, $_POST["pro_modulo"]);
$form->linha(false, true);
$form->FrmSelect("Tabela:", "pro_tabela", true, "pg_tables", "tablename", "tablename", '', "-1", true, $_POST["pro_tabela"], "onchange='document.form1.submit()'");
$form->linha(false, true);
if ($_POST["pro_tabela"] != '' and $_POST["criar"] == '') {
    $campos = $db->getAttTable($_POST["pro_tabela"]);
    $form->Append("<td colspan='10'><table cellspacing=0><tr>");
    $form->Append("<td class='cabecalho'>Campo</td><td class='cabecalho'><b>PK</b></td>\n\t               <td class='cabecalho'>Label</td><td class='cabecalho'>Tamanho</td></tr>");
    while ($ln = $db->fetch_array($campos)) {
        $form->Append("<tr><td><b>" . $ln["attname"] . "</b></td><td>\n\t\t                <input type='radio' name='pkey' value='" . $ln["attname"] . "'></td><td>\n\t\t               <input type='text' name='lbl" . $ln["attname"] . "' value='' size='10' text='label do campo'></td><td>\n\t\t               <input type='text' name='tam" . $ln["attname"] . "' value='' size='10' text='Tamanho do campo'></td></tr>");
    }
    $form->Append("</table></tr>");
    $form->linha(false, true);
    $form->abrecelula("&nbsp;");
    $form->frmbutton("Cadastrar", "criar", "onclick=\"return chknulo(document.form1)\"", "submit", "t");
    $form->fechacelula();
    $form->linha(false);
}
$form->fecha();
local("Secretaria >> <b>[</b>Tipo de Exceções de Avaliação<b>]</b>");
Makemenu($_SESSION["usu_id"], $_SESSION["usu_modulo"]);
Exemplo n.º 5
0
  <script>
  function addNovo(valor){ 	
  	
  		
  		parent.comanda.location.href='ate_nitemcomanda.php?com_id='+valor
  		parent.winList["comanda"].open();
  	
  	
  }
 </script> 
</head>
<body bgcolor="#EAE5DA" oncontextmenu='return false'>
<?php 
//echo $db->getJoinRecord("comandas(=)mesas|mes_id=com_mesid","com_id=".$_GET["com_id"],'',0);
$db->executa($db->getJoinRecord("comandas(=)mesas|mes_id=com_mesid", "com_id=" . $_GET["com_id"], '', 0), true, "pro");
$form->Append("<center><h1 style='color:#96928B'>" . $db->pro["mes_nome"] . "</h1>(comanda nº" . $_GET["com_id"] . ")</center><hr>");
$rsite = $db->executa($db->getJoinRecord("comandas(=)comanda_itens|com_id=cti_comid\n                                     (=)produtos|cti_proid=pro_id", "com_id=" . $_GET["com_id"], '', 0));
$form->Append("<table width='100%' cellspacing='0'>");
$vltotal = 0;
while ($lnite = $db->fetch_array($rsite)) {
    $obs = '';
    if ($lnite["cti_obs"] != '') {
        $obs = "<br><small>(" . $lnite["cti_obs"] . ")</small>";
    }
    $form->Append("<tr><td><b style='color:#96928B'>" . $lnite["cti_qtde"] . "</b> &nbsp;" . $lnite["pro_nome"] . "{$obs}</td>\n\t                <td style='text-align:right' valign='bottom'>" . number_format($lnite["pro_preco"], 2, ",", ".") . "</td>\n\t                <td style='text-align:right' valign='bottom'>\n\t                <b style='color:blue'>" . number_format($lnite["pro_preco"] * $lnite["cti_qtde"], 2, ",", ".") . "</b></td>\t                \n\t                <td><img src='libs/imagens/delitem.png'></td></tr>");
    $sql2 = "select  cpi_valor, cpi_item from comanda_itensextra inner join catprodutos_itens on cpi_id = ext_cipid\n             where   cpi_valor is not null and ext_iteid = " . $lnite["cti_id"];
    $rs2 = $db->executa($sql2);
    $valorext = 0;
    while ($ln2 = $db->fetch_array($rs2)) {
        $form->Append("<tr><td style='text-align:left' colspan='2'><b style='color:#96928B'>&nbsp;&nbsp;+" . $ln2["cpi_item"] . "</td>\n\t                <td style='text-align:right;color:blue;font-weight:bold' valign='bottom'>" . number_format($ln2["cpi_valor"], 2, ",", ".") . "</td></tr>");
        $valorext += $ln2["cpi_valor"];
Exemplo n.º 6
0
<body bgcolor="<?php 
echo $_SESSION["bgcolor"];
?>
" onload="winInit();">
<?php 
$sql = $db->getJoinRecord("clientes(+)ruas|cli_ruaid=rua_id\n\t\t                                         (+)bairros|bai_id=cli_baiid", $wh, 'cli_nome', 0);
//echo $sql;
$grid = new dbGrid();
$grid->sql = $sql;
$grid->header = array("Nome", "Endereço", "Fone");
$grid->fields = array("cli_nome", "rua_nome", "cli_foneprinc");
$grid->pfields = array("Nome", "Endereço", "Fone");
$grid->js = "manda";
$grid->js_campos = "0#1";
//$grid->limite     = 15;
$grid->size = 400;
$grid->event = "OnDblclick";
$grid->exec = 0;
$grid->altercolor = true;
$grid->show();
$form->Append("<hr>");
$form->append("<li><a href='#' onclick='showRelat(1);return false;' class='modulo'><b>Clientes Duplos</b></a></li>");
$window = new window(10, 30, '400px', '550px', 'consulta', 'consulta', '', '');
$window->show();
?>
  
<script>
$('bai_id').className = 'input';
</script>
<?php 
echo $fcfoco;
Exemplo n.º 7
0
            $db->executa("delete from comanda_itens where cti_id = " . $v);
        }
    }
}
if (isset($_POST["btnexcluir"])) {
    $db->executa("delete from comandas where com_id= " . $_POST["com_id"]);
    echo "<script>parent.location.href='del_nentrega.php';</script>";
}
$form->append("</center>");
$form->Makeform("form1", "post", "", "", "", true, "Pedido");
if ($_GET["cli_id"] != '') {
    $db->executa($db->getJoinRecord("clientes(+)ruas|cli_ruaid=rua_id\n\t\t                                     (+)bairros|bai_id=cli_baiid", "cli_id=" . $_GET["cli_id"], '', 0), true, "cli");
}
$form->linha(true);
$comanda = $comanda == '' ? $_POST["com_id"] : $comanda;
$form->Append("<input type='hidden' value='" . $comanda . "' name='com_id'>");
$form->Append("<input type='hidden' value='" . $gravado . "' name='gravado'>");
$form->Append("<td style='text-align:right'><b>Nome:</b></td><td>");
$form->FrmInput("Nome:", "del_nome", 75, 30, "", 'E', $db->cli["cli_nome"], '', 0);
$form->Append("&nbsp;&nbsp;&nbsp;<b onclick=\"setxy(this,'endereco');if (\$('endereco').style.display == 'none'){\$('endereco').style.display = ''}else{\$('endereco').style.display = 'none'}\">Mudar Endere�o</b></td>");
$form->linha(false, true);
$form->FrmInput("Fone:", "del_fone", 15, 10, "", 'E', $_GET["cli_fone"], "");
$form->linha(false, true);
$form->AbreCelula("Item:");
$form->FrmInput("", "cti_proid", 8, 7, "C�digo do item", '', $_POST["cti_proid"], 'onBlur="document.form1.submit()"', 0);
if ($_POST["cti_proid"] != '') {
    $db->executa($db->getAll("produtos", "pro_id=" . $_POST["cti_proid"], '', 0), true, 'pro');
    if ($db->num_rows > 0) {
        $hab = 1;
        $form->Append("&nbsp;&nbsp;<span style='color:blue;font-size:12pt;font-weight:bold'>" . $db->pro["pro_nome"] . "</span></td>");
        $form->linha(false, true);
Exemplo n.º 8
0
    $btnacao = "btnalterar";
    $btnlabel = "Alterar";
} else {
    $btnacao = "btncadastrar";
    $btnlabel = "Cadastrar";
}
if (isset($_GET["mes_id"])) {
    $btnacao = "btnalterar";
    $btnlabel = "Alterar";
    $join = "mesas";
    $wh = array("mes_id" => $_GET["mes_id"]);
    $campos = "*";
    $db->executa($db->select($campos, $join, $wh), true);
}
$form->MakeForm("form1", "post", "", "", "", false, "Cadastro de Mesas");
$form->Append("<tr><td valign='top'><fieldset><table align='left' valign='top'>");
$form->linha(true);
$form->FrmInput("Código:", "mes_id", 0, 5, "Código da mesa", "R", $db->dados["mes_id"]);
$form->linha(false, true);
$form->FrmInput("Mesa:", "mes_nome", 70, 30, "Nome Completo do Idoso", "E", $db->dados["mes_nome"]);
$form->linha(false, true);
$itens = array(1 => "Interna", 2 => "Externa");
$form->FrmSelect("Local:", "mes_local", false, $itens, '', '', 'Locl da mesa', "-1", 'true', $db->dados["mes_local"]);
$form->Append("</table></fieldset></td><td border='1' valign='top'><fieldset><table align='left'>");
$form->linha(true);
$sql = "SELECT * from mesas order by mes_id";
$grid = new dbGrid();
$grid->sql = $sql;
$grid->header = array("Código", "Mesa", "local");
$grid->fields = array("mes_id", "mes_nome", "mes_local");
$grid->pfields = array("Código", "Mesa", "local");
Exemplo n.º 9
0
  	
  }
  function cadastrar(){ 	
  	 
  	 return cliente.cadastrar();
  	   
   }
  	</script>
</head>
<body bgcolor="<?php 
echo $_SESSION["bgcolor"];
?>
" onload="winInit();">
<?php 
$form->MakeForm("form1", "post", "", "", "", true, "Clientes");
$form->Append("<input type='hidden' value='" . $db->dados["cli_id"] . "' name='cli_id'>");
$form->FrmInput("Nome:", "cli_nome", 75, 30, "", 'AE', $db->dados["cli_nome"]);
$form->linha(false, true);
$form->FrmInput("Fone:", "cli_foneprinc", 15, 10, "", 'E', $db->dados["cli_foneprinc"], "");
$form->linha(false, true);
$form->Frmdata("Nascimento:", "cli_dtnasc", '', "", strformat($db->dados["cli_dtnasc"], "dtbr"));
$form->linha(false, true);
$form->FrmDbConsulta("Endereço:", "ruas", "rua_id", "rua_nome", "fc_ruas.php", "Endereço", true, $db->dados["rua_id"], $db->dados["rua_nome"]);
$form->Append("<td><input type='text' value='" . $db->dados["cli_endnum"] . "' class='nnulo' size='5' name='cli_endnum'\n\t\t\t   onkeyup='c_maiuscula(this)' maxlenght='10'></td>");
$form->linha(false, true);
$form->FrmDbConsulta("Bairro:", "bairros", "bai_id", "bai_descr", "fc_bairros.php", "", true, $db->dados["cli_baiid"], $db->dados["bai_descr"]);
$form->linha(false, true);
$form->FrmInput("Complemento:", "cli_complemento", 75, 30, "", '', $db->dados["cli_complemento"]);
$form->linha(false, true);
$form->AbreCelula('');
//$form->FrmButton($btnlabel,$btnacao,"onclick='return chknulo(document.form1);'","submit");
Exemplo n.º 10
0
  		location.href ='cad_nprodutoitem.php?pro_id=<?php 
echo $_GET["pro_id"];
?>
';  
  		
  	}
  	</script>
</head>
<body bgcolor="<?php 
echo $_SESSION["bgcolor"];
?>
" onload="winInit();">
<?php 
$form->MakeForm("form1", "post", "", "", "", true, "");
if (isset($_GET["pro_id"])) {
    $form->Append("<tr><td valign='top' width='300'><fieldset><legend><b>Novo Item</b></legend><table valign='top'>");
    $form->linha(true);
    $form->FrmInput("Codigo:", "ite_id", 0, 5, "Codigo do item", "R", $db->dados["ite_id"]);
    $form->linha(false, true);
    $form->FrmInput("Item:", "ite_produto", 85, 20, "Descricao do item", "A", $db->dados["ite_proid"]);
    $form->linha(false, true);
    $form->Append("<td colspan=2>");
    $form->FrmButton("{$btnlabel}", "{$btnacao}", "OnClick='return chknulo(document.form1);'", "submit", "t");
    $form->FrmButton("Limpar", "btnlimpar", "onclick=\"return limpa()\"", "button");
    if (isset($_GET["aud_id"])) {
        $form->frmBDel("Excluir", "cad_produtoitem.php?pro_id=" . $_GET["pro_id"], "produtos_itens", "ite_id", $_GET["ite_id"], 1);
    }
    $form->Append("</td>");
    $form->Append("</table></fieldset></td><td border='1' valign='top'><fieldset><legend><b>Itens</b></legend></b><table align='left'><td>");
    $form->linha(true);
    $sql = "SELECT ite_id,\n\t               ite_produto\n\t\t      from produtos_itens  \n\t\t\t WHERE ite_proid =" . $_GET["pro_id"];
Exemplo n.º 11
0
<?php

require "libs/fc_sessoes.php";
require "libs/classes.class";
require "libs/form2.class";
require "libs/funcoes.php";
require "libs/class_dbgrid.php";
$db = new db();
$form = new form("", true, "libs");
$form->linha(true);
$itens[0]["Tab"] = "Produto";
$itens[0]["arq"] = "cad_nproduto";
$itens[0]["Active"] = 1;
$itens[1]["Tab"] = "Ingredientes";
$itens[1]["arq"] = "cad_nprodutoitem.php";
$itens[1]["Active"] = 0;
$form->Append("</center>");
$form->TabNav($itens, "80%");
$form->fecha();
makeMenu($_SESSION["usu_id"], $_SESSION["usu_modulo"]);
Exemplo n.º 12
0
    }
}
$form = new form('');
$form->Makeform("form1", "post", "", "", "", true, "Tele - Entrega");
$form->linha(true);
$form->FrmInput("Fone:", "cli_foneprinc", 15, 10, "", 'E', $_POST["cli_foneprinc"], "");
$form->linha(false, true);
if ($_POST["cli_foneprinc"] != '') {
    $sql = "select distinct cli_id\n\t        from clientes  left outer join clifones on cli_id = fon_cliid\n\t        where fon_numero    = " . $_POST["cli_foneprinc"] . "\n\t        or    cli_foneprinc =" . $_POST["cli_foneprinc"];
    //echo $sql;
    $db->executa($sql, true, "clif");
    if ($db->num_rows > 0) {
        $db->executa($db->getJoinRecord("clientes(+)ruas|cli_ruaid=rua_id\n\t\t                                         (+)bairros|bai_id=cli_baiid", "cli_id=" . $db->clif["cli_id"], '', 0), true, "cli");
    }
    $hab = 1;
    $form->Append("<input type='hidden' value='" . $db->cli["cli_id"] . "' name='cli_id'>");
    $form->FrmInput("Nome:", "cli_nome", 75, 30, "", 'E', $db->cli["cli_nome"]);
    $form->linha(false, true);
    $form->Frmdata("Nascimento:", "cli_dtnasc", '', "", strformat($db->cli["cli_dtnasc"], "dtbr"));
    $form->linha(false, true);
    $form->FrmDbConsulta("Endereço:", "ruas", "rua_id", "rua_nome", "fc_ruas.php", "Endereço", true, $db->cli["rua_id"], $db->cli["rua_nome"]);
    $form->Append("<td><input type='text' value='" . $db->cli["cli_endnum"] . "' class='nnulo' size='5' name='cli_endnum'\n\t\t\t   onkeyup='c_maiuscula(this)' maxlenght='10', id='cli_endnum'></td>");
    $form->linha(false, true);
    $form->FrmDbConsulta("Bairro:", "bairros", "bai_id", "bai_descr", "fc_bairros.php", "Bairro da residência do Apenado", true, $db->cli["cli_baiid"], $db->cli["bai_descr"]);
    $form->Append("<td><a onclick='showMap()'>Como Chegar</a></td>");
    $form->linha(false, true);
    $form->FrmInput("Complemento:", "cli_complemento", 75, 30, "", 'E', $db->cli["cli_complemento"]);
    $form->linha(false, true);
    $form->AbreCelula('');
    $form->FrmBtnOpen("Fazer Pedido", "btnpedido", "del_npedidotele.php?cli_id=" . $db->cli["cli_id"] . "&cli_fone=" . $_POST["cli_foneprinc"], "entrega");
    $form->FrmButton("Incluir", "btncadastrar", "onclick='return chknnulo(document.form1)'", "submit", "", false, $hab);