Skip to content

Commit

Permalink
mega atualização
Browse files Browse the repository at this point in the history
  • Loading branch information
Natan-b201 committed Feb 28, 2020
1 parent 3f350ae commit 2e38f7f
Show file tree
Hide file tree
Showing 20 changed files with 1,404 additions and 36 deletions.
17 changes: 10 additions & 7 deletions Classes/Alunos.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@ function getAev(){
function getSistema(){
return $this->sistema;
}
function pesquisa_banco($ma){
$pdo = new PDO( 'mysql:host=localhost;dbname=Al', 'root', '' );

function pesquisa_banco($ma,$bd,$us,$sn){
$pdo = new PDO( 'mysql:host=localhost;dbname='.$bd,$us , $sn );
$pdo -> query("SET NAMES UTF8");
$stmt = $pdo->prepare("SELECT *,COUNT(*) FROM Alunos WHERE Num_mat LIKE '$ma%'");
$stmt->execute(array('id','Cod_cur','Num_mat','Nome_civil','Nome_cur','Fin','Fev','Ain','Aev','sistema','Nome_social','COUNT(*)'));
$stmt = $pdo->prepare("SELECT * FROM Alunos WHERE Num_mat LIKE '$ma%'");
$stmt->execute();
$resultado = $stmt->fetchAll(PDO::FETCH_ASSOC);
if(empty($resultado[1]['id'])){
$this->cont = 1;
}
foreach($resultado as $item){
$this->cont = $item['COUNT(*)'];
$this->id = $item['id'];
$this->Cod_cur = $item['Cod_cur'];
$this->Num_mat = $item['Num_mat'];
Expand All @@ -66,9 +69,9 @@ function pesquisa_banco($ma){

}
}
function pesquisa_banco2($id){
function pesquisa_banco2($id,$bd,$us,$sn){
$this->id = $id;
$pdo = new PDO( 'mysql:host=localhost;dbname=Al', 'root', '' );
$pdo = new PDO( 'mysql:host=localhost;dbname='.$bd,$us , $sn );
$pdo -> query("SET NAMES UTF8");
$stmt = $pdo->prepare("SELECT * FROM Alunos WHERE id LIKE $this->id");
$this->cont = 1;
Expand Down
8 changes: 4 additions & 4 deletions Classes/Alunos_nome.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ function getNome(){
function getMatricula(){
return $this->matricula;
}
function pesquisa_nome($nome){
$pdo = new PDO( 'mysql:host=localhost;dbname=Al', 'root', '' );
function pesquisa_nome($nome,$bd,$us,$sn){
$pdo = new PDO( 'mysql:host=localhost;dbname='.$bd,$us , $sn );
$pdo -> query("SET NAMES UTF8");
$stmt = $pdo->prepare("SELECT * FROM Alunos WHERE Nome_civil LIKE '%$nome%' OR Nome_social LIKE '%$nome%' ORDER BY Num_mat ASC LIMIT 500");
$stmt->execute(array('id','Cod_cur','Num_mat','Nome_civil','Nome_cur','Nome_social'));
Expand All @@ -36,9 +36,9 @@ function pesquisa_nome($nome){
die;
}
}
function pesquisa_matricula($matricula){
function pesquisa_matricula($matricula,$bd,$us,$sn){
$this->matricula = $matricula;
$pdo = new PDO( 'mysql:host=localhost;dbname=Al', 'root', '' );
$pdo = new PDO( 'mysql:host=localhost;dbname='.$bd,$us , $sn );
$pdo -> query("SET NAMES UTF8");
$stmt = $pdo->prepare("SELECT * FROM Alunos WHERE Num_mat LIKE '$matricula%' ORDER BY Num_mat ASC");
$stmt->execute(array('id','Cod_cur','Num_mat','Nome_civil','Nome_cur','Nome_social'));
Expand Down
2 changes: 1 addition & 1 deletion Classes/Conec_PDO.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
$pdo = new PDO( 'mysql:host=localhost;dbname=Al', 'root', '' );
$pdo = new PDO( 'mysql:host=localhost;dbname=Al', 'root', '123' );
$pdo -> query("SET NAMES UTF8");
?>
12 changes: 6 additions & 6 deletions Classes/Tabela.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ function getId(){
function getTb(){
return $this->tb;
}
function pesquisa_doc(){
$pdo = new PDO( 'mysql:host=localhost;dbname=Al', 'root', '' );
function pesquisa_doc($bd,$us,$sn){
$pdo = new PDO( 'mysql:host=localhost;dbname='.$bd,$us , $sn );
$pdo -> query("SET NAMES UTF8");
$stmt = $pdo->prepare("SELECT * FROM Ko WHERE imagem LIKE '$this->im' ORDER BY ano_doc ASC");
$stmt->execute(array('id','data_inserido','tipo_doc','class_doc','nome','ano_doc'));
Expand All @@ -32,8 +32,8 @@ function pesquisa_doc(){
</tr>";
}
}
function pesquisa_doc3(){
$pdo = new PDO( 'mysql:host=localhost;dbname=Al', 'root', '' );
function pesquisa_doc3($bd,$us,$sn){
$pdo = new PDO( 'mysql:host=localhost;dbname='.$bd,$us , $sn );
$pdo -> query("SET NAMES UTF8");
$stmt = $pdo->prepare("SELECT * FROM Ko WHERE imagem LIKE '$this->im' ORDER BY ano_doc ASC");
$stmt->execute(array('id','data_inserido','tipo_doc','class_doc','nome','ano_doc'));
Expand All @@ -48,10 +48,10 @@ function pesquisa_doc3(){
</tr>";
}
}
function pesquisa_doc2($id,$im){
function pesquisa_doc2($id,$im,$bd,$us,$sn){
$this->id = $id;
$this->im = $im;
$pdo = new PDO( 'mysql:host=localhost;dbname=Al', 'root', '' );
$pdo = new PDO( 'mysql:host=localhost;dbname='.$bd,$us , $sn );
$pdo -> query("SET NAMES UTF8");
$stmt = $pdo->prepare("SELECT * FROM Ko WHERE id LIKE '$this->id' ORDER BY ano_doc ASC");
$stmt->execute(array('id','tipo_doc','class_doc','nome','ano_doc','data_inserido'));
Expand Down
2 changes: 1 addition & 1 deletion ConAL.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ini_set('default_charset','UTF-8');
$db_hos = "localhost";
$use = "root";
$pss = "";
$pss = "123";
$ban = "Al";
$conn = new mysqli("$db_hos","$use","$pss","$ban");
//$conn = mysqli_connect("$db_hos","$use","$pss","$ban");
Expand Down
6 changes: 5 additions & 1 deletion Conec_PDO.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php
$pdo = new PDO( 'mysql:host=localhost;dbname=Al', 'root', '' );
$bd = 'Al';
$us = 'root';
$sn = 123;

$pdo = new PDO( 'mysql:host=localhost;dbname='.$bd, $us, $sn );
$pdo -> query("SET NAMES UTF8");
?>
3 changes: 2 additions & 1 deletion adicionar_documentos.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
require_once 'Conec_PDO.php';
require_once 'Classes/Alunos.php';
require_once 'Classes/Tabela.php';
$al = new Aluno();
Expand Down Expand Up @@ -54,7 +55,7 @@
<?php
$tb = new Tabela();
$tb->setIm($al->getId());
$tb->pesquisa_doc3();
$tb->pesquisa_doc3($bd,$us,$sn);
$tb->exibir_tabela();
?>
</div>
Expand Down
3 changes: 1 addition & 2 deletions apagar_documento.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?php
session_start();
require_once 'Conec_PDO.php';
$opc = $_GET['nome'];
if($opc == 'S'){
$varpes = $_GET['iddoc'];
$pdo = new PDO( 'mysql:host=localhost;dbname=Al', 'root', '' );
$pdo -> query("SET NAMES UTF8");
$stmt = $pdo->prepare("SELECT can FROM Ko WHERE id LIKE $varpes");
$stmt->execute(array('can'));
$resultado = $stmt->fetchAll(PDO::FETCH_ASSOC);
Expand Down
7 changes: 7 additions & 0 deletions css/bootstrap.min.css

Large diffs are not rendered by default.

Loading

0 comments on commit 2e38f7f

Please sign in to comment.