コード例 #1
0
ファイル: data.php プロジェクト: eneiasramos/xmoney
 function data_changed($entry)
 {
     $text = $entry->get_text();
     if (strlen($text) && $this->field && $this->field_print) {
         $this->filter = $this->field . ' LIKE ' . String(CDate($text) . '%');
         $this->filter_print = $this->field_print . ' LIKE ' . String(CDate($text) . '%');
     } else {
         $this->filter = '';
         $this->filter_print = '';
     }
 }
コード例 #2
0
ファイル: string.php プロジェクト: eneiasramos/xmoney
 function string_changed($entry)
 {
     $text = $entry->get_text();
     if (strlen($text) && $this->field && $this->field_print) {
         $this->filter = $this->field . ' LIKE ' . String(SpacesToPercents(' ' . $text . ' '));
         $this->filter_print = $this->field_print . ' LIKE ' . String(SpacesToPercents(' ' . $text . ' '));
     } else {
         $this->filter = '';
         $this->filter_print = '';
     }
 }
コード例 #3
0
ファイル: login.php プロジェクト: eneiasramos/xmoney
 function run()
 {
     $db = new Database($this, true);
     if (!$db->link) {
         exit(1);
     }
     while (true) {
         $this->username->grab_focus();
         $response = parent::run();
         $username = $this->username->get_text();
         $password = $this->password->get_text();
         if ($response != Gtk::RESPONSE_OK) {
             exit(1);
         }
         if (!$username || !$password) {
             new Message($this, latin1('Usuário e senha devem ser informados!'), Gtk::MESSAGE_ERROR);
             continue;
         }
         $sql = 'SELECT Cod_S_Usuario FROM Tb_Usuarios WHERE Ativo = 1 AND Senha LIKE ' . String(md5($username . '@' . $password));
         if (!$db->multi_query($sql)) {
             continue;
         }
         if (!($line = $db->line())) {
             new Message($this, latin1('Usuário ou senha incorreta!', Gtk::MESSAGE_ERROR));
             continue;
         } else {
             $CodUsuario = $line['Cod_S_Usuario'];
             putenv('XMONEY_UID=' . $CodUsuario);
         }
         $sql = 'SELECT * FROM Vw_Usuario_Filial WHERE CodUsuario = ' . $CodUsuario;
         if (!$db->multi_query($sql)) {
             continue;
         }
         if (!($line = $db->line())) {
             new Message($this, latin1('Usuário não encontrado!', Gtk::MESSAGE_ERROR));
             continue;
         } else {
             $GLOBALS['CodUsuario'] = $CodUsuario;
             $GLOBALS['Usuario'] = $line['Usuario'];
             $GLOBALS['Nome'] = $line['Nome'];
             $GLOBALS['CodFilial'] = $line['CodFilial'];
             $GLOBALS['Filial'] = $line['Filial'];
             $GLOBALS['CodPerfil'] = $line['CodPerfil'];
             $GLOBALS['Perfil'] = $line['Perfil'];
             break;
         }
     }
 }
コード例 #4
0
ファイル: checks.php プロジェクト: eneiasramos/xmoney
function CheckPermissao($Owner, $tag, $show = false)
{
    $db = new Database($Owner, true);
    if (!$db->link) {
        return;
    }
    $sql = 'SELECT * FROM Vw_Permissoes';
    $db->multi_query($sql . ' WHERE CodPerfil = ' . $GLOBALS['CodPerfil'] . ' AND Alias = ' . String($tag));
    if ($db->line()) {
        return true;
    } else {
        if ($show) {
            new Message($Owner, latin1('Você não tem permissão para acessar esse recurso no sistema!'));
        }
    }
}
コード例 #5
0
 function grava_dados()
 {
     if (!$this->check_dados()) {
         return;
     }
     $db = new Database($this, false);
     if (!$db->link) {
         return;
     }
     $anotacoes = $this->anotacoes->get_text();
     $sql = 'call SP_Mov_Conta_Receber_Del';
     $data = $sql . '(' . String($this->CodId) . ',' . String($anotacoes) . ',' . $GLOBALS['CodUsuario'] . ');';
     if (!$db->multi_query($data)) {
         return;
     }
     if (!($line = $db->line())) {
         return;
     }
     $db->free_result();
     $this->Parent->pega_dados_mov();
     new Message($this, $line['Mensagem']);
     return true;
 }
