diff --git a/SRC/app/Http/Controllers/ReferentController.php b/SRC/app/Http/Controllers/ReferentController.php index e6e0c30..279a7df 100755 --- a/SRC/app/Http/Controllers/ReferentController.php +++ b/SRC/app/Http/Controllers/ReferentController.php @@ -95,4 +95,9 @@ class ReferentController extends Controller { return redirect('/referent'); } + public function setListOeuvres () + { + return Response::json(array('sucess' => 'true', )) + } + } diff --git a/SRC/app/Http/routes.php b/SRC/app/Http/routes.php index 137d053..c363a82 100644 --- a/SRC/app/Http/routes.php +++ b/SRC/app/Http/routes.php @@ -39,7 +39,7 @@ Route::group(['middleware' => 'auth'], function () Route::post('deleteListeOeuvre', 'ReferentController@deleteListeOeuvre'); Route::post('addListeOeuvre', 'ReferentController@addListeOeuvre'); Route::get('showListOeuvres/{id}', 'ReferentController@showListeOeuvres'); - Route::get('setListOeuvres', 'ReferentController@setListOeuvres'); + Route::post('setListOeuvres', 'ReferentController@setListOeuvres'); }); Route::group(['middleware' => 'admin'], function () diff --git a/SRC/public/js/getListeOeuvre.js b/SRC/public/js/ListeOeuvre.js similarity index 69% rename from SRC/public/js/getListeOeuvre.js rename to SRC/public/js/ListeOeuvre.js index 3b51a58..349046c 100644 --- a/SRC/public/js/getListeOeuvre.js +++ b/SRC/public/js/ListeOeuvre.js @@ -1,6 +1,7 @@ $(document).ready( function() { console.log( "document loaded" ); $('.listeoeuvre').click(function() { + $('#oeuvrePic').empty(); url = "/showListOeuvres/" + $(this).children('.idListeOeuvre').val(); $.get(url, function( data ) { if (data.length == 0 ) @@ -14,7 +15,13 @@ $(document).ready( function() { }, "json" ) .fail(function() { - console.log( "error" ); + $("#oeuvrePic").append('
' + +'Oouups! Il y a un problème.

' + +'' + +'
' + ); }); }); }); diff --git a/SRC/public/js/setListeOeuvre.js b/SRC/public/js/setListeOeuvre.js deleted file mode 100644 index 5f9a8c4..0000000 --- a/SRC/public/js/setListeOeuvre.js +++ /dev/null @@ -1,20 +0,0 @@ -$(document).ready( function() { - $('#enregistrer').click(function() { - event.preventDefault(); - send = {idListeOeuvre : " " , - idOeuvres : [1,2,3,4,4] } - url = "/setListOeuvres"; - $.post(url, - send, - function( data ) { - }) - .done(function() { - console.log( "success" ); - }) - .fail(function() { - console.log( "error" ); - }); - }); - -}); - diff --git a/SRC/resources/views/app.blade.php b/SRC/resources/views/app.blade.php index 7aa0932..f809232 100755 --- a/SRC/resources/views/app.blade.php +++ b/SRC/resources/views/app.blade.php @@ -32,6 +32,6 @@ - + diff --git a/SRC/resources/views/referent.blade.php b/SRC/resources/views/referent.blade.php index cd77bf7..328b9d3 100755 --- a/SRC/resources/views/referent.blade.php +++ b/SRC/resources/views/referent.blade.php @@ -84,7 +84,7 @@ - +