}
*/
Session::checkCentralAccess();
// Make a select box
if (isset($_POST['type_relations'])) {
    $rand = $_POST['rand'];
    $itemtype = $_POST['itemtype'];
    if (!class_exists($itemtype)) {
        $table = "";
    } else {
        $objeto = new $itemtype();
        $table = $objeto->getTable();
    }
    //$use_ajax=$CFG_GLPI['use_ajax'];
    //echo $CFG_GLPI['use_ajax'];
    $tabletype = PluginRelationRelation::getNombreClaseRelacionada($_POST['type_relations']);
    /*
    switch ($tabletype){
    	case "Group" :
    		$use_ajax=0;
    		break;
    	case "User" :
    		$use_ajax=0;
    		break;			
    	default:
    		$use_ajax=$CFG_GLPI['use_ajax'];
    		break;
    }	
    */
    //echo $tabletype."-".$use_ajax;
    //$params = array();
// Direct access to file
if (strpos($_SERVER['PHP_SELF'], "dropdownValue.php")) {
    $AJAX_INCLUDE = 1;
    include '../../../inc/includes.php';
    header("Content-Type: text/html; charset=UTF-8");
    Html::header_nocache();
}
Session::checkCentralAccess();
// Make a select box with all glpi users
//$type es el índice del elemento seleccionado en el desplegable de clase
$type = $_POST['type_relations'];
//echo "<input type='hidden' size='30' name='type2' value='".$type."'>";
$field_isdel = "";
$itemtype = $_POST['itemtype'];
//Obtengo la clase seleccionada
$tabletype = PluginRelationRelation::getNombreClaseRelacionada($type);
switch ($tabletype) {
    case "Group":
        $field_isdel = "1=1 ";
        break;
    default:
        $field_isdel = "is_deleted = 0 ";
        break;
}
$where = " WHERE " . $field_isdel;
//echo $tabletype;
if (!class_exists($tabletype)) {
    $datatable = "";
} else {
    $objeto = new $tabletype();
    $datatable = $objeto->getTable();