public function addCategoria(UploadDownloadCategoria $uDC)
 {
     if ($uDC->getId() != '' && $this->getId() != '') {
         $con = BDConexao::__Abrir();
         $con->executar("INSERT INTO " . Sistema::$BDPrefixo . "relacionamento_arquivos_categorias(arquivo, categoria) VALUES('" . $this->getId() . "','" . $uDC->getId() . "')");
     }
 }
Ejemplo n.º 2
0
 public function addMusica(Musica $uDA)
 {
     if ($uDA->getId() != '' && $this->getId() != '') {
         $con = BDConexao::__Abrir();
         $con->executar("INSERT INTO " . Sistema::$BDPrefixo . "relacionamento_musicas_categorias(categoria, musica) VALUES('" . $this->getId() . "','" . $uDA->getId() . "')");
     }
 }
Ejemplo n.º 3
0
 public function addCategoria(BannerCategoria $bC)
 {
     if ($bC->getId() != '' && $this->getId() != '') {
         $con = BDConexao::__Abrir();
         $con->executar("INSERT INTO " . Sistema::$BDPrefixo . "relacionamento_banners_categorias(banner, categoria) VALUES('" . $this->getId() . "','" . $bC->getId() . "')");
     }
 }
Ejemplo n.º 4
0
 public function addSlide(Slide $s)
 {
     if ($s->getId() != '' && $this->getId() != '') {
         $con = BDConexao::__Abrir();
         $con->executar("INSERT INTO " . Sistema::$BDPrefixo . "relacionamento_slides_categorias(categoria, slide) VALUES('" . $this->getId() . "','" . $s->getId() . "')");
     }
 }
Ejemplo n.º 5
0
 public function addNoticia(Noticia $n)
 {
     if ($n->getId() != '' && $this->getId() != '') {
         $con = BDConexao::__Abrir();
         $con->executar("INSERT INTO " . Sistema::$BDPrefixo . "relacionamento_noticias_categorias(categoria, noticia) VALUES('" . $this->getId() . "','" . $n->getId() . "')");
     }
 }
Ejemplo n.º 6
0
 public function checkout()
 {
     $con = BDConexao::__Abrir();
     $con->executar("SELECT * FROM " . Sistema::$BDPrefixo . "pagamentos");
     $rsP = $con->getRegistro();
     $con->executar("SELECT * FROM " . Sistema::$BDPrefixo . "frete");
     $rsF = $con->getRegistro();
     $this->pay->setReference($this->id);
     foreach ($this->itens as $k => $obj) {
         if (!$rsP['fretepagseguro'] && $rsF['ativocorreio'] && !$rsF['fretegratis'] && $obj->frete != Produto::SEM_FRETE && $obj->frete != Produto::FRETE_GRATIS) {
             $this->pay->addItem($obj->getId(), (string) $obj, $obj->quantidade, $obj->valor->formatar());
         } elseif ($rsP['fretepagseguro'] && !$rsF['fretegratis'] && $obj->frete != Produto::SEM_FRETE && $obj->frete != Produto::FRETE_GRATIS) {
             $this->pay->addItem($obj->getId(), (string) $obj, $obj->quantidade, $obj->valor->formatar(), $obj->peso->formatar() * 1000, $obj->getValorFrete()->formatar());
         } else {
             $this->pay->addItem($obj->getId(), (string) $obj, $obj->quantidade, $obj->valor->formatar());
         }
     }
     $this->pay->setShippingType(3);
     $this->pay->setShippingAddress($this->endereco->getCep(), $this->endereco->logradouro, $this->endereco->numero, $this->endereco->complemento, $this->endereco->bairro, $this->endereco->cidade, $this->endereco->estado, $this->endereco->pais);
     if (!$rsF['fretegratis'] && !$rsP['fretepagseguro']) {
         $this->pay->setShippingCost($this->endereco->getValor()->formatar());
     }
     $tel = $this->cliente->getTelefone()->listar();
     $this->pay->setSender($this->cliente->nome . " " . $this->cliente->sobreNome, $this->cliente->emailPrimario, $tel->ddd, $tel->telefone);
     $this->pay->setExtraAmount(-$this->getDesconto()->formatar());
     try {
         $this->pay->setRedirectUrl($this->urlRetorno);
         $credentials = new PagSeguroAccountCredentials($rsP['emailpagseguro'], $rsP['tokenpagseguro']);
         // Register this payment request in PagSeguro, to obtain the payment URL for redirect your customer.
         $url = $this->pay->register($credentials);
         return $url;
     } catch (PagSeguroServiceException $e) {
         throw new Exception($e->getMessage());
     }
 }
