示例#1
0
    $img->getImage()->redimensionar(1500, 1500);
    $lIM->inserir($img);
    exit;
}
$iAP->condicao("condicaoBotoes", true);
$iAP->trocar("linkCadastrarVariacao", "?p=" . $_GET['p'] . "&a=cadastrarProduto&produtoPai=" . $p->getId());
$botoes = $iAP->cutParte('botoes');
$iAP->condicao('condicao->alterar.Produto', false);
$iAP->trocar("linkVoltar", "?p=" . $_GET['p'] . "&a=listarProdutos");
$iAP->condicao("condicao->ProdutoPai", $produtoPai->getId() != 0);
$iAP->trocar("nome.ProdutoPai", $produtoPai->nome);
$iAP->trocar("linkAlterar.ProdutoPai", "?p=" . $_GET['p'] . "&a=" . $_GET['a'] . "&produto=" . $produtoPai->getId());
$iAP->trocar("nome", $p->nome);
$lPM = new ListaProdutoMarcas();
$iAP->createRepeticao("repetir->ProdutoMarcas");
while ($pM = $lPM->listar("ASC", ListaProdutoMarcas::NOME)) {
    $iAP->repetir();
    $iAP->enterRepeticao()->trocar('id.ProdutoMarca', $pM->getId());
    $iAP->enterRepeticao()->trocar('nome.ProdutoMarca', $pM->nome);
}
$lPO = new ListaProdutoOpcoes();
$iAP->createRepeticao("repetir->ProdutoOpcoes");
$iAP->createRepeticao("repetir->ProdutoOpcoes.JavaScript");
while ($pO = $lPO->listar("ASC", ListaProdutoOpcoes::NOME)) {
    if ($lPO->getParametros() % 2 == 0) {
        $bgcolor = '#E5E5E5';
    } else {
        $bgcolor = '#FFF';
    }
    $iAP->repetir("repetir->ProdutoOpcoes");
    $iAP->repetir("repetir->ProdutoOpcoes.JavaScript");
示例#2
0
 public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         $temp = new Produto($info[self::ID]);
         parent::resgatarObjetos($info);
         //$l = new ListaProdutos;
         //$l->condicoes('', $info[self::PRODUTOPAI], self::ID);
         //if($l->getTotal() > 0)
         //$temp->setProdutoPai($l->listar(), $this->carregarDadosPai);
         if (!empty($info[self::NOME])) {
             $temp->nome = $info[self::NOME];
         }
         if ($info[self::PESO] > 0) {
             $temp->peso = $info[self::PESO];
         }
         if ($info[self::LARGURA] > 0) {
             $temp->largura = $info[self::LARGURA];
         }
         if ($info[self::ALTURA] > 0) {
             $temp->altura = $info[self::ALTURA];
         }
         if ($info[self::COMPRIMENTO] > 0) {
             $temp->comprimento = $info[self::COMPRIMENTO];
         }
         if ($info[self::VALORCUSTO] > 0) {
             $temp->valorCusto = $info[self::VALORCUSTO];
         }
         if ($info[self::VALORREAL] > 0) {
             $temp->valorReal = $info[self::VALORREAL];
         }
         if ($info[self::VALORVENDA] > 0) {
             $temp->valorVenda = $info[self::VALORVENDA];
         }
         if ($info[self::FRETE] > 0) {
             $temp->frete = $info[self::FRETE];
         }
         if ($info[self::TIPOPEDIDO] > 0) {
             $temp->tipoPedido = $info[self::TIPOPEDIDO];
         }
         $temp->setURL($info[parent::URL]);
         if (trim(strip_tags($info[self::DESCRICAOPEQUENA])) != '') {
             $temp->descricaoPequena = $info[self::DESCRICAOPEQUENA];
         }
         if (trim(strip_tags($info[self::DESCRICAO])) != '') {
             $temp->descricao = $info[self::DESCRICAO];
         }
         if ($info[self::ORDEM] > 0) {
             $temp->ordem = $info[self::ORDEM];
         }
         if ($info[self::DISPONIVEL] > 0) {
             $temp->disponivel = $info[self::DISPONIVEL] == self::VALOR_DISPONIVEL_TRUE ? true : false;
         }
         if ($info[self::PROMOCAO] > 0) {
             $temp->promocao = $info[self::PROMOCAO] == self::VALOR_DISPONIVEL_TRUE ? true : false;
         }
         if ($info[self::LANCAMENTO] > 0) {
             $temp->lancamento = $info[self::LANCAMENTO] == self::VALOR_DISPONIVEL_TRUE ? true : false;
         }
         if ($info[self::DESTAQUE] > 0) {
             $temp->destaque = $info[self::DESTAQUE] == self::VALOR_DISPONIVEL_TRUE ? true : false;
         }
         if ($info[self::REMOVIDO] > 0 && !$temp->removido) {
             $temp->removido = $info[self::REMOVIDO] == self::VALOR_DISPONIVEL_TRUE ? true : false;
         }
         if (!empty($info[self::TIPOUNIDADE])) {
             $temp->tipoUnidade = $info[self::TIPOUNIDADE];
         }
         if ($info[self::QUANTIDADEU] > 0) {
             $temp->quantidadeu = $info[self::QUANTIDADEU];
         }
         if ($info[self::ESTOQUE] > 0) {
             $temp->estoque = $info[self::ESTOQUE];
         }
         if (!empty($info[self::CODIGO])) {
             $temp->codigo = $info[self::CODIGO];
         }
         if (!empty($info[self::VIDEO])) {
             $temp->setVideo($info[self::VIDEO]);
         }
         $temp->setDataCadastro(new DataHora($info[self::DATACADASTRO]));
         $lPM = new ListaProdutoMarcas();
         $lPM->condicoes('', $info[self::MARCA], ListaProdutoMarcas::ID);
         if ($lPM->getTotal() > 0) {
             $temp->setMarca($lPM->listar());
         }
         if ($temp->getMarca()->getId() == 182 || $temp->getMarca()->getId() == 160) {
             $temp->valorReal = 0;
             $temp->valorVenda = 0;
         }
         return $temp;
     }
 }
