Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Bom dia!
Possuo um sistema que ate um tempo atras o log de registro gravava no banco de dados, depois parou, o banco de dados é sql, o codigo php, está abaixo, alguem pode me ajudar?
public function geraLogStatus($acao) {
$db = new DataBase();
$s = "INSERT INTO logStatus VALUES (null, '$acao', '$this->permissoes_login', $this->id, NOW());";
#echo $s;
$q = mysql_query($s);
}
private function temLog() {
$db = new DataBase();
$s = "SELECT id FROM logStatus WHERE rdvcapa_id = $this->id;";
#echo $s;
$q = mysql_query($s);
if (mysql_num_rows($q) > 0)
return true;
else
return false;
}
public function removeLogByRdv() {
if ($this->temLog()) {
$db = new DataBase();
$s = "DELETE FROM logStatus WHERE rdvcapa_id = $this->id;";
#echo $s;
$q = mysql_query($s);
if (mysql_affected_rows()> 0)
return true;
else
return false;
} else {
return true;
}
}
public function fechaRDV() {
$db = new DataBase();
$s = "UPDATE $this->tabela SET aceite = 'F' WHERE id = $this->id";
$q = mysql_query($s);
if (mysql_affected_rows()> 0) {
$this->geraLogStatus("Fechado");
return true;
} else
return false;
}
public function docpenRDV() {
$db = new DataBase();
$s = "UPDATE $this->tabela SET aceite = 'P' WHERE id = $this->id";
#echo $s;
$q = mysql_query($s);
if (mysql_affected_rows()> 0) {
$this->geraLogStatus("Doc. Pendente");
return true;
} else
return false;
}
public function confRDV() {
$db = new DataBase();
$s = "UPDATE $this->tabela SET aceite = 'C' WHERE id = $this->id";
$q = mysql_query($s);
if (mysql_affected_rows()> 0) {
$this->geraLogStatus("Conferido");
return true;
} else
return false;
}
public function confRDV2() {
$db = new DataBase();
$s = "UPDATE $this->tabela SET aceite = 'D' WHERE id = $this->id";
$q = mysql_query($s);
if (mysql_affected_rows()> 0) {
$this->geraLogStatus("Conferido");
return true;
} else
return false;
}
public function conf_Aut() {
$db = new DataBase();
$s = "UPDATE $this->tabela SET aceite = 'A' WHERE id = $this->id";
$q = mysql_query($s);
if (mysql_affected_rows()> 0) {
$this->geraLogStatus("Conferido");
return true;
} else
return false;
}
public function reabreRDV() {
$db = new DataBase();
$s = "UPDATE $this->tabela SET aceite = 'N' WHERE id = $this->id";
$q = mysql_query($s);
if (mysql_affected_rows()> 0) {
$this->geraLogStatus("Reaberto");
return true;
} else
return false;
}
public function aceitaRDV() {
$db = new DataBase();
$s = "UPDATE $this->tabela SET aceite = 'S' WHERE id = $this->id";
$q = mysql_query($s);
if (mysql_affected_rows()> 0) {
$this->geraLogStatus("Aceito");
return true;
} else
return false;
}
}
?>Carregando comentários...