<?php
/**
 * Project module - getting actors by ajax call
 * 
 * Return a json file populating indicators select options in add/mod project page
 *  
 * @package linea21\modules\project
 * @author $Author$ - Simon Georget <simon@linea21.com>
 * @version $Id$ 
 * @access public
 * @license http://opensource.org/licenses/gpl-3.0.html
 */
session_start();

$noplugin = true; // flag for ../config/define.php file
include_once('../config/define.php');
include_once('../lib/input_helpers.php');
//////////// Check Droits utilisateur ////////////
if (!$l21auth->hasRight('indicator') && !$l21auth->isSuperAdmin()) ReloadIndex('admin');
////////////

include_once('../project/'.SQL.'.inc.php');


// retrieve last insert indicator if exists to populate the select
$data=$sql_object->DBSelect(SQL_get_last_inserted_indicator());
if(isset($data[0]['sdii_id'])) $form_sdi=array($data[0]['sdii_id']);
else $form_sdi=array();

// select-box des indicateurs
$data=$sql_object->DBSelect($req_list_sdi);
$select_sdi=SDIMultiSelectBox($data, "choose_sdi", $form_sdi);

echo $select_sdi;