コード例 #1
0
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$retirados = $validations->validNumeric ( $_GET ['retirados'] );

$id = $validations->validStringForm ( $_GET ['id'] );
$idgrade = $validations->validStringForm ( $_GET ['idgrade'] );
$total = $validations->validStringForm ( $_GET ['total'] );

?>
<table>
	<tr>
		<td><b style="color: blue">Para retirar "<?php 
echo $retirados;
?>
コード例 #2
0
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

require 'library/open-flash-chart.php';

srand((double)microtime()*1000000);

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$dia1 = (isset ( $_GET ['diaescolhido1'] )) ? $validations->validNumeric ( $_GET ['diaescolhido1'] ) : date ( 'd' );
$mes1 = (isset ( $_GET ['mesescolhido1'] )) ? $validations->validNumeric ( $_GET ['mesescolhido1'] ) : date ( 'm' );
$ano1 = (isset ( $_GET ['anoescolhido1'] )) ? $validations->validNumeric ( $_GET ['anoescolhido1'] ) : date ( 'Y' );

$data_dia1 = $dia1;
$data_mes1 = $mes1;
$data_ano1 = $ano1;
$data1 = date ( 'Y-m-d', mktime ( 0, 0, 0, $data_mes1, $data_dia1, $data_ano1 ) );

$dia2 = (isset ( $_GET ['diaescolhido2'] )) ? $validations->validNumeric ( $_GET ['diaescolhido2'] ) : date ( 'd' );
$mes2 = (isset ( $_GET ['mesescolhido2'] )) ? $validations->validNumeric ( $_GET ['mesescolhido2'] ) : date ( 'm' );
$ano2 = (isset ( $_GET ['anoescolhido2'] )) ? $validations->validNumeric ( $_GET ['anoescolhido2'] ) : date ( 'Y' );
コード例 #3
0
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$sql = "SELECT idproduto FROM produto";
$query = $db->query ( $sql );
$totalprodutos = $db->num_rows ( $query );

?>

<fieldset id="p"><legend>Resultado da comparação</legend>

<div class="linha_separador" style="width: 350px; height: 25px;">
<table width="100%">
	<tr>
		<td align="left"><input type="button"
コード例 #4
0
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$data_dia1 = $validations->validNumeric ( $_GET ['dia1'] );
$data_mes1 = $validations->validNumeric ( $_GET ['mes1'] );
$data_ano1 = $validations->validNumeric ( $_GET ['ano1'] );
$data1 = date ( 'Y-m-d', mktime ( 0, 0, 0, $data_mes1, $data_dia1, $data_ano1 ) );

$data_dia2 = $validations->validNumeric ( $_GET ['dia2'] );
$data_mes2 = $validations->validNumeric ( $_GET ['mes2'] );
$data_ano2 = $validations->validNumeric ( $_GET ['ano2'] );
$data2 = date ( 'Y-m-d', mktime ( 0, 0, 0, $data_mes2, $data_dia2, $data_ano2 ) );

