One Hat Cyber Team
Your IP :
216.73.216.193
Server IP :
170.247.48.121
Server :
Linux UBAPDWEB9271 3.10.0-1160.71.1.el7.x86_64 #1 SMP Tue Jun 28 15:37:28 UTC 2022 x86_64
Server Software :
Apache
PHP Version :
7.0.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
lelopagani.com.br
/
public
/
adm
/
View File Name :
function.php
<?php function listaNoticia ($lelo) { $ativo = "Sim"; $stmt = $lelo->stmt_init(); $stmt = $lelo->prepare( "SELECT n.* FROM noticia n WHERE n.ativo = ? ORDER BY n.data_noticia DESC "); $stmt->bind_param('s', $ativo); $stmt->execute(); $resultado = $stmt->get_result(); $noticias = array(); while ($array = $resultado->fetch_assoc()) { $noticia = new Noticia(); $noticia->idnoticia = $array['idnoticia']; $noticia->titulo = $array['titulo']; $noticia->linha_fina = $array['linha_fina']; $noticia->descricao_longa = $array['descricao_longa']; $noticia->tempo = $array['tempo']; $noticia->arquivo_capa = $array['arquivo_capa']; $noticia->descricao_capa = $array['descricao_capa']; $noticia->descricao_video = $array['descricao_video']; $noticia->link = $array['link']; $noticia->usuario = $array['usuario']; $noticia->data = $array['data']; $noticia->data_noticia = $array['data_noticia']; $noticia->video = $array['video']; $noticia->ativo = $array['ativo']; array_push($noticias, $noticia); } return $noticias; $lelo->stmt_close(); } function listaNoticiaHome ($lelo) { $ativo = "Sim"; $stmt = $lelo->stmt_init(); $stmt = $lelo->prepare("SELECT n.* FROM noticia n WHERE n.ativo = ? ORDER BY n.idnoticia DESC LIMIT 10"); $stmt->bind_param("s", $ativo); $stmt->execute(); $resultado = $stmt->get_result(); $noticias = array(); while ($array = $resultado->fetch_assoc()) { $noticia = new Noticia(); $noticia->idnoticia = $array['idnoticia']; $noticia->titulo = $array['titulo']; $noticia->linha_fina = $array['linha_fina']; $noticia->descricao_longa = $array['descricao_longa']; $noticia->tempo = $array['tempo']; $noticia->arquivo_capa = $array['arquivo_capa']; $noticia->descricao_capa = $array['descricao_capa']; $noticia->descricao_video = $array['descricao_video']; $noticia->link = $array['link']; $noticia->usuario = $array['usuario']; $noticia->data = $array['data']; $noticia->data_noticia = $array['data_noticia']; $noticia->video = $array['video']; $noticia->ativo = $array['ativo']; array_push($noticias, $noticia); } return $noticias; $lelo->stmt_close(); } function listaNoticiaId ($lelo, $id) { $ativo = "Sim"; $stmt = $lelo->stmt_init(); $stmt = $lelo->prepare("SELECT n.* FROM noticia n WHERE n.ativo = ? AND n.idnoticia = ? "); $stmt->bind_param("si", $ativo, $id); $stmt->execute(); $resultado = $stmt->get_result(); $noticias = array(); while ($array = $resultado->fetch_assoc()) { $noticia = new Noticia(); $noticia->idnoticia = $array['idnoticia']; $noticia->titulo = $array['titulo']; $noticia->linha_fina = $array['linha_fina']; $noticia->descricao_longa = $array['descricao_longa']; $noticia->tempo = $array['tempo']; $noticia->arquivo_capa = $array['arquivo_capa']; $noticia->descricao_capa = $array['descricao_capa']; $noticia->descricao_video = $array['descricao_video']; $noticia->link = $array['link']; $noticia->usuario = $array['usuario']; $noticia->data = $array['data']; $noticia->data_noticia = $array['data_noticia']; $noticia->video = $array['video']; $noticia->ativo = $array['ativo']; array_push($noticias, $noticia); } return $noticias; $lelo->stmt_close(); } function listaImagensIdNoticia ($lelo, $id) { $stmt = $lelo->stmt_init(); $stmt = $lelo->prepare( "SELECT i.* FROM imagem i WHERE i.idnoticia=? "); $stmt->bind_param("i", $id); $stmt->execute(); $resultado = $stmt->get_result(); $imagens = array(); while ($array = $resultado->fetch_assoc()) { $imagem = new Noticia(); $imagem->idimagem = $array['idimagem']; $imagem->idnoticia = $array['idnoticia']; $imagem->arquivo = $array['arquivo']; $imagem->descricao = $array['descricao']; array_push($imagens, $imagem); } return $imagens; $lelo->stmt_close(); } function listaProjeto ($lelo) { $ativo = "Sim"; $stmt = $lelo->stmt_init(); $stmt = $lelo->prepare( "SELECT p.*, c.* FROM projeto p INNER JOIN categoria c ON (p.categoria = c.idcategoria) WHERE p.ativo = ? ORDER BY p.titulo ASC "); $stmt->bind_param('s', $ativo); $stmt->execute(); $resultado = $stmt->get_result(); $projetos = array(); while ($array = $resultado->fetch_assoc()) { $projeto = new Projeto(); $projeto->idprojeto = $array['idprojeto']; $projeto->titulo = $array['titulo']; $projeto->descricao_breve = $array['descricao_breve']; $projeto->nro_projeto = $array['nro_projeto']; $projeto->data_projeto = $array['data_projeto']; $projeto->arquivo = $array['arquivo']; $projeto->link = $array['link']; $projeto->usuario = $array['usuario']; $projeto->data = $array['data']; $projeto->ativo = $array['ativo']; $projeto->categoria = $array['categoria']; $projeto->nome_categoria = $array['nome']; $projeto->categoria = $array['categoria']; array_push($projetos, $projeto); } return $projetos; $lelo->stmt_close(); } function listaProjetoId ($lelo, $id) { $ativo = "Sim"; $stmt = $lelo->stmt_init(); $stmt = $lelo->prepare("SELECT p.*, c.* FROM projeto p INNER JOIN categoria c ON (p.categoria = c.idcategoria) WHERE p.ativo = ? AND p.idprojeto=?" ); $stmt->bind_param("si", $ativo, $id); $stmt->execute(); $resultado = $stmt->get_result(); $projetos = array(); while ($array = $resultado->fetch_assoc()) { $projeto = new Projeto(); $projeto->idprojeto = $array['idprojeto']; $projeto->titulo = $array['titulo']; $projeto->descricao_breve = $array['descricao_breve']; $projeto->nro_projeto = $array['nro_projeto']; $projeto->data_projeto = $array['data_projeto']; $projeto->arquivo = $array['arquivo']; $projeto->link = $array['link']; $projeto->usuario = $array['usuario']; $projeto->data = $array['data']; $projeto->ativo = $array['ativo']; $projeto->categoria = $array['categoria']; $projeto->nome_categoria = $array['nome']; array_push($projetos, $projeto); } return $projetos; $lelo->stmt_close(); } function listaProjetoCategoriaId ($lelo, $id) { $ativo = "Sim"; $stmt = $lelo->stmt_init(); $stmt = $lelo->prepare( "SELECT p.*, c.* FROM projeto p INNER JOIN categoria c ON (p.categoria = c.idcategoria) WHERE p.ativo = ? AND c.idcategoria=? "); $stmt->bind_param("si", $ativo, $id); $stmt->execute(); $resultado = $stmt->get_result(); $projetos = array(); while ($array = $resultado->fetch_assoc()) { $projeto = new Projeto(); $projeto->idprojeto = $array['idprojeto']; $projeto->titulo = $array['titulo']; $projeto->descricao_breve = $array['descricao_breve']; $projeto->nro_projeto = $array['nro_projeto']; $projeto->data_projeto = $array['data_projeto']; $projeto->arquivo = $array['arquivo']; $projeto->link = $array['link']; $projeto->usuario = $array['usuario']; $projeto->data = $array['data']; $projeto->ativo = $array['ativo']; $projeto->categoria = $array['categoria']; $projeto->nome_categoria = $array['nome']; array_push($projetos, $projeto); } return $projetos; $lelo->stmt_close(); } function listaPerfil ($lelo) { $ativo = "Sim"; $stmt = $lelo->stmt_init(); $stmt = $lelo->prepare( "SELECT p.* FROM perfil p WHERE p.ativo = ? ORDER BY p.idperfil ASC "); $stmt->bind_param('s', $ativo); $stmt->execute(); $resultado = $stmt->get_result(); $perfis = array(); while ($array = $resultado->fetch_assoc()) { $perfil = new Perfil(); $perfil->idperfil = $array['idperfil']; $perfil->arquivo = $array['arquivo']; $perfil->data = $array['data']; $perfil->usuario = $array['usuario']; $perfil->ativo = $array['ativo']; array_push($perfis, $perfil); } return $perfis; $lelo->stmt_close(); } function listaPerfilId ($lelo, $id) { $ativo = "Sim"; $stmt = $lelo->stmt_init(); $stmt = $lelo->prepare( "SELECT p.* FROM perfil p WHERE p.ativo = ? AND p.idperfil=? "); $stmt->bind_param("si", $ativo, $id); $stmt->execute(); $resultado = $stmt->get_result(); $perfis = array(); while ($array = $resultado->fetch_assoc()) { $perfil = new Perfil(); $perfil->idperfil = $array['idperfil']; $perfil->arquivo = $array['arquivo']; $perfil->data = $array['data']; $perfil->usuario = $array['usuario']; $perfil->ativo = $array['ativo']; array_push($perfis, $perfil); } return $perfis; $lelo->stmt_close(); } function listaProjetoHome ($lelo) { $stmt = $lelo->stmt_init(); $stmt = $lelo->prepare( "SELECT p.*, c.* FROM projeto p INNER JOIN categoria c ON (p.categoria = c.idcategoria) ORDER BY p.data DESC LIMIT 10 "); // $stmt->bind_param('s', $ativo); $stmt->execute(); $resultado = $stmt->get_result(); $projetos = array(); while ($array = $resultado->fetch_assoc()) { $projeto = new Projeto(); $projeto->idprojeto = $array['idprojeto']; $projeto->titulo = $array['titulo']; $projeto->descricao_breve = $array['descricao_breve']; $projeto->nro_projeto = $array['nro_projeto']; $projeto->data_projeto = $array['data_projeto']; $projeto->arquivo = $array['arquivo']; $projeto->link = $array['link']; $projeto->usuario = $array['usuario']; $projeto->data = $array['data']; $projeto->ativo = $array['ativo']; $projeto->categoria = $array['categoria']; $projeto->nome_categoria = $array['nome']; array_push($projetos, $projeto); } return $projetos; $lelo->stmt_close(); } function listaCategoria ($lelo) { $stmt = $lelo->stmt_init(); $stmt = $lelo->prepare( "SELECT c.* FROM categoria c ORDER BY nome ASC "); // $stmt->bind_param('s', $ativo); $stmt->execute(); $resultado = $stmt->get_result(); $categorias = array(); while ($array = $resultado->fetch_assoc()) { $categoria = new Categoria(); $categoria->idcategoria = $array['idcategoria']; $categoria->nome = $array['nome']; $categoria->usuario = $array['usuario']; $categoria->data = $array['data']; array_push($categorias, $categoria); } return $categorias; $lelo->stmt_close(); } function listaCategoriaId ($lelo, $id) { $stmt = $lelo->stmt_init(); $stmt = $lelo->prepare( "SELECT c.* FROM categoria c WHERE c.idcategoria=? "); $stmt->bind_param("i", $id); $stmt->execute(); $resultado = $stmt->get_result(); $categorias = array(); while ($array = $resultado->fetch_assoc()) { $categoria = new Categoria(); $categoria->idcategoria = $array['idcategoria']; $categoria->nome = $array['nome']; $categoria->usuario = $array['usuario']; $categoria->data = $array['data']; array_push($categorias, $categoria); } return $categorias; $lelo->stmt_close(); }