コード例 #6
0
 function grava_dados()
 {
     if (!$this->check_dados()) {
         return;
     }
     $db = new Database($this, false);
     if (!$db->link) {
         return;
     }
     $nome = $this->nome->get_text();
     $cpf = $this->cpf->get_text();
     $fantasia = $this->fantasia->get_text();
     $ie = $this->ie->get_text();
     $suframa = $this->suframa->get_text();
     $fone = $this->fone->get_text();
     $fone2 = $this->fone2->get_text();
     $fax = $this->fax->get_text();
     $fax2 = $this->fax2->get_text();
     $email = $this->email->get_text();
     $url = $this->site->get_text();
     $anotacoes = $this->anotacoes->get_text();
     $limite_compra = $this->limite_compra->get_text();
     $ativo = $this->ativo->get_active();
     if ($this->operacao == 'i') {
         $sql = 'call SP_Fornecedor_Inc';
     } else {
         $sql = 'call SP_Fornecedor_Alt';
     }
     $data = $sql . '(' . String($this->CodFor) . ',' . String($this->pessoa->CodTipoPessoa) . ',' . String($nome) . ',' . String($cpf) . ',' . String($fantasia) . ',' . String($ie) . ',' . String($suframa) . ',' . String($fone) . ',' . String($fone2) . ',' . String($fax) . ',' . String($fax2) . ',' . String($email) . ',' . String($url) . ',' . String($anotacoes) . ',' . String(CommaToPoint($limite_compra)) . ',' . String($ativo) . ',' . $GLOBALS['CodUsuario'] . ');';
     if (!$db->multi_query($data)) {
         return;
     }
     $line = $db->line();
     new Message($this, $line['Mensagem']);
     $db->free_result();
     return true;
 }
コード例 #7
0
 function grava_dados()
 {
     if (!$this->check_dados()) {
         return;
     }
     $db = new Database($this, false);
     if (!$db->link) {
         return;
     }
     $endereco = $this->endereco->get_text();
     $bairro = $this->bairro->get_text();
     $cep = $this->cep->get_text();
     $cidade = $this->cidade->get_text();
     $contato = $this->contato->get_text();
     $fone = $this->fone->get_text();
     $referencia = $this->referencia->get_text();
     if ($this->operacao == 'i') {
         $sql = 'call SP_End_Transportadora_Inc';
     } else {
         $sql = 'call SP_End_Transportadora_Alt';
     }
     $data = $sql . '(' . String($this->CodId) . ',' . String($this->CodTrans) . ',' . String($this->tipo->CodTipoEndereco) . ',' . String($endereco) . ',' . String($cep) . ',' . String($bairro) . ',' . String($cidade) . ',' . String($this->estado->CodEstado) . ',' . String($contato) . ',' . String($fone) . ',' . String($referencia) . ',' . $GLOBALS['CodUsuario'] . ');';
     if (!$db->multi_query($data)) {
         return;
     }
     if (!($line = $db->line())) {
         return;
     }
     $db->free_result();
     new Message($this, $line['Mensagem']);
     return true;
 }
