Verifica effettuata
Account verificato e pronto all\'accesso
Ok';
break;
case "signIn":
$token = login($_POST["email"], $_POST["password"]);
if ($res == "NOT_FOUND" || $res == "INCORRECT_PASSWORD") {
UIauth("Credenziali errate
");
break;
}
if ($res == "UNVERIFIED") {
UIauth("Account non verificato
Reinviare la mail di verifica?");
break;
}
mainMenu($token);
break;
case "showOrders":
showOrders($_POST["sessionToken"]);
break;
case "editOrder":
editOrder($_POST["sessionToken"], $_POST["orderId"]);
break;
case "mainMenu":
mainMenu($_POST["sessionToken"]);
break;
case "saveOrder":
if(!$newView){
showOrders($_POST["sessionToken"]);
break;
}
$res = processOrder($_POST);
if ($res === true) {
showOrders($_POST["sessionToken"], 'Salvato
');
break;
}
if ($res === false) {
showOrders($_POST["sessionToken"], 'Errore
');
break;
}
if ($res === "INVALID_DATETIME_NO_DAY") {
showOrders($_POST["sessionToken"], 'Giorno errato
');
break;
}
if ($res === "INVALID_DATETIME_NO_TF") {
showOrders($_POST["sessionToken"], 'Ora errata
');
break;
}
if ($res === "WRONG_DOMAIN") {
showOrders($_POST["sessionToken"], 'L\'email deve essere @liceococito.it
');
break;
}
if ($res === "NO_CLASS") {
showOrders($_POST["sessionToken"], 'Classe errata
');
break;
}
break;
case "deleteOrder":
$res = deleteOrder($_POST["sessionToken"], $_POST["orderId"]);
if ($res === true) {
showOrders($_POST["sessionToken"], 'Cancellato
');
break;
}
if ($res === false) {
showOrders($_POST["sessionToken"], 'Errore
');
break;
}
break;
case "manageAccount":
manageAccount($_POST["sessionToken"]);
break;
case "manageSave":
if(!$newView){
mainMenu($_POST["sessionToken"]);
break;
}
$res = manageSave($_POST["sessionToken"], $_POST);
if ($res === false) {
mainMenu($_POST["sessionToken"], 'Errore
');
break;
}
if ($res === "INVALID_EMAIL") {
mainMenu($_POST["sessionToken"], 'Email non valida
');
break;
}
if ($res === "WRONG_DOMAIN") {
mainMenu($_POST["sessionToken"], 'L\'email deve essere @liceococito.it
');
break;
}
if ($res === "NO_CLASS") {
mainMenu($_POST["sessionToken"], 'Classe errata
');
break;
}
mainMenu($_POST["sessionToken"]);
break;
case "showOrdersSTAFF":
showOrdersSTAFF($_POST["sessionToken"]);
break;
case "timeframesSTAFF":
timeframesView($_POST["sessionToken"]);
break;
case "saveTimefs":
if(!$newView){
mainMenu($_POST["sessionToken"]);
break;
}
$res = saveTimefs($_POST["sessionToken"], $_POST["data"]);
if ($res === false) {
mainMenu($_POST["sessionToken"], 'Errore
');
break;
}
mainMenu($_POST["sessionToken"]);
break;
case "menuSTAFF":
dishesStaff($_POST["sessionToken"]);
break;
case "processDishes":
if(!$newView){
mainMenu($_POST["sessionToken"]);
break;
}
$res = processDishes($_POST);
if ($res === false) {
mainMenu($_POST["sessionToken"], 'Errore
');
break;
}
mainMenu($_POST["sessionToken"]);
break;
}
?>