function affich_detail_simple($form_name, $list_fields, $list_col_cant_del, $default_fields, $table, $tab_options = array()) { if (AJAX) { parse_str($protectedPost['ocs']['0'], $params); $protectedPost += $params; ob_start(); $ajax = true; } else { $ajax = false; } $form_name = "affich_controllers"; $table_name = $form_name; $tab_options = $protectedPost; $tab_options['form_name'] = $form_name; $tab_options['table_name'] = $table_name; echo open_form($form_name); // $list_fields=array($l->g(64) => 'MANUFACTURER', // $l->g(49) => 'NAME', // $l->g(66) => 'TYPE', // 'Caption'=>'CAPTION', // $l->g(53)=>'DESCRIPTION', // $l->g(277)=> 'VERSION'); // //$list_fields['SUP']= 'ID'; // $list_col_cant_del[$l->g(66)]=$l->g(66); // $default_fields= array($l->g(64)=>$l->g(64),$l->g(49)=>$l->g(49),$l->g(66)=>$l->g(66)); $queryDetails = "SELECT "; foreach ($list_fields as $lbl => $value) { $queryDetails .= $value . ","; } $queryDetails = substr($queryDetails, 0, -1) . " FROM " . $table . " WHERE (hardware_id={$systemid})"; ajaxtab_entete_fixe($list_fields, $default_fields, $tab_options, $list_col_cant_del); echo close_form(); if ($ajax) { ob_end_clean(); tab_req($list_fields, $default_fields, $list_col_cant_del, $queryDetails, $tab_options); ob_start(); } }
if ($_SESSION['OCS']['profile']->getConfigValue('CONFIG') == "YES") { $list_fonct["image/config_search.png"] = $l->g(107); $list_pag["image/config_search.png"] = $pages_refs['ms_custom_param']; } if ($_SESSION['OCS']['profile']->getConfigValue('TELEDIFF') == "YES") { $list_fonct["image/tele_search.png"] = $l->g(428); $list_pag["image/tele_search.png"] = $pages_refs["ms_custom_pack"]; } $list_pag["image/groups_search.png"] = $pages_refs["ms_custom_groups"]; $list_pag["image/cadena_ferme.png"] = $pages_refs["ms_custom_lock"]; $list_pag["image/mass_affect.png"] = $pages_refs["ms_custom_tag"]; //activation des LOGS $tab_options['LOGS'] = 'SEARCH_RESULT'; $tab_options['form_name'] = $form_name; $tab_options['table_name'] = $table_tabname; ajaxtab_entete_fixe($list_fields, $default_fields, $tab_options, $list_col_cant_del); add_trait_select($list_fonct, $list_id, $form_name, $list_pag); echo "<input type='hidden' value='" . $protectedPost['Valid-search'] . "' name='Valid-search'>"; } elseif ($protectedPost['Valid-search'] != '') { $no_result = "NO RESULT"; } if ($no_result == "NO RESULT" and !isset($ERROR)) { //choix des fonctionnalitées pour les utilisateurs $list_fonct["image/groups_search.png"] = $l->g(583); $list_pag["image/groups_search.png"] = $pages_refs["ms_custom_groups"]; add_trait_select($list_fonct, $list_id, $form_name, $list_pag); msg_warning($l->g(42)); } if ($_SESSION['OCS']["mesmachines"] != '') { $list_id_computer = computer_list_by_tag(); }
function print_computers_cached($systemid) { global $l, $server_group, $protectedPost, $list_fields, $list_col_cant_del, $default_fields, $tab_options; //print_r($protectedPost); //traitement des machines du groupe if (isset($protectedPost["actshowgroup"]) and $protectedPost["modify"] != "") { foreach ($protectedPost as $key => $val) { //check65422 if (substr($key, 0, 5) == "check") { update_computer_group(substr($key, 5), $systemid, $protectedPost["actshowgroup"]); } } $tab_options['CACHE'] = 'RESET'; } if ($_SESSION['OCS']['profile']->getRestriction('GUI') == "YES") { $sql_mesMachines = "select hardware_id from accountinfo a where " . $_SESSION['OCS']["mesmachines"]; $res_mesMachines = mysql2_query_secure($sql_mesMachines, $_SESSION['OCS']["readServer"]); $mesmachines = "("; while ($item_mesMachines = mysqli_fetch_object($res_mesMachines)) { $mesmachines .= $item_mesMachines->hardware_id . ","; } $mesmachines = "and e.hardware_id IN " . substr($mesmachines, 0, -1) . ")"; } $form_name = "list_computer_groupcache"; $table_name = $form_name; echo open_form($form_name); $queryDetails = "SELECT "; foreach ($list_fields as $lbl => $value) { $queryDetails .= $value . ","; } $queryDetails = substr($queryDetails, 0, -1) . " FROM hardware h LEFT JOIN accountinfo a ON a.hardware_id=h.id\n\t\t\t\t\t\t,groups_cache e\n\t\t\t\t\t\twhere group_id='" . $systemid . "' and h.id=e.HARDWARE_ID "; if (isset($mesmachines) and $mesmachines != '') { $queryDetails .= $mesmachines; } $tab_options['FILTRE'] = array('h.NAME' => 'Nom'); $tab_options['form_name'] = $form_name; $tab_options['table_name'] = $table_name; $statut = ajaxtab_entete_fixe($list_fields, $default_fields, $tab_options, $list_col_cant_del); if ($statut) { form_action_group($systemid); } echo close_form(); if (AJAX) { ob_end_clean(); tab_req($list_fields, $default_fields, $list_col_cant_del, $queryDetails, $tab_options); ob_start(); } }
} else { if (!is_readable($file_name)) { runCommand("-cache -net=" . $pas, $fname); } $tabBalises = array($l->g(34) => "IP", $l->g(95) => "MAC", $l->g(49) => "NAME", $l->g(232) => "DATE", $l->g(66) => "TYPE"); $ret = array(); $ret = parse_xml_file($file_name, $tabBalises, "HOST"); if ($ret != array()) { $sql = "select "; $i = 0; //var_dump($ret); while ($ret[$i]) { foreach ($ret[$i] as $key => $value) { $sql .= "'" . $value . "' as " . $key . ","; } $sql = substr($sql, 0, -1) . " union select "; $i++; } $sql = substr($sql, 0, -13); $default_fields = $tabBalises; $list_col_cant_del = $default_fields; $tab_options['NO_NAME']['NAME'] = 1; $result_exist = ajaxtab_entete_fixe($tabBalises, $default_fields, $tab_options, $list_col_cant_del); } echo "<p><input type='submit' name='reset' value='" . $l->g(1261) . "'></p>"; } echo close_form(); if ($ajax) { ob_end_clean(); tab_req($tabBalises, $default_fields, $list_col_cant_del, $sql, $tab_options); }