Compare commits
2 Commits
171cc56aea
...
fcbe264a49
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fcbe264a49 | ||
|
|
89fd896f51 |
@@ -443,6 +443,20 @@ class Controller extends DBA{
|
||||
$this->res = $this->stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
return $this-> res;
|
||||
}
|
||||
public function getLogs($USUARIO,$CIDADE,$SISTEMA){
|
||||
$this->sql = "SELECT *
|
||||
FROM log_pais
|
||||
WHERE NO_USUARIO LIKE ?
|
||||
AND CIDADE = ?
|
||||
AND SISTEMA = ? ";
|
||||
$this->stmt = $this->getMARIA()->prepare($this->sql);
|
||||
$this->stmt->bindValue(1,"%".$USUARIO."%");
|
||||
$this->stmt->bindValue(2,$CIDADE);
|
||||
$this->stmt->bindValue(3,$SISTEMA);
|
||||
$this->stmt->execute();
|
||||
$this->res = $this->stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
return $this-> res;
|
||||
}
|
||||
public function deletaPais($CPF){
|
||||
$this->sql = "DELETE FROM usuarios WHERE CPF = ?";
|
||||
$this->stmt = $this->getMARIA()->prepare($this->sql);
|
||||
@@ -551,14 +565,15 @@ class Controller extends DBA{
|
||||
public function insertLog(){
|
||||
$DATA = $_POST['DATA'];
|
||||
$TELA = $_POST['TELA'];
|
||||
$SISTEMA = $_POST['SISTEMA'];
|
||||
$CD_USUARIO = $_POST['CD_USUARIO'];
|
||||
$NO_USUARIO = $_POST['NO_USUARIO'];
|
||||
$CD_ALUNO = $_POST['CD_ALUNO'];
|
||||
$NO_ALUNO = $_POST['NO_ALUNO'];
|
||||
$CIDADE = $_POST['CIDADE'];
|
||||
if($DATA!=''){
|
||||
$this->sql = "INSERT INTO log_pais (DATA, TELA, CD_USUARIO, NO_USUARIO, CD_ALUNO,NO_ALUNO, CIDADE)
|
||||
VALUES (:DATA, :TELA, :CD_USUARIO, :NO_USUARIO, :CD_ALUNO, :NO_ALUNO, :CIDADE)";
|
||||
$this->sql = "INSERT INTO log_pais (DATA, TELA, CD_USUARIO, NO_USUARIO, CD_ALUNO,NO_ALUNO, CIDADE, SISTEMA)
|
||||
VALUES (:DATA, :TELA, :CD_USUARIO, :NO_USUARIO, :CD_ALUNO, :NO_ALUNO, :CIDADE, :SISTEMA)";
|
||||
$this->stmt = $this->getMARIA()->prepare($this->sql);
|
||||
$this->stmt->bindValue(':DATA', $DATA);
|
||||
$this->stmt->bindValue(':TELA', $TELA);
|
||||
@@ -567,6 +582,7 @@ class Controller extends DBA{
|
||||
$this->stmt->bindValue(':CD_ALUNO', $CD_ALUNO);
|
||||
$this->stmt->bindValue(':NO_ALUNO', $NO_ALUNO);
|
||||
$this->stmt->bindValue(':CIDADE', $CIDADE);
|
||||
$this->stmt->bindValue(':SISTEMA', $SISTEMA);
|
||||
$this->stmt->execute();
|
||||
if($this->stmt){
|
||||
echo 'log salvo';
|
||||
|
||||
@@ -6,4 +6,13 @@ class LogController{
|
||||
$Log = new Controller();
|
||||
$Logins = $Log->insertLog();
|
||||
}
|
||||
public function buscarLogs($params){
|
||||
$usuario = $params->USUARIO;
|
||||
$cidade = $params->CIDADE;
|
||||
$sistema = $params->SISTEMA;
|
||||
$Con = new Controller();
|
||||
$Logs = $Con->getLogs($usuario,$cidade,$sistema);
|
||||
echo json_encode($Logs);
|
||||
return json_encode($Logs);
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,7 @@ $router= [
|
||||
"/buscarCPFMae" => function(){load("LoginController","buscarCPFMae");},
|
||||
"/buscarCPFPai" => function(){load("LoginController","buscarCPFPai");},
|
||||
"/buscarcadastrocpf" => function(){load("LoginController","buscarCadastroCPF");},
|
||||
"/buscarlogs" => function(){load("LogController","buscarLogs");},
|
||||
],
|
||||
"POST"=>[
|
||||
"/inserirpais" => function(){load("PaisController","insert");},
|
||||
|
||||
Reference in New Issue
Block a user