diff --git a/config/database-local.json b/config/database-local.json new file mode 100755 index 0000000..d11c9a0 --- /dev/null +++ b/config/database-local.json @@ -0,0 +1,6 @@ +{ + "host" : "localhost", + "dbname" : "stefproject", + "user" : "php", + "password" : "Qt358nUdyeTxLDM8" +} \ No newline at end of file diff --git a/config/database.json b/config/database.json index d11c9a0..2ca9745 100755 --- a/config/database.json +++ b/config/database.json @@ -1,6 +1,6 @@ { - "host" : "localhost", + "host" : "sql31.free-h.org:3306", "dbname" : "stefproject", "user" : "php", - "password" : "Qt358nUdyeTxLDM8" + "password" : "Hx2c#e77" } \ No newline at end of file diff --git a/css/container.css b/css/container.css index a56901f..ef14f5d 100755 --- a/css/container.css +++ b/css/container.css @@ -1,2 +1,2 @@ -#WRAPPER>#CONTAINER>.sub-menu-side{display:block;position:relative}#WRAPPER>#CONTAINER>.sub-menu-side>span[data-sublink]{display:block;position:relative;width:7.5em;padding:.3em 1em .3em 2em;margin:1em;border-radius:3px;color:#5b5e63;text-shadow:1px 1px white;white-space:nowrap;transition:all .2s;cursor:pointer;overflow:hidden}#WRAPPER>#CONTAINER>.sub-menu-side>span[data-sublink]>.svg>svg{display:inline-block;position:absolute;left:.5em;top:50%;width:1em;height:1em;transform:translateY(-50%)}#WRAPPER>#CONTAINER>.sub-menu-side>span[data-sublink]>.svg>svg path{fill:#5b5e63 !important}#WRAPPER>#CONTAINER>.sub-menu-side>span[data-sublink]:hover,#WRAPPER>#CONTAINER>.sub-menu-side>span[data-sublink].active{color:#121213;background-color:#d8deea;box-shadow:inset 0 0 4px #c8ced9}#WRAPPER>#CONTAINER>.sub-menu-side>span[data-sublink]:hover>.svg>svg path,#WRAPPER>#CONTAINER>.sub-menu-side>span[data-sublink].active>.svg>svg path{fill:#121213 !important}#WRAPPER>#CONTAINER>.sub-menu-side>span[data-sublink]:nth-child(1){margin-top:1em}#WRAPPER>#CONTAINER>section{display:none;flex-grow:1}#WRAPPER>#CONTAINER>section.active{display:block}#WRAPPER>#CONTAINER>section>.inline-box{display:block;position:relative;width:calc( 100% - 2*1em - 2*1em );margin:1em;padding:1em;border-radius:3px;box-shadow:0 0 1px #b7b7b7;background-color:#fff}#WRAPPER>#CONTAINER>section>.inline-box .title{display:inline-block;font-size:1.15em;font-weight:bold}#WRAPPER>#CONTAINER>section>.inline-box .title>span{font-size:.8em;color:#333}#WRAPPER>#CONTAINER>section>.inline-box .code{display:inline-block;color:#777}#WRAPPER>#CONTAINER>section>.inline-box .code svg{display:inline-block;position:relative;margin-left:.5em;margin-right:.5em;margin-bottom:-.6em;width:1.5em;height:2em}#WRAPPER>#CONTAINER>section>.inline-box .code svg path{fill:#777 !important}#WRAPPER>#CONTAINER>section>.inline-box .mail{display:block;margin:1em;color:#777}#WRAPPER>#CONTAINER>section>.inline-box .mail svg{display:inline-block;position:relative;margin-left:.5em;margin-right:.5em;margin-bottom:-.6em;width:1.5em;height:2em}#WRAPPER>#CONTAINER>section>.inline-box .mail svg path{fill:#777 !important} +#WRAPPER>#CONTAINER>.sub-menu-side{display:block;position:relative}#WRAPPER>#CONTAINER>.sub-menu-side>span[data-sublink]{display:block;position:relative;width:7.5em;padding:.3em 1em .3em 2em;margin:1em;border-radius:3px;color:#5b5e63;text-shadow:1px 1px white;white-space:nowrap;transition:all .2s;cursor:pointer;overflow:hidden}#WRAPPER>#CONTAINER>.sub-menu-side>span[data-sublink]>.svg>svg{display:inline-block;position:absolute;left:.5em;top:50%;width:1em;height:1em;transform:translateY(-50%)}#WRAPPER>#CONTAINER>.sub-menu-side>span[data-sublink]>.svg>svg path{fill:#5b5e63 !important}#WRAPPER>#CONTAINER>.sub-menu-side>span[data-sublink]:hover,#WRAPPER>#CONTAINER>.sub-menu-side>span[data-sublink].active{color:#121213;background-color:#d8deea;box-shadow:inset 0 0 4px #c8ced9}#WRAPPER>#CONTAINER>.sub-menu-side>span[data-sublink]:hover>.svg>svg path,#WRAPPER>#CONTAINER>.sub-menu-side>span[data-sublink].active>.svg>svg path{fill:#121213 !important}#WRAPPER>#CONTAINER>.sub-menu-side>span[data-sublink]:nth-child(1){margin-top:1em}#WRAPPER>#CONTAINER>section{display:none;flex-grow:1}#WRAPPER>#CONTAINER>section.active{display:block}#WRAPPER>#CONTAINER>section.active.list{display:flex;flex-direction:column}#WRAPPER>#CONTAINER>section.active.list .inline-box{flex:1 1 1}#WRAPPER>#CONTAINER>section>.inline-box{display:inline-block;position:relative;margin:.3em 0;padding:1em;border-radius:3px;box-shadow:0 0 1px #b7b7b7;background-color:#fff}#WRAPPER>#CONTAINER>section>.inline-box .title{display:inline-block;font-size:1.15em;font-weight:bold}#WRAPPER>#CONTAINER>section>.inline-box .title>span{font-size:.8em;color:#333}#WRAPPER>#CONTAINER>section>.inline-box .code{display:inline-block;color:#777}#WRAPPER>#CONTAINER>section>.inline-box .code svg{display:inline-block;position:relative;margin-left:.5em;margin-right:.5em;margin-bottom:-.6em;width:1.5em;height:2em}#WRAPPER>#CONTAINER>section>.inline-box .code svg path{fill:#777 !important}#WRAPPER>#CONTAINER>section>.inline-box .mail{display:block;margin:1em;color:#777}#WRAPPER>#CONTAINER>section>.inline-box .mail svg{display:inline-block;position:relative;margin-left:.5em;margin-right:.5em;margin-bottom:-.6em;width:1.5em;height:2em}#WRAPPER>#CONTAINER>section>.inline-box .mail svg path{fill:#777 !important} /*# sourceMappingURL=container.css.map */ diff --git a/css/container.scss b/css/container.scss index 1abe866..216c1dd 100755 --- a/css/container.scss +++ b/css/container.scss @@ -16,7 +16,7 @@ width: 7.5em; padding: .3em 1em .3em 2em; - margin: 1em ; + margin: 1em; border-radius: 3px; @@ -83,15 +83,27 @@ display: block; } + // @active + .list + & > section.active.list{ + display: flex; + flex-direction: column; + // justify-content: space-between; + // flex-wrap: wrap; + + .inline-box{ + flex: 1 1 1; + } + } + /* [3] INLINE-BOX pour afficher les listes de donnees =========================================================*/ & > section > .inline-box{ - display: block; + display: inline-block; position: relative; - width: calc( 100% - 2*1em - 2*1em ); - margin: 1em; + // width: calc( 100% - 2*1em - 2*1em ); + margin: .3em 0; padding: 1em; border-radius: 3px; diff --git a/manager/Database.php b/manager/Database.php index dbda89b..64072ff 100755 --- a/manager/Database.php +++ b/manager/Database.php @@ -6,7 +6,7 @@ class DataBase{ /* ATTRIBUTS STATIQUES */ - public static $config_path = '/f/json/database/conf'; + public static $config_path = array('/f/json/database/conf', '/f/json/database-local/conf'); private static $pdo; private static $instance; @@ -34,7 +34,10 @@ if( self::$instance == null ){ // chargement de la configuration du server SQL - $conf = json_decode( ResourceDispatcher::getResource(self::$config_path), true ); + if( $_SERVER['HTTP_HOST'] == 'stefprojectv2' ) + $conf = json_decode( ResourceDispatcher::getResource(self::$config_path[0]), true ); + else + $conf = json_decode( ResourceDispatcher::getResource(self::$config_path[1]), true ); // creation de l'instance en fonction des parametres self::$instance = new DataBase($conf['host'], $conf['dbname'], $conf['user'], $conf['password']); diff --git a/manager/ModuleAnswer.php b/manager/ModuleAnswer.php index ad1610f..3a5b899 100755 --- a/manager/ModuleAnswer.php +++ b/manager/ModuleAnswer.php @@ -125,7 +125,8 @@ */ public function serialize(){ - $returnData = array_merge( $this->data, array('ModuleError' => $this->error) ); + // On rajoute l'erreur au message + $returnData = array_merge( array('ModuleError' => $this->error), $this->data ); return json_encode($returnData); diff --git a/src/static/container/card.svg b/src/static/container/card.svg old mode 100644 new mode 100755 diff --git a/src/static/container/mail.svg b/src/static/container/mail.svg old mode 100644 new mode 100755 diff --git a/src/static/menu-side/machines.svg b/src/static/menu-side/machines.svg old mode 100644 new mode 100755 diff --git a/src/static/menu-side/settings.svg b/src/static/menu-side/settings.svg old mode 100644 new mode 100755 diff --git a/view/users.php b/view/users.php index 913bd16..893980f 100755 --- a/view/users.php +++ b/view/users.php @@ -60,8 +60,8 @@ $request = new \manager\ModuleRequest('userDefaultModule/getAll'); // On utilise la methode 'getAll' du module 'userDefaultModule' $answer = $request->dispatch(); // On recupere la reponse - echo "
"; - echo 'Liste des utilisateurs:
'; + echo "
"; + // echo 'Liste des utilisateurs:
'; // si erreur, on affiche l'explicitation if( $answer->error != \manager\ManagerError::Success )