function maj() { entete_page("Configuration du Dashboard - Modification en base ", "../"); $sql = mysql_query("DELETE FROM ui_type_objet"); $displayedS = $_POST["displayed"]; if (count($displayedS) > 0) { foreach ($displayedS as $id_type_objet => $displayed) { $ordre = $_POST["ordre"][$id_type_objet]; if ($ordre == "" || !isset($ordre)) { $ordre = "NULL"; } $sql = mysql_query("INSERT INTO ui_type_objet (id_type_objet, displayed,ordre) \n\t\tVALUES (\n\t\t'" . $id_type_objet . "',\n\t\t'" . $displayed . "',\n\t\t" . $ordre . "\n\t\t)") or die(mysql_error()); echo "<p>MAJ de {$id_type_objet}</p>"; } } echo "<a href='?a=home'>Retour</a>"; }
function suppr_post() { entete_page("Configuration des scenarios - Supprimer en base ", "../"); if ($_GET["id"] == "") { echo "Error : pas d'identifiant renvoyé !"; } $sql = mysql_query("\tDELETE FROM scenario\n\t\t\t\t\t\t\tWHERE id_scenario ='" . $_GET["id"] . "'") or die(mysql_error()); $sql = mysql_query("\tDELETE FROM scenario_conditions\n\t\t\t\t\t\t\tWHERE id_scenario ='" . $_GET["id"] . "'") or die(mysql_error()); $sql = mysql_query("\tDELETE FROM scenario_actions\n\t\t\t\t\t\t\tWHERE id_scenario ='" . $_GET["id"] . "'") or die(mysql_error()); echo "<p>Scenario supprimé<p>"; echo "<a href='?a=home'>Retour</a>"; }
?<?php require_once "../includes/global_ui.php"; entete_page("Graphes", "../"); ?> <div> <a href="#" onclick="afficher_graphe('temp');" data-role="button" data-icon="refresh" data-iconpos="left" data-mini="true" data-inline="true" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-theme="b" class="ui-btn ui-btn-inline ui-shadow ui-btn-corner-all ui-mini ui-btn-icon-left ui-btn-hover-c ui-btn-up-c"><span class="ui-btn-inner ui-btn-corner-all"><span class="ui-btn-text">T° Jour</span><span class="ui-icon ui-icon-refresh ui-icon-shadow"> </span></span></a> <a href="#" onclick="afficher_graphe('temp_week');" data-role="button" data-icon="refresh" data-iconpos="left" data-mini="true" data-inline="true" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-theme="b" class="ui-btn ui-btn-inline ui-shadow ui-btn-corner-all ui-mini ui-btn-icon-left ui-btn-hover-c ui-btn-up-c"><span class="ui-btn-inner ui-btn-corner-all"><span class="ui-btn-text">T° Semaine</span><span class="ui-icon ui-icon-refresh ui-icon-shadow"> </span></span></a> <a href="#" onclick="afficher_graphe('temp_month');" data-role="button" data-icon="refresh" data-iconpos="left" data-mini="true" data-inline="true" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-theme="b" class="ui-btn ui-btn-inline ui-shadow ui-btn-corner-all ui-mini ui-btn-icon-left ui-btn-hover-c ui-btn-up-c"><span class="ui-btn-inner ui-btn-corner-all"><span class="ui-btn-text">T° Mois</span><span class="ui-icon ui-icon-refresh ui-icon-shadow"> </span></span></a> <a href="#" onclick="afficher_graphe('elec');" data-role="button" data-icon="refresh" data-iconpos="left" data-mini="true" data-inline="true" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-theme="b" class="ui-btn ui-btn-inline ui-shadow ui-btn-corner-all ui-mini ui-btn-icon-left ui-btn-hover-c ui-btn-up-c"><span class="ui-btn-inner ui-btn-corner-all"><span class="ui-btn-text">Elect Jour</span><span class="ui-icon ui-icon-refresh ui-icon-shadow"> </span></span></a> <a href="#" onclick="afficher_graphe('elec_week');" data-role="button" data-icon="refresh" data-iconpos="left" data-mini="true" data-inline="true" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-theme="b" class="ui-btn ui-btn-inline ui-shadow ui-btn-corner-all ui-mini ui-btn-icon-left ui-btn-hover-c ui-btn-up-c"><span class="ui-btn-inner ui-btn-corner-all"><span class="ui-btn-text">Elect Semaine</span><span class="ui-icon ui-icon-refresh ui-icon-shadow"> </span></span></a> <a href="#" onclick="afficher_graphe('elec_month');" data-role="button" data-icon="refresh" data-iconpos="left" data-mini="true" data-inline="true" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-theme="b" class="ui-btn ui-btn-inline ui-shadow ui-btn-corner-all ui-mini ui-btn-icon-left ui-btn-hover-c ui-btn-up-c"><span class="ui-btn-inner ui-btn-corner-all"><span class="ui-btn-text">Elect Mois</span><span class="ui-icon ui-icon-refresh ui-icon-shadow"> </span></span></a> </div> <div id="graphe"> </div> <script type="text/javascript"> function afficher_graphe(type) { $("#graphe").html("<img src='../images/ajax-loader.gif' alt='loading'/>"); $.post("graphes_ajax.php" , { type:type }, function(data){ $("#graphe").html(data); }); } </script> <?php pied_page(); ?>
<?php require_once "includes/global_ui.php"; entete_page("test", ""); ?> <script type="text/javascript" src="js/crontab_generator.js"></script> <div id="content"> <div id="content-inner"> <div style="margin-bottom:20px;"> <div id="output"> <p id="output-crontab" style="font-size:2.5em;font-weight:bold;text-align:center;"> <span id="min-out">*</span> <span id="hour-out">*</span> <span id="dom-out">*</span> <span id="mon-out">*</span> <span id="dow-out">*</span> </p> </div> </div> <div data-role="collapsible-set"> <div data-role="collapsible"> <h3>Minute</h3> <p> <div data-role="navbar"> <ul> <li><a href="#" class="ui-btn-active ui-state-persist" onclick="display_cron('min-all');">every minute</a></li> <li><a href="#" onclick="display_cron('min-every');">every <em>n</em> minutes</a></li> <li><a href="#" onclick="display_cron('min-selected');">each selected minute</a></li>
function suppr_post() { entete_page("Configuration des Objets - Suppression en base ", "../"); if ($_GET["id"] == "") { echo "Error : pas d'identifiant renvoyé !"; } $sql = mysql_query("\tDELETE FROM objets\n\t\t\t\t\t\t\tWHERE id_objet_logique ='" . $_GET["id"] . "'") or die(mysql_error()); echo "<p>Objet supprimé</p>"; echo "<a href='?'>Retour</a>"; }
function suppr_post() { entete_page("Configuration des types d'objet - Supprimer un type d'objet en base ", "../"); if ($_GET["id"] == "") { echo "Error : pas d'identifiant renvoyé !"; } $sql = mysql_query("\tDELETE FROM type_objet\n\t\t\t\t\t\t\tWHERE id_type_objet_logique ='" . $_GET["id"] . "'") or die(mysql_error()); $sql = mysql_query("\tDELETE FROM actions_possibles\n\t\t\t\t\t\t\tWHERE id_type_objet ='" . $_GET["id"] . "'") or die(mysql_error()); $sql = mysql_query("\tDELETE FROM etats_possibles\n\t\t\t\t\t\t\tWHERE id_type_objet ='" . $_GET["id"] . "'") or die(mysql_error()); echo "<p>Type d'objet supprimé</p>"; echo "<a href='?'>Retour</a>"; }
<?php require_once "../includes/global_ui.php"; entete_page("Configuration", "../"); ?> <div data-role="content"> <div class="content-primary"> <h2>Configuration</h2> <h3>Objets</h3> <ul data-role="listview" data-inset="true"> <li><a href="gestion_objet.php">Gestion des Objets</a></li> <li><a href="gestion_type_objet.php">Gestion des Types d'objets</a></li> <li><a href="gestion_nabaztag.php">Gestion des Nabaztag</a></li> </ul> <h3>Scenarii</h3> <ul data-role="listview" data-inset="true"> <li><a href="gestion_scenario.php">Gestion des Scénarios</a></li> <li><a href="planification.php">Planification</a></li> </ul> <h3>Dashboard</h3> <ul data-role="listview" data-inset="true"> <li><a href="gestion_dashboard.php">Gestion du Dashboard</a></li> </ul> <h3>Paramètres</h3> <ul data-role="listview" data-inset="true"> <li><a href="gestion_action.php">Gestion des Actions</a></li> <li><a href="gestion_etat.php">Gestion des Etats</a></li> <li><a href="gestion_notification.php">Gestion des Notifications prédéfinies</a></li> </ul>
function suppr_post() { entete_page("Configuration des Nabaztag - Suppression en base ", "../"); if ($_GET["id"] == "") { echo "Error : pas d'identifiant renvoyé !"; } $sql = mysql_query("\tDELETE FROM nabaztag\n\t\t\t\t\t\t\tWHERE id_nab ='" . $_GET["id"] . "'") or die(mysql_error()); echo "<p>Nabaztag supprimé</p>"; echo "<a href='?a=home'>Retour</a>"; }
<?php require_once "../includes/global_ui.php"; require_once "../connexion.php"; entete_page("DashBoard", "../"); switch ($_GET[a]) { default: dashboard(); break; } function dashboard() { echo ' <div data-role="content"> <div class="content-primary"> <ul data-role="listview" id="liste_objet_dashboard">'; $sql_type = mysql_query("\tSELECT type_objet.id_type_objet_logique,nom_type_objet\n\t\t\t\t\t\t\t\tFROM type_objet, objets, ui_type_objet\n\t\t\t\t\t\t\t\tWHERE type_objet.id_type_objet_logique = objets.id_type_objet_logique\n\t\t\t\t\t\t\t\tAND ui_type_objet.id_type_objet=objets.id_type_objet_logique\n\t\t\t\t\t\t\t\tand displayed='1'\n\t\t\t\t\t\t\t\tGROUP BY type_objet.id_type_objet_logique\n\t\t\t\t\t\t\t\tORDER BY ordre ASC") or die(mysql_error()); while (list($id_type_objet_logique, $nom_type_objet, $nb) = mysql_fetch_array($sql_type)) { echo ' <li data-role="list-divider">' . $nom_type_objet . '</li>'; $sql_objets = mysql_query("\tSELECT id_objet_logique,nom_objet,lib_etat , nom_icone\n\t\t\t\t\t\t\t\t\tFROM (objets, etats) LEFT OUTER JOIN etats_possibles\n\t\t\t\t\t\t\t\t\t\ton objets.id_type_objet_logique=etats_possibles.id_type_objet\n\t\t\t\t\t\t\t\t\t\tand etats.id_etat=etats_possibles.id_etat\n\t\t\t\t\t\t\t\t\tWHERE objets.id_etat = etats.id_etat\n\t\t\t\t\t\t\t\t\tAND objets.id_type_objet_logique='" . $id_type_objet_logique . "'\n\t\t\t\t\t\t\t\t\tORDER BY nom_objet"); while (list($id_objet_logique, $nom_objet, $lib_etat, $nom_icone) = mysql_fetch_array($sql_objets)) { echo '<li id="dash_object_' . $id_objet_logique . '"> <img src="../images/' . $nom_icone . '" alt=""/> <h3>' . $nom_objet . '</h3>'; $sql_action_possible = mysql_query("SELECT actions.id_action,lib_action\n\t\t\t\t\t\t\t\t\t\t\t\tFROM actions_possibles, objets, actions\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE objets.id_type_objet_logique = actions_possibles.id_type_objet\n\t\t\t\t\t\t\t\t\t\t\t\tAND actions_possibles.id_etat_cible <> objets.id_etat\n\t\t\t\t\t\t\t\t\t\t\t\tAND actions_possibles.id_action = actions.id_action\n\t\t\t\t\t\t\t\t\t\t\t\tAND objets.id_objet_logique = '" . $id_objet_logique . "'"); while (list($id_action, $lib_action) = mysql_fetch_array($sql_action_possible)) { echo "<p><a href='#' onclick=\"lancer_action('" . $id_objet_logique . "','" . $id_action . "');\">{$lib_action}</a></p>"; } echo "</li>"; }
<?php require_once "../includes/global_ui.php"; require_once "../connexion.php"; entete_page("Scenario", "../"); switch ($_GET[a]) { default: scenario(); break; } function scenario() { echo ' <div data-role="content"> <div class="content-primary"> <ul data-role="listview" id="liste_objet_scenario">'; $sql_type = mysql_query("\tSELECT type_objet.id_type_objet_logique,nom_type_objet\n\t\t\t\t\t\t\t\tFROM type_objet, objets, ui_type_objet\n\t\t\t\t\t\t\t\tWHERE type_objet.id_type_objet_logique = objets.id_type_objet_logique\n\t\t\t\t\t\t\t\tAND ui_type_objet.id_type_objet=objets.id_type_objet_logique\n\t\t\t\t\t\t\t\tand displayed='1'\n\t\t\t\t\t\t\t\tGROUP BY type_objet.id_type_objet_logique\n\t\t\t\t\t\t\t\tORDER BY ordre ASC") or die(mysql_error()); while (list($id_type_objet_logique, $nom_type_objet, $nb) = mysql_fetch_array($sql_type)) { echo ' <li data-role="list-divider">' . $nom_type_objet . '</li>'; $sql_objets = mysql_query("\tSELECT id_objet_logique,nom_objet,lib_etat , nom_icone\n\t\t\t\t\t\t\t\t\tFROM (objets, etats) LEFT OUTER JOIN etats_possibles\n\t\t\t\t\t\t\t\t\t\ton objets.id_type_objet_logique=etats_possibles.id_type_objet\n\t\t\t\t\t\t\t\t\t\tand etats.id_etat=etats_possibles.id_etat\n\t\t\t\t\t\t\t\t\tWHERE objets.id_etat = etats.id_etat\n\t\t\t\t\t\t\t\t\tAND objets.id_type_objet_logique='" . $id_type_objet_logique . "'\n\t\t\t\t\t\t\t\t\tORDER BY nom_objet"); while (list($id_objet_logique, $nom_objet, $lib_etat, $nom_icone) = mysql_fetch_array($sql_objets)) { echo '<li id="dash_object_' . $id_objet_logique . '"> <img src="../images/' . $nom_icone . '" alt=""/> <h3>' . $nom_objet . '</h3>'; $sql_action_possible = mysql_query("SELECT actions.id_action,lib_action\n\t\t\t\t\t\t\t\t\t\t\t\tFROM actions_possibles, objets, actions\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE objets.id_type_objet_logique = actions_possibles.id_type_objet\n\t\t\t\t\t\t\t\t\t\t\t\tAND actions_possibles.id_etat_cible <> objets.id_etat\n\t\t\t\t\t\t\t\t\t\t\t\tAND actions_possibles.id_action = actions.id_action\n\t\t\t\t\t\t\t\t\t\t\t\tAND objets.id_objet_logique = '" . $id_objet_logique . "'"); while (list($id_action, $lib_action) = mysql_fetch_array($sql_action_possible)) { echo "<p><a href='#' onclick=\"lancer_action('" . $id_objet_logique . "','" . $id_action . "');\">{$lib_action}</a></p>"; } echo "</li>"; }
function suppr_post() { entete_page("Plannifications - Suppression en base ", "../"); if ($_GET["id"] == "") { echo "Error : pas d'identifiant renvoyé !"; } $sql = mysql_query("\tDELETE FROM etats\n\t\t\t\t\t\t\tWHERE id_etat ='" . $_GET["id"] . "'") or die(mysql_error()); echo "<p>Etat supprimé</p>"; echo "<a href='?a=home'>Retour</a>"; }