if ($data1 == '1999-11-30') {
	$data1 = date ( 'Y-m-d', mktime ( 0, 0, 0, date ( 'm' ) - 1, date ( 'd' ), date ( 'Y' ) ) );
コード例 #5
0
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$controle = $validations->validNumeric ( $_GET ['c'] );

$sql = "SELECT l.nome AS vendedor, c.txtnome AS txtnomecliente, mvm.estornado AS estorno, SUM(mvm.quant) AS quantidade, SUM(mvm.vr_total) as valortotal, mvv.vr_totalvenda FROM mv_vendas_movimento AS mvm JOIN mv_vendas AS mvv ON (mvm.controle = mvv.controle)  LEFT JOIN cliente AS c ON mvm.id_cliente=c.idcliente LEFT JOIN cad_login AS l ON mvm.id_login=l.id WHERE mvm.controle='" . $controle . "' GROUP BY mvm.controle";

$query = $db->query ( $sql );

if ($db->num_rows ( $query )) {
	
	$row = $db->fetch_assoc ( $query );
	
	$datacontrole = timestamp_converte ( $controle, 0 );
	
コード例 #6
0
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

/*
 * FIXME Change cad_empresa_id to dinamic id
 */

$sql = "SELECT reducao_estoque AS auth FROM configuracao WHERE cad_empresa_id=1";
$query = $db->query($sql);
$row = $db->fetch_assoc($query);
$auth = $row['auth'];

$idproduto = $validations->validNumeric ( $_GET ['id'] );

if (isset ( $_GET ['add_nomegrade'] ) && isset ( $_GET ['add_qtdgrade'] )) {
コード例 #7
0
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$dia1 = (isset ( $_GET ['dia1'] )) ? $validations->validNumeric ( $_GET ['dia1'] ) : date ( 'd' );
$mes1 = (isset ( $_GET ['mes1'] )) ? $validations->validNumeric ( $_GET ['mes1'] ) : date ( 'm' );
$ano1 = (isset ( $_GET ['ano1'] )) ? $validations->validNumeric ( $_GET ['ano1'] ) : date ( 'Y' );

$data_dia1 = $dia1;
$data_mes1 = $mes1;
$data_ano1 = $ano1;
$data1 = date ( 'Y-m-d', mktime ( 0, 0, 0, $data_mes1, $data_dia1, $data_ano1 ) );

$dia2 = (isset ( $_GET ['dia2'] )) ? $validations->validNumeric ( $_GET ['dia2'] ) : date ( 'd' );
$mes2 = (isset ( $_GET ['mes2'] )) ? $validations->validNumeric ( $_GET ['mes2'] ) : date ( 'm' );
$ano2 = (isset ( $_GET ['ano2'] )) ? $validations->validNumeric ( $_GET ['ano2'] ) : date ( 'Y' );
コード例 #8
0
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$usuario = $validations->validStringForm ( $_GET ['usuario'] );
$dinheiro = $validations->validStringForm ( $_GET ['dinheiro'] );
$cheque = $validations->validStringForm ( $_GET ['cheque'] );
$cartao_debito = $validations->validStringForm ( $_GET ['cartao_debito'] );
$cartao_credito = $validations->validStringForm ( $_GET ['cartao_credito'] );
?>

<table width="460">
	<tr>
		<td align="center">
			<?
			if ($dinheiro == 'true' || $cheque == 'true' || $cartao_debito == 'true' || $cartao_credito == 'true') {
コード例 #9
0
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$idusuario = $validations->validNumeric ( $_GET ['i'] );

if ($idusuario) {
	$sql = 'SELECT id, login, senha, autoriza, ativo, nome FROM cad_login WHERE id=' . $idusuario;
	$query = $db->query ( $sql );
	$row = $db->fetch_assoc ( $query );
	for($n = 0; $n < $_CONF ['max_perm']; $n ++) {
		if (permite ( $row ['login'], $n ))
			$per [$n] = TRUE;
		else
			$per [$n] = 0;
	}
コード例 #10
0
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$codbarra = $validations->validNumeric ( $_GET ['cb'] );

$sql = 'SELECT p.idproduto, p.txtproduto, p.vlvarejo, p.vlatacado, p.vlprontaentrega, c.txtnome AS colecao, pt.txtnome AS tipo, f.nome AS fornecedor FROM produto AS p LEFT JOIN fornecedor AS f ON f.idfornecedor=p.fornecedor_idfornecedor LEFT JOIN produtotipo AS pt ON pt.idprodutotipo=p.produtotipo_idprodutotipo LEFT JOIN colecao AS c ON c.idcolecao=p.colecao_idcolecao WHERE p.cod_barra=' . $codbarra;
$query = $db->query ( $sql );

if ($db->num_rows ( $query )) {
	
	$row = $db->fetch_assoc ( $query );
	
	$idproduto = $row ['idproduto'];
	
	if ($row ['colecao']) {
コード例 #11
0
ファイル: eventos.php プロジェクト: renatomarinho/ASC
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

if (! isset ( $_GET ['id_agenda'] )) {
	$dinicio = $validations->validNumeric ( $_GET ['d1'] );
	$minicio = $validations->validNumeric ( $_GET ['m1'] );
	$ainicio = $validations->validNumeric ( $_GET ['a1'] );
	
	$diainicio = mktime ( 0, 0, 0, $minicio, $dinicio, $ainicio );
	$diafinal = mktime ( 23, 59, 59, $minicio, $dinicio, $ainicio );
	
	$sql = "SELECT idagendaeventos, inicio, final, tarefa, status FROM rvs_agendaeventos WHERE inicio>" . $diainicio . " AND final<" . $diafinal . "";
} else {
	$sql = "SELECT idagendaeventos, inicio, final, tarefa, status FROM rvs_agendaeventos WHERE idagendaeventos = " . $_GET ['id_agenda'];
}
コード例 #12
0
ファイル: colecao_salvar.php プロジェクト: renatomarinho/ASC
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$colecao = $validations->validStringForm ( $_POST ['colecao'] );
if (! isset ( $_POST ['descricao'] )) {
	$_POST ['descricao'] = '';
}
$descricao = $validations->validStringForm ( $_POST ['descricao'] );
$periodo = str_pad ( $_POST ['mes1'], 2, "0", STR_PAD_LEFT ) . '/' . $_POST ['ano1'];
$periodo2 = str_pad ( $_POST ['mes2'], 2, "0", STR_PAD_LEFT ) . '/' . $_POST ['ano2'];
if ($periodo2 != $periodo)
	$periodo .= ' até ' . $periodo2;

$sql = "INSERT INTO colecao ( txtnome, txtperiodo, txtdescricao ) VALUES ( '" . $colecao . "', '" . $periodo . "', '" . nl2br ( $descricao ) . "' )";
$db->query ( $sql );
コード例 #13
0
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$idusuario = $validations->validNumeric ( $_POST ['i'] );
$nome = strtoupper ( $validations->validStringForm ( $_POST ['nome'] ) );
$login = strtoupper ( $validations->validStringForm ( $_POST ['login'] ) );

$sql = "SELECT id FROM cad_login WHERE login='******' AND id!=" . $idusuario . "";
$query = $db->query ( $sql );

if (! $db->num_rows ( $query )) {
	
	$senha = md5 ($_POST['senha']);
	
	if (strlen($_POST['senha'])>3) {
コード例 #14
0
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$login = strtoupper ( $validations->validStringForm ( $_POST ['login'] ) );

$sql = "SELECT id FROM cad_login WHERE login='******'";
$query = $db->query ( $sql );

if (! $db->num_rows ( $query )) {
	
	$nome = strtoupper ( $validations->validStringForm ( $_POST ['nome'] ) );
	$senha = md5 ( $_POST ['senha'] );
	$permissao = $validations->validNumeric ( $_POST ['permissao'] );
	
	$sql = "INSERT INTO cad_login ( login, senha, autoriza, ativo, nome ) VALUES ( '" . $login . "', '" . $senha . "', " . $permissao . ", 'ativo', '" . $nome . "' )";
コード例 #15
0
ファイル: autenticacao.php プロジェクト: renatomarinho/ASC
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

ob_start();

require "config/default.php";

$db = new db();
$db->connect();

$validations = new validations();

?>

<?
if (isset($_SESSION['nomeuser'])) {
	header("Location: index.php");
} else if (isset($_POST) && isset($_POST['usuario_1']) && isset($_POST['senha_1'])) {

    
	$user = $validations->validStringForm(strtoupper($_POST['usuario_1']));
	$senha = md5($_POST['senha_1']);
	$sql = 'SELECT id, autoriza FROM cad_login WHERE ativo = \'ativo\' AND login = \''.$user.'\' AND senha = \''.$senha.'\' LIMIT 1';
	$query = $db->query($sql);
	$row = $db->fetch_assoc($query);
	if ($row['id'] >= 1) {
コード例 #16
0
// the terms of the GNU General Public License as published by the Free Software      //
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}
$validations = new validations ( );
$db = new db ( );
$db->connect ();

/*
 * FIXME Change cad_empresa_id to dinamic id
 */

if (! isset ( $_GET ['u'] )) {
	$_SESSION ['controlevenda'] = strtotime ( 'now' );
	unset ( $_SESSION ['carrinho_venda'] );
} else {
	$usuario = $validations->validNumeric($_GET ['u']);
	$cliente = $validations->validNumeric($_GET ['c']);
}
コード例 #17
0
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$idfornecedor = $validations->validNumeric ( $_GET ['id'] );

$sql = "SELECT f.nome, f.cnpj, f.uf, f.cidade, f.endereco, f.contato, f.email, f.telefone, f.telefone2, f.fax, f.ie, f.cep, f.bairro, f.idpais, p.nome AS nomepais FROM fornecedor AS f INNER JOIN paises AS p ON f.idpais=p.numcode WHERE f.idfornecedor=" . $idfornecedor . "";
$query = $db->query ( $sql );
$rowfornecedor = $db->fetch_assoc ( $query );

$nome = $rowfornecedor ['nome'];
$cnpj = ($rowfornecedor ['cnpj']) ? $rowfornecedor ['cnpj'] : 'Não informado';
$uf = ($rowfornecedor ['uf']) ? $rowfornecedor ['uf'] : 'Não informado';
if ($uf == 'OU') {
	$uf = 'Exterior';
}
コード例 #18
0
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////


if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$dados_cheque = array ();
$dados_credito = array ();

$idcliente = $validations->validNumeric ( $_POST ['cliente'] );
$idlogin = $validations->validNumeric ( $_POST ['usuario'] );
$vr_totalvenda = $validations->validNumeric ( $_POST ['totalvenda'] );

$terminal = $validations->validNumeric ( $_POST ['terminal'] );

if (! isset ( $_SESSION ['turno'] )) {
	$turno = 0;
} else {
コード例 #19
0
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$_GET ['id'] = $validations->validNumeric ( $_GET ['id'] );

$sql = "SELECT * FROM produto WHERE idproduto = " . $_GET ['id'];
$query = $db->query ( $sql );
$row = $db->fetch_assoc ( $query );
$sql = "SELECT nquantidade FROM estoque WHERE produto_idproduto = " . $_GET ['id'];
$query = $db->query ( $sql );
$rowestoque = $db->fetch_assoc ( $query );
$quantidade = $rowestoque ['nquantidade'];

?>
コード例 #20
0
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////


if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$db = new db ( );
$db->connect ();

$validations = new validations ( );

$abertura = $validations->validNumeric ( $_POST ['ab'] );
$turno = $validations->validNumeric ( $_POST ['tu'] );
$terminal = $validations->validNumeric ( $_POST ['te'] );
$idusuario = $validations->validNumeric ( $_POST ['i'] );
$valor_caixa = $validations->validStringForm ( $_POST ['v'] );

$_SESSION ['turno'] = $turno;

$sql = "INSERT INTO mv_caixa ( abertura, vr_abertura, cad_login_id, turno, terminal, sync_timestamp ) VALUES ( " . $abertura . ", '" . $valor_caixa . "', " . $idusuario . ", '" . $turno . "', '" . $terminal . "', " . strtotime ( 'now' ) . " )";
$db->query ( $sql );

?>
コード例 #21
0
ファイル: cliente_salvar.php プロジェクト: renatomarinho/ASC
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

if (isset ( $_POST ['idcliente'] )) {
	
	$idcliente = $validations->validNumeric ( $_POST ['idcliente'] );
	
	$nome = strtoupper ( $validations->validStringForm ( $_POST ['nome'] ) );
	$endereco = strtoupper ( $validations->validStringForm ( $_POST ['endereco'] ) );
	$bairro = strtoupper ( $validations->validStringForm ( $_POST ['bairro'] ) );
	$cidade = strtoupper ( $validations->validStringForm ( $_POST ['cidade'] ) );
	$estado = strtoupper ( $validations->validStringForm ( $_POST ['estado'] ) );
	$dddtel = $validations->validNumeric ( $_POST ['dddtel'] );
	$tel1 = $validations->validNumeric ( $_POST ['tel1'] );
	$tel2 = $validations->validNumeric ( $_POST ['tel2'] );
コード例 #22
0
ファイル: colecao_dados.php プロジェクト: renatomarinho/ASC
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$idcolecao = $validations->validNumeric ( $_GET ['id'] );

$sql = "SELECT txtnome, txtperiodo, txtdescricao FROM colecao WHERE idcolecao=" . $idcolecao . "";
$query = $db->query ( $sql );
$rowcolecao = $db->fetch_assoc ( $query );
$txtnome = $rowcolecao ['txtnome'];
$txtperiodo = $rowcolecao ['txtperiodo'];
$txtdescricao = $rowcolecao ['txtdescricao'];

if (strlen ( $txtperiodo ) > 8) {
	$periodo_explode = explode ( ' até ', $txtperiodo );
	$periodo_1 = explode ( '/', $periodo_explode [0] );
コード例 #23
0
// Copyright (C) 2008 onwards Renato Marinho ( renato.marinho@greyland.com.br )         //
//                                                                                    //
// This program is free software; you can redistribute it and/or modify it under      //
// the terms of the GNU General Public License as published by the Free Software      //
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////


if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$idusuario = $validations->validNumeric ( $_GET ['i'] );
$permissoes = $validations->validStringForm ( $_GET ['p'] );

$sql = "UPDATE cad_login SET autoriza='" . $permissoes . "' WHERE id=" . $idusuario . "";
$db->query ( $sql );

?>
コード例 #24
0
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$i = $validations->validNumeric($_GET ['i']);
$p = $_GET['p'];

$sql = "SELECT login FROM cad_login WHERE id=".$i." AND senha='".md5($p)."' AND ativo='ativo'";
$query = $db->query ( $sql );
if ($db->num_rows ( $query )) {
	$row = $db->fetch_assoc ( $query );
	if (permite ( $row ['login'], 4 ) == 1) {
		echo 'ok';
	} else {
		echo 'no';
	}
コード例 #25
0
ファイル: editar_OLD.php プロジェクト: renatomarinho/ASC
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

if (! isset ( $_GET ['id'] )) {
	$sql = " ORDER BY idcliente DESC";
} else {
	$idcliente = $validations->validNumeric ( $_GET ['id'] );
	$sql = "WHERE idcliente=" . $idcliente;
}

if (isset ( $_GET ['refer'] )) {
	$refer = $_GET ['refer'];
} else {
	$refer = '';
}
コード例 #26
0
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

if (isset ( $_POST ['nomefornec'] ))
	$txtnome = strtoupper ( $validations->validStringForm ( $_POST ['nomefornec'] ) );
if (isset ( $_POST ['cpf'] ))
	$cnpj = $validations->validNumeric ( $_POST ['cpf'] );
if (isset ( $_POST ['estado'] ))
	$txtuf = $validations->validStringForm ( $_POST ['estado'] );
if (isset ( $_POST ['cidade'] ))
	$txtcidade = strtoupper ( $validations->validStringForm ( $_POST ['cidade'] ) );
if (isset ( $_POST ['endereco'] ))
	$txtendereco = strtoupper ( $validations->validStringForm ( $_POST ['endereco'] ) );
if (isset ( $_POST ['contato'] ))
	$txtcontato = strtoupper ( $validations->validStringForm ( $_POST ['contato'] ) );
コード例 #27
0
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$idproduto = $validations->validNumeric ( $_GET ['p'] );

$sql = 'SELECT p.idproduto, p.txtproduto, p.vlvarejo, p.vlatacado, p.vlprontaentrega, c.txtnome AS colecao, pt.txtnome AS tipo, f.nome AS fornecedor FROM produto AS p LEFT JOIN fornecedor AS f ON f.idfornecedor=p.fornecedor_idfornecedor LEFT JOIN produtotipo AS pt ON pt.idprodutotipo=p.produtotipo_idprodutotipo LEFT JOIN colecao AS c ON c.idcolecao=p.colecao_idcolecao WHERE idproduto=' . $idproduto;
$query = $db->query ( $sql );
$row = $db->fetch_assoc ( $query );

if ($row ['colecao']) {
	$colecao = $row ['colecao'];
} else {
	$colecao = 'N�o atribu�da';
}
コード例 #28
0
// This program is free software; you can redistribute it and/or modify it under      //
// the terms of the GNU General Public License as published by the Free Software      //
// Foundation; either version 3 of the License, or (at your option) any later         //
// version.                                                                           //
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////


if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$db = new db ( );
$db->connect ();

$validations = new validations ( );

$fechamento = $validations->validNumeric ( $_POST ['f'] );
$valor_caixa = $validations->validStringForm ( $_POST ['v'] );

$sql = "UPDATE mv_caixa SET fechamento=" . $fechamento . ", vr_fechamento='" . $valor_caixa . "' ORDER BY id DESC LIMIT 1";
$db->query ( $sql );

?>
コード例 #29
0
ファイル: empresa_salvar.php プロジェクト: renatomarinho/ASC
//                                                                                    //
// This program is distributed in the hope that it will be useful, but WITHOUT ANY    // 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    //
// PARTICULAR PURPOSE.  See the GNU General Public License for more details:          //
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

require "_language.php";

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}

$validations = new validations ( );
$db = new db ( );
$db->connect ();

$cnpj = $validations->validStringForm ( $_POST ['cnpj'] );
$ie = $validations->validStringForm ( $_POST ['ie'] );
$endereco = $validations->validStringForm ( $_POST ['endereco'] );
$bairro = $validations->validStringForm ( $_POST ['bairro'] );
$cidade = $validations->validStringForm ( $_POST ['cidade'] );
$estado = $validations->validStringForm ( $_POST ['estado'] );
$cep = $validations->validStringForm ( $_POST ['cep'] );
$tel = $validations->validStringForm ( $_POST ['tel'] );
$fax = $validations->validStringForm ( $_POST ['fax'] );
$email = $validations->validStringForm ( $_POST ['email'] );
$site = $validations->validStringForm ( $_POST ['site'] );
$filiais = ($validations->validNumeric ( $_POST ['filiais'] ) < 1) ? 1 : $validations->validNumeric ( $_POST ['filiais'] );
コード例 #30
0
ファイル: fechar_venda.php プロジェクト: renatomarinho/ASC
//                                                                                    //
//  http://www.gnu.org/copyleft/gpl.html                                              //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

if (! isset ( $_CONF ['PATH'] )) {
	require "../../config/default.php";
}
//
//    echo "<pre>";
//    print_r($_SESSION);
//    echo "</pre>";
//    


$validations = new validations ( );
$db = new db ( );
$db->connect ();

$usuario = $validations->validNumeric ( $_GET ['u'] );
$valorvenda = $validations->validStringForm ( $_GET ['v'] );

if (isset ( $_GET ['c'] ) && $_GET ['c'] > 0) {
	$cliente = $validations->validNumeric ( $_GET ['c'] );
	$sql = "SELECT idcliente, txtnome FROM cliente WHERE idcliente=" . $cliente . " ";
	$querycliente = $db->query ( $sql );
	$rowcliente = $db->fetch_assoc ( $querycliente );
	$idcliente = $rowcliente ['idcliente'];
	$txtnome = ucwords ( strtolower ( $rowcliente ['txtnome'] ) );
} else {
	$idcliente = 0;