Line 320... |
Line 320... |
320 |
}
|
320 |
}
|
321 |
$html_filtre .= '<option id="filtre_tous" value="*" ';
|
321 |
$html_filtre .= '<option id="filtre_tous" value="*" ';
|
322 |
if (isset($_POST['bazar_filtre_'.$numero_liste]) && '*' == $_POST['bazar_filtre_'.$numero_liste]) {
|
322 |
if (isset($_POST['bazar_filtre_'.$numero_liste]) && '*' == $_POST['bazar_filtre_'.$numero_liste]) {
|
323 |
$html_filtre .= 'selected="selected" ';
|
323 |
$html_filtre .= 'selected="selected" ';
|
324 |
}
|
324 |
}
|
325 |
$html_filtre .= '>'.'Tout afficher'.'</option>';
|
325 |
$html_filtre .= '>'.'Tous les événements'.'</option>';
|
Line 326... |
Line 326... |
326 |
|
326 |
|
327 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
|
327 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
|
328 |
$html_filtre .= '<option class="filtre_'.$ligne->blv_valeur.'" value="'.$ligne->blv_valeur.'"';
|
328 |
$html_filtre .= '<option class="filtre_'.$ligne->blv_valeur.'" value="'.$ligne->blv_valeur.'"';
|
329 |
if (isset($_POST['bazar_filtre_'.$numero_liste]) && $ligne->blv_valeur == $_POST['bazar_filtre_'.$numero_liste]) {
|
329 |
if (isset($_POST['bazar_filtre_'.$numero_liste]) && $ligne->blv_valeur == $_POST['bazar_filtre_'.$numero_liste]) {
|
Line 345... |
Line 345... |
345 |
if (isset ($_POST['date_fin'])) {
|
345 |
if (isset ($_POST['date_fin'])) {
|
346 |
$defaut_fin = $_POST['date_fin'];
|
346 |
$defaut_fin = $_POST['date_fin'];
|
347 |
} else {
|
347 |
} else {
|
348 |
$defaut_fin = '';
|
348 |
$defaut_fin = '';
|
349 |
}
|
349 |
}
|
- |
|
350 |
|
350 |
$formulaire_filtre .= 'de <input type="text" readonly size="10" name="date_debut" class="inputDate" id="date_debut" value="'.$defaut_debut.'" />';
|
351 |
$formulaire_filtre .= 'du <input type="text" readonly size="10" name="date_debut" class="inputDate" id="date_debut" value="'.$defaut_debut.'" />';
|
351 |
$formulaire_filtre .= ' à <input type="text" readonly size="10" name="date_fin" class="inputDate" id="date_fin" value="'.$defaut_fin.'" />';
|
352 |
$formulaire_filtre .= ' au <input type="text" readonly size="10" name="date_fin" class="inputDate" id="date_fin" value="'.$defaut_fin.'" />';
|
352 |
$formulaire_filtre .= "\n".'<script language="javascript" type="text/javascript">' ."\n".
|
353 |
$formulaire_filtre .= "\n".'<script language="javascript" type="text/javascript">' ."\n".
|
- |
|
354 |
'
|
- |
|
355 |
if (typeof(addListener) != \'function\') {
|
- |
|
356 |
// fonction portable pour ajout de listeners
|
- |
|
357 |
function addListener(element, baseName, handler)
|
- |
|
358 |
{
|
- |
|
359 |
if (element.addEventListener) {
|
- |
|
360 |
element.addEventListener(baseName, handler, false) ;
|
- |
|
361 |
} else if (element.attachEvent) {
|
- |
|
362 |
element.attachEvent(\'on\'+baseName, handler) ;
|
- |
|
363 |
}
|
- |
|
364 |
}
|
- |
|
365 |
}
|
- |
|
366 |
function verifDate()
|
- |
|
367 |
{
|
- |
|
368 |
if (document.getElementById("date_debut") != null && document.getElementById("date_fin") != null) {
|
- |
|
369 |
this.form.submit() ;
|
- |
|
370 |
}
|
- |
|
371 |
}
|
- |
|
372 |
var calDateFin = document.getElementById("date_fin") ;
|
- |
|
373 |
addListener(calDateFin,\'change\',verifDate) ;
|
- |
|
374 |
var calDateDeb = document.getElementById("date_debut") ;
|
- |
|
375 |
addListener(calDateDeb,\'change\',verifDate) ;
|
353 |
'$(document).ready(function() { $(\'#date_debut, #date_fin\').datepicker($.extend({}, $.datepicker.regional["fr-FR"],{
|
376 |
$(document).ready(function() { $(\'#date_debut, #date_fin\').datepicker($.extend({}, $.datepicker.regional["fr-FR"],{
|
354 |
dateFormat:\'dd-mm-yy\',
|
377 |
dateFormat:\'dd-mm-yy\',
|
355 |
buttonImage: "client/bazar/images/cal.png",
|
378 |
buttonImage: "client/bazar/images/cal.png",
|
356 |
showOn: "both",
|
379 |
showOn: "both",
|
357 |
beforeShow: customRange,
|
380 |
beforeShow: customRange,
|
358 |
buttonImageOnly: true'."\n".
|
381 |
buttonImageOnly: true'."\n".
|
359 |
'}));})' ."\n".
|
382 |
'}));})' ."\n".
|
360 |
'function customRange(input) { return {minDate: (input.id == "date_fin" ? $("#date_debut").datepicker("getDate") : null),
|
383 |
'function customRange(input) { return {minDate: (input.id == "date_fin" ? $("#date_debut").datepicker("getDate") : null),
|
361 |
maxDate: (input.id == "date_debut" ? $("#date_fin").datepicker("getDate") : null)};}' ."\n".
|
384 |
maxDate: (input.id == "date_debut" ? $("#date_fin").datepicker("getDate") : null)};}' ."\n".
|
362 |
'</script>';
|
385 |
'</script>';
|
- |
|
386 |
|
363 |
return $formulaire_filtre;
|
387 |
return $formulaire_filtre;
|
364 |
}
|
388 |
}
|
Line 365... |
Line 389... |
365 |
|
389 |
|
366 |
/** Renvoie le formulaire d un filtre
|
390 |
/** Renvoie le formulaire d un filtre
|