Example #1
0
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
include_once '../configs/sm.php';
include_once '../model/Pedra.php';
include_once '../model/Usuario.php';
session_start();
if ($_SESSION['login'] == "true") {
    $usuario = Usuario::listaUsuario($_SESSION['usuario']);
    $sm->assign("usuario", $usuario);
    $opc = addslashes(trim($_GET['opc']));
    if ($opc == "Editar") {
        $cod = addslashes(trim($_GET['cod']));
        $pedra = Pedra::listaPedra($cod);
        $sm->assign("nomePedra", $pedra->getNome_Pedra());
        $sm->assign("cod", $cod);
        $sm->assign("opc", $opc);
        $sm->display("../view/manterPedra.html");
    } else {
        if ($opc == "Incluir") {
            $sm->assign("opc", $opc);
            $sm->display("../view/manterPedra.html");
        } else {
            $cod = addslashes(trim($_GET['cod']));
            $sm->assign("cod", $cod);
            $sm->assign("tipo", "Pedra");
            $sm->display("../view/remover.html");
        }
    }
Example #2
0
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
include_once '../configs/sm.php';
include_once '../model/Joia.php';
include_once '../model/Tipo.php';
include_once '../model/Loja.php';
include_once '../model/Cor.php';
include_once '../model/Pedra.php';
include_once '../model/Usuario.php';
session_start();
if ($_SESSION['login'] == "true") {
    $usuario = Usuario::listaUsuario($_SESSION['usuario']);
    $sm->assign("usuario", $usuario);
    $tipo = Tipo::listaTipos();
    $cor = Cor::listaCores();
    $loja = Loja::listaLojas();
    $pedra = Pedra::listaPedras();
    $sm->assign("tipos", $tipo);
    $sm->assign("cores", $cor);
    $sm->assign("pedras", $pedra);
    $sm->assign("lojas", $loja);
    $sm->display("../view/manterJoia.html");
} else {
    header("location:../index.php?&erro=\"Login\"");
}
Example #3
0
if ($_SESSION['login'] == "true") {
    $opc = addslashes(trim($_GET['opc']));
    if ($opc != "Remover") {
        $nomePedra = addslashes(trim($_POST['nome']));
    }
    if ($opc == "Editar") {
        $cod = addslashes(trim($_GET['cod']));
        $pedra = Pedra::listaPedra($cod);
        $pedra->setNome_pedra($nomePedra);
        Pedra::editaPedra($pedra);
        header("location:../controller/controllerPedra.php");
    } else {
        if ($opc == "Incluir") {
            $pedra = Pedra::listaPedra($cod);
            $pedra->setNome_pedra($nomePedra);
            Pedra::inserePedra($pedra);
            header("location:../controller/controllerPedra.php");
        } else {
            $cod = addslashes(trim($_GET['cod']));
            $escolha = addslashes(trim($_GET['escolha']));
            if ($escolha == "Sim") {
                Pedra::deletaPedra($cod);
                header("location:../controller/controllerPedra.php");
            } else {
                header("location:../controller/controllerPedra.php");
            }
        }
    }
} else {
    header("location:../index.php?&erro=\"Login\"");
}
Example #4
0
 $vendedor = Vendedor::listaVendedores();
 $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);
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\"");
}