Ejemplo n.º 7
0
 public static function consultarExistencia($tabela, $where)
 {
     $tabela = strtolower($tabela);
     $con = BDConexao::__Abrir();
     $con->consultar($tabela, $where);
     return $con->getTotal() > 0 ? true : false;
 }
Ejemplo n.º 8
0
 public function addCategoria(GaleriaCategoria $gC)
 {
     if ($gC->getId() != '' && $this->getId() != '') {
         $con = BDConexao::__Abrir();
         $con->executar("INSERT INTO " . Sistema::$BDPrefixo . "relacionamento_galerias_categorias(galeria, categoria) VALUES('" . $this->getId() . "','" . $gC->getId() . "')");
     }
 }
Ejemplo n.º 9
0
 public function __construct($id = '')
 {
     parent::__construct($id);
     $this->titulo = '';
     $this->emails = new Lista('mailing_pacotes_emails');
     $this->emails->condicoes(array(1 => array('campo' => 'pacote', 'valor' => $this->id)));
     $this->con = BDConexao::__Abrir();
 }
Ejemplo n.º 10
0
 public function __construct($tabela = '', $pre = true)
 {
     if (!empty($tabela)) {
         $this->tabela = $tabela;
     }
     $this->pre = $pre;
     $this->parametros = BDConsultas::__VariaveisPadroes();
     //$this->dados = new AbrirDados(($pre ? Sistema::$BDPrefixo : '').$this->tabela, $this->parametros);
     $this->con = BDConexao::__Abrir();
 }
Ejemplo n.º 11
0
 public function condicoes($array = '', $valor = '', $campo = '', $operador = '=', $join = '')
 {
     $this->parametros['pos'] = 0;
     $where = '';
     $this->consultado = false;
     if (!empty($array) && is_array($array)) {
         if (empty($this->condicao)) {
             $where = 'WHERE';
         }
         for ($i = 1; $i <= count($array); $i++) {
             $array[$i]['operador'] = empty($array[$i]['operador']) ? '=' : $array[$i]['operador'];
             if (isset($array[$i]['OR'])) {
                 if (($i > 1 || !empty($this->condicao)) && $array[$i]['OR']) {
                     $where .= ' OR';
                 } elseif ($i > 1 || !empty($this->condicao)) {
                     $where .= ' AND';
                 }
             } elseif ($i > 1 || !empty($this->condicao)) {
                 $where .= ' AND';
             }
             $where .= ' ' . $array[$i]['campo'] . ' ' . $array[$i]['operador'] . ' "' . str_replace("\"", "\\'", $array[$i]['valor']) . '"';
         }
         $this->condicao .= !empty($array['join']) ? $array['join'] . $where : $where;
         $this->con->executar("SELECT * FROM " . ($this->pre ? Sistema::$BDPrefixo : '') . $this->tabela . " " . $this->condicao);
     } elseif (!empty($campo)) {
         if (empty($campo)) {
             $this->con->executar("SELECT * FROM " . ($this->pre ? Sistema::$BDPrefixo : '') . $this->tabela . " WHERE id = " . $valor);
             $this->condicaoID = $valor;
         } else {
             $this->con->executar("SELECT * FROM " . ($this->pre ? Sistema::$BDPrefixo : '') . $this->tabela . " WHERE " . $campo . ' ' . $operador . ' "' . $valor . '"');
             $this->condicao = $join . ' WHERE ' . $campo . ' ' . $operador . ' "' . $valor . '"';
         }
     } elseif (!empty($join)) {
         $this->join = $join;
         $this->con->executar($this->join);
     } else {
         $this->con->executar("SELECT * FROM " . ($this->pre ? Sistema::$BDPrefixo : '') . $this->tabela);
     }
     $this->total = $this->con->getTotal();
     $this->parametros['pos'] = 0;
     $this->limiteDefinido = false;
     $this->con = BDConexao::__Abrir();
     return $this;
 }
