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

Source for file mysql.inc.php

Documentation is available at mysql.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 SQLget_WorkshopList($nb{
  12.   $query =     "SELECT W.* FROM ".T_WORK" W WHERE workshop_statut='P' ORDER BY workshop_range ASC, workshop_denomination ASC LIMIT 0, ".$nb.";";
  13.   return $query;
  14. }
  15.  
  16. function SQLget_pastEvents($nb{
  17.   $query =     "SELECT DATE_FORMAT(workcal_task_date, '".toStringSqlDate()."') AS task_date, workcal_id, workcal_task, workcal_workshop_id,
  18.                 workshop_denomination
  19.                 FROM ".T_WORK_CAL ."
  20.                 LEFT OUTER JOIN  ".T_WORK" on workcal_workshop_id=workshop_id
  21.                 WHERE workcal_task_date < NOW() ORDER BY workcal_task_date DESC LIMIT 0, ".$nb.";";
  22.  
  23.   return $query;
  24. }
  25.  
  26. function SQLget_incomingEvents($nb{
  27.   $query =     "SELECT DATE_FORMAT(workcal_task_date, '".toStringSqlDate()."') AS task_date, workcal_id, workcal_task, workcal_workshop_id,
  28.                 workshop_denomination
  29.                 FROM ".T_WORK_CAL ."
  30.                 LEFT OUTER JOIN  ".T_WORK" on workcal_workshop_id=workshop_id
  31.                 WHERE workcal_task_date >= NOW() ORDER BY workcal_task_date ASC LIMIT 0, ".$nb.";";
  32.  
  33.   return $query;
  34. }
  35.  
  36. function SQLget_Events($nb{
  37.     $query =     "SELECT DATE_FORMAT(workcal_task_date, '".toStringSqlDate()."') AS task_date, workcal_id, workcal_task, workcal_workshop_id,
  38.     workshop_denomination
  39.     FROM ".T_WORK_CAL ."
  40.     LEFT OUTER JOIN  ".T_WORK" on workcal_workshop_id=workshop_id
  41.     ORDER BY workcal_task_date DESC LIMIT 0, ".$nb.";";
  42.  
  43.     return $query;
  44. }
  45.  
  46. function SQL_Get_WorkshopsNames($array array()) {
  47.  
  48.   $str='';
  49.   $sep='';
  50.   if(empty($array)) $str '1 = 1';
  51.   else {
  52.     foreach($array as $v{
  53.       $str .= $sep'workshop_id='.$v;
  54.       $sep ' OR ';
  55.     }
  56.   }
  57.   $query "SELECT workshop_denomination, workshop_id, workshop_restricted FROM "T_WORK ." WHERE ("$str .") AND workshop_statut='P' ORDER BY workshop_range ASC, workshop_denomination ASC";
  58.  
  59.   return $query;
  60. }
  61.  
  62. function SQL_Get_NewsBoard($nb 3{
  63.   $query"SELECT news_id, news_title, news_header, news_body, DATE_FORMAT(news_published_date, '".toStringSqlDate('long')."') AS news_published_date_display FROM " T_NEWS " WHERE news_statut = 'P' ORDER BY news_range, news_published_date DESC LIMIT 0, ".$nb.";";
  64.  
  65.   return $query;
  66. }
  67. function SQL_Get_SdiBoard($nb 3{
  68.  
  69.   $query"SELECT DISTINCT I.sdii_name, sdiv_id, sdii_id, sdiv_scale, sdiv_date_crea, MAX(sdiv_date_crea) AS date_c_max
  70.             FROM " T_SDI_INFO " as I LEFT OUTER JOIN " T_SDI_VALUE " as V ON I.sdii_id=V.sdiv_sdi_info
  71.             WHERE sdiv_statut='P' AND sdii_statut='P' GROUP BY I.sdii_name, sdiv_scale ORDER BY date_c_max DESC LIMIT 0, ".$nb.";";
  72.   //sdiv_sdi_info,,  sdiv_scale
  73.  
  74.   return $query;
  75. }
  76. function SQL_Get_FilterTheme({
  77.   $query "SELECT * FROM " T_SD_THEME " ORDER BY sdtheme_range, sdtheme_id;";
  78.   return $query;
  79. }
  80.  
  81. function SQL_Get_FilterPriority({
  82.   $query "SELECT * FROM " T_PRIORITY " ORDER BY priority_id;";
  83.   return $query;
  84. }
  85.  
  86. function SQL_Get_FilterScale($mask=-1{
  87.   if ($mask<>-1$mask="OR scale_statut='I'";
  88.   else $mask="";
  89.   $query"SELECT * FROM " T_SCALE " WHERE scale_statut='P' ".$mask." ORDER BY scale_range ASC, scale_dependencies ASC, scale_denomination ASC;";
  90.   return $query;
  91. }
  92. function SQL_Get_FilterLevel({
  93.   $query "SELECT * FROM " T_LEVEL " WHERE level_statut='P' ORDER BY level_range ASC, level_range DESC;";
  94.   return $query;
  95. }
  96.  
  97. function SQL_Get_LastPublications($nb{
  98.   $query "SELECT publi_id, publi_title, publi_resume  FROM  " T_PUBLI " WHERE publi_statut = 'P' ORDER BY publi_range ASC, publi_published_date DESC LIMIT 0, ".$nb.";";
  99.   return $query;
  100. }
  101.  
  102.   $query =     "SELECT news_id, news_title, news_header, news_body, ".
  103.                 "DATE_FORMAT(news_published_date, '".toStringSqlDate()."') AS news_published_date_display,".
  104.                 "DATE_FORMAT(news_date_crea, '".toStringSqlDate()."') AS news_date_crea_display, user_login, theme_name ".
  105.                 "FROM " T_NEWS " ".
  106.                 "LEFT OUTER JOIN " T_THEME" ON news_theme=theme_id ".
  107.                 "LEFT OUTER JOIN " T_USER" ON news_posted_by=user_id ".
  108.                 "WHERE news_statut <> 'E' ".
  109.                 "AND news_published_date <> '0001-01-01' ".
  110.                 "ORDER BY news_published_date DESC LIMIT 0 , 15;";
  111.  
  112.   return $query;
  113. }
  114. ?>

Documentation generated on Thu, 20 Mar 2014 16:49:10 +0100 by phpDocumentor 1.4.1