コード例 #1
0
	<?php 
$fornecedorDAO = new FornecedorDAO();
?>
	<form enctype="multipart/form-data" action="#aba1" method="post" name="compra_proposta_form">
		<table width="650" class="tabela">
			<tr>
				<td colspan="4" class="tabela_tit">Nova Proposta</td>
			</tr>
			<tr>
				<td align="right"><strong>Fornecedor:</strong></td>
				<td>
					<select name="id_fornecedor" id="fornecedor" class="form_estilo <?php 
echo isset($errors['id_fornecedor']) ? 'form_estilo_erro' : '';
?>
" onchange="carrega_fornecedor_contas(this.value)" style="width:470px">
					<option></option>
					<?php 
$fornecedores = $fornecedorDAO->lista($controle_id_empresa);
$p_valor = '';
foreach ($fornecedores as $f) {
    $p_valor .= '<option value="' . $f->id_fornecedor . '" ';
    if ($p->id_fornecedor == $f->id_fornecedor) {
        $p_valor .= ' selected="selected"';
    }
    $p_valor .= '>' . $f->fantasia . '</option>';
}
echo $p_valor;
?>
					</select>
				</td>
			</tr>
コード例 #2
0
ファイル: index.php プロジェクト: hexti/troncal
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/FornecedorDAO.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$acesso = listarAcesso();
if (!in_array(153, $acesso)) {
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/modulos.php";</script>';
}
$Fornecedor = new Fornecedor();
$DAO = new FornecedorDAO();
if (!empty($_GET['cmd']) && $_GET['cmd'] == 'del') {
    $id = ValidateInteger(INPUT_GET, 'id');
    $retorno = $DAO->Deletar($id);
    if ($retorno == 1) {
        echo '<script language= "JavaScript">alert("Fornecedor removido com sucesso");</script>';
        echo '<script language= "JavaScript">location.href="index.php";</script>';
    } else {
        print_r($retorno);
    }
}
?>
	<!-- topbar ends -->
		<div class="container-fluid">
		<div class="row-fluid">
				
			<!-- left menu starts -->
			<div class="span2 main-menu-span">
				<?php 
コード例 #3
0
    $f->agencia = $agencia;
    $f->conta = $conta;
    $f->favorecido = $favorecido;
    $f->contato1 = $contato1;
    $f->tel1 = $tel1;
    $f->ramal1 = $ramal1;
    $f->email1 = $email1;
    $f->contato2 = $contato2;
    $f->tel2 = $tel2;
    $f->ramal2 = $ramal2;
    $f->email2 = $email2;
    $f->descProduto = $descProduto;
    $f->creditoCompra = $creditoCompra;
    $f->id_empresa = $controle_id_empresa;
    if (count($errors) == 0) {
        $fornecedorDAO = new FornecedorDAO();
        $f = $fornecedorDAO->inserir($f);
        ?>
 <script type="text/javascript">
			if(confirm('Novo registro adicionado com sucesso!\nCadastrar outro?')){
				window.location = 'fornecedor_add.php';		
			}else{
				window.location = 'fornecedor.php';
			}
		</script> <?php 
    }
}
?>
 <?php 
