linea21-core
[ class tree: linea21-core ] [ index: linea21-core ] [ all elements ]

Source for file pgsql.inc.php

Documentation is available at pgsql.inc.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage public
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. function SQL_Get_NewsBoard($nb{
  12.   $query"SELECT news_id, news_title, to_char(news_published_date, '".toStringSqlDate('long')."') AS news_published_date_display FROM " T_NEWS " WHERE news_statut = 'P' ORDER BY news_published_date DESC OFFSET 0 LIMIT ".$nb.";";
  13.  
  14.   return $query;
  15. }
  16. function SQL_Get_SdiBoard({
  17.  
  18.   $query"SELECT DISTINCT I.sdii_name, V.sdiv_id, I.sdii_id, V.sdiv_scale, V.sdiv_date_crea, MAX(sdiv_date_crea) AS date_c_max
  19.             FROM " T_SDI_INFO " as I LEFT OUTER JOIN " T_SDI_VALUE " as V ON I.sdii_id=V.sdiv_sdi_info
  20.             WHERE sdiv_statut='P' AND sdii_statut='P' GROUP BY I.sdii_name, I.sdii_id, V.sdiv_scale, V.sdiv_id, V.sdiv_date_crea ORDER BY date_c_max DESC;";
  21.  
  22.   return $query;
  23. }
  24. function SQL_Get_FilterTheme({
  25.   $query "SELECT * FROM " T_SD_THEME " ORDER BY sdtheme_range, sdtheme_id;";
  26.   return $query;
  27. }
  28.  
  29. function SQL_Get_FilterPriority({
  30.   $query "SELECT * FROM " T_PRIORITY " ORDER BY priority_id;";
  31.   return $query;
  32. }
  33.  
  34. function SQL_Get_FilterScale($mask=-1{
  35.   if ($mask<>-1$mask="OR scale_statut='I'";
  36.   else $mask="";
  37.   $query"SELECT * FROM " T_SCALE " WHERE scale_statut='P' ".$mask." ORDER BY scale_dependencies ASC, scale_denomination ASC;";
  38.   return $query;
  39. }
  40. function SQL_Get_FilterLevel({
  41.   $query "SELECT * FROM " T_LEVEL " WHERE level_statut='P' ORDER BY level_range DESC;";
  42.   return $query;
  43. }
  44.  
  45. function SQL_Get_UserWorkshop($login$pass{
  46.   $query "SELECT user_id ,  jwu_workshop_id FROM " T_USER " As U LEFT OUTER JOIN " J_WORK_USERS " As W ON U.user_id=W.jwu_user_id WHERE lower(user_login) = '".strtolower($login)."' AND user_password='".$pass."' AND user_validity='Y';";
  47.   return $query;
  48. }
  49.  
  50. function SQL_Get_LastPublications($nb{
  51.   $query "SELECT publi_id, publi_title, publi_resume  FROM  " T_PUBLI " WHERE publi_statut = 'P' ORDER BY publi_published_date DESC OFFSET 0 LIMIT ".$nb.";";
  52.   return $query;
  53. }
  54.  
  55. function SQL_getRSSformatedNews({
  56.   $query =     "SELECT news_id, news_title, substring(news_header || ' ' || news_body from 0 for 247) || '...' AS news_description, theme_name, ".
  57.                 "to_char(news_published_date, 'YYYY-MM-DD') || 'T' || to_char(news_published_date, 'HH24:MI:SS+00:00') AS news_published_date_display, ".
  58.                 "to_char(news_date_crea, '".toStringSqlDate()."') AS news_date_crea_display, user_login ".
  59.                 "FROM " T_NEWS " ".
  60.                 "LEFT OUTER JOIN " T_THEME" ON news_theme=theme_id ".
  61.                 "LEFT OUTER JOIN " T_USER" ON news_posted_by=user_id ".
  62.                 " WHERE news_statut='P' ".
  63.                 "ORDER BY news_published_date DESC OFFSET 0 LIMIT 15;";
  64.   return $query;
  65. }
  66.  
  67.  
  68.   $query =     "SELECT news_id, news_title, news_header, news_body, ".
  69.                 "to_char(news_published_date, 'YYYY-MM-DD') || 'T' || to_char(news_published_date, 'HH24:MI:SS+00:00') AS news_published_date_display, ".
  70.                 "to_char(news_date_crea, 'YYYY-MM-DD') AS news_date_crea_display, user_login, theme_name ".
  71.                 "FROM " T_NEWS " ".
  72.                 "LEFT OUTER JOIN " T_THEME" ON news_theme=theme_id ".
  73.                 "LEFT OUTER JOIN " T_USER" ON news_posted_by=user_id ".
  74.                 "WHERE news_statut <> 'E' ".
  75.                 "AND news_published_date <> '0001-01-01' ".
  76.                 "ORDER BY news_published_date DESC OFFSET 0 LIMIT 15;";
  77.   return $query;
  78. }
  79. ?>

Documentation generated on Fri, 16 Oct 2009 09:38:07 +0200 by phpDocumentor 1.4.1