<?php

importar("LojaVirtual.Produtos.Lista.ListaProdutoMarcas");
$tituloPagina = 'Produtos > Marcas > Alterar';
$iAPM = new IFAdmin(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaProdutos/produtoMarca.html"));
$lI = new ListaIdiomas();
if (!empty($_POST)) {
    $erro = '';
    if (empty($_POST['nome'])) {
        $erro = "<b>Nome</b> não preenchido!<br><br>";
    }
    if (empty($erro)) {
        $lPM = new ListaProdutoMarcas();
        $lPM->condicoes('', $_GET['marca'], ListaProdutoMarcas::ID);
        $pM = $lPM->listar();
        $pM->nome = $_POST['nome'];
        if (!empty($_POST['url'])) {
            $pM->getURL()->setURL($_POST['url']);
        } else {
            $pM->getURL()->setURL("marca-" . URL::cleanURL($_POST['nome']));
        }
        $pM->descricao = $_POST['descricao'];
        $pM->enderecoURL = $_POST['enderecoURL'];
        $pM->disponivel = $_POST['disponivel'] == ListaProdutoMarcas::VALOR_DISPONIVEL_TRUE ? true : false;
        if (!empty($_FILES['imagem']['name'])) {
            $pM->setImagem(new Image(Arquivos::__OpenArquivoByTEMP($_FILES['imagem'])));
        }
        $lPM->alterar($pM);
        while ($i = $lI->listar()) {
            $t = $i->getTraducaoById(ListaProdutoMarcas::NOME, $lPM->getTabela(), $pM->getId());
            if ($t->getId()) {
 public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         $lP = new ListaProdutos();
         $lP->condicoes('', $info[self::ID], ListaProdutos::ID);
         //if($lP->getTotal() > 0){
         $prod = $lP->listar();
         if ($lP->getTotal() > 0) {
             $temp = PedidoItem::__ProdutoToPedidoItem($prod);
         } else {
             $temp = new PedidoItem($info[self::ID]);
         }
         if (!empty($info[self::NOME])) {
             $temp->nome = $info[self::NOME];
         }
         if ($info[self::PESO] > 0) {
             $temp->peso = $info[self::PESO];
         }
         if ($info[self::LARGURA] > 0) {
             $temp->largura = $info[self::LARGURA];
         }
         if ($info[self::ALTURA] > 0) {
             $temp->altura = $info[self::ALTURA];
         }
         if ($info[self::COMPRIMENTO] > 0) {
             $temp->comprimento = $info[self::COMPRIMENTO];
         }
         if ($info[self::VALORCUSTO] > 0) {
             $temp->valorCusto = $info[self::VALORCUSTO];
         }
         if ($info[self::VALORREAL] > 0) {
             $temp->valorReal = $info[self::VALORREAL];
         }
         if ($info[self::VALORVENDA] > 0) {
             $temp->valorVenda = $info[self::VALORVENDA];
         }
         if ($info[self::FRETE] > 0) {
             $temp->frete = $info[self::FRETE];
         }
         if ($info[self::TIPOPEDIDO] > 0) {
             $temp->tipoPedido = $info[self::TIPOPEDIDO];
         }
         if (trim(strip_tags($info[self::DESCRICAOPEQUENA])) != '') {
             $temp->descricaoPequena = $info[self::DESCRICAOPEQUENA];
         }
         if (trim(strip_tags($info[self::DESCRICAO])) != '') {
             $temp->descricao = $info[self::DESCRICAO];
         }
         if ($info[self::ORDEM] > 0) {
             $temp->ordem = $info[self::ORDEM];
         }
         if ($info[self::DISPONIVEL] > 0) {
             $temp->disponivel = $info[self::DISPONIVEL] == self::VALOR_DISPONIVEL_TRUE ? true : false;
         }
         if ($info[self::PROMOCAO] > 0) {
             $temp->promocao = $info[self::PROMOCAO] == self::VALOR_DISPONIVEL_TRUE ? true : false;
         }
         if ($info[self::LANCAMENTO] > 0) {
             $temp->lancamento = $info[self::LANCAMENTO] == self::VALOR_DISPONIVEL_TRUE ? true : false;
         }
         if ($info[self::DESTAQUE] > 0) {
             $temp->destaque = $info[self::DESTAQUE] == self::VALOR_DISPONIVEL_TRUE ? true : false;
         }
         if ($info[self::REMOVIDO] > 0 && !$temp->removido) {
             $temp->removido = $info[self::REMOVIDO] == self::VALOR_DISPONIVEL_TRUE ? true : false;
         }
         if ($info[self::TIPOUNIDADE] > 0) {
             $temp->tipoUnidade = $info[self::TIPOUNIDADE];
         }
         if ($info[self::QUANTIDADEU] > 0) {
             $temp->quantidadeu = $info[self::QUANTIDADEU];
         }
         if ($info[self::ESTOQUE] > 0) {
             $temp->estoque = $info[self::ESTOQUE];
         }
         if (!empty($info[self::CODIGO])) {
             $temp->codigo = $info[self::CODIGO];
         }
         if (!empty($info[self::VIDEO])) {
             $temp->setVideo($info[self::VIDEO]);
         }
         $temp->setDataCadastro(new DataHora($info[self::DATACADASTRO]));
         $lPE = new ListaPedidos();
         $lPE->condicoes('', $info[self::IDSESSAO], ListaPedidos::ID);
         if ($lPE->getTotal() > 0) {
             $temp->setPedido($lPE->listar());
         }
         $lPM = new ListaProdutoMarcas();
         $lPM->condicoes('', $info[self::MARCA], ListaProdutoMarcas::ID);
         if ($lPM->getTotal() > 0) {
             $temp->setMarca($lPM->listar());
         }
         $temp->quantidade = $info[self::QUANTIDADE];
         $temp->observacao = $info[self::OBSERVACAO];
         $temp->setValorFrete($info[self::VALORFRETE]);
         return $temp;
         //}
     }
 }