$sm->assign("vendedores", $vendedor); $dados = Transita::listaTransitas(); $joias = array(); $tipos = array(); $texto = ""; $precoTotal = 0.0; if ($dados) { foreach ($dados as $dado) { $joia = Joia::listaJoiaQR($dado->getNome_transita(), 1); array_push($joias, $joia); if ($joia != null) { $precoTotal += $joia->getPreco_venda(); $texto = "-------------------------"; $texto = $texto . "\nProduto: " . Tipo::listaTipo($joia->getTipo())->getNome_tipo() . "\n"; $texto = $texto . "Pedra: " . Pedra::listaPedra($joia->getPedra())->getNome_pedra() . "\n"; $texto = $texto . "Cor: " . Cor::listaCor($joia->getCor())->getNome_cor() . "\n"; $texto = $texto . "Fornecedor: " . Loja::listaLoja($joia->getLoja())->getNome_loja(); array_push($tipos, $texto); $texto = ''; } } } if (!isset($pastaParametro)) { $nome = Vendedor::listaVendedor(1); } else { $pastaParametro = $_GET['pastaParametro']; $nome = $pastaParametro; } $path = "../vendedores/" . $nome->getPasta(); $diretorio = dir($path); $i = 1;
include_once '../model/Cor.php'; session_start(); if ($_SESSION['login'] == "true") { $opc = addslashes(trim($_GET['opc'])); if ($opc != "Remover") { $nomeCor = addslashes(trim($_POST['nome'])); } if ($opc == "Editar") { $cod = addslashes(trim($_GET['cod'])); $cor = Cor::listaCor($cod); $cor->setNome_cor($nomeCor); Cor::editaCor($cor); header("location:../controller/controllerCor.php"); } else { if ($opc == "Incluir") { $cor = Cor::listaCor($cod); $cor->setNome_cor($nomeCor); Cor::insereCor($cor); header("location:../controller/controllerCor.php"); } else { $cod = addslashes(trim($_GET['cod'])); $escolha = addslashes(trim($_GET['escolha'])); if ($escolha == "Sim") { Cor::deletaCor($cod); header("location:../controller/controllerCor.php"); } else { header("location:../controller/controllerCor.php"); } } } } else {
include_once '../configs/sm.php'; include_once '../model/Joia.php'; include_once '../model/Tipo.php'; include_once '../model/Cor.php'; include_once '../model/Pedra.php'; include_once '../model/Loja.php'; include_once '../model/Usuario.php'; session_start(); if ($_SESSION['login'] == "true") { $usuario = Usuario::listaUsuario($_SESSION['usuario']); $sm->assign("usuario", $usuario); $getId = $_GET['id']; $getTipo = $_GET['tipo']; $getLoja = $_GET['loja']; $getCor = $_GET['cor']; $getPedra = $_GET['pedra']; $joia = Joia::listaJoia($getId); $tipo = Tipo::listaTipo($getTipo); $cor = Cor::listaCor($getCor); $loja = Loja::listaLoja($getLoja); $pedra = Pedra::listaPedra($getPedra); $sm->assign("joia", $joia); $sm->assign("tipo", $tipo); $sm->assign("cor", $cor); $sm->assign("loja", $loja); $sm->assign("pedra", $pedra); $sm->display("../view/ListaJoiaIndividual.html"); } else { header("location:../index.php?&erro=\"Login\""); }