コード例 #8
0
ファイル: edita_perfil.php プロジェクト: eneiasramos/xmoney
 function grava_dados()
 {
     if (!$this->check_dados()) {
         return;
     }
     $db = new Database($this, false);
     if (!$db->link) {
         return;
     }
     $nome = $this->nome->get_text();
     $descricao = $this->descricao->get_text();
     if ($this->operacao == 'i') {
         $sql = 'call SP_Perfil_Inc';
     } else {
         $sql = 'call SP_Perfil_Alt';
     }
     $data = $sql . '(' . String($this->CodPerfil) . ',' . String($nome) . ',' . String($descricao) . ',' . $GLOBALS['CodUsuario'] . ');';
     if (!$db->multi_query($data)) {
         return;
     }
     // Mensagem
     $line = $db->line();
     $mensagem = $line['Mensagem'];
     if ($this->operacao == 'i') {
         $line = $db->line();
         $CodPerfil = $line['CodPerfil'];
     }
     // limpa BUFFER
     while ($db->line()) {
     }
     // pega CodPerfil
     if (!$CodPerfil) {
         $CodPerfil = $this->CodPerfil;
     }
     // Permissoes
     $db->query(' DELETE FROM Tb_Permissoes WHERE Cod_S_Perfil = ' . $CodPerfil);
     foreach ($this->itens as $key => $value) {
         if ($value->get_active()) {
             if (!$db->query(' INSERT INTO Tb_Permissoes (Cod_S_Perfil, Cod_S_Item) ' . ' VALUES (' . String($CodPerfil) . ',' . String($key) . ');')) {
                 return;
             } else {
                 $this->progresso->pulse();
                 while (Gtk::events_pending()) {
                     Gtk::main_iteration();
                 }
             }
         }
     }
     new Message($this, $mensagem);
     return true;
 }
コード例 #9
0
 function grava_dados()
 {
     if (!$this->check_dados()) {
         return;
     }
     $db = new Database($this, false);
     if (!$db->link) {
         return;
     }
     $num_doc = $this->num_doc->get_text();
     $parcela = $this->parcela->get_text();
     $vencimento = CDate($this->vencimento->get_text());
     $valor = CommaToPoint($this->valor->get_text());
     $anotacoes = $this->anotacoes->get_text();
     if ($this->operacao == 'i') {
         $sql = 'call SP_Conta_Receber_Inc';
     } else {
         $sql = 'call SP_Conta_Receber_Alt';
     }
     $data = $sql . '(' . String($this->tipo_doc->CodTipoDoc) . ',' . String($this->filial->CodFilial) . ',' . String($this->clientes->CodCliente) . ',' . String($num_doc) . ',' . String($parcela) . ',' . String($vencimento) . ',' . String($valor) . ',' . String($anotacoes) . ',' . $GLOBALS['CodUsuario'] . ');';
     if (!$db->multi_query($data)) {
         return;
     }
     $line = $db->line();
     $db->free_result();
     new Message($this, $line['Mensagem']);
     return true;
 }
コード例 #10
0
 private function parseProtocolVersion()
 {
     $protocolVersion = String($_SERVER['SERVER_PROTOCOL']);
     return (string) $protocolVersion->stripStart('HTTP/');
 }
コード例 #11
0
 function grava_dados()
 {
     if (!$this->check_dados()) {
         return;
     }
     $db = new Database($this, false);
     if (!$db->link) {
         return;
     }
     $nome = $this->nome->get_text();
     if ($this->operacao == 'i') {
         $sql = 'call SP_Unid_Estoque_Inc';
     } else {
         $sql = 'call SP_Unid_Estoque_Alt';
     }
     $data = $sql . '(' . String($this->CodUnidade) . ',' . String($nome) . ',' . $GLOBALS['CodUsuario'] . ');';
     if (!$db->multi_query($data)) {
         return;
     }
     $line = $db->line();
     $db->free_result();
     new Message($this, $line['Mensagem']);
     return true;
 }
コード例 #12
0
ファイル: Search.php プロジェクト: shrutijain27/Crawler
</div>

                <div>
                <a href="GetProduct_Details.php?id=<?php 
        echo $r['_source']['model_id'];
        ?>
"><?php 
        echo $r['_source']['model'];
        ?>
