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 SQL_Get_WorkshopsNames($array array()) {
  37.  
  38.   $str='';
  39.   $sep='';
  40.   if(empty($array)) $str '1 = 1';
  41.   else {
  42.     foreach($array as $v{
  43.       $str .= $sep'workshop_id='.$v;
  44.       $sep ' OR ';
  45.     }
  46.   }
  47.   $query "SELECT workshop_denomination, workshop_id FROM "T_WORK ." WHERE ("$str .") AND workshop_statut='P' ORDER BY workshop_range ASC, workshop_denomination ASC";
  48.  
  49.   return $query;
  50. }
  51.  
  52. function SQL_Get_NewsBoard($nb{
  53.   $query"SELECT news_id, news_title, 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.";";
  54.  
  55.   return $query;
  56. }
  57. function SQL_Get_SdiBoard({
  58.  
  59.   $query"SELECT DISTINCT I.sdii_name, sdiv_id, sdii_id, sdiv_scale, sdiv_date_crea, MAX(sdiv_date_crea) AS date_c_max
  60.             FROM " T_SDI_INFO " as I LEFT OUTER JOIN " T_SDI_VALUE " as V ON I.sdii_id=V.sdiv_sdi_info
  61.             WHERE sdiv_statut='P' AND sdii_statut='P' GROUP BY I.sdii_name, sdiv_scale ORDER BY date_c_max DESC;";
  62.   //sdiv_sdi_info,,  sdiv_scale
  63.   return $query;
  64. }
  65. function SQL_Get_FilterTheme({
  66.   $query "SELECT * FROM " T_SD_THEME " ORDER BY sdtheme_range, sdtheme_id;";
  67.   return $query;
  68. }
  69.  
  70. function SQL_Get_FilterPriority({
  71.   $query "SELECT * FROM " T_PRIORITY " ORDER BY priority_id;";
  72.   return $query;
  73. }
  74.  
  75. function SQL_Get_FilterScale($mask=-1{
  76.   if ($mask<>-1$mask="OR scale_statut='I'";
  77.   else $mask="";
  78.   $query"SELECT * FROM " T_SCALE " WHERE scale_statut='P' ".$mask." ORDER BY scale_range ASC, scale_dependencies ASC, scale_denomination ASC;";
  79.   return $query;
  80. }
  81. function SQL_Get_FilterLevel({
  82.   $query "SELECT * FROM " T_LEVEL " WHERE level_statut='P' ORDER BY level_range ASC, level_range DESC;";
  83.   return $query;
  84. }
  85.  
  86. function SQL_Get_LastPublications($nb{
  87.   $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.";";
  88.   return $query;
  89. }
  90.  
  91.   $query =     "SELECT news_id, news_title, news_header, news_body, ".
  92.                 "DATE_FORMAT(news_published_date, '".toStringSqlDate()."') AS news_published_date_display,".
  93.                 "DATE_FORMAT(news_date_crea, '".toStringSqlDate()."') AS news_date_crea_display, user_login, theme_name ".
  94.                 "FROM " T_NEWS " ".
  95.                 "LEFT OUTER JOIN " T_THEME" ON news_theme=theme_id ".
  96.                 "LEFT OUTER JOIN " T_USER" ON news_posted_by=user_id ".
  97.                 "WHERE news_statut <> 'E' ".
  98.                 "AND news_published_date <> '0001-01-01' ".
  99.                 "ORDER BY news_published_date DESC LIMIT 0 , 15;";
  100.  
  101.   return $query;
  102. }
  103. ?>

Documentation generated on Mon, 08 Apr 2013 18:15:59 +0200 by phpDocumentor 1.4.1