Ejemplo n.º 1
0
 public function alterar(PedidoItem $p, Pedido $pe)
 {
     //parent::alterar($p);
     $where = "WHERE " . self::ID . " = '" . $p->getId() . "' AND " . self::IDSESSAO . " = '" . $pe->getId() . "'";
     $disponivel = $p->disponivel ? self::VALOR_DISPONIVEL_TRUE : self::VALOR_DISPONIVEL_FALSE;
     $promocao = $p->promocao ? self::VALOR_DISPONIVEL_TRUE : self::VALOR_DISPONIVEL_FALSE;
     $lancamento = $p->lancamento ? self::VALOR_DISPONIVEL_TRUE : self::VALOR_DISPONIVEL_FALSE;
     $destaque = $p->destaque ? self::VALOR_DISPONIVEL_TRUE : self::VALOR_DISPONIVEL_FALSE;
     $removido = $p->removido ? self::VALOR_DISPONIVEL_TRUE : self::VALOR_DISPONIVEL_FALSE;
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::NOME, addslashes(str_replace("\"", "'", $p->nome)), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::PESO, $p->peso->formatar(".", "", 3), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::LARGURA, $p->largura->formatar(), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::ALTURA, $p->altura->formatar(), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::COMPRIMENTO, $p->comprimento->formatar(), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::VALORCUSTO, $p->valorCusto->formatar(), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::VALORREAL, $p->valorReal->formatar(), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::VALORVENDA, $p->valorVenda->formatar(), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::ESTOQUE, $p->estoque, $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::DESCRICAOPEQUENA, addslashes($p->descricaoPequena), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::DESCRICAO, addslashes($p->descricao), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::DISPONIVEL, $disponivel, $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::PROMOCAO, $promocao, $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::LANCAMENTO, $lancamento, $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::DESTAQUE, $destaque, $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::REMOVIDO, $removido, $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::ORDEM, $p->ordem, $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::CODIGO, $p->codigo, $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::FRETE, $p->frete, $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::TIPOPEDIDO, $p->tipoPedido, $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::TIPOUNIDADE, addslashes(str_replace("\"", "'", $p->tipoUnidade)), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::QUANTIDADEU, $p->quantidadeu, $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::VIDEO, $p->getVideo(), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::MARCA, $p->getMarca()->getId(), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::QUANTIDADE, $p->quantidade, $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::VALORFRETE, $p->getValorFrete()->formatar(), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::OBSERVACAO, $p->observacao, $where);
 }