post para salvar logs
This commit is contained in:
@@ -328,6 +328,35 @@ class Controller extends DBA{
|
||||
}
|
||||
}
|
||||
}
|
||||
public function insertLog(){
|
||||
$DATA = $_POST['DATA'];
|
||||
$TELA = $_POST['TELA'];
|
||||
$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->stmt = self::$instMARIA->prepare($this->sql);
|
||||
$this->stmt->bindValue(':DATA', $DATA);
|
||||
$this->stmt->bindValue(':TELA', $TELA);
|
||||
$this->stmt->bindValue(':CD_USUARIO', $CD_USUARIO);
|
||||
$this->stmt->bindValue(':NO_USUARIO', $NO_USUARIO);
|
||||
$this->stmt->bindValue(':CD_ALUNO', $CD_ALUNO);
|
||||
$this->stmt->bindValue(':NO_ALUNO', $NO_ALUNO);
|
||||
$this->stmt->bindValue(':CIDADE', $CIDADE);
|
||||
$this->stmt->execute();
|
||||
if($this->stmt){
|
||||
echo 'log salvo';
|
||||
}else{
|
||||
echo 'erro';
|
||||
}
|
||||
}else{
|
||||
echo 'erro';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DBA{
|
||||
|
||||
9
app/controllers/LogController.php
Normal file
9
app/controllers/LogController.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace app\controllers;
|
||||
|
||||
class LogController{
|
||||
public function inserirLog(){
|
||||
$Log = new Controller();
|
||||
$Logins = $Log->insertLog();
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,7 @@ $router= [
|
||||
"POST"=>[
|
||||
"/inserirpais" => fn()=> load("PaisController","insert"),
|
||||
"/inserir_acesso" => fn()=> load("AcessoController","inserir"),
|
||||
"/log" => fn()=> load("LogController","inserirLog"),
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user