<?php
$con=mysqli_connect("localhost","ceiscasedu_admacademico","9xFj#j6R4JZw","ceiscasedu_academico");
mysqli_set_charset($con,"utf8");

setlocale(LC_ALL,"es_ES");
date_default_timezone_set('America/Asuncion');

$currentPage = basename($_SERVER['SCRIPT_NAME']);

$sqlCiudad = "SELECT * FROM ciudad";
$queryCiudades = mysqli_query($con, $sqlCiudad);

$sqlPersonaAlum = "SELECT * FROM persona PS WHERE NOT EXISTS (SELECT * FROM alumno AL WHERE AL.Persona_id = PS.Persona_id) AND NOT EXISTS (SELECT * FROM funcionario FN WHERE FN.Persona_id = PS.Persona_id)";
$queryPersonaAlum = mysqli_query($con, $sqlPersonaAlum);

$sqlPersona = "SELECT * FROM persona PS WHERE EXISTS (SELECT * FROM alumno AL WHERE AL.Persona_id = PS.Persona_id) AND NOT EXISTS (SELECT * FROM funcionario FN WHERE FN.Persona_id = PS.Persona_id)";
$queryPersona = mysqli_query($con, $sqlPersona);

$sqlFuncionario = "SELECT * FROM persona PS WHERE NOT EXISTS (SELECT * FROM alumno AL WHERE AL.Persona_id = PS.Persona_id)";
$queryFuncionario = mysqli_query($con, $sqlFuncionario);

$sqlFuncionario_NE = "SELECT * FROM persona PS WHERE NOT EXISTS (SELECT * FROM alumno AL WHERE AL.Persona_id = PS.Persona_id) AND NOT EXISTS (SELECT * FROM funcionario FN WHERE FN.Persona_id = PS.Persona_id)";
$queryFuncionario_NE = mysqli_query($con, $sqlFuncionario_NE);

$sqlCurso = "SELECT * FROM curso";
$queryCurso = mysqli_query($con, $sqlCurso);
$queryCursoMat = mysqli_query($con, $sqlCurso);

$sqlRol = "SELECT * FROM roles";
$queryRol = mysqli_query($con, $sqlRol);
?>