</a>
                </div>
        </div>

    <?php 
    }
    $max = String(PHP_INT_MAX);
    $params['size'] = $max;
    $query_results = $es->search($params);
    $results = $query_results['hits']['hits'];
    $total_pages = ceil(count($results) / 1);
    //    var_dump($total_pages);die;
    for ($count = 1; $count < $total_pages; $count++) {
        ?>
         <a href="SearchPage.php?page=<?php 
        echo $count;
        ?>
" >
             <?php 
        echo $count;
        ?>
</a>
コード例 #13
0
ファイル: edita_produto.php プロジェクト: eneiasramos/xmoney
 function grava_dados()
 {
     if (!$this->check_dados()) {
         return;
     }
     $db = new Database($this, false);
     if (!$db->link) {
         return;
     }
     $modelo = $this->modelo->get_text();
     $descricao = $this->descricao->get_text();
     $custo = $this->custo->get_text();
     $margem = $this->margem->get_text();
     $percentual = $this->percentual->get_text();
     $icms = $this->icms->get_text();
     $ipi = $this->ipi->get_text();
     $clas_fiscal = $this->clas_fiscal->get_text();
     $qtde_minima = $this->qtde_minima->get_text();
     $cota_compra = $this->cota_compra->get_text();
     $cota_venda = $this->cota_venda->get_text();
     if ($this->operacao == 'i') {
         $sql = 'call SP_Produto_Inc';
     } else {
         $sql = 'call SP_Produto_Alt';
     }
     $data = $sql . '(' . String($this->CodProduto) . ',' . String($this->situacao->CodSitProduto) . ',' . String($this->tipo->CodTipoProduto) . ',' . String($this->ativo->get_active()) . ',' . String($this->grupos->CodGrupo) . ',' . String($this->marcas->CodMarca) . ',' . String($modelo) . ',' . String($descricao) . ',' . String(CommaToPoint($custo)) . ',' . String(CommaToPoint($margem)) . ',' . String(CommaToPoint($percentual)) . ',' . String($icms) . ',' . String($ipi) . ',' . String($clas_fiscal) . ',' . String($qtde_minima) . ',' . String($cota_compra) . ',' . String($cota_venda) . ',' . String($this->unid_compra->CodUnidCompra) . ',' . String($this->unid_venda->CodUnidVenda) . ',' . String($this->unid_estoque->CodUnidEstoque) . ',' . $GLOBALS['CodUsuario'] . ');';
     if (!$db->multi_query($data)) {
         return;
     }
     $line = $db->line();
     $db->free_result();
     new Message($this, $line['Mensagem']);
     return true;
 }
コード例 #14
0
ファイル: edita_usuario.php プロジェクト: eneiasramos/xmoney
 function grava_dados()
 {
     if (!$this->check_dados()) {
         return;
     }
     $db = new Database($this, false);
     if (!$db->link) {
         return;
     }
     $usuario = $this->usuario->get_text();
     $nome = $this->nome->get_text();
     $senha = $this->senha->get_text();
     $endereco = $this->endereco->get_text();
     $bairro = $this->bairro->get_text();
     $cep = $this->cep->get_text();
     $cidade = $this->cidade->get_text();
     $cpf = $this->cpf->get_text();
     $rg = $this->rg->get_text();
     $dependentes = $this->dependentes->get_text();
     $filhos = $this->filhos->get_text();
     $cracha = $this->cracha->get_text();
     $email = $this->email->get_text();
     $tel = $this->tel->get_text();
     $cel = $this->cel->get_text();
     $data_nasc = CDate($this->data_nasc->get_text());
     $data_adm = CDate($this->data_adm->get_text());
     $data_homo = CDate($this->data_homo->get_text());
     $data_resc = CDate($this->data_resc->get_text());
     if ($this->operacao == 'i') {
         $sql = 'call SP_Usuario_Inc';
     } else {
         $sql = 'call SP_Usuario_Alt';
     }
     $data = $sql . '(' . String($this->CodUsuario) . ',' . String($this->filial->CodFilial) . ',' . String($this->estado->CodEstado) . ',' . String($this->est_civil->CodEstCivil) . ',' . String($this->perfil->CodPerfil) . ',' . String($usuario) . ',' . String($nome) . ',' . String($this->ativo->get_active()) . ',' . String($endereco) . ',' . String($bairro) . ',' . String($cep) . ',' . String($cidade) . ',' . String($cpf) . ',' . String($rg) . ',' . String($data_nasc) . ',' . String($this->sexo->CodSexo) . ',' . String($dependentes) . ',' . String($filhos) . ',' . String($this->depto->CodDepto) . ',' . String($this->cargo->CodCargo) . ',' . String($cracha) . ',' . String($tel) . ',' . String($cel) . ',' . String($email) . ',' . String($data_adm) . ',' . String($data_homo) . ',' . String($data_resc) . ',' . $GLOBALS['CodUsuario'] . ');';
     if (!$db->multi_query($data)) {
         return;
     }
     $line = $db->line();
     $CodUsuario = $line['CodUsuario'];
     $mensagem = $line['Mensagem'];
     // limpa BUFFER
     while ($db->line()) {
     }
     if ($this->alterar_senha->get_active()) {
         if (!$CodUsuario) {
             $CodUsuario = $this->CodUsuario;
         }
         $sql = ' UPDATE Tb_Usuarios SET Senha = ' . String(md5($usuario . '@' . $senha)) . ' WHERE Cod_S_Usuario = ' . $CodUsuario;
         $db->query($sql);
     }
     new Message($this, $mensagem);
     return true;
 }
コード例 #15
0
ファイル: edita_banco.php プロジェクト: eneiasramos/xmoney
 function grava_dados()
 {
     if (!$this->check_dados()) {
         return;
     }
     $db = new Database($this, false);
     if (!$db->link) {
         return;
     }
     if ($this->operacao == 'a') {
         $id = $this->id->get_text();
     }
     $nome = $this->nome->get_text();
     $agencia = $this->agencia->get_text();
     $conta = $this->conta->get_text();
     if ($this->operacao == 'i') {
         $sql = 'call SP_Banco_Inc';
     } else {
         $sql = 'call SP_Banco_Alt';
     }
     $data = $sql . '(' . String($id) . ',' . String($nome) . ',' . String($agencia) . ',' . String($conta) . ',' . String($this->filial->CodFilial) . ',' . $GLOBALS['CodUsuario'] . ');';
     if (!$db->multi_query($data)) {
         return;
     }
     $line = $db->line();
     $db->free_result();
     new Message($this, $line['Mensagem']);
     return true;
 }
コード例 #16
0
 function grava_dados()
 {
     if ($this->ValorTotal > 0) {
         /* WOW! Totais OK! */
     } else {
         new Message($this, 'Todos os totais devem estar preenchidos!');
         return;
     }
     $db = new Database($this, false);
     if (!$db->link) {
         return;
     }
     $sql = 'call SP_Mov_Conta_Receber_Inc';
     $children = $this->lista->get_children();
     $max = count($children) / 8;
     $i = 0;
     foreach ($this->InfoLinha as $key => $value) {
         $anotacoes = $children[$i * 8]->get_text();
         $total = $children[$i * 8 + 1]->entry->get_text();
         $desconto = $children[$i * 8 + 2]->entry->get_text();
         $juros = $children[$i * 8 + 3]->entry->get_text();
         $id = $children[$i * 8 + 7]->get_text();
         $data = $sql . '(' . String($key) . ',' . String($this->banco->CodBanco) . ',' . String($this->despesa->CodTipoDespesa) . ',' . String($this->forma_pgto->CodFormaPgto) . ',' . String($juros) . ',' . String($desconto) . ',' . String($total) . ',' . String($anotacoes) . ',' . $GLOBALS['CodUsuario'] . ');';
         if (!$db->multi_query($data)) {
             return;
         }
         // Limpa Buffer
         while ($db->line()) {
         }
         // printf ("%s\n", $line ['Mensagem']);
         ++$i;
     }
     $this->Parent->pega_dados();
     new Message($this, 'Conta(s) a Receber baixada(s) com sucesso!');
     return true;
 }
コード例 #17
0
ファイル: edita_filial.php プロジェクト: eneiasramos/xmoney
 function grava_dados()
 {
     if (!$this->check_dados()) {
         return;
     }
     $db = new Database($this, false);
     if (!$db->link) {
         return;
     }
     $nome = $this->nome->get_text();
     $cnpj = $this->cnpj->get_text();
     $razao = $this->razao->get_text();
     $endereco = $this->endereco->get_text();
     $bairro = $this->bairro->get_text();
     $cep = $this->cep->get_text();
     $cidade = $this->cidade->get_text();
     $tel = $this->tel->get_text();
     $fax = $this->fax->get_text();
     $email = $this->email->get_text();
     $url = $this->url->get_text();
     $dominio = $this->dominio->get_text();
     if ($this->operacao == 'i') {
         $sql = 'call SP_Filial_Inc';
     } else {
         $sql = 'call SP_Filial_Alt';
     }
     $data = $sql . '(' . String($this->CodFilial) . ',' . String($this->estado->CodEstado) . ',' . String($nome) . ',' . String($cnpj) . ',' . String($razao) . ',' . String($endereco) . ',' . String($bairro) . ',' . String($cep) . ',' . String($cidade) . ',' . String($tel) . ',' . String($fax) . ',' . String($email) . ',' . String($url) . ',' . String($dominio) . ',' . $GLOBALS['CodUsuario'] . ');';
     if (!$db->multi_query($data)) {
         return;
     }
     $line = $db->line();
     $db->free_result();
     new Message($this, $line['Mensagem']);
     return true;
 }
コード例 #18
0
ファイル: lista_precos.php プロジェクト: eneiasramos/xmoney
 function cotped_compra_venda($tipo)
 {
     switch ($tipo) {
         case 'cc':
             $tabela = ' Tb_Itens_Cotacao_Compra ';
             $campo_id = ' Cod_S_CotCompra ';
             break;
         case 'cv':
             $tabela = ' Tb_Itens_Cotacao_Venda ';
             $campod_id = ' Cod_S_CotVenda ';
             break;
         case 'pc':
             $tabela = ' Tb_Itens_Pedido_Compra ';
             $campo_id = ' Cod_S_PedCompra ';
             break;
         case 'pv':
             $tabela = ' Tb_Itens_Pedido_Venda ';
             $campo_id = ' Cod_S_PedVenda ';
             break;
         default:
             return;
             break;
     }
     unset($this->InfoLinha);
     $this->grid->store->foreach(array($this, 'enumerar_linhas'));
     if (!isset($this->InfoLinha)) {
         new Message($this, 'Nenhum item selecionado!');
         return;
     }
     if ($this->CodId) {
         $CodId = $this->CodId;
     } else {
         if (!($id = $this->nova_cotacao_pedido($tipo))) {
             return;
         } else {
             $CodId = $id;
         }
     }
     $db = new Database($this);
     if (!$db->conexao) {
         return;
     }
     foreach ($this->InfoLinha as $key => $value) {
         if ($value) {
             if (!$db->query('sistema', ' INSERT INTO ' . $tabela . '(' . $campo_id . ',Cod_S_Pro)' . ' VALUES (' . String($CodId) . ',' . String($key) . ');')) {
                 return;
             }
         }
     }
     switch ($tipo) {
         case 'cc':
             if ($this->Parent instanceof TEditaCompra) {
                 $lista = $this->Parent;
             } else {
                 $lista = new TEditaCompra($this, 'c', 'a', $CodId);
             }
             break;
         case 'cv':
             if ($this->Parent instanceof TEditaVenda) {
                 $lista = $this->Parent;
             } else {
                 $lista = new TEditaVenda($this, 'c', 'a', $CodId);
             }
             break;
         case 'pc':
             if ($this->Parent instanceof TEditaCompra) {
                 $lista = $this->Parent;
             } else {
                 $lista = new TEditaCompra($this, 'p', 'a', $CodId);
             }
             break;
         case 'pv':
             if ($this->Parent instanceof TEditaVenda) {
                 $lista = $this->Parent;
             } else {
                 $lista = new TEditaVenda($this, 'p', 'a', $CodId);
             }
             break;
     }
     if ($lista->atualizar()) {
         $lista->show();
     }
 }