modified: SRC/app/Http/Controllers/ReferentController.php
modified: SRC/public/js/ListeOeuvre.js modified: SRC/resources/views/referent.blade.php
This commit is contained in:
parent
f6027554fe
commit
695adc5d3a
@ -123,13 +123,13 @@ class ReferentController extends Controller {
|
||||
|
||||
public function search()
|
||||
{
|
||||
$auteurs = Input::get('auteur', array());
|
||||
$designations = Input::get('designation', array());
|
||||
$domaines = Input::get('domaine', array());
|
||||
$matieres = Input::get('matiere', array());
|
||||
$techniques = Input::get('technique', array());
|
||||
$debut = Input::get('debut');
|
||||
$fin = Input::get('fin');
|
||||
$auteurs = (Input::get('auteur', array()))?Input::get('auteur', array()): [];
|
||||
$designations = (Input::get('designation', array()))? Input::get('designation', array()): [];
|
||||
$domaines = (Input::get('domaine', array()))? Input::get('domaine', array()): [];
|
||||
$matieres = (Input::get('matiere', array()))? Input::get('matiere', array()): [];
|
||||
$techniques = (Input::get('technique', array()))?Input::get('technique', array()): [];
|
||||
$debut = (Input::get('debut'))? Input::get('debut'): '';
|
||||
$fin = (Input::get('fin'))?Input::get('fin'): '';
|
||||
|
||||
$res = Oeuvre::authorFilter($auteurs)
|
||||
->designationFilter($designations)
|
||||
|
@ -56,3 +56,43 @@ $('#enregistrer').click(function() {
|
||||
});
|
||||
|
||||
|
||||
// Afficher résultat de recherche d'oeuvre
|
||||
$('#search_button').click(function() {
|
||||
$('#oeuvreRes').empty();
|
||||
url = "/search";
|
||||
dataSend = {
|
||||
_token : $('#_tokenRes').val(),
|
||||
auteur: $('#auteur').val(),
|
||||
designation: $('#designation').val(),
|
||||
matiere: $('#matiere').val(),
|
||||
domaine: $('#domaine').val(),
|
||||
technique: $('#technique').val(),
|
||||
debut: $('#debut').val(),
|
||||
fin: $('#fin').val()
|
||||
};
|
||||
$.post(url,
|
||||
dataSend,
|
||||
function( data ) {
|
||||
console.log(data);
|
||||
if (data.length == 0 )
|
||||
$("#oeuvreRes").append("Aucune Oeuvre Trouvé..");
|
||||
data.forEach( function(el) {
|
||||
$("#oeuvreRes").append('<div class="col-xs-4 col-md-3">'
|
||||
+'<a href="#" class="thumbnail">'
|
||||
+'<img src="http://www.augustins.org/documents/10180/156407/' + el.urlPhoto + '"/>'
|
||||
+'</a></div>');
|
||||
})
|
||||
}, "json" )
|
||||
|
||||
.fail(function() {
|
||||
$("#oeuvreRes").append('<div class="alert alert-danger">'
|
||||
+'<strong>Oouups!</strong> Il y a un problème.<br><br>'
|
||||
+'<ul>'
|
||||
+'<li>Erreur lors de la récupération</li>'
|
||||
+'</ul>'
|
||||
+'</div>'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
@ -108,11 +108,11 @@
|
||||
<!-- PART CHOOSE AND FILL FILTER -->
|
||||
<legend>Recherche avancée</legend><br>
|
||||
<form class="form-horizontal" role="form" action="search" method="post">
|
||||
<input type="hidden" name="_token" value="{{{ csrf_token() }}}" />
|
||||
<input type="hidden" id="_tokenRes" name="_token" value="{{{ csrf_token() }}}" />
|
||||
<div class="form-group">
|
||||
<label for="inputEmail3" class="col-sm-2 control-label">Auteur</label>
|
||||
<div class="col-sm-10">
|
||||
<select data-placeholder="Choisissez un auteur" name="auteur[]" class="chosen-select" multiple tabindex="4">
|
||||
<select data-placeholder="Choisissez un auteur" id="auteur" name="auteur[]" class="chosen-select" multiple tabindex="4">
|
||||
<option value=""></option>
|
||||
@foreach ($data['auteur'] as $val)
|
||||
<option value="{{$val -> id}}">{{$val -> nom}}</option>
|
||||
@ -123,7 +123,7 @@
|
||||
<div class="form-group">
|
||||
<label for="inputEmail3" class="col-sm-2 control-label">Désignation</label>
|
||||
<div class="col-sm-10">
|
||||
<select data-placeholder="Choisissez une désignation" name="designation[]" class="chosen-select" multiple tabindex="4">
|
||||
<select data-placeholder="Choisissez une désignation" id="designation" name="designation[]" class="chosen-select" multiple tabindex="4">
|
||||
<option value=""></option>
|
||||
@foreach ($data['designation'] as $val)
|
||||
<option value="{{$val->id}}">{{$val->nom}}</option>
|
||||
@ -134,7 +134,7 @@
|
||||
<div class="form-group">
|
||||
<label for="inputEmail3" class="col-sm-2 control-label">Domaine</label>
|
||||
<div class="col-sm-10">
|
||||
<select data-placeholder="Choisissez un domaine" name="domaine[]" class="chosen-select" multiple tabindex="4">
|
||||
<select data-placeholder="Choisissez un domaine" id="domaine" name="domaine[]" class="chosen-select" multiple tabindex="4">
|
||||
<option value=""></option>
|
||||
@foreach ($data['domaine'] as $val)
|
||||
<option value="{{$val->id}}">{{$val->nom}}</option>
|
||||
@ -145,7 +145,7 @@
|
||||
<div class="form-group">
|
||||
<label for="inputEmail3" class="col-sm-2 control-label">Matière</label>
|
||||
<div class="col-sm-10">
|
||||
<select data-placeholder="Choisissez une matière" name="matiere[]" class="chosen-select" multiple tabindex="4">
|
||||
<select data-placeholder="Choisissez une matière" id="matiere" name="matiere[]" class="chosen-select" multiple tabindex="4">
|
||||
<option value=""></option>
|
||||
@foreach ($data['matiere'] as $val)
|
||||
<option value="{{$val->id}}">{{$val->nom}}</option>
|
||||
@ -156,7 +156,7 @@
|
||||
<div class="form-group">
|
||||
<label for="inputEmail3" class="col-sm-2 control-label">Technique</label>
|
||||
<div class="col-sm-10">
|
||||
<select data-placeholder="Choisissez une technique" name="technique[]" class="chosen-select" multiple tabindex="4">
|
||||
<select data-placeholder="Choisissez une technique" id="technique" name="technique[]" class="chosen-select" multiple tabindex="4">
|
||||
<option value=""></option>
|
||||
@foreach ($data['technique'] as $val)
|
||||
<option value="{{$val->id}}">{{$val->nom}}</option>
|
||||
@ -167,23 +167,23 @@
|
||||
<div class="form-group">
|
||||
<label for="inputEmail3" class="col-sm-2 control-label">Mot clé</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" class="form-control" name="motcle" disabled id="exampleInputName2" placeholder="Mot clé">
|
||||
<input type="text" class="form-control" name="motcle" disabled id="motcle" placeholder="Mot clé">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="inputEmail3" class="col-sm-2 control-label">Date Début</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="date" class="form-control" name="debut" id="exampleInputName2" placeholder="date début">
|
||||
<input type="date" class="form-control" name="debut" id="debut" placeholder="date début">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="inputEmail3" class="col-sm-2 control-label">Date Fin</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="date" class="form-control" name="fin" id="exampleInputName2" placeholder="date fin">
|
||||
<input type="date" class="form-control" name="fin" id="fin" placeholder="date fin">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<center><button type="submit" class="btn btn-primary">Rechercher</button></center>
|
||||
<center><button type="button" class="btn btn-primary" id="search_button">Rechercher</button></center>
|
||||
</form>
|
||||
|
||||
|
||||
@ -192,28 +192,13 @@
|
||||
<legend>Résultat de ma recherche</legend>
|
||||
<span style="float: right"><a href="">Sélectionner tout</a> -- <a href="">Annuler sélection</a></span><br>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body" id="oeuvrePic">
|
||||
<div class="panel-body" id="oeuvreRes">
|
||||
|
||||
<div class="col-xs-4 col-md-3">
|
||||
<a href="#" class="thumbnail">
|
||||
<img src="http://www.augustins.org/documents/10180/156407/1"/>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xs-4 col-md-3">
|
||||
<a href="#" class="thumbnail">
|
||||
<img src="http://www.augustins.org/documents/10180/156407/1"/>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xs-4 col-md-3">
|
||||
<a href="#" class="thumbnail">
|
||||
<img src="http://www.augustins.org/documents/10180/156407/1"/>
|
||||
</a>
|
||||
</div>
|
||||
<!-- TODO -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<button style="float: right" class="btn btn-primary" id="enregistrer">Enregistrer</button>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@endsection
|
Reference in New Issue
Block a user