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 scale
  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. //////////// Check Inclusion de pages ////////////
  12. if (!class_exists('auth')){
  13.   include_once("../lib/lib_common.php");
  14.   ReloadIndex('admin');
  15. }
  16. ////////////
  17.  
  18. $req_add "SELECT scale_id, scale_denomination FROM " T_SCALE " WHERE scale_statut<>'E' AND scale_statut<>'I' AND scale_dependencies<" (MAX_SCALE_LEVEL-1" ORDER BY scale_id;";
  19.  
  20. $req_quickbox_add "SELECT scale_id, scale_denomination, DATE_FORMAT(scale_date_crea, '".toStringSqlDate('long')."') AS scale_date_crea_display FROM " T_SCALE " WHERE scale_statut  <> 'E' ORDER BY scale_date_crea DESC LIMIT 0 , 10;";
  21.  
  22. $req_quickbox_sup "SELECT scale_id, scale_denomination, DATE_FORMAT(scale_date_crea, '".toStringSqlDate()."') AS scale_date_crea_display, DATE_FORMAT(scale_last_modify, '".toStringSqlDate('long')."') AS scale_last_modify_display FROM " T_SCALE " WHERE scale_statut  = 'E' ORDER BY scale_last_modify DESC
  23. LIMIT 0 , 10;";
  24.  
  25. $req_quickbox_list "SELECT scale_id, scale_denomination, DATE_FORMAT(scale_date_crea, '".toStringSqlDate()."') AS scale_date_crea_display, DATE_FORMAT(scale_last_modify, '".toStringSqlDate('long')."') AS scale_last_modify_display FROM " T_SCALE " WHERE scale_statut <> 'E' ORDER BY scale_last_modify DESC
  26. LIMIT 0 , 10;";
  27.  
  28. function SQL_getMaxScalesDepth($depth$except = -1)
  29. {
  30.   $requete "SELECT scale_id, scale_denomination FROM " T_SCALE " WHERE scale_statut<>'E' AND scale_statut<>'I' AND scale_dependencies<" $depth;
  31.   if ($except != -1{
  32.     for($i 0$i count($except)$i++$requete .= " AND scale_id<>'" $except[$i"'";
  33.   }
  34.   $requete .= " ORDER BY scale_id;";
  35.   return $requete;
  36. }
  37.  
  38. $req_list "SELECT  DISTINCT s1.scale_id AS scale_id1, s1.scale_denomination AS scale_denomination1, s2.scale_id AS scale_id2, s2.scale_denomination AS scale_denomination2
  39.             FROM " T_SCALE " s1
  40.             LEFT  OUTER  JOIN " T_SCALE " s2 ON s2.scale_root = s1.scale_id 
  41.             ORDER  BY s1.scale_id, s1.scale_denomination, s2.scale_denomination;";
  42.  
  43. $req_list2 "SELECT * FROM " T_SCALE " WHERE scale_statut<>'E' ORDER BY scale_dependencies DESC, scale_denomination ASC;";
  44.  
  45. function SQL_getdetscale($scale_id)
  46. {
  47.   $req_det "SELECT s1.scale_denomination, s1.scale_surface, s1.scale_inhabitantsnumber, s1.scale_root, s2.scale_denomination as scale_denomination_root, s1.scale_comment, s1.scale_dependencies, DATE_FORMAT(s1.scale_last_modify, '".toStringSqlDate('long')."') AS scale_last_modify, DATE_FORMAT(s1.scale_date_crea, '".toStringSqlDate()."') AS scale_date_crea, s1.scale_statut FROM " T_SCALE "  s1 LEFT  OUTER  JOIN " T_SCALE " s2 ON s1.scale_root = s2.scale_id WHERE s1.scale_id =" $scale_id ";";
  48.   return $req_det;
  49. }
  50.  
  51. function SQL_getonescale($scale_id)
  52. {
  53.   $req_one_scale "SELECT scale_id, scale_denomination, scale_surface, scale_inhabitantsnumber, scale_root, scale_comment, scale_dependencies, scale_statut FROM " T_SCALE " WHERE scale_statut<>'E' AND scale_id=" $scale_id ";";
  54.   return $req_one_scale;
  55. }
  56.  
  57. function SQL_getlistscale($scale_id)
  58. {
  59.   $req_sup "SELECT scale_id, scale_denomination FROM " T_SCALE " WHERE scale_statut<>'E' AND scale_statut<>'I' AND scale_id<>'$scale_id' AND scale_dependencies<(MAX_SCALE_LEVEL-1" ORDER BY scale_range ASC, scale_id;";
  60.   return $req_sup;
  61. }
  62. ?>

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