forked from AdrianCavazos/RES-PV
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
25 lines (25 loc) · 673 Bytes
/
index.php
File metadata and controls
25 lines (25 loc) · 673 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
session_start();
if(!empty($_SESSION["userId"])) {
require_once('usuarios/Modelo/usuarios.php');
$Modelo = new Usuarios();
$tipoDeUsuario = $Modelo->getUserType($_SESSION["userId"]);
if (!$tipoDeUsuario) {
$_SESSION["errorMessage"] = "Invalid Credentials";
} else {
switch($tipoDeUsuario){
case 1:
header('Location: homeAdministrador.php');
break;
case 2:
header('Location: homeMesero.php');
break;
case 3:
header('Location: homeContador.php');
break;
}
}
} else {
require_once 'login.php';
}
?>