Source for file display.php
Documentation is available at display.php
* @package linea21.modules
* @subpackage yellowpages
* @author linea21 <info@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
include_once('../yellowpages/'. SQL. '.inc.php');
* DisplayUrlAddYellowpages()
* affichage d'ajout d'un organisation
$link_table= array('rub'=> $GLOBALS['links'][LANGUAGE]['directory-add']['linkvalue']);
$content= '<div class="nb_sujet_yp"> <a href="'. HrefMaker($link_table). '" title="'. $GLOBALS['lang']['yp']['add_public']. '">'. $GLOBALS['lang']['yp']['add_public']. '</a></div>'. END_LINE;
* DisplayListYellowPages()
* affichage de l'annuaire
$bdd_nb_yp= $result_nb_yp[0]['num_rows'];
if ($filter==- 1) $table_link= array('rub' => $GLOBALS['links'][LANGUAGE]['directory']['linkvalue']);
else $table_link= array('rub' => $GLOBALS['links'][LANGUAGE]['directory']['linkvalue'],'id' => $search, 'filter' => $filter);
$bdd_nb_yp_display = $bdd_nb_yp;
echo '<h1>'. $GLOBALS['lang']['yp']['list']. '</h1>'. END_LINE;
echo '<div class="h1_comment" id="h1_yellowpages">'. $GLOBALS['lang']['yp']['h1_public_comment']. '</div>';
for($i= 0; $i< count($result_yp); $i++ ) {
$link_table= array('rub'=> $GLOBALS['links'][LANGUAGE]['directory-detail']['linkvalue'],'id'=> $result_yp[$i]['yellowp_id'], 'name'=> $result_yp[$i]['yellowp_name']);
$link_table2= array('rub'=> $GLOBALS['links'][LANGUAGE]['directory']['linkvalue'],'filter'=> $GLOBALS['filters'][LANGUAGE]['theme']['linkvalue'],'id'=> $result_yp[$i]['sdtheme_id'], 'name'=> $result_yp[$i]['sdtheme_name']);
$yp_name= formatText($result_yp[$i]['yellowp_name'], '2HTML');
$yp_sdtheme= formatText($result_yp[$i]['sdtheme_name'], '2HTML');
$yp_theme= formatText($result_yp[$i]['theme_name'], '2HTML');
$content.= '<p> '. $GLOBALS['lang']['yp']['activity']. ' : '. $yp_activity. '</p>'. END_LINE;
$content.= '<p class="filter_info"> '. $GLOBALS['lang']['divers']['themeref']. ' : <a href="'. HrefMaker($link_table2). '" title="'. formatText($yp_sdtheme, '2ATT'). '" class="filter_info_theme">'. $yp_sdtheme. '</a>
'. $GLOBALS['lang']['divers']['sousthemeref']. ': <span class="filter_info_scale">'. $yp_theme. '</span>
$content.= '<p class="filter_info"> '. $GLOBALS['lang']['divers']['themeref']. ' : '. empty_nc($yp_sdtheme). ' <span>'. $GLOBALS['lang']['divers']['sousthemeref']. ': '. empty_nc($yp_sdtheme). '</span> </p>'. END_LINE;
$content.= '<p class="info"> '. $GLOBALS['lang']['yp']['noresult']. '</p>';
* affichage de la liste alphabétique
$content= '<div class="lienliste">'. END_LINE;
$content.= $GLOBALS['lang']['divers']['trialpha']. ' :';
for($i= 0; $i< count($result_alphabetical); $i++ ) {
$link_aff_classic= HrefMaker(array('rub'=> $GLOBALS['links'][LANGUAGE]['directory']['linkvalue'], 'filter'=> "alpha", 'id'=> $result_alphabetical[$i]['first_letter']));
if ($i== 0) $separator= "";
if ($result_alphabetical[$i]['first_letter']== strtoupper($filter_id))
$content.= $separator. ' <span>'. $result_alphabetical[$i]['first_letter']. '</span> '. END_LINE;
else $content.= $separator. ' <a href="'. $link_aff_classic. '" title="'. $result_alphabetical[$i]['first_letter']. '" >'. $result_alphabetical[$i]['first_letter']. '</a> '. END_LINE;
* DisplayOneYellowPages()
* affichage d'une organisation
$data= $GLOBALS['sql_object'] -> DBSelect(SQL_getdetyp($yp_id));
for($i= 0; $i< count($data); $i++ ) {
$link_table2= array('rub'=> $GLOBALS['links'][LANGUAGE]['directory']['linkvalue'],'filter'=> $GLOBALS['filters'][LANGUAGE]['theme']['linkvalue'],'id'=> $data[0]['sdtheme_id'], 'name'=> $data[0]['sdtheme_name']);
$yp_name= formatText($data[$i]['yellowp_name'], '2HTML');
$yp_sdtheme= formatText($data[0]['sdtheme_name'], '2HTML');
$yp_theme= formatText($data[0]['theme_name'], '2HTML');
$yp_street= formatText($data[0]['yellowp_street'], '2HTML');
$yp_postal_code= formatText($data[0]['yellowp_postal_code'], '2HTML');
$yp_city= formatText($data[0]['yellowp_city'], '2HTML');
$yp_phone= formatText($data[0]['yellowp_phone'], '2HTML');
$yp_fax= formatText($data[0]['yellowp_fax'], '2HTML');
$yp_email= formatText($data[0]['yellowp_email'], '2HTML');
$yp_website= formatText($data[0]['yellowp_website'], '2HTML');
$content.= '<h1>'. $yp_name. '</h1>'. END_LINE;
$content.= '<dl id="det_yp"><dt> '. $GLOBALS['lang']['yp']['adresse']. ' : </dt><dd>'. $yp_street. ' '. $yp_postal_code. ' '. $yp_city. '</dd>'. END_LINE;
$content.= '<dt> '. $GLOBALS['lang']['yp']['phone']. ' : </dt><dd>'. empty_nc($yp_phone). '</dd>'. END_LINE;
$content.= '<dt> '. $GLOBALS['lang']['yp']['fax']. ': </dt><dd>'. empty_nc($yp_fax). '</dd>'. END_LINE;
$content.= '<dt> '. $GLOBALS['lang']['yp']['email']. ' : </dt><dd><a href="mailto:'. $yp_email. '" title="'. formatText($yp_email, '2ATT'). '">'. $yp_email. '</a></dd>'. END_LINE;
if ($data[0]['yellowp_website']<> "") $content.= '<dt> '. $GLOBALS['lang']['yp']['website']. ' : </dt><dd><a href="'. $data[0]['yellowp_website']. '" title="'. formatText($yp_website, '2ATT'). '">'. $yp_website. '</a></dd>'. END_LINE;
else $content.= '<dt> '. $GLOBALS['lang']['yp']['website']. ' : </dt><dd>'. empty_nc($yp_website). '</dd>'. END_LINE;
$content.= '<dt> '. $GLOBALS['lang']['yp']['activity']. ' : </dt><dd>'. $yp_activity. '</dd>'. END_LINE;
$content.= '<dt> '. $GLOBALS['lang']['divers']['themeref']. ' : </dt><dd><a href="'. HrefMaker($link_table2). '" title="'. formatText($yp_sdtheme, '2ATT'). '">'. $yp_sdtheme. '</a>
</dd><dt> '. $GLOBALS['lang']['divers']['sousthemeref']. ': </dt><dd>'. $yp_theme. '
$content.= '<dt> '. $GLOBALS['lang']['divers']['themeref']. ' : </dt><dd>'. empty_nc($yp_sdtheme). ' </dd><dt>'. $GLOBALS['lang']['divers']['sousthemeref']. ': </dt><dd>'. empty_nc($yp_sdtheme). '</span> </dd>'. END_LINE;
$content.= '<p class="info">'. $GLOBALS['lang']['yp']['noresult']. '</p>';
* affichage confirmation de l'ajout
$link_table= array('rub'=> $GLOBALS['links'][LANGUAGE]['directory']['linkvalue']);
$content= '<p class="confirm">'. $GLOBALS['lang']['yp']['confirm_pub']. ' <a href="'. HrefMaker($link_table). '" title="'. formatText($GLOBALS['lang']['yp']['confirm_pub2'], '2ATT'). '" >'. $GLOBALS['lang']['yp']['confirm_pub2']. '</a>'. END_LINE;
* DisplayAddYellowPages()
* affichage formulaire d'ajout
include_once('../lib/input_helpers.php');
include_once('../class/class.yellowpages.php');
// testing $_POST['yp_name'] and not $_POST['valider'] because of OPERA bug
if(isset ($_POST['yp_name'])) {
$table[0]= $_POST['yp_name'];
$table[1]= $_POST['yp_activity'];
$table[2]= $_POST['yp_theme'];
$table[3]= $_POST['yp_street'];
$table[4]= $_POST['yp_postal_code'];
$table[5]= $_POST['yp_city'];
$table[7]= $_POST['yp_phone'];
$table[8]= $_POST['yp_fax'];
$table[9]= $_POST['yp_email'];
$table[10]= $_POST['yp_website'];
if($_SESSION['securityaction']!= md5($_POST['securitycode'])) {
$integrity= $GLOBALS['lang']['security']['message'];
if(!isset ($integrity)) $integrity= $yp_object->CheckDataIntegrity($table);
echo "<p class=\"error\">". $integrity. "</p>";
$form_name= formatText($_POST['yp_name'], '2FIELD');
$form_activity= formatText($_POST['yp_activity'], '2FIELD');
$form_theme= $_POST['yp_theme'];
$form_street= formatText($_POST['yp_street'], '2FIELD');
$form_postal_code= $_POST['yp_postal_code'];
$form_city= formatText($_POST['yp_city'], '2FIELD');
$form_phone= $_POST['yp_phone'];
$form_fax= $_POST['yp_fax'];
$form_email= formatText($_POST['yp_email'], '2FIELD');
$form_website= formatText($_POST['yp_website'], '2FIELD');
$result= $yp_object->AddYellowPages($table, $GLOBALS['sql_object']);
$link_confirm= HrefMaker(array('rub'=> $GLOBALS['links'][LANGUAGE]['directory']['linkvalue']));
if (!isset ($integrity) || is_string($integrity)) {
$form= '<h1>'. $GLOBALS['lang']['yp']['add_public']. '</h1>'. END_LINE;
$form.= '<div class="h1_comment" id="h1_yellowpages">'. $GLOBALS['lang']['yp']['h1_public_add']. '</div>';
$form.= '<form action="index.php" method="post">'. END_LINE;
$form.= '<p><label for="yp_name">'. $GLOBALS['lang']['yp']['name2']. '* : </label>'. END_LINE;
$form.= '<input type="text" maxlength="150" name="yp_name" id="yp_name" value="'. $form_name. '" class="textfield" /></p>'. END_LINE;
$form.= '<p><label for="yp_activity">'. $GLOBALS['lang']['yp']['activity']. ' * : </label>'. END_LINE;
$form.= '<input type="text" maxlength="255" name="yp_activity" id="yp_activity" value="'. $form_activity. '" class="textfield" /></p>'. END_LINE;
$form.= '<p><label for="yp_theme">'. $GLOBALS['lang']['yp']['theme']. ' : </label>'. END_LINE;
$form.= '<p><label for="yp_street">'. $GLOBALS['lang']['yp']['street']. ' * : </label>'. END_LINE;
$form.= '<input type="text" maxlength="200" class="textfield" name="yp_street" id="yp_street" value="'. $form_street. '" /></p>'. END_LINE;
$form.= '<p><label for="yp_postal_code">'. $GLOBALS['lang']['yp']['postal_code']. ' * : </label>'. END_LINE;
$form.= '<input type="text" maxlength="6" class="textfield" name="yp_postal_code" id="yp_postal_code" value="'. $form_postal_code. '" /></p>'. END_LINE;
$form.= '<p><label for="yp_city">'. $GLOBALS['lang']['yp']['city']. ' * : </label>'. END_LINE;
$form.= '<input type="text" maxlength="100" class="textfield" name="yp_city" id="yp_city" value="'. $form_city. '" /></p>'. END_LINE;
$form.= '<p><label for="yp_phone">'. $GLOBALS['lang']['yp']['phone']. ' : </label>'. END_LINE;
$form.= '<input type="text" maxlength="12" class="textfield" name="yp_phone" id="yp_phone" value="'. $form_phone. '" /></p>'. END_LINE;
$form.= '<p><label for="yp_fax">'. $GLOBALS['lang']['yp']['fax']. ' : </label>'. END_LINE;
$form.= '<input type="text" maxlength="12" class="textfield" name="yp_fax" id="yp_fax" value="'. $form_fax. '" /></p>'. END_LINE;
$form.= '<p><label for="yp_email">'. $GLOBALS['lang']['yp']['email']. ' * : </label>'. END_LINE;
$form.= '<input type="text" maxlength="150" class="textfield" name="yp_email" id="yp_email" value="'. $form_email. '" /></p>'. END_LINE;
$form.= '<p><label for="yp_website">'. $GLOBALS['lang']['yp']['website']. ' : </label>'. END_LINE;
$form.= '<input type="text" maxlength="150" class="textfield" name="yp_website" id="yp_website" value="'. $form_website. '" /></p>'. END_LINE;
$form.= '<span class="info">' . $GLOBALS['lang']['security']['info2'] . ' : </span>'. END_LINE;
$form.= '<img src="../lib/securitycode.php" alt="' . $GLOBALS['lang']['security']['info2'] . '" id="securityimg" />';
$form.= '<p><label for="securitycode" >' . $GLOBALS['lang']['antispam']['info'] . ' : </label>'. END_LINE;
$form.= '<input type="text" class="shorttextfield" id="securitycode" maxlength="5" name="securitycode" /></p> ';
$form.= '<input type="hidden" id="rub_yp" value="'. $GLOBALS['links'][LANGUAGE]['directory-add']['linkvalue']. '" name="rub" /> ';
$form.= '<input type="image" src="../gfx/' . THEME_PUBLIC. '/images/public/' . LANGUAGE. '/button_valid.gif" value="'. $GLOBALS['lang']['btn']['valid']. '" size="15" name="valider" id="valider" />'. END_LINE;
|