Ejemplo n.º 12
0
 public function getTraducaoById($campo, $tabela, $id)
 {
     $v[1] = array('campo' => ListaTraducoes::TABELACONTEUDO, 'valor' => $tabela);
     $v[2] = array('campo' => ListaTraducoes::IDCONTEUDO, 'valor' => $id);
     $v[3] = array('campo' => ListaTraducoes::CAMPOCONTEUDO, 'valor' => $campo);
     $v[4] = array('campo' => ListaTraducoes::IDIOMA, 'valor' => $this->id);
     $lT = new ListaTraducoes();
     $lT->condicoes($v);
     if ($lT->getTotal() > 0) {
         $t = $lT->listar();
     } else {
         $t = new Traducao();
         $con = BDConexao::__Abrir();
         $con->executar("SELECT * FROM " . Sistema::$BDPrefixo . $tabela . " WHERE id = '" . $id . "'");
         $rs = $con->getRegistro();
         $t->conteudo = $rs[$campo];
         $t->traducao = $rs[$campo];
     }
     return $t;
 }
Ejemplo n.º 13
0
function cat($cat, $tit = '')
{
    global $con;
    $con2 = BDConexao::__Abrir();
    /*if($cat > 0){
    		
    		$con2->executar("SELECT * FROM ".Sistema::$BDPrefixo."produtos_categorias c WHERE c.id = '".$cat."'");
    		$c = $con2->getRegistro();
    		
    		if(empty($tit)){
    		$tit .= $c['nome'];
    		
    		$texto .= "
    ".chr(13)."
    ".chr(13).$tit.chr(13)."
    ";}*/
    //$sql = "SELECT IF(p.nome='', (SELECT p2.nome FROM ".Sistema::$BDPrefixo."produtos p2 WHERE p2.id = p.produtopai), p.nome) as nome, IF(p.valorreal<=0, (SELECT p2.valorreal FROM ".Sistema::$BDPrefixo."produtos p2 WHERE p2.id = p.produtopai), p.valorreal) as valorreal, IF(p.valorvenda<=0, (SELECT p2.valorvenda FROM ".Sistema::$BDPrefixo."produtos p2 WHERE p2.id = p.produtopai), p.valorvenda) as valorvenda FROM ".Sistema::$BDPrefixo."produtos p WHERE p.codigo = (SELECT rpc.produto FROM ".Sistema::$BDPrefixo."relacionamento_produtos_categorias rpc WHERE rpc.categoria = '".$cat."' AND rpc.produto = p.codigo) AND IF(p.valorreal<=0, (SELECT p2.valorreal FROM ".Sistema::$BDPrefixo."produtos p2 WHERE p2.id = p.produtopai), p.valorreal) > 0 AND p.estoque > 0 ORDER BY p.nome ASC";
    if (empty($_GET['t'])) {
        $sql = "SELECT p.* FROM produtos p WHERE p.prd_stock > 0 GROUP BY p.prd_produto ORDER BY p.prd_desc ASC";
    }
    $con->executar($sql);
    if ($con->getTotal() > 0) {
        while ($p = $con->getRegistro()) {
            if (!preg_match("!ZIONEER!", $p['prd_desc']) && !preg_match("!ZZ!", $p['prd_desc'])) {
                $texto .= str_pad($p['prd_produto'], 12, ' ') . str_pad($p['prd_desc'], 68, ' ') . str_pad($p['prd_preco2'] > 0 ? number_format($p['prd_preco2'], 2) : 'Consulte', 12, ' ', STR_PAD_LEFT) . ' ' . chr(13) . "\n";
            }
        }
    } else {
        $texto = '';
    }
    //}
    //$con2->executar("SELECT * FROM ".Sistema::$BDPrefixo."produtos_categorias c WHERE c.categoriapai = '".$cat."' AND c.disponivel = 1 ORDER BY c.nome ASC");
    //$catF = $con2->getRegistro();
    //echo cat($catF['id'], empty($tit) ? "" : $tit." > ");
    /*while($catF = $con2->getRegistro()){
    		if($catF['id'] != "1010201001")
    			$texto .= cat($catF['id'], empty($tit) ? "" : $tit." > ");
    	}*/
    return $texto;
}
function menu_produtos($ref = "", $subref = 0, $nivel = 0)
{
    $con = BDConexao::__Abrir();
    $con2 = BDConexao::__Abrir();
    if ($ref == "") {
        $con->executar("SELECT * FROM `grupos` WHERE grp_classif LIKE '1.01.01.05.001%' OR grp_classif LIKE '1.01.01.03.001.004%' GROUP BY grp_classif ORDER BY grp_classif ASC");
    }
    $ordem = 0;
    $idPai = str_replace(".", "", str_replace(" ", "", $ref));
    $lPC = new ListaProdutoCategorias();
    while ($row = $con->getRegistro()) {
        $ordem++;
        $id = str_replace(".", "", str_replace(" ", "", $row['grp_classif']));
        $lPC->condicoes("", $id, ListaProdutoCategorias::ID);
        if ($lPC->getTotal() > 0) {
            $pC = $lPC->listar();
            $pC->nome = Strings::__PrimeirasLetrasMaiusculas($row['grp_descricao']);
            $pC->getURL()->setURL(URL::cleanURL($pC->nome));
            $pC->ordem = $ordem;
            $pC->subreferencia = $row['grp_classif'];
            $lPC->alterar($pC);
        } else {
            $con2->executar("INSERT INTO " . Sistema::$BDPrefixo . "produtos_categorias (id, categoriapai) VALUES('" . $id . "','" . $idPai . "')");
            $lPC->condicoes("", $id, ListaProdutoCategorias::ID);
            $pC = $lPC->listar();
            $pC->nome = Strings::__PrimeirasLetrasMaiusculas($row['grp_descricao']);
            $pC->getURL()->setURL(URL::cleanURL($pC->nome));
            $pC->ordem = $ordem;
            $pC->disponivel = 1;
            $pC->subreferencia = $row['grp_classif'];
            $lPC->alterar($pC);
        }
        //if($nivel == 0){
        //	menu_produtos($row['grp_classif'], 0, $nivel+1);
        //}
    }
}
Ejemplo n.º 15
0
            EnvioEmail::$msg = $msg;
            while ($rs = $p->getEncomendas()->listar()) {
                EnvioEmail::$para = $rs['email'];
                EnvioEmail::enviar();
            }
            $con = BDConexao::__Abrir();
            $con->executar("DELETE FROM " . Sistema::$BDPrefixo . "produtos_encomenda WHERE idproduto = '" . $p->getId() . "'");
        }
        $javaScript .= Aviso::criar("Produto salvo com sucesso!");
    } else {
        $javaScript .= Aviso::criar($erro);
    }
}
$p = $lP->condicoes('', $_GET['produto'], ListaProdutos::ID)->disableDadosProdutoPai()->listar();
if (isset($_GET['uploadFlash'])) {
    $con = BDConexao::__Abrir();
    $con->executar("SELECT * FROM " . Sistema::$BDPrefixo . "marcadagua");
    $rs = $con->getRegistro();
    $img = new Imagem();
    $img->setSessao($lP->getTabela(), $p->getId());
    $arq = Arquivos::__OpenArquivoByTEMP($_FILES['Filedata']);
    //header("Content-type: image/jpeg");
    $img->setImage(new Image($arq));
    $img->getImage()->open();
    //echo $img->getImage()->getImage();exit;
    if ($rs['produtos']) {
        if ($rs['tipo'] == 1) {
            if (!empty($rs['texto'])) {
                $ma = new NewImage(strlen($rs['texto']) * 9, 20);
                $ma->writeText($rs['texto']);
            }
Ejemplo n.º 16
0
 private static function criarListaParaEnvio(Mailing $m)
 {
     if ($m->getId() != '' && $m->getPacote()->getId() != '') {
         $m->getPacote()->getEmails()->setParametros(0);
         $con = BDConexao::__Abrir();
         $con->executar("DELETE FROM " . Sistema::$BDPrefixo . "mailing_pacotes_envio WHERE mailing = '" . $m->getId() . "'");
         while ($rs = $m->getPacote()->getEmails()->listar()) {
             $con->executar("INSERT INTO " . Sistema::$BDPrefixo . "mailing_pacotes_envio(mailing, email) VALUES('" . $m->getId() . "','" . $rs['email'] . "')");
         }
         $m->getPacote()->getEmails()->setParametros(0);
     }
 }
Ejemplo n.º 17
0
 private static function _GetEnderecoByCep($cep)
 {
     try {
         BDConexao::$usuario = 'tta_usuario';
         BDConexao::$senha = '2133618';
         $con = BDConexao::__Abrir();
         $con->executar("SET NAMES 'utf8';");
         $con->executar("SELECT CONCAT(l.LOG_TIPO_LOGRADOURO, ' ', l.LOG_NO) as logradouro, (SELECT c.LOC_NO FROM tta_correios.log_localidade c WHERE c.LOC_NU_SEQUENCIAL = l.LOC_NU_SEQUENCIAL) as cidade, l.LOC_NU_SEQUENCIAL as idcidade, l.UFE_SG as uf, (SELECT e.UFE_NO FROM tta_correios.log_faixa_uf e WHERE e.UFE_SG = l.UFE_SG) as estado, (SELECT b.BAI_NO FROM tta_correios.log_bairro b WHERE b.BAI_NU_SEQUENCIAL = l.BAI_NU_SEQUENCIAL_INI) as bairro FROM tta_correios.log_logradouro l WHERE l.CEP = '" . str_replace("-", '', $cep) . "'");
         if ($con->getTotal() == 0) {
             $con->executar("SELECT '' as logradouro, c.LOC_NO as cidade, c.LOC_NU_SEQUENCIAL as idcidade, c.UFE_SG as uf, (SELECT e.UFE_NO FROM tta_correios.log_faixa_uf e WHERE e.UFE_SG = c.UFE_SG) as estado, '' as bairro FROM tta_correios.log_localidade c WHERE c.CEP = '" . str_replace("-", '', $cep) . "'");
         }
         if ($con->getTotal() > 0) {
             $rs['status'] = 'true';
             $rs['size'] = $con->getTotal();
             while ($tmp = $con->getRegistro()) {
                 $rs['root'][] = $tmp;
             }
             BDConexao::$usuario = Sistema::$BDUsuario;
             BDConexao::$senha = Sistema::$BDSenha;
             $con = BDConexao::__Abrir();
             $con->executar("SET NAMES 'utf8';");
             $con->close();
         } else {
             $rs['status'] = 'false';
             $rs['size'] = 0;
             $rs['msg'] = mysql_error();
             BDConexao::$usuario = Sistema::$BDUsuario;
             BDConexao::$senha = Sistema::$BDSenha;
             $con = BDConexao::__Abrir();
             $con->executar("SET NAMES 'utf8';");
             $con->close();
         }
     } catch (Exception $e) {
         $rs['status'] = 'false';
         $rs['size'] = 0;
         $rs['msg'] = $e->getMessage();
         BDConexao::$usuario = Sistema::$BDUsuario;
         BDConexao::$senha = Sistema::$BDSenha;
     }
     $con = BDConexao::__Abrir();
     $con->executar("SET NAMES 'utf8';");
     $con->close();
     return $rs;
 }
Ejemplo n.º 18
0
 public function addEncomenda($email)
 {
     if ($email != '' && $this->getId() != '') {
         $con = BDConexao::__Abrir();
         $con->executar("SELECT * FROM " . Sistema::$BDPrefixo . "produtos_encomenda WHERE idproduto = '" . $this->getId() . "' AND email = '" . $email . "'");
         if ($con->getTotal() == 0) {
             $con->executar("INSERT INTO " . Sistema::$BDPrefixo . "produtos_encomenda(idproduto, email) VALUES('" . $this->getId() . "','" . $email . "')");
         }
     }
 }
Ejemplo n.º 19
0
 public function sendEmail($assunto, Idioma $idioma = null, $vendedor = false)
 {
     if (empty($idioma)) {
         $idioma = new Idioma();
         $idioma->sigla = 'br';
     } elseif (!$idioma->getId()) {
         $idioma = new Idioma();
         $idioma->sigla = 'br';
     }
     $temE = new InterFaces(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/email-padrao.html"));
     $temEE = new InterFaces(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaPedidos/email-pedido.html"));
     $temEE->setSession($idioma->sigla);
     $temEE->trocar('lang', $idioma->sigla);
     $p = $this->getCliente();
     $endP = $p->getEndereco()->listar();
     $telP = $p->getTelefone()->listar();
     $lP = new ListaProdutos();
     $temEE->createRepeticao("repetir->PedidoItens");
     $con = BDConexao::__Abrir();
     $con->executar("SELECT * FROM " . Sistema::$BDPrefixo . "frete");
     $rs = $con->getRegistro();
     $con->executar("SELECT * FROM " . Sistema::$BDPrefixo . "pagamentos");
     $rsP = $con->getRegistro();
     $total = 0;
     $end = $this->getEndereco();
     $temEE->condicao("condicao->Alterar.Endereco.Pedido", isset($_GET['alterar-endereco']) || $end->getCep() == '' || $end->logradouro == '' || $end->numero == '' || $end->bairro == '' || $end->getCidade()->nome == '' || $end->getEstado()->uf == '');
     $temEE->condicao("condicao->tipo.Endereco.Pedido", !empty($end->tipo));
     $temEE->trocar($end->tipo . '.Endereco.Pedido', "checked=\"checked\"");
     $temEE->trocar('cep.Endereco.Pedido', $end->getCep());
     $temEE->trocar('logradouro.Endereco.Pedido', $end->logradouro);
     $temEE->trocar('ddd.Telefone.Pedido', $tel->ddd);
     $temEE->trocar('telefone.Telefone.Pedido', $tel->telefone);
     $temEE->trocar('numero.Endereco.Pedido', $end->numero);
     $temEE->trocar('complemento.Endereco.Pedido', $end->complemento);
     $temEE->trocar('bairro.Endereco.Pedido', $end->bairro);
     $temEE->trocar('cidade.Endereco.Pedido', $end->getCidade()->nome);
     $temEE->trocar('estado.Endereco.Pedido', $end->getEstado()->uf);
     $temEE->trocar("tipoPagamento.Pedido", $this->getTipoPagamento());
     $temEE->trocar("status.Pedido", $idioma->getTraducaoByConteudo($this->getStatus())->traducao);
     $recuperar = true;
     $itens = new ListaPedidoItens();
     $a[1] = array('campo' => ListaPedidoItens::IDSESSAO, 'valor' => $this->id);
     $itens->condicoes($a);
     while ($pI = $itens->listar()) {
         if ($pI) {
             $lP->condicoes('', $pI->getProdutoPai(), ListaProdutos::ID);
             if ($lP->getTotal() > 0) {
                 $produtoPai = $lP->listar();
             }
             $cat = $produtoPai ? $produtoPai->getCategorias()->listar() : $pI->getCategorias()->listar();
             $temEE->repetir();
             $temEE->enterRepeticao()->trocar("n.PedidoItem", $this->getItem()->getParametros());
             $temEE->enterRepeticao()->trocar("id.PedidoItem", $pI->getId());
             $temEE->enterRepeticao()->trocar("quantidade.PedidoItem", $pI->quantidade);
             $temEE->enterRepeticao()->trocar("nome.PedidoItem", $idioma->getTraducaoByConteudo($pI->nome)->traducao . ($pI->observacao != '' ? ' ' . $pI->observacao : ''));
             $temEE->enterRepeticao()->trocar("valor.PedidoItem", "\$ " . $pI->valor->moeda());
             $valorP = $pI->valor;
             $temEE->enterRepeticao()->trocar("valorPonto.PedidoItem", (string) Numero::__CreateNumero($valorP->formatar())->formatar());
             $total += $pI->valor->num * $pI->quantidade;
             if ($pI->getImagens()->getTotal() > 0) {
                 $temEE->enterRepeticao()->trocar("imagem.PedidoItem", $pI->getImagens()->listar("DESC", ListaImagens::DESTAQUE)->getImage()->showHTML(60, 1000));
             }
             if ($pI->quantidade > $pI->estoque) {
                 $recuperar = false;
             }
         }
     }
     $temEE->condicao('condicao->Desconto', $this->getDesconto()->num > 0);
     $temEE->trocar('desconto', "\$ " . $this->getDesconto()->moeda());
     $total -= $this->getDesconto()->num;
     $temEE->condicao("condicao->RecuperarPedido", $this->getStatus()->getStatus() == PedidoStatus::CANCELADO && $recuperar);
     $temEE->condicao("condicao->EfetivarPagamento", $this->getStatus()->getStatus() == PedidoStatus::COBRANCA);
     $temEE->trocar("linkFinalizar.Pedido", Sistema::$caminhoURL . $idioma->sigla . "/finalizar-pedido&pedido=" . $this->getId() . "&recuperar");
     $temEE->condicao("condicao->DepositoPagamento", $this->getTipoPagamento() == PagamentoDeposito::GetTipo());
     $temEE->trocar("textoDeposito", nl2br($rsP['textodeposito']));
     $temEE->condicao('condicao->ExisteFrete', $this->hasFrete() && $this->getItem()->getTotal() > 0);
     $temEE->condicao('condicao->ExistePrazo', $this->getEndereco()->prazo > 0 && $this->getItem()->getTotal() > 0);
     $temEE->condicao('condicao->ExisteFreteCorreios', $rs['ativocorreio']);
     $temEE->trocar("valor.Endereco.Cliente", $this->freeFrete() ? $idioma->getTraducaoByConteudo('Grátis')->traducao : ($end->getValor()->num > 0 ? "\$ " . $end->getValor()->moeda() : ''));
     $temEE->trocar("tipo.Endereco.Pedido", PedidoEnderecoEntrega::GetNameType($end->tipo));
     $temEE->trocar("prazo.Endereco.Pedido", $this->getEndereco()->prazo);
     $temEE->trocar("total", "\$ " . Numero::__CreateNumero($total + $end->getValor()->num)->moeda());
     $temEE->trocar("observacoes", $this->observacoes);
     $temE->trocar('texto', $temEE->concluir());
     $msg = $temE->concluir();
     EnvioEmail::$de = Sistema::$nomeEmpresa . "<" . Sistema::$emailEmpresa . ">";
     EnvioEmail::$assunto = $idioma->getTraducaoByConteudo($assunto)->traducao . "!";
     EnvioEmail::$html = true;
     EnvioEmail::$msg = $msg;
     if (!$vendedor) {
         EnvioEmail::$de = Sistema::$nomeEmpresa . "<" . Sistema::$emailEmpresa . ">";
         EnvioEmail::$para = $p->emailPrimario;
     } else {
         EnvioEmail::$de = $p->nome . "<" . $p->emailPrimario . ">";
         EnvioEmail::$para = Sistema::$emailEmpresa;
     }
     EnvioEmail::enviar();
 }
Ejemplo n.º 20
0
<?php

//Passagem de dados para a conexao ao Banco de Dados
importar('Utils.BD.BDConexao');
BDConexao::$host = Sistema::$BDHost;
BDConexao::$banco = Sistema::$BDBanco;
BDConexao::$usuario = Sistema::$BDUsuario;
BDConexao::$senha = Sistema::$BDSenha;
//BDConexao::$staticConnection    = mysql_pconnect(BDConexao::$host, BDConexao::$usuario, BDConexao::$senha);
Ejemplo n.º 21
0
 public static function __CalcularValorCorreios($cepDestino, $tipo, $p, $c, $l, $a)
 {
     $con = BDConexao::__Abrir();
     $con->executar("SELECT * FROM " . Sistema::$BDPrefixo . "frete");
     $rs = $con->getRegistro();
     $client = new nusoap_client("http://ws.correios.com.br/calculador/CalcPrecoPrazo.asmx?WSDL", true);
     if ($rs['logincorreio'] && $rs['senhacorreio']) {
         $result = $client->call('CalcPrecoPrazo', array('nCdEmpresa' => $rs['logincorreio'], 'sDsSenha' => $rs['senhacorreio'], 'nCdServico' => $tipo == self::FRETE_TIPO_PAC ? self::FRETE_PAC_CONTRATO : self::FRETE_SEDEX_CONTRATO, 'sCepOrigem' => $rs['ceporigem'], 'sCepDestino' => $cepDestino, 'nVlPeso' => $p, 'nCdFormato' => 1, 'nVlComprimento' => $c, 'nVlAltura' => $a, 'nVlLargura' => $l, 'nVlDiametro' => $d ? $d : 0, 'sCdMaoPropria' => 'N', 'nVlValorDeclarado' => 0, 'sCdAvisoRecebimento' => 'N'));
         if (!empty($result["CalcPrecoPrazoResult"]['Servicos']['cServico']["MsgErro"])) {
             $result = $client->call('CalcPrecoPrazo', array('nCdEmpresa' => '', 'sDsSenha' => '', 'nCdServico' => $tipo == self::FRETE_TIPO_PAC ? self::FRETE_PAC : self::FRETE_SEDEX, 'sCepOrigem' => $rs['ceporigem'], 'sCepDestino' => $cepDestino, 'nVlPeso' => $p, 'nCdFormato' => 1, 'nVlComprimento' => $c, 'nVlAltura' => $a, 'nVlLargura' => $l, 'nVlDiametro' => $d ? $d : 0, 'sCdMaoPropria' => 'N', 'nVlValorDeclarado' => 0, 'sCdAvisoRecebimento' => 'N'));
         }
     } else {
         $result = $client->call('CalcPrecoPrazo', array('nCdEmpresa' => '', 'sDsSenha' => '', 'nCdServico' => $tipo == self::FRETE_TIPO_PAC ? self::FRETE_PAC : self::FRETE_SEDEX, 'sCepOrigem' => $rs['ceporigem'], 'sCepDestino' => $cepDestino, 'nVlPeso' => $p, 'nCdFormato' => 1, 'nVlComprimento' => $c, 'nVlAltura' => $a, 'nVlLargura' => $l, 'nVlDiametro' => $d ? $d : 0, 'sCdMaoPropria' => 'N', 'nVlValorDeclarado' => 0, 'sCdAvisoRecebimento' => 'N'));
     }
     if (!empty($result["CalcPrecoPrazoResult"]['Servicos']['cServico']["MsgErro"])) {
         throw new Exception($result["CalcPrecoPrazoResult"]['Servicos']['cServico']["Erro"] . " - " . $result["CalcPrecoPrazoResult"]['Servicos']['cServico']["MsgErro"]);
     }
     $ar['valor'] = $result["CalcPrecoPrazoResult"]['Servicos']['cServico']['Valor'];
     $ar['prazo'] = $result["CalcPrecoPrazoResult"]['Servicos']['cServico']['PrazoEntrega'];
     return $ar;
 }
Ejemplo n.º 22
0
 public function addCategoria(ProdutoCategoria $pC)
 {
     if ($pC->getId() != '' && $this->getId() != '') {
         $con = BDConexao::__Abrir();
         $con->executar("INSERT INTO " . Sistema::$BDPrefixo . "relacionamento_ofertascoletivas_categorias(ofertacoletiva, categoria) VALUES('" . $this->getId() . "','" . $pC->getId() . "')");
     }
 }