From c8c4e3b9c67a7119f6000728926cb43b4fe1e511 Mon Sep 17 00:00:00 2001 From: DonRenando Date: Wed, 18 Feb 2015 19:52:26 +0100 Subject: [PATCH 01/10] CSS --- SRC/public/css/app.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SRC/public/css/app.css b/SRC/public/css/app.css index a1efff6..dd17f56 100755 --- a/SRC/public/css/app.css +++ b/SRC/public/css/app.css @@ -3,6 +3,8 @@ html { font-family: sans-serif; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; + height: 100%; + width: 100%; } body { margin: 0; From 0eb41b4d9345cae6ba521bdbb7a9b02e8a5381eb Mon Sep 17 00:00:00 2001 From: Malibu Date: Wed, 18 Feb 2015 20:03:19 +0100 Subject: [PATCH 02/10] tt --- SRC/app/Http/Controllers/AdminController.php | 2 +- SRC/resources/views/admin.blade.php | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/SRC/app/Http/Controllers/AdminController.php b/SRC/app/Http/Controllers/AdminController.php index b554348..cb8d055 100755 --- a/SRC/app/Http/Controllers/AdminController.php +++ b/SRC/app/Http/Controllers/AdminController.php @@ -45,7 +45,7 @@ class AdminController extends Controller { $user->droits = (Input::get('isadmin'))?1:0; $user->city = Input::get('city'); $user->lastname = Input::get('lastname'); - $user->image = "pictures/user_picture/default.png"; + $user->image = "pictures/user_picture/default.jpg"; $user->save(); return redirect('/admin')->with('message_add', 'User ajouté avec succès'); diff --git a/SRC/resources/views/admin.blade.php b/SRC/resources/views/admin.blade.php index 536cc65..a691134 100755 --- a/SRC/resources/views/admin.blade.php +++ b/SRC/resources/views/admin.blade.php @@ -2,8 +2,19 @@ @section('content') -{{ Session::get('message_add') }} -{{ Session::get('message_delete') }} +
+ @if (session('message_add')) +
+ {{ Session::get('message_add') }} +
+ @endif + + @if (session('message_delete')) +
+ {{ Session::get('message_delete') }} +
+ @endif +

From 416ddb7a1606ea1f217e4ec67721002d0657aea6 Mon Sep 17 00:00:00 2001 From: DonRenando Date: Wed, 18 Feb 2015 21:15:20 +0100 Subject: [PATCH 03/10] CSS2 --- SRC/public/css/app.css | 12 ++++++------ SRC/resources/views/home.blade.php | 9 ++++----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/SRC/public/css/app.css b/SRC/public/css/app.css index dd17f56..001c582 100755 --- a/SRC/public/css/app.css +++ b/SRC/public/css/app.css @@ -4,7 +4,7 @@ html { -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; height: 100%; - width: 100%; + width: 100% } body { margin: 0; @@ -5351,13 +5351,13 @@ a.list-group-item-danger.active:focus { padding-bottom: 75%; } .well { - min-height: 20px; + min-height: 10px; padding: 19px; margin-bottom: 20px; background-color: #015402; color : white; font-weight: bold; - font-size: 25px; + font-size: 15px; border: 5px solid #7F2403; border-radius: 4px; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); @@ -5367,10 +5367,10 @@ a.list-group-item-danger.active:focus { border-color: rgba(0, 0, 0, 0.15); } .well-lg { - padding: 24px; + padding: 15px; margin: 5%; - margin-left : 25%; - margin-right: 25%; + margin-left : 40%; + margin-right: 40%; border-radius: 6px; } diff --git a/SRC/resources/views/home.blade.php b/SRC/resources/views/home.blade.php index d311dbf..7f71afa 100755 --- a/SRC/resources/views/home.blade.php +++ b/SRC/resources/views/home.blade.php @@ -38,8 +38,8 @@
@endif
- {{ $ref -> name }}-Nom -
{{$ref -> firstname}}, {{$ref -> lastname}}
+ {{ $ref -> name }}-Nom +
{{$ref -> firstname}}, {{$ref -> lastname}}
@endforeach @@ -55,12 +55,11 @@ - + +--> @endsection From 278fa55ed8f1303eecd4b4b850835fa6327fdb98 Mon Sep 17 00:00:00 2001 From: DonRenando Date: Wed, 18 Feb 2015 22:17:31 +0100 Subject: [PATCH 04/10] CSS3 --- SRC/public/css/app.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SRC/public/css/app.css b/SRC/public/css/app.css index 001c582..f56ff1f 100755 --- a/SRC/public/css/app.css +++ b/SRC/public/css/app.css @@ -5369,7 +5369,7 @@ a.list-group-item-danger.active:focus { .well-lg { padding: 15px; margin: 5%; - margin-left : 40%; + margin-left : 35%; margin-right: 40%; border-radius: 6px; From 4cbb358f486a56bdf654787185d0eefbbc447efd Mon Sep 17 00:00:00 2001 From: DonRenando Date: Wed, 18 Feb 2015 22:49:48 +0100 Subject: [PATCH 05/10] CSS4 --- SRC/public/css/app.css | 2 +- SRC/resources/views/home.blade.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SRC/public/css/app.css b/SRC/public/css/app.css index f56ff1f..001c582 100755 --- a/SRC/public/css/app.css +++ b/SRC/public/css/app.css @@ -5369,7 +5369,7 @@ a.list-group-item-danger.active:focus { .well-lg { padding: 15px; margin: 5%; - margin-left : 35%; + margin-left : 40%; margin-right: 40%; border-radius: 6px; diff --git a/SRC/resources/views/home.blade.php b/SRC/resources/views/home.blade.php index 7f71afa..0352145 100755 --- a/SRC/resources/views/home.blade.php +++ b/SRC/resources/views/home.blade.php @@ -38,8 +38,8 @@
@endif
- {{ $ref -> name }}-Nom -
{{$ref -> firstname}}, {{$ref -> lastname}}
+ {{ $ref -> name }}-Nom +
{{$ref -> firstname}}, {{$ref -> lastname}}
@endforeach From 357d903bb5461e9ceae2be2c5bf50158d4c3143c Mon Sep 17 00:00:00 2001 From: DonRenando Date: Wed, 18 Feb 2015 23:03:16 +0100 Subject: [PATCH 06/10] curseur --- SRC/public/css/app.css | 4 +++- SRC/resources/views/home.blade.php | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/SRC/public/css/app.css b/SRC/public/css/app.css index 001c582..370b8b1 100755 --- a/SRC/public/css/app.css +++ b/SRC/public/css/app.css @@ -6265,4 +6265,6 @@ body, label, .checkbox label { font-weight: 300; -} \ No newline at end of file +} + +html, body, a, a:hover { cursor:url('http://www.snazzyspace.com/cursorsfolder/mickey-big-pointer.png'), auto !important; } \ No newline at end of file diff --git a/SRC/resources/views/home.blade.php b/SRC/resources/views/home.blade.php index 0352145..9f43bce 100755 --- a/SRC/resources/views/home.blade.php +++ b/SRC/resources/views/home.blade.php @@ -55,7 +55,6 @@ - @endsection From 51fd0b06b909dbcd79f0be281989962074d678fd Mon Sep 17 00:00:00 2001 From: Malibu Date: Wed, 18 Feb 2015 23:15:18 +0100 Subject: [PATCH 09/10] database update --- SRC/app/AssoListeAJeu.php | 10 ++++ SRC/app/AssoListeAOeuvre.php | 10 ++++ .../Http/Controllers/ReferentController.php | 52 +++++++++++++++++-- SRC/app/Http/routes.php | 2 + SRC/app/Jeu.php | 10 ++++ SRC/app/ListeOeuvre.php | 27 ++++++++++ SRC/app/Oeuvre.php | 10 ++++ SRC/app/User.php | 4 +- SRC/init/table.sql | 43 +++++++-------- SRC/resources/views/referent.blade.php | 20 ++----- 10 files changed, 143 insertions(+), 45 deletions(-) create mode 100644 SRC/app/AssoListeAJeu.php create mode 100644 SRC/app/AssoListeAOeuvre.php create mode 100644 SRC/app/Jeu.php create mode 100644 SRC/app/ListeOeuvre.php create mode 100644 SRC/app/Oeuvre.php diff --git a/SRC/app/AssoListeAJeu.php b/SRC/app/AssoListeAJeu.php new file mode 100644 index 0000000..888e7c8 --- /dev/null +++ b/SRC/app/AssoListeAJeu.php @@ -0,0 +1,10 @@ + 'Référent', 'me' => $me]); + + // List Oeuvre of one user + $sessions = ListeOeuvre::currentUser()->get(); + echo $sessions[0]->oeuvres()->get(); + + //return view('referent', ['nameRoute' => 'Référent', 'me' => $me, 'sessions' => $sessions]); } /** - * updateUser an user in database. + * updateUser an user informations in database. * * */ @@ -53,6 +61,44 @@ class ReferentController extends Controller { $user->save(); return redirect('/referent')->with('message_update', 'Referent mis à jour avec succès'); - } + } + + /** + * create a new session + * + */ + public function addSession() + { + // TODO + $ListeOeuvre = new ListeOeuvre; + $ListeOeuvre->idusers = 2; + $ListeOeuvre->nom = "Linux"; + $ListeOeuvre->etat = 1; + $ListeOeuvre->save(); + + $assolistaoeuvre = new AssoListeAOeuvre; + $assolistaoeuvre->liste_oeuvre_id = 1; + $assolistaoeuvre->oeuvre_id = 1; + $assolistaoeuvre->save(); + + $assolistaoeuvre2 = new AssoListeAOeuvre; + $assolistaoeuvre2->liste_oeuvre_id = 1; + $assolistaoeuvre2->oeuvre_id = 2; + $assolistaoeuvre2->save(); + } + + + /** + * get all user sessions + * + */ + private function getSessions() + { + // TODO + } + + + + } diff --git a/SRC/app/Http/routes.php b/SRC/app/Http/routes.php index 995f90a..8861b9e 100755 --- a/SRC/app/Http/routes.php +++ b/SRC/app/Http/routes.php @@ -28,6 +28,8 @@ Route::group(['middleware' => 'auth'], function () Route::get('referent', 'ReferentController@index'); Route::get('logout', 'LoginController@logout'); Route::post('update', 'ReferentController@update'); + + Route::post('addSession', 'ReferentController@addSession'); }); Route::group(['middleware' => 'admin'], function () diff --git a/SRC/app/Jeu.php b/SRC/app/Jeu.php new file mode 100644 index 0000000..e365a2b --- /dev/null +++ b/SRC/app/Jeu.php @@ -0,0 +1,10 @@ +belongsToMany('App\Oeuvre', 'assolisteaoeuvre'); + } + + public function jeux() + { + return $this->belongsToMany('App\Jeu', 'assolisteajeu'); + } + + public function scopeCurrentUser($query) + { + $idUser = Auth::user()->id; + return $query->where('idusers', $idUser); + } +} diff --git a/SRC/app/Oeuvre.php b/SRC/app/Oeuvre.php new file mode 100644 index 0000000..ac09b01 --- /dev/null +++ b/SRC/app/Oeuvre.php @@ -0,0 +1,10 @@ +email; - return $query->where('email', $email)->first(); + $idUser = Auth::user()->id; + return $query->where('id', $idUser)->first(); } public function scopeReferents($query) diff --git a/SRC/init/table.sql b/SRC/init/table.sql index fab9dd5..27a9788 100644 --- a/SRC/init/table.sql +++ b/SRC/init/table.sql @@ -106,23 +106,22 @@ CREATE TABLE oeuvre ( ); CREATE TABLE assodesignationaoeuvre ( - idoeuvre INT NOT NULL, - iddesignation INT NOT NULL, - PRIMARY KEY (iddesignation,idoeuvre), - FOREIGN KEY (iddesignation) REFERENCES designation(iddesignation), - FOREIGN KEY (idoeuvre) REFERENCES oeuvre(idoeuvre) + oeuvre_id INT NOT NULL, + designation_id INT NOT NULL, + PRIMARY KEY (designation_id,oeuvre_id), + FOREIGN KEY (designation_id) REFERENCES designation(iddesignation), + FOREIGN KEY (oeuvre_id) REFERENCES oeuvre(idoeuvre) ); CREATE TABLE assoauteuraoeuvre ( - idoeuvre INT NOT NULL, - idauteur INT NOT NULL, - PRIMARY KEY (idauteur,idoeuvre), - FOREIGN KEY (idauteur) REFERENCES auteur(idauteur), - FOREIGN KEY (idoeuvre) REFERENCES oeuvre(idoeuvre) + oeuvre_id INT NOT NULL, + auteur_id INT NOT NULL, + PRIMARY KEY (auteur_id,oeuvre_id), + FOREIGN KEY (auteur_id) REFERENCES auteur(idauteur), + FOREIGN KEY (oeuvre_id) REFERENCES oeuvre(idoeuvre) ); - CREATE TABLE listeoeuvre ( idlisteoeuvre INT NOT NULL AUTO_INCREMENT, idusers INT NOT NULL, @@ -135,23 +134,21 @@ CREATE TABLE listeoeuvre ( ); CREATE TABLE assolisteaoeuvre ( - idlisteoeuvre INT NOT NULL, - idoeuvre INT NOT NULL, - PRIMARY KEY (idlisteoeuvre,idoeuvre), - FOREIGN KEY (idlisteoeuvre) REFERENCES listeoeuvre(idlisteoeuvre), - FOREIGN KEY (idoeuvre) REFERENCES oeuvre(idoeuvre) + liste_oeuvre_id INT NOT NULL, + oeuvre_id INT NOT NULL, + PRIMARY KEY (liste_oeuvre_id,oeuvre_id), + FOREIGN KEY (liste_oeuvre_id) REFERENCES listeoeuvre(idlisteoeuvre), + FOREIGN KEY (oeuvre_id) REFERENCES oeuvre(idoeuvre) ); CREATE TABLE assolisteajeu ( - idlisteoeuvre INT NOT NULL, - idjeu INT NOT NULL, - PRIMARY KEY (idlisteoeuvre,idjeu), - FOREIGN KEY (idlisteoeuvre) REFERENCES listeoeuvre(idlisteoeuvre), - FOREIGN KEY (idjeu) REFERENCES jeu(idjeu) + liste_oeuvre_id INT NOT NULL, + jeu_id INT NOT NULL, + PRIMARY KEY (liste_oeuvre_id,jeu_id), + FOREIGN KEY (liste_oeuvre_id) REFERENCES listeoeuvre(idlisteoeuvre), + FOREIGN KEY (jeu_id) REFERENCES jeu(idjeu) ); - - CREATE TABLE description ( iddescription INT NOT NULL AUTO_INCREMENT, idoeuvre INT NOT NULL, diff --git a/SRC/resources/views/referent.blade.php b/SRC/resources/views/referent.blade.php index 1433150..c9c4e9f 100755 --- a/SRC/resources/views/referent.blade.php +++ b/SRC/resources/views/referent.blade.php @@ -18,26 +18,12 @@

Mes sessions: + @foreach ($sessions as $session) - - - - - - - - - - - - - - - - - + + @endforeach
FalbalaSupprimer
bibloSupprimer
TralalaSupprimer
RedminSupprimer
Vive arch linux{{$session->nom}} Supprimer
From dbf284c117eefbd4778d354c15cffcad51ab00e2 Mon Sep 17 00:00:00 2001 From: DonRenando Date: Wed, 18 Feb 2015 23:16:41 +0100 Subject: [PATCH 10/10] erreur2 --- SRC/public/css/app.css | 4 ---- 1 file changed, 4 deletions(-) diff --git a/SRC/public/css/app.css b/SRC/public/css/app.css index 09b4dd6..7c9e104 100755 --- a/SRC/public/css/app.css +++ b/SRC/public/css/app.css @@ -6268,7 +6268,3 @@ label, } html, body, a, a:hover { cursor:url('http://www.snazzyspace.com/cursorsfolder/mickey-big-pointer.png'), auto !important; } - - - -a:hover { cursor:url('http://www.snazzyspace.com/cursorsfolder/mickey-hand.png'), auto !important; } \ No newline at end of file