extranet/includes/recherche/recherche_annonces.php

209 lines
8.2 KiB
PHP
Raw Normal View History

2009-10-06 08:31:48 +00:00
<?php
if(isset($_REQUEST['submit']))
{
unset($_SESSION['recherchehisto']);
2009-10-14 10:06:17 +00:00
//Traitement historique
if($_REQUEST['formA']['histo']=='on')
{
$parametres = array( 'source', 'bodacc', 'histo', 'annee', 'dateparution', 'nparution', 'bpage', 'nannonce', 'txt');
}
else
{
if($_REQUEST['formA']['source']=='bodacc')
{
$parametres = array( 'source', 'bodacc', 'histo', 'annee', 'dateparution', 'nparution', 'bpage', 'nannonce');
}
elseif($_REQUEST['formA']['source']=='asso')
{
$parametres = array( 'source', 'bodacc', 'annee', 'dateparution', 'nparution', 'bpage', 'nannonce');
}
elseif($_REQUEST['formA']['source']=='balo')
{
$parametres = array( 'source', 'bodacc', 'annee', 'dateparution', 'nparution', 'bpage', 'naffaire');
}
}
foreach($parametres as $param)
{
if( isset($_REQUEST['formA'][$param]) )
{
$_SESSION['recherchehisto'][$param] = $_REQUEST['formA'][$param];
2009-10-14 10:06:17 +00:00
}
2009-10-06 08:31:48 +00:00
}
2009-10-09 13:26:57 +00:00
header("Location: ./index.php?page=recherche&vue=annoncelist");
exit;
2009-10-06 08:31:48 +00:00
}
?>
<script type="text/javascript">
function formSource(source)
{
var fields = Array( 'bodacc', 'histo', 'date', 'nparution', 'fpage', 'nannonce', 'naffaire', 'txt' );
2009-10-06 08:31:48 +00:00
switch(source)
{
case 'asso':
var field_actif = new Array('date', 'nparution', 'fpage', 'nannonce');
2009-10-06 08:31:48 +00:00
break;
case 'bodacc':
var field_actif = new Array('bodacc', 'histo', 'date', 'nparution', 'fpage', 'nannonce');
2009-10-06 08:31:48 +00:00
break;
case 'balo':
var field_actif = new Array('date', 'nparution', 'fpage', 'naffaire');
break;
2009-10-06 08:31:48 +00:00
}
for (var i=0;i<fields.length;i++) { $('#'+fields[i]).css('display', 'none') }
for (var i=0;i<field_actif.length;i++){ $('#'+field_actif[i]).css('display', 'block') }
2009-10-06 08:31:48 +00:00
}
$(document).ready(function()
{
2009-10-09 13:26:57 +00:00
//Init
formSource($('select[name=formA[source]]').val());
if($('input[type=checkbox][name=formA[histo]]').attr('checked')== true){ $('#txt').css('display','block');
}else{ $('#txt').css('display','none'); }
2009-10-06 08:31:48 +00:00
//Evenement
$('#datepicker').datepicker($.datepicker.regional['fr']);
$('select[name=formA[source]]').change(function(){ formSource($(this).val()); });
2009-10-09 13:26:57 +00:00
$('input[type=checkbox][name=formA[histo]]').click(function(){
if($(this).attr('checked')== true){ $('#txt').css('display','block');
}else{ $('#txt').css('display','none'); }
});
2009-10-06 08:31:48 +00:00
2009-10-09 13:26:57 +00:00
$('#deselectBodacc').click(function(){
$('input[type=radio][name=formA[bodacc]]').each(function(){
$(this).attr('checked', false);
});
2009-10-06 08:31:48 +00:00
});
2009-10-06 08:31:48 +00:00
});
</script>
2010-01-22 08:58:39 +00:00
<link rel="stylesheet" type="text/css" href="css/jquery-ui.css"/>
2009-10-06 08:31:48 +00:00
<style type="text/css">
.infoTitle {clear:both; float:left; width:180px; margin-left:30px; padding:0 10px 0 0;}
.infoData {float:left; width:320px; margin:2px 0;}
form { }
2009-10-06 08:31:48 +00:00
form em { color:#FF0000;}
fieldset {border:0; margin:0; padding:0;}
fieldset legend{ padding:0 0 0 10px;}
.fieldgrp{clear:both; width:100%; margin-bottom:.5em; overflow:hidden;}
.fieldgrp:after{content:"."; display:block; clear:both; visibility:hidden; line-height:0; height:0; }
2009-10-09 13:26:57 +00:00
.fieldgrp label{ width:150px; font-weight:bold; margin-left:30px; clear:both; padding:0 10px 0 0; line-height:22px; _padding-top:3px; float:left; display:block; font-size:108%;}
.fieldgrp label.inline{ clear:none; margin:0; float:left; display:block; width:auto;}
2009-10-06 08:31:48 +00:00
.fieldgrp label span{font-weight:normal;}
.fieldgrp label abbr{color:#4B911C; font-size:120%; vertical-align:middle;}
.fieldgrp p { clear:both; margin:0 0 0 30px; font-size:12px; }
.field { float:left; padding:0 10px 0 0; line-height:22px; _padding-top:3px;}
.field .longfield{width:215px;}
.field .longfield-select{width:220px;}
.field .smallfield{width:95px;}
.field .medfield{width:110px;}
2009-10-09 13:26:57 +00:00
.field input, .field select{ font-size:110%; margin:2px 0; }
.field input.radio { margin:0 5px; vertical-align:middle; border:none; }
.field input.checkbox { border:none; }
.field span { margin-left:10px; }
2009-10-06 08:31:48 +00:00
div.submit{ width:100%; text-align:center; }
.noborder {border:none;}
</style>
<div id="center">
<h1>Rechercher une annonce</h1>
<form name="annonces" method="post" action="./index.php?page=recherche&vue=annonce">
<input type="hidden" name="formA[type]" value="annonces"/>
<div class="fieldgrp">
<label for="source">Source</label>
<div class="field">
<select name="formA[source]">
2009-10-09 13:26:57 +00:00
<option value="bodacc" <?=(isset($_SESSION['recherchehisto']['source']) && $_SESSION['recherchehisto']['source']=='bodacc')? 'selected' : ''?>>BODACC / BORC</option>
<option value="asso" <?=(isset($_SESSION['recherchehisto']['source']) && $_SESSION['recherchehisto']['source']=='asso')? 'selected' : ''?>>JO Association</option>
<option value="balo" <?=(isset($_SESSION['recherchehisto']['source']) && $_SESSION['recherchehisto']['source']=='balo')? 'selected' : ''?>>BALO</option>
2009-10-06 08:31:48 +00:00
</select>
</div>
</div>
<div id="bodacc" class="fieldgrp">
<label for="bodacc">Bodacc</label>
<div class="field">
2009-10-09 13:26:57 +00:00
<span><input class="radio" type="radio" name="formA[bodacc]" value="a" <?=(isset($_SESSION['recherchehisto']['bodacc']) && $_SESSION['recherchehisto']['bodacc']=='a')? 'checked' : ''?>/>A</span>
<span><input class="radio" type="radio" name="formA[bodacc]" value="b" <?=(isset($_SESSION['recherchehisto']['bodacc']) && $_SESSION['recherchehisto']['bodacc']=='b')? 'checked' : ''?>/>B</span>
<span><input class="radio" type="radio" name="formA[bodacc]" value="c" <?=(isset($_SESSION['recherchehisto']['bodacc']) && $_SESSION['recherchehisto']['bodacc']=='c')? 'checked' : ''?>/>C</span>
<span><a href="#" id="deselectBodacc">Désélection</a></span>
2009-10-06 08:31:48 +00:00
</div>
</div>
<div id="histo" class="fieldgrp">
<label for="histo">Historique jusqu'à 1953</label>
2009-10-06 08:31:48 +00:00
<div class="field">
2009-10-09 13:26:57 +00:00
<input class="checkbox" type="checkbox" name="formA[histo]" <?=(isset($_SESSION['recherchehisto']['histo']) && $_SESSION['recherchehisto']['histo']=='on')? 'checked' : ''?>/>
2009-10-06 08:31:48 +00:00
</div>
</div>
<div id="date" class="fieldgrp">
<label for="annee">Année</label>
2009-10-06 08:31:48 +00:00
<div class="field">
2009-10-09 13:26:57 +00:00
<input type="text" name="formA[annee]" size="4" maxlength="4" value="<?=$_SESSION['recherchehisto']['annee']?>"/>
2009-10-06 08:31:48 +00:00
</div>
<label class="inline" for="dateparution">ou Date de parution</label>
<div class="field">
2009-10-14 10:06:17 +00:00
<input id="datepicker" type="text" name="formA[dateparution]" size="10" maxlength="10" value="<?=$_SESSION['recherchehisto']['dateparution']?>"/>
2009-10-06 08:31:48 +00:00
</div>
</div>
<div id="nparution" class="fieldgrp">
<label for="nparution">Numéro de parution</label>
2009-10-06 08:31:48 +00:00
<div class="field">
2009-10-14 10:06:17 +00:00
<input type="text" name="formA[nparution]" size="10" maxlength="10" value="<?=$_SESSION['recherchehisto']['nparution']?>"/>
2009-10-06 08:31:48 +00:00
</div>
</div>
<div id="fpage" class="fieldgrp">
2009-10-06 08:31:48 +00:00
<label for="page">Page</label>
<div class="field">
2009-10-14 10:06:17 +00:00
<input type="text" name="formA[bpage]" size="10" maxlength="10" value="<?=$_SESSION['recherchehisto']['bpage']?>"/>
2009-10-06 08:31:48 +00:00
</div>
</div>
<div id="nannonce" class="fieldgrp">
<label for="nannonce">Numéro d'annonce</label>
2009-10-06 08:31:48 +00:00
<div class="field">
2009-10-14 10:06:17 +00:00
<input type="text" name="formA[nannonce]" size="10" maxlength="10" value="<?=$_SESSION['recherchehisto']['nannonce']?>"/>
2009-10-06 08:31:48 +00:00
</div>
</div>
<div id="naffaire" class="fieldgrp">
<label for="naffaire">Numéro d'affaire</label>
2009-10-06 08:31:48 +00:00
<div class="field">
2009-10-14 10:06:17 +00:00
<input type="text" name="formA[naffaire]" size="10" maxlength="10" value="<?=$_SESSION['recherchehisto']['naffaire']?>"/>
2009-10-06 08:31:48 +00:00
</div>
</div>
<div id="txt" class="fieldgrp">
<label for="txt">Recherche</label>
<div class="field">
<input type="text" name="formA[txt]" size="55" maxlength="2048" value="<?
if (isset($_SESSION['recherchehisto']) == true) {
print htmlspecialchars($_SESSION['recherchehisto']['txt']);
}
?>"/>
2009-10-06 08:31:48 +00:00
</div>
<p>
<b><u>Attention :</u></b>
Ce formulaire de recherche permet de rechercher dans les pages entières du BORC, BODAC et BODACC telles qu'elles ont été numérisées par Scores & Décisions.
Cette recherche permet de rechercher des annonces dans des pages jusqu'à l'année de parution <b>1953</b>.
2009-10-06 08:31:48 +00:00
</p>
<p>&nbsp;</p>
<p><u>Opérateurs et méthodes de recherche :</u></p>
<p>Opérateur OU, <b>|</b> (ex: <b>societe | ville</b>)</p>
<p>Exclure des termes, <b>-</b> ou <b>!</b> (ex: <b>societe -ville</b> ou <b>societe !ville</b>)</p>
2009-10-06 08:31:48 +00:00
<p>Phrase (ex: <b>"boulangerie dupain"</b>)</p>
<p>Recherche de proximité (ex: <b>"boulangerie plantes"$50</b> , recherche d'une boulangerie dans rue des plantes )</p>
2009-10-06 08:31:48 +00:00
<p>Ordre de recherche (ex: <b>boulangerie << dupain</b> , recherche du mot "boulangerie" puis du mot "dupain") </p>
</div>
<div class="submit"><input type="submit" name="submit" value="Ok"/></div>
</form>
</div>