include "fornecedor_form.php";
?>
コード例 #4
0
    }
    $error .= '</ul>';
    $a = new stdClass();
    $a->descricao = $descricao;
    $a->anexo = $imagem_dir;
    $a->id_fornecedor = $id_fornecedor;
    if (count($errors) == 0) {
        $fornecedorDAO = new FornecedorDAO();
        $f_insert = $fornecedorDAO->inserirAnexo($a);
        ?>
 <script type="text/javascript">
			alert('Documento anexado com sucesso!');
		</script> <?php 
    }
}
$fornecedorDAO = new FornecedorDAO();
if ($submit) {
    pt_register("POST", "razao");
    pt_register("POST", "fantasia");
    pt_register("POST", "cnpj");
    pt_register("POST", "id_regime");
    pt_register("POST", "ie");
    pt_register("POST", "fax");
    pt_register("POST", "cep");
    pt_register("POST", "endereco");
    pt_register("POST", "numero");
    pt_register("POST", "complemento");
    pt_register("POST", "bairro");
    pt_register("POST", "cidade");
    pt_register("POST", "estado");
    pt_register("POST", "id_banco");
コード例 #5
0
		</div>
		<div><input type="text" class="form_estilo" name="busca"
			value="<?php 
echo $busca;
?>
" size="30" /> <input type="submit" name="submit"
			class="button_busca" value="Buscar" /></div>
		</form>
		<div style="clear: both"><br />
		<a href="fornecedor_add.php">
		<h3><img src="../images/botao_add.png" border="0" /> Adicionar novo
		registro</h3>
		</a></div>
		<?php 
#if($submit!='') {
$fornecedorDAO = new FornecedorDAO();
$fornecedores = $fornecedorDAO->busca($busca, $controle_id_empresa, $pagina);
$p_valor = "";
?>
 <br />
		<table width="100%" cellpadding="4" cellspacing="1"
			class="result_tabela">
			<tr>
				<td colspan="9" class="barra_busca"><?php 
$fornecedorDAO->QTDPagina();
?>
</td>
			</tr>
			<tr>
				<td class="result_menu"><b>Razão</b></td>
				<td class="result_menu"><b>Fantasia</b></td>
コード例 #6
0
ファイル: new.php プロジェクト: hexti/troncal
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/FeriadoDAO.php';
include_once '../Feriado.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$acesso = listarAcesso();
if (!in_array(247, $acesso)) {
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/modulos.php";</script>';
}
//Verifica se a opcao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $feriado = new Fornecedor();
    $DAO = new FornecedorDAO();
    $feriado->setData($_POST['data'], "converter");
    $feriado->setUsuario(userId());
    connectSQL();
    $result = mysql_query("SELECT * FROM " . MYSQL_BASE_FERIADOS . " WHERE excluido IS NULL AND dia='" . $feriado->getData() . "'");
    $num_rows = mysql_num_rows($result);
    if ($num_rows > 0) {
        $msg = utf8_encode("Não foi possível salvar, pois o dia já existe nos registros.");
        echo '<script language= "JavaScript">alert("' . $msg . '");</script>';
    } else {
        $data = $feriado->getData();
        if (!empty($data)) {
            $retorno = $DAO->Gravar($feriado);
            if ($retorno == true) {
                echo '<script language= "JavaScript">alert("Feriado cadastrada com sucesso");</script>';
                echo '<script language= "JavaScript">location.href="new.php";</script>';
コード例 #7
0
<?php

header("Content-Type: text/html; charset=ISO-8859-1", true);
require "../includes/verifica_logado_ajax.inc.php";
require "../includes/funcoes.php";
require "../includes/global.inc.php";
pt_register('GET', 'id');
$fornecedorDAO = new FornecedorDAO();
$clientes = $fornecedorDAO->buscaPorId($id, $controle_id_empresa);
echo '
<script>
	 document.pagamento_form.favorecido.value=\'' . $clientes->fantasia . '\';
	 document.pagamento_form.cnpj.value=\'' . $clientes->cnpj . '\';
</script>
';
コード例 #8
0
<?php

include_once "../includes/verifica_logado_ajax.inc.php";
include_once "../includes/funcoes.php";
include_once "../includes/global.inc.php";
include_once '../includes/browser.php';
$fornecedorDAO = new FornecedorDAO();
pt_register('GET', 'id');
$f = $fornecedorDAO->buscaPorId($id);
echo json_encode($f);
コード例 #9
0
ファイル: edit.php プロジェクト: hexti/troncal
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/FornecedorDAO.php';
include_once '../Fornecedor.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$acesso = listarAcesso();
if (!in_array(151, $acesso)) {
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/modulos.php";</script>';
}
$DAO = new FornecedorDAO();
$fornecedor = new Fornecedor();
//Verifica se foi executado a acao de salvar
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'editar') {
    $id = limpaTexto($_POST['id']);
    $fornecedor->setNome(limpaTexto($_POST['nome']));
    $fornecedor->setCNPJCPF(limpaTexto($_POST['cnpjcpf']));
    $fornecedor->setEndereco(limpaTexto($_POST['endereco']));
    $fornecedor->setBairro(limpaTexto($_POST['bairro']));
    $fornecedor->setCep(limpaTexto($_POST['cep']));
    $fornecedor->setCidade(limpaTexto($_POST['cidade']));
    $fornecedor->setEstado(limpaTexto($_POST['estado']));
    $fornecedor->setTelefone(limpaTexto($_POST['telefone']));
    $fornecedor->setEmail(limpaTexto($_POST['email']));
    $fornecedor->setId($id);
    $nome = $fornecedor->getNome();
    $telefone = $fornecedor->getTelefone();
    $email = $fornecedor->getEmail();
    //Verifica se o nome esta em branco
コード例 #10
0
ファイル: new.php プロジェクト: hexti/troncal
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/FornecedorDAO.php';
include_once '../Fornecedor.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$acesso = listarAcesso();
if (!in_array(150, $acesso)) {
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/modulos.php";</script>';
}
//Verifica se a opcao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $fornecedor = new Fornecedor();
    $DAO = new FornecedorDAO();
    $fornecedor->setNome(limpaTexto($_POST['nome']));
    $fornecedor->setEndereco(limpaTexto($_POST['endereco']));
    $fornecedor->setBairro(limpaTexto($_POST['bairro']));
    $fornecedor->setCep(limpaTexto($_POST['cep']));
    $fornecedor->setCidade(limpaTexto($_POST['cidade']));
    $fornecedor->setEstado(limpaTexto($_POST['estado']));
    $fornecedor->setTelefone(limpaTexto($_POST['telefone']));
    $fornecedor->setEmail(limpaTexto($_POST['email']));
    $fornecedor->setCNPJCPF(limpaTexto($_POST['cnpjcpf']));
    $fornecedor->setUsuario(userId());
    $nome = $fornecedor->getNome();
    $telefone = $fornecedor->getTelefone();
    $email = $fornecedor->getEmail();
    //Verifica se os campos de contato foram preenchidos
    if (empty($telefone) && empty($email)) {
コード例 #11
0
<?php

require 'header.php';
$permissao = verifica_permissao('Direcao', $controle_id_departamento_p, $controle_id_departamento_s);
if ($permissao == 'FALSE' and $controle_id_empresa != '1') {
    echo '<br><br><strong>Você não tem permissão para acessar essa página</strong>';
    exit;
}
pt_register('GET', 'id_fornecedor_anexo');
$fornecedorDAO = new FornecedorDAO();
$anexo = $fornecedorDAO->buscaPorIdAnexo($id_fornecedor_anexo);
$fornecedorDAO->excluirAnexo($anexo);
if (is_file($anexo->anexo)) {
    unlink($file_path . $anexo->anexo);
}
コード例 #12
0
ファイル: edit.php プロジェクト: hexti/troncal
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/FeriadoDAO.php';
include_once '../Feriado.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$acesso = listarAcesso();
if (!in_array(248, $acesso)) {
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/modulos.php";</script>';
}
$DAO = new FornecedorDAO();
$feriado = new Fornecedor();
//Verifica se foi executado a acao de salvar
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'editar') {
    $feriado->setData($_POST['data'], "converter");
    $feriado->setId($_POST['id']);
    connectSQL();
    $result = mysql_query("SELECT * FROM " . MYSQL_BASE_FERIADOS . " WHERE excluido IS NULL AND dia='" . $feriado->getData() . "'");
    $num_rows = mysql_num_rows($result);
    if ($num_rows > 0) {
        $msg = utf8_encode("Não foi possível salvar, pois o dia já existe nos registros.");
        echo '<script language= "JavaScript">alert("' . $msg . '");</script>';
    } else {
        $data = $feriado->getData();
        if (!empty($data)) {
            $retorno = $DAO->Atualizar($feriado);
            if ($retorno == true) {
                echo '<script language= "JavaScript">alert("Registro alterado com sucesso");</script>';
                echo '<script language= "JavaScript">location.href="index.php";</script>';