本文整理汇总了PHP中db::executa方法的典型用法代码示例。如果您正苦于以下问题:PHP db::executa方法的具体用法?PHP db::executa怎么用?PHP db::executa使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类db
的用法示例。
在下文中一共展示了db::executa方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doLogin
function doLogin($usu_login, $usu_senha)
{
$db = new db("../config.php");
$json = new Services_JSON();
$db->executa($db->getJoinRecord("funcionarios", "fun_nome='{$usu_login}' and fun_senha='{$usu_senha}'", '', 0), true, "user");
if ($db->num_rows == 1) {
$id = $db->user["usu_id"];
$login = $db->user["usu_login"];
$itens = array("usu_id" => $id, "usu_login" => $login, "status" => 1);
$str = $json->encode($itens);
session_register("usu_nome");
session_register("usu_id");
$_SESSION["usu_modulo"] = 0;
$_SESSION["usu_nome"] = $db->user["fun_nome"];
$_SESSION["usu_id"] = $db->user["fun_id"];
$_SESSION["sis_exerc"] = $exercicio;
$_SESSION["usu_grpid"] = $grp_id;
$_SESSION["bgcolor"] = "#EAE5DA";
$_SESSION["dtatend"] = date("d/m/Y");
if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
$ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
} else {
$ip = $HTTP_SERVER_VARS['REMOTE_ADDR'];
}
} else {
$itens = array("usu_id" => '', "usu_login" => $_GET["usu_login"], "status" => 2);
$str = $json->encode($itens);
}
return $str;
}
示例2: clientesFone
function clientesFone()
{
$db = new db("../config.php");
$db->_DEBUG = 1;
$json = new Services_JSON();
$rs = $db->executa($db->getAll("clientes", "(cli_nome = '" . $_GET["cli_nome"] . "'\n \t AND cli_foneprinc = " . $_GET["cli_fone"] . ")\n \t or (cli_nome = '" . $_GET["cli_nome"] . "' and cli_ruaid = " . $_GET["rua_id"] . ")\n \t ", '', 0));
if ($db->num_rows > 0) {
while ($ln = $db->fetch_array($rs)) {
$itens[] = array("cli_id" => $ln["cli_id"], "tem" => "S");
}
} else {
$itens[] = array("tem" => "N");
}
$str = $json->encode($itens);
return $str;
}
示例3: trazItens
function trazItens($cpi_id)
{
$db = new db("../config.php");
$db->_DEBUG = 1;
$json = new Services_JSON();
$rs = $db->executa($db->getAll("catprodutos_itens", "cpi_id={$cpi_id}", '', 0));
if ($db->num_rows > 0) {
while ($ln = $db->fetch_array($rs)) {
$itens = array("cpi_id" => $ln["cpi_id"], "cpi_item" => urlencode($ln["cpi_item"]), "tem" => "S");
}
} else {
$itens = array("tem" => "N");
}
$str = $json->encode($itens);
return $str;
}
示例4: addNovo
<script type='text/javascript' src='libs/funcoes.js'></script>
<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> " . $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'> +" . $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>");
示例5: db
<?php
session_start("usuarios");
if (!session_is_registered("usu_nome") and !session_is_registered("usu_id")) {
echo "sua Sess�o � inv�lida.....";
exit;
}
require_once "libs/classes.class";
require_once "libs/funcoes.php";
$db = new db();
if (is_admin($_SESSION["usu_id"])) {
$sqlmod = "select mod_id,mod_nome,mod_descricao,mod_icone\n from sis_modulos order by mod_id";
} else {
$sqlmod = "select mod_id,mod_nome,mod_descricao,mod_icone\n from sis_modulos left outer join per_mod\n\t\t\t on mod_id = per_mod\n\t\t\t where per_usuid = " . $_SESSION["usu_id"] . "\n\t\t\t order by mod_id";
}
$rsmod = $db->executa($sqlmod);
?>
<html>
<head>
<title>Módulos</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="Quanta Plus">
<link rel='stylesheet' href='libs/estilos.css' title='XP Extended' />
<SCRIPT LANGUAGE='JavaScript' SRC='libs/menuw.js'></SCRIPT>
<script type='text/javascript' src='libs/hmenu.js'></script>
<script type='text/javascript' src='libs/funcoes.js'></script>
<script type='text/javascript' src='libs/prototype.js'></script>
<script>
function muda(val,obj){
示例6: db
<?php
//atualiza menus
require "../libs/classes.class";
$db = new db("../config.php");
//$db->_DEBUG = 1;
//$fp = fopen("update.sql","r");
//while (!feof($fp)){
// $db->executa(fgets($fp));
//}
$sql = "create table comandaentrega (cet_comid bigint,cet_funid integer);";
$db->executa($sql);
$sql = "create unique index comandaentrega_unique on comandaentrega(cet_comid,cet_funid)";
$db->executa($sql);
$sql = "create index comandaentrega_cet_comid on comandaentrega(cet_comid)";
$db->executa($sql);
$sql = "create index comandaentrega_cet_funid on comandaentrega(cet_funid)";
$db->executa($sql);
示例7: db
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();
$db->_DEBUG = 1;
$hab1 = 0;
$hab = 0;
$form = new form('', true, "libs", false, 5);
if ($_POST["gravado"] != 1) {
$db->begin();
$campos = array("com_delivery" => 0, "com_dtcomanda" => date("Y-m-d"), "com_aberta" => '1', "com_mesid" => $_GET["mes_id"]);
$db->executa($db->insert($campos, "comandas"));
$comanda = $db->last_id("comandas", "com_id");
$gravado = 1;
$db->commit();
}
//echo $comanda;
if (isset($_POST["btncadastrar"])) {
echo $_POST["comanda"];
$db->begin();
$campos = array("cti_comid" => $_POST["com_id"], "cti_proid" => $_POST["cti_proid"], "cti_qtde" => $_POST["cti_qtde"]);
$db->executa($db->insert($campos, "comanda_itens"));
$item = $db->last_id("comanda_itens", "cti_id");
if (is_array($_POST["itens"])) {
$vi = '';
$obs = "Sem: ";
while (list($k, $v) = each($_POST["itens"])) {
示例8: db
<?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"] . ")'";
}
示例9: db
<?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";
$db = new db();
$db->_DEBUG = 1;
if (isset($_POST["btncadastrar"])) {
$sql = "select 1 from comandaentrega where cet_comid = " . $_POST["com_id"];
$db->executa($sql);
if ($db->num_rows > 0) {
messagebox("Comanda já lançada!");
} else {
$campos = array("cet_comid" => $_POST["com_id"], "cet_funid" => $_POST["cet_funid"]);
$db->executa($db->insert($campos, "comandaentrega"));
}
}
$form = new form();
$form->Makeform("form1", "post", "", "", "", true, "Controle da Entrega");
$form->linha(false, true);
$form->FrmInput("Comanda:", "com_id", 0, 10, "Número da comanda", "E");
$form->linha(false, true);
$form->FrmSelect("Funcionário:", "cet_funid", true, "funcionarios", "fun_id", "fun_nome", '', -1, "E", $_POST["cet_funid"]);
$form->linha(false, true);
$form->AbreCelula("");
$form->frmbutton("Cadastrar", "btncadastrar", "onclick='return chknulo(document.form1)'", "submit", 't');
$form->fecha();
$form->Append("<hr>");
示例10: db
<?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";
$db = new db();
if (isset($_POST["btncadastrar"])) {
$db->executa($db->doInsert("mesas"));
} elseif (isset($_POST["btnalterar"])) {
$db->executa($db->doUpdate("mesas", '', "where mes_id=" . $_GET["mes_id"]));
}
$js = " \tfunction manda(id){\n \t\tteste = 'cad_nmesa.php';\n \t\tlocation.href =teste+'?mes_id='+id; \t\t \n \t}";
$form = new form($js);
if (isset($_GET["mes_id"])) {
$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);
}
示例11: db
<?php
session_start("usuarios");
if (!isset($_SESSION["usu_login"]) and !isset($_SESSION["usu_id"])) {
echo "sua Sessão é inválida.....";
exit;
}
require_once "libs/classes.class";
require_once "libs/funcoes.php";
$db = new db();
if (isset($btncadastrar)) {
$campos = array("mnu_nome" => $txtmnu_nome, "mnu_pai" => $cbopai_id, "mnu_img" => $txtmnu_imagem, "mnu_dir" => $radmnu_dir, "mnu_sub" => $radsub_menu, "mnu_paisub" => $txtmnu_subpai, "mnu_arq" => $txtmnu_arq);
$db->executa($db->insert($campos, "mnu_filho"), 0);
$codmenu = $db->last_id("mnu_filho", "mnu_filid");
$sql = "insert into per_menus (mnu_id,per_usuid) values ({$codmenu}," . $_SESSION["usu_id"] . ")";
$rs = $db->executa($sql);
echo "<script>window.location.href='cfg1_nmenufilho001.php';</script>";
}
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="Quanta Plus">
<link rel="stylesheet" href="libs/estilos.css" type="text/css" media="all">
<script language="JavaScript" src="libs/funcoes.js"></script>
<link rel="stylesheet" href="libs/menuw.css" type="text/css" media="all">
<SCRIPT LANGUAGE="JavaScript" SRC="libs/menuw.js"></SCRIPT>
<link rel="stylesheet" href="libs/mnucemes.css" title="XP Extended" />
<script type="text/javascript" src="libs/hmenu.js"></script>
示例12: db
<?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";
$db = new db();
$form = new form("", false);
if (isset($_POST["btncadastrar"])) {
$exeptions = array("ite_proid" => $_GET["pro_id"]);
$db->executa($db->doInsert("produtos_itens", $exeptions));
} elseif (isset($_POST["btnalterar"])) {
$exeptions = array("ite_proid" => $_GET["pro_id"]);
$db->executa($db->doUpdate("produtos_itens", $exeptions, "where ite_id=" . $_POST["ite_id"]));
}
if (isset($_GET["ite_id"])) {
$btnacao = "btnalterar";
$btnlabel = "Alterar";
$db->dselect("produtos_itens", "ite_id", $_GET["ite_id"], true);
} else {
$btnacao = "btncadastrar";
$btnlabel = "Cadastrar";
}
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="Quanta Plus">
示例13: db
<?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";
$db = new db();
$db->_DEBUG = 1;
if (isset($_POST["btncadastrar"])) {
if ($_POST["cli_id"] == '') {
$campos = array("cli_nome" => $_POST["cli_nome"], "cli_ruaid" => $_POST["rua_id"], "cli_baiid" => $_POST["bai_id"], "cli_complemento" => $_POST["cli_complemento"], "cli_endnum" => $_POST["cli_endnum"], "cli_dtnasc" => $_POST["cli_dtnasc"], "cli_foneprinc" => $_POST["cli_foneprinc"]);
$db->executa($db->insert($campos, "clientes"));
}
}
$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"]);
示例14: count
$pdf->SetFont($fonte, "", 12);
$pdf->sety(15);
$pdf->SetFont($fonte, "b", 12);
$pdf->setx(5);
$pdf->ln();
$pdf->SetFont($fonte, "", 14);
$pdf->setx(5);
$pdf->cell(50, 5, "Tele Entregas do Dia", 0, 1);
$pdf->line(5, $pdf->GetY(), 290, $pdf->GetY());
$pdf->ln(10);
$pdf->setfont($fonte, "B", "14");
$pdf->cell(0, 5, $_GET["dtvenda"], 0, 1, "C");
$pdf->setfillcolor(235);
$pdf->SetFont($fonte, "b", 10);
$sql1 = "select count(*) as total from comandas\n where com_delivery = 1\n and com_dtcomanda = '" . strformat($_GET["dtvenda"], "dten") . "'";
$db->executa($sql1, true, "entregas");
$total = $db->entregas["total"];
$sql = "SELECT sum(cti_qtde) as total ,pro_nome \n from comandas inner join comanda_itens on com_id = cti_comid \n inner join produtos on pro_id = cti_proid\n where com_dtcomanda = '" . strformat($_GET["dtvenda"], "dten") . "'\n group by pro_nome order by pro_nome";
$rs = $db->executa($sql);
$pdf->cell(140, 5, "Produto", "B", 0, "C", 1);
$pdf->cell(45, 5, "Qtde", "B", 1, "C", 1);
$pdf->SetFont($fonte, "", 10);
while ($ln = $db->fetch_array($rs)) {
if ($pdf->getY() >= $pdf->h - 15) {
$pdf->addpage();
$pdf->SetFont($fonte, "b", 10);
$pdf->cell(140, 5, "Produto", "B", 0, "C", 1);
$pdf->cell(45, 5, "Qtde", "B", 1, "C", 1);
$pdf->SetFont($fonte, "", 10);
}
$pdf->cell(140, 5, $ln["pro_nome"], 1, 0);
示例15: db
<?php
session_start("usuarios");
if (!isset($_SESSION["usu_login"]) and !isset($_SESSION["usu_id"])) {
echo "sua Sessão é inválida.....";
exit;
}
require_once "libs/classes.class";
require_once "libs/funcoes.php";
$db = new db();
if (isset($btncadastrar)) {
$db->begin();
$erro = 0;
$db->executa("delete from per_mod where per_usuid = {$cbousu_id}");
while (list($k, $v) = each($per_mod)) {
$sql = "insert into per_mod (per_usuid,per_mod) values ({$cbousu_id},{$v})";
$rs = $db->executa($sql);
if (!$rs) {
$erro++;
}
}
if ($erro == 0) {
$db->commit();
messagebox("Permissões liberadas com Sucesso!");
} else {
$db->rollback();
messagebox("Erro ao liberar permissões!\\n Erro: " . $db->erro());
}
}
if (isset($cbousu_id)) {
$sqlmod = "select mod_id, \n mod_nome,\n per_usuid,\n per_mod\n\t\t from sis_modulos left outer join per_mod \n\t\t\t on mod_id = per_mod and per_usuid = {$cbousu_id}";