salvando novas chamadas no banco
This commit is contained in:
@@ -518,6 +518,105 @@ class Controller extends DBA{
|
||||
}
|
||||
}
|
||||
}
|
||||
public function updateChamada(){
|
||||
$DT_DIARIO_CLASSE = $_POST['DT_DIARIO_CLASSE'];
|
||||
$CD_AULA = intval($_POST['CD_AULA']);
|
||||
$CD_SALA = intval($_POST['CD_SALA']);
|
||||
$CD_MATRICULA = intval($_POST['CD_MATRICULA']);
|
||||
$FL_PRESENTE_AUSENTE = $_POST['FL_PRESENTE_AUSENTE'];
|
||||
$CIDADE = $_POST['CIDADE'];
|
||||
if($DT_DIARIO_CLASSE!=''){
|
||||
$this-> sql = "UPDATE SEC_DIARIO_CLASSE_AUSENCIA
|
||||
SET FL_PRESENTE_AUSENTE = ?
|
||||
WHERE DT_DIARIO_CLASSE = ?
|
||||
AND CD_AULA = ?
|
||||
AND CD_SALA = ?
|
||||
AND CD_MATRICULA = ?";
|
||||
$Con = new Controller();
|
||||
$this->stmt = $Con -> getSTMT($CIDADE,$this->sql);
|
||||
$this->stmt->bindValue(1, $FL_PRESENTE_AUSENTE);
|
||||
$this->stmt->bindValue(2, $DT_DIARIO_CLASSE);
|
||||
$this->stmt->bindValue(3, $CD_AULA);
|
||||
$this->stmt->bindValue(4, $CD_SALA);
|
||||
$this->stmt->bindValue(5, $CD_MATRICULA);
|
||||
$this->stmt->execute();
|
||||
if($this->stmt){
|
||||
echo 'editado com sucesso';
|
||||
}else{
|
||||
echo 'erro';
|
||||
}
|
||||
}else{
|
||||
echo 'dados incompletos';
|
||||
}
|
||||
}
|
||||
public function insertDiarioClasse(){
|
||||
$DT_DIARIO_CLASSE = $_POST['DT_DIARIO_CLASSE'];
|
||||
$CD_SALA = intval($_POST['CD_SALA']);
|
||||
$CD_AULA = intval($_POST['CD_AULA']);
|
||||
$CD_CALENDARIO = intval($_POST['CD_CALENDARIO']);
|
||||
$CD_DISCIPLINA = intval($_POST['CD_DISCIPLINA']);
|
||||
$CD_USUARIO = intval($_POST['CD_USUARIO']);
|
||||
$CIDADE = $_POST['CIDADE'];
|
||||
|
||||
if($DT_DIARIO_CLASSE!=''){
|
||||
$this-> sql = "INSERT INTO SEC_DIARIO_CLASSE (DT_DIARIO_CLASSE, CD_SALA, CD_AULA, CD_USUARIO_SISTEMA_PROFESSOR , CD_CALENDARIO , CD_DISCIPLINA ,
|
||||
CONTEUDO_MINISTRADO, CONSIDERACOES_GERAIS, CD_USUARIO_SISTEMA_REGISTRO, FL_ORIGEM_FALTAS)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
|
||||
$Con = new Controller();
|
||||
$this->stmt = $Con -> getSTMT($CIDADE,$this->sql);
|
||||
$this->stmt->bindValue(1, $DT_DIARIO_CLASSE);
|
||||
$this->stmt->bindValue(2, $CD_SALA);
|
||||
$this->stmt->bindValue(3, $CD_AULA);
|
||||
$this->stmt->bindValue(4, $CD_USUARIO);
|
||||
$this->stmt->bindValue(5, $CD_CALENDARIO);
|
||||
$this->stmt->bindValue(6, $CD_DISCIPLINA);
|
||||
$this->stmt->bindValue(7, '');
|
||||
$this->stmt->bindValue(8, '');
|
||||
$this->stmt->bindValue(9, $CD_USUARIO);
|
||||
$this->stmt->bindValue(10, 1);
|
||||
$this->stmt->execute();
|
||||
if($this->stmt){
|
||||
echo 'sucesso';
|
||||
}else{
|
||||
echo 'erro';
|
||||
}
|
||||
}else{
|
||||
echo 'dados incompletos';
|
||||
}
|
||||
}
|
||||
public function insertNovaChamada(){
|
||||
$DT_DIARIO_CLASSE = $_POST['DT_DIARIO_CLASSE'];
|
||||
$CD_SALA = intval($_POST['CD_SALA']);
|
||||
$CD_AULA = intval($_POST['CD_AULA']);
|
||||
$CD_MATRICULA = intval($_POST['CD_MATRICULA']);
|
||||
$FL_PRESENTE_AUSENTE = $_POST['FL_PRESENTE_AUSENTE'];
|
||||
$CD_USUARIO_SISTEMA_REGISTRO = intval($_POST['CD_USUARIO_SISTEMA_REGISTRO']);
|
||||
$CIDADE = $_POST['CIDADE'];
|
||||
|
||||
if($DT_DIARIO_CLASSE!=''){
|
||||
$this-> sql = "INSERT INTO SEC_DIARIO_CLASSE_AUSENCIA (DT_DIARIO_CLASSE, CD_SALA, CD_AULA, CD_MATRICULA, FL_PRESENTE_AUSENTE, CD_USUARIO_SISTEMA_REGISTRO,
|
||||
FL_ORIGEM_FALTAS, DT_REGISTRO_ALT )
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
|
||||
$Con = new Controller();
|
||||
$this->stmt = $Con -> getSTMT($CIDADE,$this->sql);
|
||||
$this->stmt->bindValue(1, $DT_DIARIO_CLASSE);
|
||||
$this->stmt->bindValue(2, $CD_SALA);
|
||||
$this->stmt->bindValue(3, $CD_AULA);
|
||||
$this->stmt->bindValue(4, $CD_MATRICULA);
|
||||
$this->stmt->bindValue(5, $FL_PRESENTE_AUSENTE);
|
||||
$this->stmt->bindValue(6, $CD_USUARIO_SISTEMA_REGISTRO);
|
||||
$this->stmt->bindValue(7, 1);
|
||||
$this->stmt->bindValue(8, $DT_DIARIO_CLASSE);
|
||||
$this->stmt->execute();
|
||||
if($this->stmt){
|
||||
echo 'sucesso';
|
||||
}else{
|
||||
echo 'erro';
|
||||
}
|
||||
}else{
|
||||
echo 'dados incompletos';
|
||||
}
|
||||
}
|
||||
public function inserirAcesso(){
|
||||
$DATA = $_POST['DATA'];
|
||||
$ACESSO_CONTROLE = $_POST['ACESSO_CONTROLE'];
|
||||
@@ -642,22 +741,24 @@ class Controller extends DBA{
|
||||
die('informação incompleta...');
|
||||
}
|
||||
}
|
||||
public function getChamadasRealizadas($CD_SALA,$CD_DISCIPLINA,$DATA,$CIDADE){
|
||||
public function getChamadasRealizadas($CD_SALA,$CD_DISCIPLINA,$DATA,$ANO,$CIDADE){
|
||||
if(!$CD_SALA==''){
|
||||
$this-> sql = "SELECT SDCA.DT_DIARIO_CLASSE , SDCA.CD_AULA , SDCA.CD_MATRICULA , SDCA.FL_PRESENTE_AUSENTE , SM.CD_ALUNO, A.NO_ALUNO , SM.NR_TURMA, SDC.CD_DISCIPLINA
|
||||
$this-> sql = "SELECT SDCA.DT_DIARIO_CLASSE , SDCA.CD_AULA , SDCA.CD_MATRICULA , SDCA.FL_PRESENTE_AUSENTE ,
|
||||
SM.CD_ALUNO, A.NO_ALUNO , SM.NR_TURMA, SDC.CD_DISCIPLINA , SM.STATUS
|
||||
FROM SEC_DIARIO_CLASSE_AUSENCIA SDCA
|
||||
INNER JOIN SEC_MATRICULA SM ON SDCA.CD_MATRICULA = SM.CD_MATRICULA
|
||||
INNER JOIN ALUNO A ON SM.CD_ALUNO = A.CD_ALUNO
|
||||
INNER JOIN SEC_DIARIO_CLASSE SDC ON SDCA.DT_DIARIO_CLASSE = SDC.DT_DIARIO_CLASSE
|
||||
AND SDCA.CD_SALA = SDC.CD_SALA
|
||||
AND SDCA.CD_AULA = SDC.CD_AULA
|
||||
WHERE SDCA.CD_SALA = ? AND SDCA.DT_DIARIO_CLASSE = ? AND SDC.CD_DISCIPLINA = ?
|
||||
WHERE SDCA.CD_SALA = ? AND SDCA.DT_DIARIO_CLASSE = ? AND SDC.CD_DISCIPLINA = ? AND SM.ANO_FREQ = ?
|
||||
ORDER BY SDCA.CD_AULA , A.NO_ALUNO ";
|
||||
$Con = new Controller();
|
||||
$this->stmt = $Con -> getSTMT($CIDADE,$this->sql);
|
||||
$this->stmt->bindValue(1, $CD_SALA);
|
||||
$this->stmt->bindValue(2, $DATA);
|
||||
$this->stmt->bindValue(3, $CD_DISCIPLINA);
|
||||
$this->stmt->bindValue(4, $ANO);
|
||||
$this->stmt->execute();
|
||||
$this->res = $this->stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
return $this-> res;
|
||||
@@ -666,6 +767,66 @@ class Controller extends DBA{
|
||||
die('informação incompleta...');
|
||||
}
|
||||
}
|
||||
|
||||
public function getNovaChamada($CD_SALA,$ANO,$CIDADE){
|
||||
if(!$CD_SALA==''){
|
||||
$this-> sql = "SELECT SM.CD_MATRICULA , SM.CD_ALUNO , SM.CD_SALA , SM.NR_TURMA , SM.STATUS , SM.ANO_FREQ, A.NO_ALUNO
|
||||
FROM SEC_MATRICULA SM
|
||||
INNER JOIN ALUNO A ON SM.CD_ALUNO = A.CD_ALUNO
|
||||
WHERE SM.CD_SALA = ? AND SM.ANO_FREQ = ?
|
||||
ORDER BY A.NO_ALUNO";
|
||||
$Con = new Controller();
|
||||
$this->stmt = $Con -> getSTMT($CIDADE,$this->sql);
|
||||
$this->stmt->bindValue(1, $CD_SALA);
|
||||
$this->stmt->bindValue(2, $ANO);
|
||||
$this->stmt->execute();
|
||||
$this->res = $this->stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
return $this-> res;
|
||||
}else{
|
||||
//caso o id não foi passado recebe essa mensagem
|
||||
die('informação incompleta...');
|
||||
}
|
||||
}
|
||||
|
||||
public function getCodigoCalendario($CD_CAD_DIVERSO,$DT_CALENDARIO,$ID_TIPO_ENSINO,$CIDADE){
|
||||
if(!$CD_CAD_DIVERSO==''){
|
||||
$this-> sql = "SELECT SC.CD_CALENDARIO
|
||||
FROM SEC_CALENDARIO SC
|
||||
INNER JOIN SEC_TIPO_ENSINO STE ON SC.ID_TIPO_ENSINO = STE.CD_TP_ENSINO
|
||||
WHERE SC.CD_CAD_DIVERSO = ? AND SC.DT_CALENDARIO = ? AND STE.SIGLA = ?";
|
||||
$Con = new Controller();
|
||||
$this->stmt = $Con -> getSTMT($CIDADE,$this->sql);
|
||||
$this->stmt->bindValue(1, $CD_CAD_DIVERSO);
|
||||
$this->stmt->bindValue(2, $DT_CALENDARIO);
|
||||
$this->stmt->bindValue(3, $ID_TIPO_ENSINO);
|
||||
$this->stmt->execute();
|
||||
$this->res = $this->stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
return $this-> res;
|
||||
}else{
|
||||
//caso o id não foi passado recebe essa mensagem
|
||||
die('informação incompleta...');
|
||||
}
|
||||
}
|
||||
|
||||
public function getDiarioClasse($CD_AULA,$CD_SALA,$DT_DIARIO_CLASSE,$CIDADE){
|
||||
if(!$DT_DIARIO_CLASSE==''){
|
||||
$this-> sql = "SELECT *
|
||||
FROM SEC_DIARIO_CLASSE SDC
|
||||
WHERE CD_AULA = ? AND CD_SALA = ? AND DT_DIARIO_CLASSE = ?";
|
||||
$Con = new Controller();
|
||||
$this->stmt = $Con -> getSTMT($CIDADE,$this->sql);
|
||||
$this->stmt->bindValue(1, $CD_AULA);
|
||||
$this->stmt->bindValue(2, $CD_SALA);
|
||||
$this->stmt->bindValue(3, $DT_DIARIO_CLASSE);
|
||||
$this->stmt->execute();
|
||||
$this->res = $this->stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
return $this-> res;
|
||||
}else{
|
||||
//caso o id não foi passado recebe essa mensagem
|
||||
die('informação incompleta...');
|
||||
}
|
||||
}
|
||||
|
||||
public function insertLog(){
|
||||
$DATA = $_POST['DATA'];
|
||||
$TELA = $_POST['TELA'];
|
||||
|
||||
Reference in New Issue
Block a user