* @version $Id$ * @access public * @license http://opensource.org/licenses/gpl-3.0.html */ include_once(override('../yellowpages/'.SQL.'.inc.php')); /** * DisplayUrlAddYellowpages() * @return * affichage d'ajout d'un organisation **/ if(!function_exists('DisplayUrlAddYellowpages')) { function DisplayUrlAddYellowpages() { $link_table= array('rub'=> $GLOBALS['links'][U_L]['directory-add']['linkvalue']); $content=''._t('yp','add_public').''.PHP_EOL; echo $content; } } /** * DisplayListYellowPages() * affichage de l'annuaire * @param $debut * @param unknown $limite * @param integer $filter * @param integer $search * @return **/ if(!function_exists('DisplayListYellowPages')) { function DisplayListYellowPages($debut, $limite = SELECT_LIMIT, $filter= -1, $search= -1){ $result_yp = $GLOBALS['sql_object'] -> DBSelect(SQL_get_Display_ypList($debut, $limite, $filter, $search)); $result_nb_yp = $GLOBALS['sql_object'] -> DBSelect(SQL_get_Display_CountypList($filter, $search)); $bdd_nb_yp=$result_nb_yp[0]['num_rows']; $sep = ' / '; if ($filter==-1) $table_link=array('rub' => $GLOBALS['links'][U_L]['directory']['linkvalue']); else $table_link=array('rub' => $GLOBALS['links'][U_L]['directory']['linkvalue'],'id' => $search, 'filter' => $filter); $bdd_nb_yp_display = $bdd_nb_yp; if($bdd_nb_yp!=0) DisplayAlphaBeta($filter,$search); $content = ''; $content .= get_linkin_page($table_link, $bdd_nb_yp, $debut); $content .='
'._t('yp','activity').' : '.$yp_activity.'
'.PHP_EOL; if ($yp_sdtheme<>""){ $content .= ''._t('divers','themeref').' : '.$yp_sdtheme.'' . $sep . _t('divers','sousthemeref').' : '.$yp_theme.'
'.PHP_EOL; } else { $content.=''._t('divers','themeref').' : '.empty_nc($yp_sdtheme).' ' . $sep ._t('divers','sousthemeref').' : '.empty_nc($yp_sdtheme).'
'.PHP_EOL; } $content.=''._t('yp','noresult').'
'; } $content .= get_linkin_page($table_link, $bdd_nb_yp, $debut); echo $content; } } /** * DisplayAlphaBeta() * affichage de la liste alphabétique * @param $filter * @param $filter_id * @return **/ if(!function_exists('DisplayAlphaBeta')) { function DisplayAlphaBeta($filter,$filter_id){ $result_alphabetical = $GLOBALS['sql_object'] -> DBSelect(SQL_get_req_alphabetical()); $content=''.PHP_EOL; $content.= formatted_permalink($link_self); $content.='
'.PHP_EOL; $content.=''._t('yp','confirm_pub').' '._t('yp','confirm_pub2').''.PHP_EOL; $content.='
'.PHP_EOL; echo $content; } } /** * DisplayAddYellowPages() * affichage formulaire d'ajout * @param integer $btn * @param $table * @return **/ if(!function_exists('DisplayAddYellowPages')) { function DisplayAddYellowPages() { include_once('../lib/input_helpers.php'); include_once('../class/class.yellowpages.php'); $form_name=''; $form_activity=''; $form_theme=''; $form_street=''; $form_postal_code=''; $form_city=''; $form_phone=''; $form_fax=''; $form_email=''; $form_website='http://'; $data= $GLOBALS['sql_object'] -> DBSelect(SQL_get_req_list_theme()); $select_theme=ThemeSelectBox($data, "yp_theme", $form_theme); // 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[6]=''; $table[7]=$_POST['yp_phone']; $table[8]=$_POST['yp_fax']; $table[9]=$_POST['yp_email']; ($_POST['yp_website'] != 'http://') ? $table[10]=$_POST['yp_website'] : $table[10]=''; $table[11]="D"; $yp_object= new yellowpages; // prevent spam if($_SESSION['securityaction']!=md5($_POST['securitycode'])) { $integrity=_t('security','message'); } if(!isset($integrity)) $integrity=$yp_object->CheckDataIntegrity($table); if (is_string($integrity)) { echo "".$integrity."
"; $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'); } else { $result=$yp_object->AddYellowPages($table, $GLOBALS['sql_object']); $link_confirm=HrefMaker(array('rub'=> $GLOBALS['links'][U_L]['directory']['linkvalue'])); if(is_numeric($result)) DisplayConfirmAdd(); else echo "".system_error()."
"; } } if (!isset($integrity) || is_string($integrity)) { $form ='