adosProduto->idCategoria?? null;
        $this->_conn = $conn;

        // var_dump($_POST);exit;
    }

    public function findAll()
    {
        //MONTA A INSTRUÇÃO SQL
        $sql = "SELECT * FROM tblProduto";

        //PREPARA UM PROCESSO DE EXECUÇÃO DE INSTRUÇÃO SQL
        $stm = $this->_conn->prepare($sql);

        //EXECUTA A INSTRUÇÃO SQL
        $stm->execute();

        //DEVOLVE OS VALORES DA SELECT PARA SEREM UTILIZADOS
        return $stm->fetchAll(\PDO::FETCH_ASSOC);
    }

    public function findById()
    {
        $sql = "SELECT * FROM tblProduto WHERE idProduto =?";

        $stm = $this->_conn->prepare($sql);
        $stm->bindValue(1, $this->_idProduto);

        $stm->execute();

        return $stm->fetchAll(\PDO::FETCH_ASSOC);
    }

    //CREATE COM ERROS
    public function create()
    {
        $sql = "INSERT INTO tblProduto (nome, foto, preco, descricao, qntde, desconto, idCategoria)
        VALUES (?,?,?,?,?,?,?)";

        $nome = $_POST["nome"];
        $preco = $_POST["preco"];
        $descricao = $_POST["descricao"];
        $qntde = $_POST["qntde"];
        $desconto = $_POST["desconto"];
        $idCategoria = $_POST["idCategoria"];
        $foto = $_FILES["foto"]["name"];

        // echo $nome;
        // echo $preco;
        // echo $descricao;
        // echo $qntde;
        // echo $desconto;
        // echo $idCategoria;
        // var_dump($foto);
        // exit;

        $extensao = pathinfo($foto, PATHINFO_EXTENSION);

        //echo $extensao;exit;
        $novoNomeArquivo = md5(microtime()). ".$extensao";
        //echo $novoNomeArquivo;exit;
        move_uploaded_file($_FILES["foto"]["tmp_name"], "../upload/$novoNomeArquivo");

        $stm = $this->_conn->prepare($sql);

        $stm->bindValue(1, $nome);
        $stm->bindValue(2, $novoNomeArquivo);
        $stm->bindValue(3, $preco);
        $stm->bindValue(4, $descricao);
        $stm->bindValue(5, $qntde);
        $stm->bindValue(6, $desconto);
        $stm->bindValue(7, $idCategoria);

        if ($stm->execute()) {
            return "Success";
        } else {
            return "Failed";
        }
    }

    public function delete()
    {
        $sql = "DELETE FROM tblProduto WHERE idProduto =?";

        $stm = $this->_conn->prepare($sql);

        $stm->bindValue(1, $this->_idProduto);

        if ($stm->execute()) {
            return "Dados excluídos com sucesso!";
        }
    }

    public function update()
    {

        $nome = $_POST["nome"];
        $preco = $_POST["preco"];
        $descricao = $_POST["descricao"];
        $qntde = $_POST["qntde"];
        $desconto = $_POST["desconto"];
        $idCategoria = $_POST["idCategoria"];
        $foto = $_FILES["foto"]["name"];
        $idProduto = $_POST["idProduto"];

        /* UPDATE IMAGEM */
        if ($_FILES["foto"]["error"]!= UPLOAD_ERR_NO_FILE) {
            $sqlImagem = "SELECT foto FROM tblProduto WHERE idProduto =?";
            $stm = $this->_conn->prepare($sqlImagem);

            $stm->bindValue(1, $idProduto);

            $stm->execute();

            $produto = $stm->fetchAll(\PDO::FETCH_ASSOC);

            // var_dump($produto[0]["foto"]);exit;

            //EXCLUSÃO DA FOTO ANTIGA DA PASTA
            unlink("../upload/". $produto[0]["foto"]);

            $nomeArquivo = $_FILES["foto"]["name"];
            $extensao = pathinfo($nomeArquivo, PATHINFO_EXTENSION);
            $novoNomeArquivo = md5(microtime()). ".". "$extensao";

            move_uploaded_file($_FILES["foto"]["tmp_name"], "../upload/$novoNomeArquivo");
        }

        /* UPDATE BANCO */
        $sql = "UPDATE tblProduto SET 
        nome =?,
        preco =?,
        descricao =?,
        qntde =?,
        desconto =?,
        idCategoria =?,
        foto =?
        WHERE idProduto =?";

        $stm = $this->_conn->prepare($sql);

        $stm->bindValue(1, $nome);
        $stm->bindValue(2, $preco);
        $stm->bindValue(3, $descricao);
        $stm->bindValue(4, $qntde);
        $stm->bindValue(5, $desconto);
        $stm->bindValue(6, $idCategoria);
        $stm->bindValue(7, $novoNomeArquivo);
        $stm->bindValue(8, $idProduto);

        if ($stm->execute()) {
            return "Dados alterados com sucesso!";
        }
    }
}
The Flour Bluff Athletics Hornet of the Week is Vishal Patel. Vishal is a multi-sport athlete for the Hornets. He is a runner on the Hornet Cross Country Team. Vishal follows his three brothers Nikesh, Dillon, and Kunal in being a standout student-athlete on the Hornet Boys’ Soccer Team. On the field, Vishal has been awarded Second Team All-District for his Defensive play. Off the field, Vishal is a member of the Flour Bluff University Preparatory Program. His academic success in both his high school and TAMUCC courses have resulted in him being named twice as Academic All District and being inducted into the National Honor Society. Vishal is also involved in other numerous high school clubs and organizations. After high school, he plans on attending the McCombs School of Business at the University of Texas. Vishal is the personification of the Hornet characteristics of class, pride, and heart.
The thing I enjoy most is the bond and memories I’m making with my teammates.
I have the best nickname on the team, and it’s sticker burr.
I’m involved in many organizations that require you to be very active in giving back to the community.
My plan after graduation is to attend McCombs School of Business at UT.
My favorite soccer-related movie is Underdogs.
Do you have a favorite pro team.
I’m a very good baker and a good Fortnite player.701 Crenshaw is a multifamily property located in the highly affluent and desirable Hancock Park neighborhood in Los Angeles. This classic apartment offers a tremendous opportunity for a local and experienced investor to capitalize on the growing rents in the area. Most of the units have been lightly remodeled and will be delivered vacant at close of escrow, allowing a new owner to achieve market rents immediately.
The entire property is a 2-story structure built in 1939 with a total size of 6,789 SF, sitting on 7,499 SF lot zoned LA-R3 and directly next to the new Crenshaw/Wilshire Metro Purple Line Extension development. In addition, there are total 6 garage parking spaces in the rear with a legal structure above that can be converted to an ADU as an additional unit.
* Property is subject to City of Los Angeles Rent Control.
