<?php
/**
 * @package linea21.core
 * @subpackage level
 * @author linea21 <info@linea21.com>
 * @version $id SVN
 * @access public
 * @license http://opensource.org/licenses/gpl-3.0.html
 */

// ////////// Check Inclusion de pages ////////////
if (!function_exists('AuthenthificationProcess')) {
    include_once("../lib/lib_common.php");
    ReloadIndex('admin');
} 
// //////////


$req_liste = "SELECT * FROM " . T_LEVEL . " WHERE level_statut<>'E' ORDER BY level_range DESC;";

$req_quickbox_list = "SELECT level_id, level_name, DATE_FORMAT(level_last_modify, '".toStringSqlDate('long')."') AS level_last_modify, level_last_modify AS level_last_modify2, DATE_FORMAT(level_date_crea, '".toStringSqlDate()."') AS level_date_crea
						FROM " . T_LEVEL . "
						WHERE level_statut <> 'E'
						ORDER BY level_last_modify2 DESC
						LIMIT 0 , 10;";

function SQL_getdetlevel($level_id)
{
    $req_det = "SELECT level_name, level_description, level_comment, level_visual_identity, level_range, DATE_FORMAT(level_last_modify, '".toStringSqlDate('long')."') AS level_last_modify, DATE_FORMAT(level_date_crea, '".toStringSqlDate()."') AS level_date_crea, level_statut FROM " . T_LEVEL . " WHERE level_id =" . $level_id . ";";
    return $req_det;
} 

function SQL_getonelevel($level_id)
{
    $req_one_level = "SELECT level_id, level_name, level_description, level_comment, level_visual_identity, level_range, level_statut FROM " . T_LEVEL . " WHERE level_statut<>'E' AND level_id=" . $level_id . ";";
    return $req_one_level;
} 
function SQL_getlistscale($scale_id)
{
    $req_sup = "SELECT scale_id, scale_denomination FROM " . T_SCALE . " WHERE scale_statut<>'E' AND scale_id<>$scale_id AND scale_dependencies<" . (MAX_SCALE_LEVEL-1) . " ORDER BY scale_id;";
    return $req_sup;
} 

?>
