69,10 → 69,10 |
} |
|
|
/** baz_voir_fiche() - Permet de visualiser en détail une fiche au format XHTML |
/** baz_voir_fiche() - Permet de visualiser en detail une fiche au format XHTML |
* |
* @global boolean Rajoute des informations internes à l'application (date de modification, lien vers la page de départ de l'appli) si à 1 |
* @global integer Identifiant de la fiche à afficher |
* @global boolean Rajoute des informations internes a l'application (date de modification, lien vers la page de départ de l'appli) si a 1 |
* @global integer Identifiant de la fiche a afficher |
* |
* @return string HTML |
*/ |
79,14 → 79,30 |
function baz_voir_fiche($danslappli, $idfiche='') { |
$res=''; |
if (isset($_GET['id_fiche'])) $GLOBALS['_BAZAR_']['id_fiche']=$_GET['id_fiche']; |
if ($idfiche!='') $GLOBALS['_BAZAR_']['id_fiche']=$idfiche; |
|
if ($idfiche!='') $GLOBALS['_BAZAR_']['id_fiche']=$idfiche; |
$url= $GLOBALS['_BAZAR_']['url']; |
$url->addQueryString('action', BAZ_VOIR_FICHE); |
$url->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
$url = preg_replace ('/&/', '&', $url->getURL()) ; |
|
//cas ou un commentaire a été entré |
//cas ou la fiche a été validee |
if (isset($_GET['publiee'])) { |
publier_fiche($_GET['publiee']); |
} |
|
//cas on une structure s'approprie une ressource |
if (isset($_GET['appropriation'])) { |
if ($_GET['appropriation']==1) { |
$requete = 'INSERT INTO bazar_appropriation VALUES ('.$GLOBALS['_BAZAR_']['id_fiche'].', '.$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID).')'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
} |
elseif ($_GET['appropriation']==0) { |
$requete = 'DELETE FROM bazar_appropriation WHERE ba_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' AND ba_ce_id_structure='.$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID); |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
} |
} |
|
//cas ou un commentaire a été entre |
if (isset($_POST['Nom'])) { |
$requete = 'INSERT INTO bazar_commentaires VALUES ('. |
baz_nextid('bazar_commentaires', 'bc_id_commentaire', $GLOBALS['_BAZAR_']['db']). |
131,12 → 147,9 |
} |
//affiche le texte sinon |
else { |
$res .= '<h1 class="BAZ_titre">'.$GLOBALS['_BAZAR_']['typeannonce'].'</h1>'."\n"; |
$res .= '<h2 class="BAZ_titre">'.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n"; |
} |
$res .= '<div class="BAZ_cadre_fiche">'."\n"; |
$res .= '<div class="BAZ_cadre_fiche_haut">'."\n"; |
$res .= ' </div>'."\n"; |
$res .= '<div class="BAZ_cadre_fiche_corps">'."\n"; |
$requete = 'SELECT * FROM bazar_fiche WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError ($resultat)) { |
154,7 → 167,7 |
//cas d'une image personalisée |
if (isset($ligne['bf_url_image'])) { |
$res .= '<div id="fiche_image">'."\n"; |
$res .= '<img src="client/bazar/images/'.$ligne['bf_url_image'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" width="130" height="130" />'."\n"; |
$res .= '<img src="client/bazar/upload/'.$ligne['bf_url_image'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" width="130" height="130" />'."\n"; |
$res .= '</div>'."\n"; |
} |
//cas d'une image par défaut |
167,7 → 180,7 |
$res .= '<div id="BAZ_description">'.$ligne['bf_description'].'</div>'."\n"; |
$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['template']); |
for ($i=0; $i<count($tableau); $i++) { |
if (isset($ligne[$tableau[$i]['nom_bdd']])) { |
if (isset($ligne[$tableau[$i]['nom_bdd']]) && ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' ) ) { |
$val=$tableau[$i]['nom_bdd']; |
if (!in_array($val, array ('bf_titre', 'bf_description', 'bf_date_debut_validite_fiche', |
'bf_date_fin_validite_fiche'))) { |
177,7 → 190,7 |
} |
} |
} |
elseif (($tableau[$i]['type']=='liste')or($tableau[$i]['type']=='checkbox')) { |
elseif ( $tableau[$i]['type']=='liste' || $tableau[$i]['type']=='checkbox' ) { |
//pour les champs renseignes par une liste, on va chercher le label de la liste, plutot que l'id |
$requete = 'SELECT blv_label FROM bazar_fiche_valeur_liste, bazar_liste_valeurs WHERE bfvl_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche']. |
' AND bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND bfvl_valeur=blv_valeur AND blv_ce_liste='.$tableau[$i]['nom_bdd'].' AND blv_ce_i18n="'.$GLOBALS['_BAZAR_']['langue'].'"'; |
222,7 → 235,7 |
$res .= '<span class="description">'."\n"; |
$res .= '<ul>'."\n"; |
while ($ligne2 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$res .= '<li><a href="http://'.$_SERVER['HTTP_HOST'].'/client/bazar/upload/'.$ligne2['bfj_fichier'].'">'.$ligne2['bfj_description'].'</a></li>'."\n"; |
$res .= '<li><a href="client/bazar/upload/'.$ligne2['bfj_fichier'].'">'.$ligne2['bfj_description'].'</a></li>'."\n"; |
} |
$res .= '</ul></span>'."\n"; |
} |
246,78 → 259,94 |
} |
|
//informations complementaires (id fiche, etat publication,... ) |
if ($danslappli==1) { |
$res .= '<span class="rubrique">'.BAZ_NUM_FICHE.':</span> '.$GLOBALS['_BAZAR_']['id_fiche'].'<br />'."\n"; |
if ($ligne['bf_statut_fiche']==1) { |
if ($danslappli==1) { |
if ($ligne['bf_statut_fiche']==1 && $GLOBALS['_BAZAR_']['appropriation']!=1 ) { |
$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_DU.' '.strftime('%d.%m.%Y',strtotime($ligne['bf_date_debut_validite_fiche'])).' '.BAZ_AU.' '.strftime('%d.%m.%Y',strtotime($ligne['bf_date_fin_validite_fiche'])).'<br />'."\n"; |
} |
else { |
$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_NON.'<br />'."\n"; |
elseif ($GLOBALS['_BAZAR_']['appropriation']!=1 || $ligne['bf_statut_fiche']!=1) { |
$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_NON; |
if ( $est_admin ) { |
$res .= ' <strong>'.BAZ_VALIDER_PUBLICATION.' : </strong>'."\n"; |
$lien_publie = &$GLOBALS['_BAZAR_']['url']; |
$lien_publie->addQueryString('action', BAZ_VOIR_FICHE); |
$lien_publie->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
$lien_publie->addQueryString('typeannonce', $ligne['bf_ce_nature']); |
$lien_publie->addQueryString('publiee', 1); |
$res .= '<a href="'.$lien_publie->getURL().'">'.BAZ_OUI.'</a> / '; |
$lien_publie->removeQueryString('publiee'); |
$lien_publie->addQueryString('publiee', 0); |
$res .='<a href="'.$lien_publie->getURL().'">'.BAZ_NON.'</a>'."\n"; |
$lien_publie->removeQueryString('publiee'); |
} |
$res .= '<br />'."\n"; |
} |
$res .= '<span class="rubrique">'.BAZ_DATE_CREATION.' :</span> '.strftime('%d.%m.%Y à %H:%M',strtotime($ligne['bf_date_creation_fiche'])).'<br />'."\n"; |
$res .= '<span class="rubrique">'.BAZ_DATE_MAJ.' :</span> '.strftime('%d.%m.%Y à %H:%M',strtotime($ligne['bf_date_maj_fiche'])).'<br />'."\n"; |
|
if ($est_admin or |
$GLOBALS['_BAZAR_']['annonceur']==$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)) { |
//affichage des infos pouvant interesser les admins |
if ( $est_admin ) { |
$res .= '<span class="rubrique">'.BAZ_NUM_FICHE.':</span> '.$GLOBALS['_BAZAR_']['id_fiche'].'<br />'."\n"; |
$res .= '<span class="rubrique">'.BAZ_DATE_CREATION.' :</span> '.strftime('%d.%m.%Y à %H:%M',strtotime($ligne['bf_date_creation_fiche'])).'<br />'."\n"; |
} |
//affichage des infos et du lien pour la mise a jour de la fiche |
if ( $est_admin || $GLOBALS['_BAZAR_']['annonceur']==$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID) ) { |
$res .= '<span class="rubrique">'.BAZ_DATE_MAJ.' :</span> '.strftime('%d.%m.%Y à %H:%M',strtotime($ligne['bf_date_maj_fiche']))."\n"; |
$lien_modifier=$GLOBALS['_BAZAR_']['url']; |
$lien_modifier->addQueryString('action', BAZ_ACTION_MODIFIER); |
$lien_modifier->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
$lien_modifier->addQueryString('typeannonce', $ligne['bf_ce_nature']); |
$res .= ' <a href="'.$lien_modifier->getURL().'">'.BAZ_MODIFIER_LA_FICHE.'</a>'."\n"; |
$res .= ' <a href="'.$lien_modifier->getURL().'">'.BAZ_MODIFIER_LA_FICHE.'</a>'."\n"; |
} |
} |
$res .= '</div>'."\n"; |
$res .= '</div>'."\n"; |
$res .= '<div class="BAZ_cadre_fiche_bas"> </div>'."\n"; |
$res .= '</div>'."\n"; |
|
//on ajoute les appropriations, s'il le faut |
if (($danslappli==1)and($GLOBALS['_BAZAR_']['appropriation']==1)) { |
$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche">'."\n"; |
$res .= '<div class="BAZ_cadre_fiche_haut"> </div>'."\n"; |
$res .= '<div class="BAZ_cadre_fiche_corps">'."\n"; |
$res .= '<h3>'.BAZ_LES_STRUCTURES_POSSEDANT_UNE_RESSOURCE.'</h3>'."\n"; |
|
$res .= '<h3>'.BAZ_LES_STRUCTURES_POSSEDANT_UNE_RESSOURCE.'</h3>'."\n"; |
$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.' FROM bazar_appropriation,'.BAZ_ANNUAIRE.' WHERE ba_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' AND ba_ce_id_structure='.BAZ_CHAMPS_ID.' ORDER BY '.BAZ_CHAMPS_NOM.' ASC'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError ($resultat)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
$possede_ressource=0; |
if ($resultat->numRows()>0) { |
$res .= BAZ_IL_Y_A.$resultat->numRows().' '; |
if ($resultat->numRows()==1) $res .= BAZ_COMMENTAIRE.'<br />'."\n"; |
else $res .= BAZ_COMMENTAIRES.'<br />'."\n"; |
if ($resultat->numRows()==1) $res .= BAZ_STRUCTURE_POSSEDANT.'<br />'."\n"; |
else $res .= BAZ_STRUCTURES_POSSEDANT.'<br />'."\n"; |
$res .= '<ul>'."\n"; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$res .= '<div class="bulle_haut"> </div>'."\n"; |
$res .= '<div class="bulle_corps">'."\n"; |
//affichage du commentaire |
$res .= $ligne['bc_commentaire'].'<br />'."\n"; |
$res .= '</div>'."\n"; |
$res .= '<div class="bulle_bas">'."\n"; |
$res .= '<div style="font-size:9px;margin-left:10px;">'.BAZ_PAR.' : <strong>'.$ligne['bc_nom'].'</strong>'.BAZ_ECRIT_LE.$ligne['bc_date'].'</div>'."\n"; |
//pour les identifiés seulement, administrateurs de la rubrique ou superadmins |
if ($est_admin==1) { |
$url_comment= $GLOBALS['_BAZAR_']['url']; |
$url_comment->addQueryString('action', BAZ_VOIR_FICHE); |
$url_comment->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
$url_comment->addQueryString('id_commentaire', $ligne['bc_id_commentaire']); |
$res .= '<a href="'.$url_comment->getURL().'" style="font-size:9px;float:right;">'.BAZ_SUPPRIMER.'</a>'."\n"; |
} |
$res .= '</div>'."\n"; |
$res .= '<li><a href="'.BAZ_URL_ANNUAIRE.'&voir_fiche='.$ligne[BAZ_CHAMPS_ID].'" onclick="javascript:window.open(this.href);return false;">'.$ligne[BAZ_CHAMPS_NOM].'</a></li>'."\n"; |
if ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)==$ligne[BAZ_CHAMPS_ID]) $possede_ressource=1; |
} |
$res .= '</ul><br />'."\n"; |
} |
else $res .= BAZ_PAS_D_APPROPRIATION.'<br /><br />'."\n"; |
|
$res .='<p class="bulle_corps">'."\n"; |
$lien_appropriation = $GLOBALS['_BAZAR_']['url']; |
$lien_appropriation->addQueryString('action', BAZ_VOIR_FICHE); |
$lien_appropriation->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
if ($possede_ressource) { |
$lien_appropriation->addQueryString('appropriation', 0); |
$res .= BAZ_POSSEDE_DEJA_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_VOUS_ENLEVER.'</a>'."\n"; |
$lien_appropriation->removeQueryString('appropriation'); |
} |
elseif ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) { |
$lien_appropriation->addQueryString('appropriation', 1); |
$res .= BAZ_SI_POSSEDE_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_APPARAITRE.'</a>'."\n"; |
$lien_appropriation->removeQueryString('appropriation'); |
} |
elseif ($GLOBALS['AUTH']->getAuth() && !$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) { |
$res .= BAZ_IL_FAUT_ETRE_STRUCTURE."\n"; |
} |
elseif (!$GLOBALS['AUTH']->getAuth()) { |
$res .= BAZ_IL_FAUT_ETRE_IDENTIFIE_STRUCTURE."\n"; |
} |
$res .='</p>'."\n"; |
$res .= '</div>'."\n"; |
$res .= '<div class="BAZ_cadre_fiche_bas"> </div>'."\n"; |
$res .= '</div>'."\n"; |
} |
|
//on ajoute les commentaires, s'il le faut |
if (($danslappli==1)and($GLOBALS['_BAZAR_']['commentaire']==1)) { |
$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche">'."\n"; |
$res .= '<div class="BAZ_cadre_fiche_haut"> </div>'."\n"; |
$res .= '<div class="BAZ_cadre_fiche_corps">'."\n"; |
$res .= '<h3>'.BAZ_LES_COMMENTAIRES.'</h3>'."\n"; |
$requete = 'SELECT * FROM bazar_commentaires WHERE bc_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' ORDER BY bc_date ASC'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
336,7 → 365,7 |
$res .= '</div>'."\n"; |
$res .= '<div class="bulle_bas">'."\n"; |
$res .= '<div style="font-size:9px;margin-left:10px;">'.BAZ_PAR.' : <strong>'.$ligne['bc_nom'].'</strong>'.BAZ_ECRIT_LE.$ligne['bc_date'].'</div>'."\n"; |
//pour les identifiés seulement, administrateurs de la rubrique ou superadmins |
//pour les identifies seulement, administrateurs de la rubrique ou superadmins |
if ($est_admin==1) { |
$url_comment= $GLOBALS['_BAZAR_']['url']; |
$url_comment->addQueryString('action', BAZ_VOIR_FICHE); |
350,26 → 379,26 |
else $res .= BAZ_PAS_DE_COMMENTAIRES.'<br /><br />'."\n"; |
|
//formulaire des commentaires |
$form_commentaire = new HTML_QuickForm('commentaire', 'post', $url); |
$form_commentaire = new HTML_QuickForm('bazar_commentaire', 'post', $url); |
$squelette =& $form_commentaire->defaultRenderer(); |
$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n"); |
$squelette->setElementTemplate( '<label style="width:200px;">{label} </label><br />'."\n".'{element}<br />'."\n"); |
$squelette->setRequiredNoteTemplate("\n".'{requiredNote} '."\n"); |
$option=array('style'=>'width:300px;', 'maxlength'=>100); |
$squelette->setElementTemplate( '<label style="width:200px;">{label}'. |
'<!-- BEGIN required --><span class="symbole_obligatoire"> *</span><!-- END required -->'."\n". |
'</label><br />'."\n".'{element}<br />'."\n"); |
$squelette->setRequiredNoteTemplate("\n".'<span class="symbole_obligatoire"> *{requiredNote}</span>'."\n"); |
$option=array('style'=>'width:300px;border:1px solid #000;', 'maxlength'=>100); |
$form_commentaire->addElement('text', 'Nom', BAZ_ENTREZ_VOTRE_NOM, $option); |
$option=array('style'=>'width:100%;height:100px;white-space: pre;padding:3px;'); |
$option=array('style'=>'width:95%;height:100px;white-space: pre;padding:3px;border:1px solid #000;'); |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/textarea.php'; |
$formtexte= new HTML_QuickForm_textarea('Commentaire', BAZ_ENTREZ_VOTRE_COMMENTAIRE, $option); |
$form_commentaire->addElement($formtexte) ; |
$form_commentaire->addElement('submit', 'Envoyer', BAZ_ENVOYER); |
$option=array('style'=>'border:1px solid #000;'); |
$form_commentaire->addElement('submit', 'Envoyer', BAZ_ENVOYER, $option); |
$form_commentaire->addRule('Nom', BAZ_NOM_REQUIS, 'required', '', 'client') ; |
$form_commentaire->addRule('Commentaire', BAZ_COMMENTAIRE_REQUIS, 'required', '', 'client') ; |
$form_commentaire->setRequiredNote(BAZ_CHAMPS_REQUIS) ; |
$res .= $form_commentaire->toHTML(); |
|
$res .= '</div>'."\n"; |
$res .= '<div class="BAZ_cadre_fiche_bas"> </div>'."\n"; |
$res .= '</div>'."\n"; |
} |
|
return $res ; |
497,7 → 526,7 |
BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ; |
if (DB::isError($resultat)) { |
echo ($resultat->getMessage().$resultat->getDebugInfo()) ; |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC); |
$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')'; |
654,34 → 683,34 |
|
//option cachee pour savoir si le formulaire a ete appele deja |
$formtemplate->addElement('hidden', 'recherche_effectuee', 1) ; |
|
// Ajout des options si un type de fiche a ete choisie |
if (isset($_POST['nature']) || isset($GLOBALS['_BAZAR_']['categorie_nature'])) { |
if ($GLOBALS['_BAZAR_']['categorie_nature'] != '') { |
$champs_requete = 'bn_ce_id_menu' ; |
$_POST['nature'] = $GLOBALS['_BAZAR_']['categorie_nature']; |
} else { |
$champs_requete = 'bn_id_nature' ; |
} |
// Récupération du template |
$requete = 'select bn_template from bazar_nature where '.$champs_requete.'='.$_POST['nature']; |
$resultat = $GLOBALS['_BAZAR_']['db']->getOne($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
|
$tableau = baz_valeurs_template($resultat) ; |
|
for ($i=0; $i<count($tableau); $i++) { |
if (($tableau[$i]['type'] == 'liste' || $tableau[$i]['type'] == 'checkbox') && $tableau[$i]['recherche'] == 1) { |
if ($tableau[$i]['type'] == 'checkbox') { |
$formtemplate->addElement ('html', '<br />'.$tableau[$i]['label'].'<br />') ; |
} |
$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'], |
$tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire']) ; |
} |
} |
} |
// |
// // Ajout des options si un type de fiche a ete choisie |
// if (isset($_POST['nature']) || isset($GLOBALS['_BAZAR_']['categorie_nature'])) { |
// if ($GLOBALS['_BAZAR_']['categorie_nature'] != '') { |
// $champs_requete = 'bn_ce_id_menu' ; |
// $_POST['nature'] = $GLOBALS['_BAZAR_']['categorie_nature']; |
// } else { |
// $champs_requete = 'bn_id_nature' ; |
// } |
// // Récupération du template |
// $requete = 'select bn_template from bazar_nature where '.$champs_requete.'='.$_POST['nature']; |
// $resultat = $GLOBALS['_BAZAR_']['db']->getOne($requete) ; |
// if (DB::isError($resultat)) { |
// die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
// } |
// |
// $tableau = baz_valeurs_template($resultat) ; |
// |
// for ($i=0; $i<count($tableau); $i++) { |
// if (($tableau[$i]['type'] == 'liste' || $tableau[$i]['type'] == 'checkbox') && $tableau[$i]['recherche'] == 1) { |
// if ($tableau[$i]['type'] == 'checkbox') { |
// $formtemplate->addElement ('html', '<br />'.$tableau[$i]['label'].'<br />') ; |
// } |
// $tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'], |
// $tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire']) ; |
// } |
// } |
// } |
//Bouton de validation du formulaire |
$option=array('style'=>'border:1px solid #000;width:80px;font:12px Myriad, Arial, sans-serif;'); |
$bouton[] = &HTML_QuickForm::createElement('submit', 'rechercher', BAZ_RECHERCHER, $option); |
696,28 → 725,27 |
$requeteWhere = '' ; |
$requeteWhereListe = '' ; |
|
for ($i = 0; $i < count ($tableau); $i++) { |
if ($tableau[$i]['type'] == 'checkbox' || $tableau[$i]['type'] == 'liste') { |
$nom_liste = $tableau[$i]['type'].$tableau[$i]['nom_bdd'] ; |
|
if (is_array($_POST[$nom_liste])) { |
foreach ($_POST[$nom_liste] as $cle =>$valeur) { |
echo $valeur ; |
if ($valeur == 1) { |
$case_coche = true ; |
$requeteWhereListe .= ' AND bfvl_ce_liste='.$tableau[$i]['nom_bdd'] ; // Numéro de la liste |
|
} |
} |
} |
} |
} |
if ($case_coche) { |
$requeteFrom = ', bazar_fiche_valeur_liste ' ; |
$requeteWhereListe .= ' AND bfvl_valeur IN ()' ; |
$requeteWhere = ' bfvl_ce_fiche=bf_id_fiche'.$requeteWhereListe; |
} |
|
// for ($i = 0; $i < count ($tableau); $i++) { |
// if ($tableau[$i]['type'] == 'checkbox' || $tableau[$i]['type'] == 'liste') { |
// $nom_liste = $tableau[$i]['type'].$tableau[$i]['nom_bdd'] ; |
// |
// if (is_array($_POST[$nom_liste])) { |
// foreach ($_POST[$nom_liste] as $cle =>$valeur) { |
// if ($valeur == 1) { |
// $case_coche = true ; |
// $requeteWhereListe .= ' AND bfvl_ce_liste='.$tableau[$i]['nom_bdd'] ; // Numéro de la liste |
// |
// } |
// } |
// } |
// } |
// } |
// if ($case_coche) { |
// $requeteFrom = ', bazar_fiche_valeur_liste ' ; |
// $requeteWhereListe .= ' AND bfvl_valeur IN ()' ; |
// $requeteWhere = ' bfvl_ce_fiche=bf_id_fiche'.$requeteWhereListe; |
// } |
// |
//affichage des resultats de la recherche si le formulaire a ete envoye |
$requeteSQL=''; |
if (isset($_REQUEST['recherche_effectuee'])) { |