Source for file mysql.inc.php
Documentation is available at mysql.inc.php
* @package linea21.modules
* @subpackage yellowpages
* @author linea21 <info@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
//////////// Check Inclusion de pages ////////////
include_once("../lib/lib_common.php");
$req_add = "SELECT scale_id, scale_denomination FROM " . T_SCALE . " WHERE scale_statut<>'E' AND scale_dependencies<". (MAX_SCALE_LEVEL- 1). " ORDER BY scale_id;";
$req_quickbox_list = "SELECT yellowp_id, yellowp_name, DATE_FORMAT(yellowp_last_modify, '". toStringSqlDate('long'). "') AS yellowp_last_modify, yellowp_last_modify AS yellowp_last_modify2, DATE_FORMAT(yellowp_date_crea, '". toStringSqlDate(). "') AS yellowp_date_crea
FROM " . T_YELLOWPAGES . "
WHERE yellowp_statut <> 'E'
ORDER BY yellowp_last_modify2 DESC
$req_count_yp = "SELECT COUNT(yellowp_id) as num_rows FROM " . T_YELLOWPAGES . " WHERE yellowp_statut<>'E';";
$req_list_theme= "SELECT T.theme_id, T.theme_name, T.theme_statut, SDT.sdtheme_name, SDT.sdtheme_id FROM " . T_THEME . " AS T LEFT OUTER JOIN ". T_SD_THEME . " AS SDT ON SDT.sdtheme_id=T.theme_sd_theme WHERE T.theme_statut <> 'E' ORDER BY sdtheme_range DESC, sdtheme_name ASC, theme_name ASC;";
$req_alphabetical= "SELECT DISTINCT UPPER(LEFT(yellowp_name, 1)) AS first_letter FROM ". T_YELLOWPAGES. " WHERE yellowp_statut <> 'E' ORDER BY first_letter ASC;";
$mask= " WHERE yellowp_statut = 'P'";
$mask= " WHERE yellowp_statut = 'D'";
$mask= " WHERE yellowp_statut = 'AA'";
$mask= " WHERE yellowp_statut <> 'E' AND lower(yellowp_name) LIKE '\\\\". strtolower($search). "%' ";
$mask= " WHERE yellowp_statut <> 'E'";
if($filter== - 1) $mask= " WHERE yellowp_statut <> 'E'";
$requete= "SELECT COUNT(yellowp_id) AS num_rows FROM " . T_YELLOWPAGES . $mask. ";";
function SQL_getypList($debut, $limite = SELECT_LIMIT, $filter= - 1, $search= - 1) {
$mask= " WHERE yellowp_statut = 'P'";
$mask= " WHERE yellowp_statut = 'D'";
$mask= " WHERE yellowp_statut = 'AA'";
$mask= " WHERE yellowp_statut <> 'E' AND lower(yellowp_name) LIKE '\\\\". strtolower($search). "%' ";
$mask= " WHERE yellowp_statut <> 'E'";
if($filter== - 1) $mask= " WHERE yellowp_statut <> 'E'";
$requete= "SELECT Y.yellowp_id, LEFT(Y.yellowp_name, 60) AS yellowp_name, Y.yellowp_statut, DATE_FORMAT(Y.yellowp_date_crea, '". toStringSqlDate('long'). "') AS yellowp_date_crea_display FROM " . T_YELLOWPAGES. " AS Y ".
$mask. " ORDER BY Y.yellowp_name LIMIT ". $debut. " , ". $limite. ";";
$mask= " WHERE yellowp_statut = 'P' AND SD.sdtheme_id =". $search;
$mask= " WHERE yellowp_statut ='P' AND lower(yellowp_name) LIKE '\\\\". strtolower($search). "%' ";
$mask= " WHERE yellowp_statut ='P'";
if($filter== - 1) $mask= " WHERE yellowp_statut ='P'";
$requete= "SELECT COUNT(yellowp_id) AS num_rows FROM " . T_YELLOWPAGES. " AS Y ".
" LEFT OUTER JOIN ". T_THEME. " AS T on Y.yellowp_theme=T.theme_id".
" LEFT OUTER JOIN ". T_SD_THEME. " AS SD on T.theme_sd_theme=SD.sdtheme_id"
$mask= " WHERE yellowp_statut = 'P' AND SD.sdtheme_id =". $search;
$mask= " WHERE yellowp_statut ='P' AND lower(yellowp_name) LIKE '\\\\". strtolower($search). "%' ";
$mask= " WHERE yellowp_statut ='P'";
if($filter== - 1) $mask= " WHERE yellowp_statut ='P'";
$requete= "SELECT Y.yellowp_id, LEFT(Y.yellowp_name, 60) AS yellowp_name, T.theme_name, yellowp_activity, SD.sdtheme_name, SD.sdtheme_id, Y.yellowp_statut, DATE_FORMAT(Y.yellowp_date_crea, '". toStringSqlDate('long'). "') AS yellowp_date_crea_display FROM " . T_YELLOWPAGES. " AS Y ".
" LEFT OUTER JOIN ". T_THEME. " AS T on Y.yellowp_theme=T.theme_id".
" LEFT OUTER JOIN ". T_SD_THEME. " AS SD on T.theme_sd_theme=SD.sdtheme_id".
$mask. " ORDER BY Y.yellowp_name LIMIT ". $debut. " , ". $limite. ";";
$req_alphabetical= "SELECT DISTINCT UCASE(LEFT(yellowp_name, 1)) AS first_letter FROM ". T_YELLOWPAGES. " WHERE yellowp_statut = 'P' ORDER BY first_letter ASC;";
return $req_alphabetical;
$req_list_theme= "SELECT T.theme_id, T.theme_name, T.theme_statut, SDT.sdtheme_name, SDT.sdtheme_id FROM " . T_THEME . " AS T LEFT OUTER JOIN ". T_SD_THEME . " AS SDT ON SDT.sdtheme_id=T.theme_sd_theme WHERE T.theme_statut ='P' ORDER BY sdtheme_range DESC, sdtheme_name ASC, theme_name ASC;";
$q = "SELECT yellowp_name
FROM " . T_YELLOWPAGES . "
WHERE yellowp_id =". $id . ";";
SELECT yellowp_name, yellowp_activity, t.theme_name, yellowp_theme, yellowp_street, SD.sdtheme_name, SD.sdtheme_id, yellowp_postal_code, yellowp_city, yellowp_country, yellowp_phone, yellowp_fax, yellowp_email, yellowp_website, yellowp_latitude, yellowp_longitude, DATE_FORMAT(yellowp_last_modify, '". toStringSqlDate('long'). "') AS yellowp_last_modify, DATE_FORMAT(yellowp_date_crea, '". toStringSqlDate(). "') AS yellowp_date_crea, yellowp_statut
FROM " . T_YELLOWPAGES . "
LEFT OUTER JOIN " . T_THEME . " t ON yellowp_theme = t.theme_id
LEFT OUTER JOIN ". T_SD_THEME. " AS SD on t.theme_sd_theme=SD.sdtheme_id
WHERE yellowp_id =". $yp_id . ";";
$mask= "LIMIT $debut , ". SELECT_LIMIT;
$req_listpre= "SELECT * FROM " . T_YELLOWPAGES . " WHERE yellowp_statut<>'E' ORDER BY yellowp_name $mask ;";
$mask= "LIMIT $debut , ". SELECT_LIMIT;
$req_list2= "SELECT * FROM " . T_YELLOWPAGES . " WHERE yellowp_statut='D' ORDER BY yellowp_name $mask ;";
$mask= "LIMIT $debut , ". SELECT_LIMIT;
$req_listtheme= "SELECT * FROM " . T_YELLOWPAGES . " WHERE yellowp_theme=$theme ORDER BY yellowp_name $mask ;";
$req_Onetheme= "SELECT theme_name FROM " . T_THEME . " WHERE theme_id=$theme_id ;";
$mask= "LIMIT $debut , ". SELECT_LIMIT;
$req_liststatut= "SELECT * FROM " . T_YELLOWPAGES . " WHERE yellowp_statut='$statut' ORDER BY yellowp_name $mask ;";
|