$historiqueManager = new PdoHistoriqueManager();\r
$alerteManager = new PdoAlerteManager();\r
\r
- switch ($_GET['action']) {\r
- case 'get_exploitant' :\r
- echo $exploitantManager -> getExploitant($_GET['id']) -> getJSONP();\r
- break;\r
+ if($_GET['action']) {\r
+ switch ($_GET['action']) {\r
+ case 'get_exploitant' :\r
+ echo $exploitantManager -> getExploitant($_GET['id']) -> getJSONP();\r
+ break;\r
\r
- case 'get_exploitants' :\r
- $exploitants = $exploitantManager -> getExploitants();\r
- if (!empty($exploitants)) {\r
- $i = 0;\r
- echo '[';\r
- foreach ($exploitants as $exploitant) {\r
- echo $exploitant -> getJSON();\r
- if ($i != sizeof($exploitants) - 1) {\r
- echo ',';\r
+ case 'get_exploitants' :\r
+ $exploitants = $exploitantManager -> getExploitants();\r
+ if (!empty($exploitants)) {\r
+ $i = 0;\r
+ echo '[';\r
+ foreach ($exploitants as $exploitant) {\r
+ echo $exploitant -> getJSON();\r
+ if ($i != sizeof($exploitants) - 1) {\r
+ echo ',';\r
+ }\r
+ $i++;\r
}\r
- $i++;\r
+ echo ']';\r
}\r
- echo ']';\r
- }\r
- break;\r
+ break;\r
\r
- case 'get_instance' :\r
- echo $instanceManager -> getInstance($_GET['id']) -> getJSON();\r
- break;\r
+ case 'get_instance' :\r
+ echo $instanceManager -> getInstance($_GET['id']) -> getJSON();\r
+ break;\r
\r
- case 'get_instances' :\r
- $instances = $instanceManager -> getInstances();\r
- if (!empty($instances)) {\r
- $i = 0;\r
- echo '[';\r
- foreach ($instances as $instance) {\r
- echo $instance -> getJSON();\r
- if ($i != sizeof($instances) - 1) {\r
- echo ',';\r
+ case 'get_instances' :\r
+ $instances = $instanceManager -> getInstances();\r
+ if (!empty($instances)) {\r
+ $i = 0;\r
+ echo '[';\r
+ foreach ($instances as $instance) {\r
+ echo $instance -> getJSON();\r
+ if ($i != sizeof($instances) - 1) {\r
+ echo ',';\r
+ }\r
+ $i++;\r
}\r
- $i++;\r
+ echo ']';\r
}\r
- echo ']';\r
- }\r
- break;\r
+ break;\r
\r
- case 'get_historique' :\r
- echo $historiqueManager -> getHistorique($_GET['id']) -> getJSON();\r
- break;\r
+ case 'disable_maintien' :\r
+ $instanceManager -> desactiverMaintienById($_GET['id']);\r
+ break;\r
\r
- case 'get_historiques' :\r
- $historiques = $historiqueManager -> getHistoriques();\r
- if (!empty($historiques)) {\r
- $i = 0;\r
- echo '[';\r
- foreach ($historiques as $historique) {\r
- echo $historique -> getJSONP();\r
- if ($i != sizeof($historiques) - 1) {\r
- echo ',';\r
+ case 'get_historique' :\r
+ echo $historiqueManager -> getHistorique($_GET['id']) -> getJSON();\r
+ break;\r
+\r
+ case 'get_historiques' :\r
+ $historiques = $historiqueManager -> getHistoriques();\r
+ if (!empty($historiques)) {\r
+ $i = 0;\r
+ echo '[';\r
+ foreach ($historiques as $historique) {\r
+ echo $historique -> getJSONP();\r
+ if ($i != sizeof($historiques) - 1) {\r
+ echo ',';\r
+ }\r
+ $i++;\r
}\r
- $i++;\r
+ echo ']';\r
}\r
- echo ']';\r
- }\r
- break;\r
+ break;\r
\r
- case 'get_alerte' :\r
- echo $alerteManager -> getAlerte($_GET['id']) -> getJSON();\r
- break;\r
+ case 'get_alerte' :\r
+ echo $alerteManager -> getAlerte($_GET['id']) -> getJSON();\r
+ break;\r
\r
- case 'get_alertes' :\r
- $alertes = $alerteManager -> getAlertes();\r
- if (!empty($alertes)) {\r
- $i = 0;\r
- echo '[';\r
- foreach ($alertes as $alerte) {\r
- echo $alerte -> getJSON();\r
- if ($i != sizeof($alertes) - 1) {\r
- echo ',';\r
+ case 'get_alertes' :\r
+ $alertes = $alerteManager -> getAlertes();\r
+ if (!empty($alertes)) {\r
+ $i = 0;\r
+ echo '[';\r
+ foreach ($alertes as $alerte) {\r
+ echo $alerte -> getJSON();\r
+ if ($i != sizeof($alertes) - 1) {\r
+ echo ',';\r
+ }\r
+ $i++;\r
}\r
- $i++;\r
+ echo ']';\r
}\r
- echo ']';\r
- }\r
- break;\r
- }\r
+ break;\r
+ }\r
+ } else { echo "Welcome sur ALLO Serveur !"; }\r
}\r
\r
?>
\ No newline at end of file