1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
if($_POST['sect'] != ""){
$cwhere = " where emploi_offre.ID_sect = ".$_POST['sect'];
}
if($_POST['fonc'] != ""){
if($cwhere != ""){
$cwhere = " and emploi_offre.ID_fonc = ".$_POST['fonc'];
}else{
$cwhere = " where emploi_offre.ID_sect = ".$_POST['fonc'];
}
}
if($_POST['zone'] != ""){
if($cwhere != ""){
$cwhere = " and emploi_zone_dep.ID_zone = ".$_POST['zone'];
}else{
$cwhere = " where emploi_zone_dep.ID_zone = ".$_POST['zone'];
}
}
$sql =
"select emploi_offre.ID,substring(emploi_offre.texte,1,50) as extrait,emploi_offre.ID_pharm,emploi_pharm.nom,"
."emploi_pharm.email,emploi_secteur.nom as nom_sect,emploi_fonction.nom as nom_fonc FROM emploi_offre "
."INNER JOIN emploi_pharm,emploi_secteur,emploi_fonction,emploi_zone_dep"
." ON emploi_offre.ID_pharm=emploi_pharm.ID and emploi_offre.ID_sect=emploi_secteur.ID "
."and emploi_offre.ID_fonc=emploi_fonction.ID and substring(emploi_pharm.cp,1,2)="
."emploi_zone_dep.departement ".$cwhere;
$req = mysql_query($sql); |