function show_blacklist_fields($nb_field, $default_values, $field_name, $nb_value_by_field, $size, $separat, $javascript = '') { global $aff; $i = 1; while ($i <= $nb_field) { if ($i != 1) { $aff .= $separat; } $aff .= show_modif($default_values[$field_name . $i], $field_name . $i, 0, '', array('MAXLENGTH' => $nb_value_by_field, 'SIZE' => $size, 'JAVASCRIPT' => $javascript)); $i++; } $aff .= "</td></tr><tr><td>"; return $aff; }
function remplirListe($input_name) { //connecOCS(); //requete SQL avec filtre sur les logiciels des pc linux et Correctifs, mise a jour windows $sql = "SELECT DISTINCT softwares.NAME FROM softwares_name_cache softwares WHERE softwares.NAME NOT LIKE '%Correctif%' AND softwares.NAME NOT LIKE '%Mise a jour%' ORDER BY softwares.NAME"; //requete SQL sans filtre //$sql= "SELECT DISTINCT softwares.NAME FROM softwares ORDER BY softwares.NAME"; $query = mysqli_query($_SESSION['OCS']["readServer"], $sql) or die("erreur" . mysqli_error($_SESSION['OCS']["readServer"])); //echo '<option value=""></option>'; //remplit la liste deroulante while ($row = mysqli_fetch_array($query)) { $name[$row['NAME']] = $row['NAME']; } echo show_modif($name, $input_name, 2); }
$protectedPost['OP_' . $i] = $val['op']; $protectedPost['COMPTO_' . $i] = $val['compto']; $protectedPost['RULE_NAME'] = $val['rule_name']; $i++; } $protectedPost['NUM_RULES'] = $i - 2; } //new rule if ($protectedPost['NEW_RULE'] or $protectedPost['NUM_RULES'] or $protectedPost['MODIF'] != "") { if ($protectedPost['MODIF'] != "") { $modif = $protectedPost['MODIF']; } else { $modif = $protectedPost['OLD_MODIF']; } $numero = $protectedPost['NUM_RULES'] + 1; $tab_nom = $l->g(674) . " " . show_modif($protectedPost['RULE_NAME'], "RULE_NAME", "0"); $tab = "<table align='center'>"; $i = 1; while ($i < $numero + 1) { if ($i == 1) { $entete = 'YES'; } else { $entete = 'NO'; } $tab .= fields_conditions_rules($i, $entete); $i++; } echo $tab_nom; echo $tab; echo "</tr></table>"; echo "<a onclick='return pag(" . $numero . ",\"NUM_RULES\",\"rules\")'><font color=green>" . $l->g(682) . "</font></a> <a onclick='return pag(\"RAZ\",\"RAZ\",\"rules\");'><font color=\"red\">" . $l->g(113) . "</font></a><br><br>";
echo "<tr><td colspan='3'>"; echo "<div id='OS_div' style='display:block'>"; echo "<table BGCOLOR='#C7D9F5' BORDER='0' WIDTH = '600px' ALIGN = 'Center' CELLPADDING='0' BORDERCOLOR='#9894B5' >"; echo $title_user . $notify_user; $notify_txt = $lign_begin . $l->g(449) . $td_colspan2 . show_modif($_POST['NOTIFY_TEXT'], 'NOTIFY_TEXT', 1) . $lign_end; $notify_count_down = $lign_begin . $l->g(450) . $td_colspan2 . show_modif($protectedPost['NOTIFY_COUNTDOWN'], 'NOTIFY_COUNTDOWN', 0, '', array('MAXLENGTH' => 4, 'SIZE' => 4, 'JAVASCRIPT' => $chiffres)) . $l->g(511) . $lign_end; $notify_can_abord = $lign_begin . $l->g(451) . $td_colspan2 . show_modif($yes_no, 'NOTIFY_CAN_ABORT', 2) . $lign_end; $notify_can_delay = $lign_begin . $l->g(452) . $td_colspan2 . show_modif($yes_no, 'NOTIFY_CAN_DELAY', 2) . $lign_end; echo "<tr><td colspan='3' align=center><div id='NOTIFY_USER_div' style='display:" . ($protectedPost["NOTIFY_USER"] == 1 ? " block" : "none") . "'>"; echo $sous_tab_beg; echo $notify_txt . $notify_count_down . $notify_can_abord . $notify_can_delay; echo $sous_tab_end; echo "</div></td></tr>"; $need_done_action = "<tr height='30px' bgcolor='white'><td colspan='2'>" . $l->g(453) . ":</td><td>" . champ_select_block($yes_no, 'NEED_DONE_ACTION', array('NEED_DONE_ACTION' => 1)) . $lign_end; echo $need_done_action; $need_done_action_txt = $lign_begin . $l->g(449) . $td_colspan2 . show_modif($_POST['NEED_DONE_ACTION_TEXT'], 'NEED_DONE_ACTION_TEXT', 1) . $lign_end; echo "<tr><td colspan='3' align=center><div id='NEED_DONE_ACTION_div' style='display:" . ($protectedPost["NEED_DONE_ACTION"] == 1 ? " block" : "none") . "'>"; echo $sous_tab_beg; echo $need_done_action_txt; echo $sous_tab_end; echo "</div></td></tr>"; echo "</table></td></tr>"; echo "</div>"; echo "</table>"; echo "<br><input type='submit' name='valid' id='valid' value='" . $l->g(13) . "' OnClick='return verif();' >"; echo "<input type='hidden' id='digest_algo' name='digest_algo' value='MD5'>\n\t <input type='hidden' id='digest_encod' name='digest_encod' value='Hexa'>\n\t <input type='hidden' id='download_rep_creat' name='download_rep_creat' value='" . $default['DOWNLOAD_REP_CREAT'] . "'>"; // <input type='hidden' id='download_server_docroot' name='download_server_docroot' value='".$default['DOWNLOAD_SERVER_DOCROOT']."'>"; echo close_form(); echo "</div>"; ?>
$sql['SQL'] .= " group by " . $field_name_soft; // $_SESSION['OCS']["forcedRequest"].=" group by name"; if ($sql_fin['SQL'] != '') { $sql['SQL'] .= $sql_fin['SQL']; $sql['ARG'] = array_merge_values($sql['ARG'], $sql_fin['ARG']); // $_SESSION['OCS']["forcedRequest"].=$sql_fin; } $list_fields = array('name' => 'name', 'nbre' => 'nb'); $default_fields = $list_fields; $list_col_cant_del = $default_fields; $tab_options['LIEN_LBL']['nbre'] = 'index.php?' . PAG_INDEX . '=' . $pages_refs['ms_multi_search'] . '&prov=allsoft&value='; $tab_options['LIEN_CHAMP']['nbre'] = 'id'; $tab_options['LBL']['name'] = $l->g(847); $tab_options['LBL']['nbre'] = $l->g(1120); $tab_options['ARG_SQL'] = $sql['ARG']; $result_exist = tab_req($table_name, $list_fields, $default_fields, $list_col_cant_del, $sql['SQL'], $form_name, 80, $tab_options); } echo "<br><div class='mvt_bordure'>"; echo "<b>" . $l->g(735) . "</b><br><br>"; echo $l->g(382) . ": " . show_modif($protectedPost['NAME_RESTRICT'], 'NAME_RESTRICT', 0); echo " " . $l->g(381) . ": " . show_modif(array('<' => '<', '>' => '>', '=' => '='), 'COMPAR', 2); echo show_modif($protectedPost['NBRE'], 'NBRE', 0, '', array('MAXLENGTH' => 100, 'SIZE' => 10, 'JAVASCRIPT' => $numeric)); //echo "<input type='input' name='NBRE' value='".$protectedPost['NBRE']."' ".$numeric.">"; echo "<br><a href='index.php?" . PAG_INDEX . "=" . $pages_refs['ms_soft_csv'] . "&no_header=1&soft=" . $protectedPost['NAME_RESTRICT'] . "&nb=" . $protectedPost['NBRE'] . "&comp=" . htmlentities($protectedPost['COMPAR'], ENT_COMPAT | ENT_HTML401, "UTF-8") . "'><br>" . $l->g(183) . " " . $l->g(765) . "<br></a>"; if ($protectedPost['COMPAR'] == '<' and $protectedPost['NBRE'] <= 15 and $protectedPost['NBRE'] != "") { echo "<br><a href='index.php?" . PAG_INDEX . "=" . $pages_refs['ms_soft_csv'] . "&no_header=1&soft=" . $protectedPost['NAME_RESTRICT'] . "&nb=" . $protectedPost['NBRE'] . "&comp=" . htmlentities($protectedPost['COMPAR'], ENT_COMPAT | ENT_HTML401, "UTF-8") . "&all_computers=yes'>" . $l->g(912) . "</a><br>"; } echo "<br><input type='submit' value='" . $l->g(393) . "' name='SUBMIT_FORM'><input type='submit' value='" . $l->g(396) . "' name='RESET'>"; echo '</div>'; echo '</div>'; echo close_form();
$first = $val_rules['rule']; $list_rules[$val_rules['rule']] = $val_rules['rule_name']; $nb_rule++; } if ($nb_rule > 1) { $select_choise = $l->g(668) . show_modif($list_rules, 'rule_choise', 2, $form_name); echo $select_choise; } elseif ($nb_rule == 1) { $protectedPost['rule_choise'] = $first; echo "<input type=hidden value='" . $first . "' name='rule_choise' id='rule_choise'>"; } elseif ($nb_rule == 0) { msg_error($l->g(982)); } } if ($protectedPost['onglet'] == 'MACH') { echo $l->g(1292) . show_modif(array('NO' => $l->g(454), 'YES' => $l->g(455)), 'DWL_OPT', 2, $form_name); } if ($protectedPost['onglet'] == 'MACH' and $protectedPost['DWL_OPT'] != '' or $protectedPost['onglet'] == 'SERV_GROUP' and $protectedPost['rule_choise'] != '') { //recherche de toutes les r�gles pour les serveurs de redistribution $list_fields = array('FILE_ID' => 'e.FILEID', 'INFO_LOC' => 'e.INFO_LOC', 'CERT_FILE' => 'e.CERT_FILE', 'CERT_PATH' => 'e.CERT_PATH', $l->g(1037) => 'a.NAME', $l->g(1039) => 'a.PRIORITY', $l->g(51) => 'a.COMMENT', $l->g(274) => 'a.OSNAME', $l->g(953) . " (KB)" => 'a.SIZE'); if (!isset($nb_rule) or $nb_rule > 0) { if ($protectedPost['onglet'] != 'SERV_GROUP') { $list_fields['PACK_LOC'] = 'e.PACK_LOC'; $list_fields['ACTIVE_ID'] = 'e.ID'; $list_fields['MODIF'] = 'e.ID'; } else { $list_fields['ACTIVE_ID'] = 'e.FILEID'; $list_fields['MODIF'] = 'e.FILEID'; } } $default_fields = array($l->g(1037) => $l->g(1037), $l->g(1039) => $l->g(1039), $l->g(274) => $l->g(274), $l->g(953) . " (KB)" => $l->g(953) . " (KB)", 'SELECT' => 'SELECT');
function multi_lot($form_name, $lbl_choise) { global $protectedPost, $protectedGet, $l; $list_id = ""; //print_r($protectedPost); if (!isset($protectedGet['origine'])) { if (isset($protectedGet['idchecked']) and $protectedGet['idchecked'] != "") { $choise_req_selection['REQ'] = $l->g(584); $choise_req_selection['SEL'] = $l->g(585); $select_choise = show_modif($choise_req_selection, 'CHOISE', 2, $form_name); echo "<center>" . $lbl_choise . " " . $select_choise . "</center><br>"; } if ($protectedPost['CHOISE'] == 'REQ' or $protectedGet['idchecked'] == '') { msg_info($l->g(901)); if ($protectedGet['idchecked'] == '') { echo "<input type='hidden' name='CHOISE' value='" . $protectedPost['CHOISE'] . "'>"; $protectedPost['CHOISE'] = 'REQ'; } $list_id = $_SESSION['OCS']['ID_REQ']; } if ($protectedPost['CHOISE'] == 'SEL') { msg_info($l->g(902)); $list_id = $protectedGet['idchecked']; } //gestion tableau if (is_array($list_id)) { $list_id = implode(",", $list_id); } } else { $list_id = $protectedGet['idchecked']; } if ($list_id != "") { return $list_id; } else { return false; } }
} else { $server_group = false; } incPicker(); $tdhdpb = "<td align='left' width='20%'>"; $tdhfpb = "</td>"; $tdhd = "<td align='left' width='20%'><b>"; $tdhf = ":</b></td>"; $tdpopup = "<td align='left' width='20%' onclick=\"javascript: OuvrirPopup('group_chang_value.php', '', 'resizable=no, location=no, width=400, height=200, menubar=no, status=no, scrollbars=no, menubar=no')\">"; //if user clic on modify if ($protectedPost['MODIF_x']) { //don't show the botton modify $img_modif = ""; //list of input we can modify $name = show_modif($item->NAME, 'NAME', 0); $description = show_modif($item->DESCRIPTION, 'DESCR', 1); //show new bottons $button_valid = "<input title='" . $l->g(625) . "' type='image' src='image/modif_valid_v2.png' name='Valid_modif'>"; $button_reset = "<input title='" . $l->g(626) . "' type='image' src='image/modif_anul_v2.png' name='Reset_modif'>"; } else { //only show the botton for modify $img_modif = "<input title='" . $l->g(115) . "' type='image' src='image/modif.png' name='MODIF'>"; $name = $item->NAME; $description = $item->DESCRIPTION; $button_valid = ""; $button_reset = ""; } //form for modify values of group's echo open_form('CHANGE'); echo "<br><br><table align='center' width='65%' border='0' cellspacing=20 bgcolor='#C7D9F5' style='border: solid thin; border-color:#A1B1F9'>"; //TELEDIFF_WK
msg_warning($error); } } if ($error == "" and isset($protectedPost['Valid_modif']) or isset($protectedPost['YES'])) { if ($protectedPost['choix_activ'] == "MAN") { activ_pack($protectedGet["active"], $protectedPost["HTTPS_SERV"], $protectedPost['FILE_SERV']); } if ($protectedPost['choix_activ'] == "AUTO") { activ_pack_server($protectedGet["active"], $protectedPost["HTTPS_SERV"], $protectedPost['FILE_SERV_REDISTRIB']); } echo "<script> alert('" . $l->g(469) . "');window.opener.document.packlist.submit(); self.close();</script>"; } if ($_SESSION['OCS']["use_redistribution"] == 1) { $list_choise['MAN'] = $l->g(650); $list_choise['AUTO'] = $l->g(649); $choix_activ = $l->g(514) . ' : ' . show_modif($list_choise, 'choix_activ', 2, $form_name) . "<br>"; echo $choix_activ; } else { $protectedPost['choix_activ'] = "MAN"; echo "<input type='hidden' name='choix_activ' value='MAN'>"; } echo "<br>"; if (isset($protectedPost['choix_activ']) and $protectedPost['choix_activ'] != '') { if ($protectedPost['choix_activ'] == "MAN") { $tab_name = array($l->g(471), $l->g(470)); $name_field = array("FILE_SERV", "HTTPS_SERV"); $type_field = array(0, 0); $value_field = array($protectedPost['FILE_SERV'], $protectedPost['HTTPS_SERV']); } else { if (count($groupListServers) == 0) { msg_error($l->g(660));
$sql_del = "delete from subnet where netid='%s'"; $arg_del = $protectedPost['SUP_PROF']; mysql2_query_secure($sql_del, $_SESSION['OCS']["writeServer"], $arg_del); //delete cache unset($_SESSION['OCS']["ipdiscover"]); require_once BACKEND . 'ipdiscover/ipdiscover.php'; $tab_options['CACHE'] = 'RESET'; } if (isset($_SESSION['OCS']["ipdiscover"])) { $dpt = array_keys($_SESSION['OCS']["ipdiscover"]); array_unshift($dpt, ""); foreach ($dpt as $key => $value) { $list_index[$key] = $value; } asort($list_index); echo $l->g(562) . " " . show_modif($list_index, 'DPT_CHOISE', 2, $form_name, array('DEFAULT' => "NO")); } else { msg_info(mb_strtoupper($l->g(1134))); } if (isset($protectedPost['DPT_CHOISE']) and $protectedPost['DPT_CHOISE'] != '0') { $array_rsx = find_all_subnet($dpt[$protectedPost['DPT_CHOISE']]); $tab_options['VALUE']['LBL_RSX'] = $_SESSION['OCS']["ipdiscover"][$dpt[$protectedPost['DPT_CHOISE']]]; $arg_sql = array(); $sql = " select * from (select inv.RSX as ID,\n\t\t\t\t\t inv.c as 'INVENTORIE',\n\t\t\t\t\t non_ident.c as 'NON_INVENTORIE',\n\t\t\t\t\t ipdiscover.c as 'IPDISCOVER',\n\t\t\t\t\t ident.c as 'IDENTIFIE',\n\t\t\t\t\t CASE WHEN ident.c IS NULL and ipdiscover.c IS NULL THEN 100 WHEN ident.c IS NULL THEN 0 ELSE round(100-(non_ident.c*100/(ident.c+non_ident.c)),1) END as 'pourcentage'\n\t\t\t from (SELECT COUNT(DISTINCT hardware_id) as c,'IPDISCOVER' as TYPE,tvalue as RSX\n\t\t\t\t\tFROM devices \n\t\t\t\t\tWHERE name='IPDISCOVER' and tvalue in "; $arg = mysql2_prepare($sql, $arg_sql, $array_rsx); $arg['SQL'] .= " GROUP BY tvalue) \n\t\t\t\tipdiscover right join\n\t\t\t\t (SELECT count(distinct(hardware_id)) as c,'INVENTORIE' as TYPE,ipsubnet as RSX\n\t\t\t\t\tFROM networks left join subnet on networks.ipsubnet=subnet.netid\n\t\t\t\t\tWHERE ipsubnet in "; $arg = mysql2_prepare($arg['SQL'], $arg['ARG'], $array_rsx); $arg['SQL'] .= " and status='Up' GROUP BY ipsubnet) \n\t\t\t\tinv on ipdiscover.RSX=inv.RSX left join\n\t\t\t\t\t(SELECT COUNT(DISTINCT mac) as c,'IDENTIFIE' as TYPE,netid as RSX\n\t\t\t\t\tFROM netmap \n\t\t\t\t\tWHERE mac IN (SELECT DISTINCT(macaddr) FROM network_devices) \n\t\t\t\t\t\tand netid in "; $arg = mysql2_prepare($arg['SQL'], $arg['ARG'], $array_rsx); $arg['SQL'] .= " GROUP BY netid) \n\t\t\t\tident on ipdiscover.RSX=ident.RSX left join\n\t\t\t\t\t(SELECT COUNT(DISTINCT mac) as c,'NON IDENTIFIE' as TYPE,netid as RSX\n\t\t\t\t\tFROM netmap n\n\t\t\t\t\tLEFT JOIN networks ns ON ns.macaddr=n.mac\n\t\t\t\t\tWHERE n.mac NOT IN (SELECT DISTINCT(macaddr) FROM network_devices) \n\t\t\t\t\t\tand (ns.macaddr IS NULL OR ns.IPSUBNET <> n.netid) \n\t \t\t\t\t\tand ns.HARDWARE_ID IS NULL\n\t\t\t\t\t\tand n.netid in "; $arg = mysql2_prepare($arg['SQL'], $arg['ARG'], $array_rsx);
if ($fp) { while ($ln = fgets($fp, 1024)) { $ln = preg_replace('(\\r\\n|\\n|\\r|\\t|)', '', $ln); //foreach ($tag as $poub=>$key){ if (array_key_exists($ln, $tag)) { $index = $tag[$ln]; } elseif (substr($ln, 0, 2) == '</') { unset($index); } elseif (trim($ln) != "" and isset($index)) { $data[$index][] = $ln; } } fclose($fp); } $array_top = array(5 => 5, 10 => 10, 20 => 20); $stats .= $l->g(55) . ": " . show_modif($array_top, "CHOICE_TOP", 2, $form_name) . "<br>"; $sql = "select count(id) c,name from softwares "; if (isset($data)) { $sql .= " where ("; $first = 0; $j = 0; foreach ($data as $k => $v) { $i = 0; while ($v[$i]) { $jonct = ''; if (($k == 'LIKE' or $k == '=') and $first != 0) { $jonct = ' OR '; $j++; } elseif ($first != 0) { if ($j != 0) { $jonct = ') AND (';
msg_success($msg['SUCCESS']); $protectedPost['onglet'] = 1; } echo open_form($form_name); show_tabs($data_on, $form_name, "onglet", 2); echo '<div class="right-content mlt_bordure" >'; $table = "accountinfo"; if (isset($protectedPost['ACCOUNTINFO_CHOISE']) and $protectedPost['ACCOUNTINFO_CHOISE'] == 'SNMP' and $protectedPost['onglet'] == 1 or isset($protectedPost['accountinfo']) and $protectedPost['accountinfo'] == 'SNMP' and $protectedPost['onglet'] == 2) { $array_tab_account = find_all_account_tab('TAB_ACCOUNTSNMP'); $account_field = "TAB_ACCOUNTSNMP"; } else { $array_tab_account = find_all_account_tab('TAB_ACCOUNTAG'); $account_field = "TAB_ACCOUNTAG"; } if ($protectedPost['onglet'] == 1) { echo $l->g(56) . ": " . show_modif($accountinfo_choise, 'ACCOUNTINFO_CHOISE', 2, $form_name, array('DEFAULT' => "NO")); if ($protectedPost['ACCOUNTINFO_CHOISE'] == "SNMP") { $account_choise = "SNMP"; } else { $account_choise = "COMPUTERS"; } $tab_options['CACHE'] = 'RESET'; if (isset($protectedPost['del_check']) and $protectedPost['del_check'] != '') { $list = $protectedPost['del_check']; $tab_values = explode(',', $list); $i = 0; while ($tab_values[$i]) { del_accountinfo($tab_values[$i]); $i++; } }
function admin_profil($form) { global $protectedPost, $l, $pages_refs; $yes_no = array('YES' => $l->g(455), 'NO' => $l->g(454)); $info_field = array('NAME' => array('INFO' => array('LBL' => $l->g(1153) . ": ", 'VALUE' => '')), 'GUI' => array('RESTRICTION' => array('LBL' => $l->g(1154) . ": ", 'VALUE' => $yes_no)), 'TELEDIFF_ACTIVATE' => array('RESTRICTION' => array('LBL' => $l->g(1158) . ": ", 'VALUE' => $yes_no)), 'TELEDIFF_VISIBLE' => array('RESTRICTION' => array('LBL' => $l->g(1301) . ": ", 'VALUE' => $yes_no)), 'EXPORT_XML' => array('RESTRICTION' => array('LBL' => $l->g(1305), 'VALUE' => $yes_no)), 'WOL' => array('RESTRICTION' => array('LBL' => $l->g(1281) . ": ", 'VALUE' => $yes_no)), 'MACADD' => array('ADMIN_BLACKLIST' => array('LBL' => $l->g(1159) . ": ", 'VALUE' => $yes_no)), 'SERIAL' => array('ADMIN_BLACKLIST' => array('LBL' => $l->g(1160) . ": ", 'VALUE' => $yes_no)), 'IPDISCOVER' => array('ADMIN_BLACKLIST' => array('LBL' => $l->g(1161) . ": ", 'VALUE' => $yes_no), 'CONFIGURATION' => array('LBL' => $l->g(1172) . ": ", 'VALUE' => $yes_no)), 'TELEDIFF' => array('CONFIGURATION' => array('LBL' => $l->g(1162) . ": ", 'VALUE' => $yes_no)), 'CONFIG' => array('CONFIGURATION' => array('LBL' => $l->g(1163) . ": ", 'VALUE' => $yes_no)), 'GROUPS' => array('CONFIGURATION' => array('LBL' => $l->g(1164) . ": ", 'VALUE' => $yes_no)), 'CONSOLE' => array('CONFIGURATION' => array('LBL' => $l->g(1165) . ": ", 'VALUE' => $yes_no)), 'ALERTE_MSG' => array('CONFIGURATION' => array('LBL' => $l->g(1166) . ": ", 'VALUE' => $yes_no)), 'ACCOUNTINFO' => array('CONFIGURATION' => array('LBL' => $l->g(1167) . ": ", 'VALUE' => $yes_no)), 'CHANGE_ACCOUNTINFO' => array('CONFIGURATION' => array('LBL' => $l->g(1168) . ": ", 'VALUE' => $yes_no)), 'CHANGE_USER_GROUP' => array('CONFIGURATION' => array('LBL' => $l->g(1169) . ": ", 'VALUE' => $yes_no)), 'MANAGE_PROFIL' => array('CONFIGURATION' => array('LBL' => $l->g(1170) . ": ", 'VALUE' => $yes_no)), 'MANAGE_USER_GROUP' => array('CONFIGURATION' => array('LBL' => $l->g(1171) . ": ", 'VALUE' => $yes_no)), 'MANAGE_SMTP_COMMUNITIES' => array('CONFIGURATION' => array('LBL' => $l->g(1205) . ": ", 'VALUE' => $yes_no)), 'DELETE_COMPUTERS' => array('CONFIGURATION' => array('LBL' => $l->g(1272) . ": ", 'VALUE' => $yes_no))); $lbl_cat = array('INFO' => $l->g(1173), 'PAGE_PROFIL' => $l->g(1174), 'RESTRICTION' => $l->g(1175), 'ADMIN_BLACKLIST' => $l->g(1176), 'CONFIGURATION' => $l->g(1177)); if ($protectedPost['Valid_modif_profil']) { //read profil file $forprofil = read_profil_file($protectedPost['PROFILS']); //read all profil value $forall = read_config_file(); //build new tab with new values foreach ($info_field as $if_name => $if_value) { foreach ($if_value as $if_cat => $if_val) { if (isset($protectedPost[$if_name]) and $protectedPost['cat'] == $if_cat) { $new_value[$if_cat][$if_name] = $protectedPost[$if_name]; } else { $new_value[$if_cat][$if_name] = $forprofil[$if_cat][$if_name]; } } } foreach ($forall['URL'] as $name => $value) { if (isset($protectedPost[$name]) and $protectedPost['cat'] == "PAGE_PROFIL") { $new_value["PAGE_PROFIL"][$name] = ''; } } if (!isset($new_value['PAGE_PROFIL'])) { $new_value['PAGE_PROFIL'] = $forprofil['PAGE_PROFIL']; } update_config_file($protectedPost['PROFILS'], $new_value); msg_success($l->g(1274)); } $array_profil = get_profile_labels(); echo $l->g(1196) . ": " . show_modif($array_profil, "PROFILS", 2, $form); echo "<a href=\"index.php?" . PAG_INDEX . "=" . $pages_refs['ms_new_profil'] . "&head=1&form=" . $form . "\"><img src=image/plus.png></a>"; if (isset($protectedPost['PROFILS']) and $protectedPost['PROFILS'] != '') { $forall = read_config_file(); $forprofil = read_profil_file($protectedPost['PROFILS'], 'WRITE'); if (is_array($forprofil) and is_array($forall)) { foreach ($forprofil as $key => $value) { if (isset($lbl_cat[$key])) { $data_on[$key] = $lbl_cat[$key]; } } onglet($data_on, $form, "cat", 10); if (isset($forprofil[$protectedPost['cat']]) and $protectedPost['cat'] != 'PAGE_PROFIL') { $name_field = array(); $type_field = array(); $tab_name = array(); $value_field = array(); foreach ($info_field as $if_name => $if_value) { foreach ($if_value as $if_cat => $if_val) { if ($protectedPost['cat'] == $if_cat) { if (isset($forprofil[$if_cat][$if_name])) { $protectedPost[$if_name] = $forprofil[$if_cat][$if_name]; } array_push($name_field, $if_name); array_push($tab_name, $if_val['LBL']); if (is_array($if_val['VALUE'])) { array_push($type_field, 2); if (!isset($protectedPost[$if_name])) { array_push($if_val['VALUE'], ''); } array_push($value_field, $if_val['VALUE']); } else { array_push($type_field, 0); array_push($value_field, replace_language($forprofil[$if_cat][$if_name])); } } } } $tab_typ_champ = show_field($name_field, $type_field, $value_field); tab_modif_values($tab_name, $tab_typ_champ, $tab_hidden, array('button_name' => 'modif_profil')); } elseif ($protectedPost['cat'] == 'PAGE_PROFIL') { $champs = "<table align=center><tr><td align=center>"; $i = 0; ksort($forall['URL']); foreach ($forall['URL'] as $key => $value) { $champs .= "<input type='checkbox' name='" . $key . "' id='" . $key . "' "; if (isset($forprofil[$protectedPost['cat']][$key])) { $champs .= " checked "; } $champs .= " ></td><td>" . $key . "</td><td align=center>"; $i++; if ($i == 4) { $champs .= "</td></tr><tr><td align=center>"; $i = 0; } } $champs .= "</td></tr></table>"; tab_modif_values($champs, array(), array(), array('button_name' => 'modif_profil')); } } } }
// code is always made freely available. // Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt //==================================================================================== $form_name = "repart_tag"; $table_name = $form_name; echo open_form($form_name); if (!isset($protectedPost['TAG_CHOISE']) or $protectedPost['TAG_CHOISE'] == '') { $protectedPost['TAG_CHOISE'] = 'a.TAG'; } //BEGIN SHOW ACCOUNTINFO require_once 'require/function_admininfo.php'; $accountinfo_value = interprete_accountinfo($list_fields, $tab_options); $list_fields = $accountinfo_value['LIST_FIELDS']; $list_fields_flip = array_flip($list_fields); //END SHOW ACCOUNTINFO echo $l->g(340) . " " . show_modif($list_fields_flip, 'TAG_CHOISE', 2, $form_name, array('DEFAULT' => "NO")); if (isset($protectedPost['TAG_CHOISE'])) { $tag = $protectedPost['TAG_CHOISE']; } if (array($accountinfo_value['TAB_OPTIONS'])) { $tab_options['REPLACE_VALUE']['ID'] = $accountinfo_value['TAB_OPTIONS']['REPLACE_VALUE'][$list_fields_flip[$tag]]; } unset($list_fields); $list_fields['ID'] = 'ID'; $tab_options['LBL']['ID'] = $list_fields_flip[$tag]; $list_fields['Nbr_mach'] = 'c'; $tab_options['LIEN_LBL']['Nbr_mach'] = "index.php?" . PAG_INDEX . "=" . $pages_refs['ms_all_computers'] . "&filtre=" . $tag . "&value="; $tab_options['LIEN_CHAMP']['Nbr_mach'] = "ID"; $tab_options['LBL']['Nbr_mach'] = $l->g(1120); $list_col_cant_del = $list_fields; $default_fields = $list_fields;
$tab_options['LBL']['SERIAL'] = $l->g(36); } elseif ($protectedPost['onglet'] == 3) { $table_name = "blacklist_subnet"; $tab_options['form_name'] = $form_name; $tab_options['table_name'] = $table_name; $list_fields = array('ID' => 'ID', 'SUBNET' => 'SUBNET', 'MASK' => 'MASK', 'SUP' => 'ID', 'CHECK' => 'ID'); $list_col_cant_del = $list_fields; $default_fields = $list_fields; $tab_options['FILTRE'] = array('SUBNET' => 'SUBNET', 'MASK' => 'MASK'); $tab_options['LBL_POPUP']['SUP'] = 'SUBNET'; $tab_options['LBL']['SUBNET'] = $l->g(2005); } elseif ($protectedPost['onglet'] == 4) { $list_action[1] = $l->g(95); $list_action[2] = $l->g(36); $list_action[3] = $l->g(2005); echo "<p>" . $l->g(700) . ": " . show_modif($list_action, "BLACK_CHOICE", 2, $form_name) . "</p>"; if (isset($protectedPost['BLACK_CHOICE']) and $protectedPost['BLACK_CHOICE'] != '') { $aff = "<table align=center><tr><td>"; if ($protectedPost['BLACK_CHOICE'] == 1) { $aff .= $l->g(654) . ": </td><td>"; $aff = show_blacklist_fields($MACnb_field, $protectedPost, $MACfield_name, $MACnb_value_by_field, $MACsize, $MACseparat, $javascript_mac); } elseif ($protectedPost['BLACK_CHOICE'] == 3) { $aff .= $l->g(1142) . ": </td><td>"; $aff = show_blacklist_fields($SUBnb_field, $protectedPost, $SUBfield_name, $SUBnb_value_by_field, $SUBsize, $SUBseparat, $chiffres); $aff .= $l->g(1143) . ": </td><td>"; $aff = show_blacklist_fields($MASKnb_field, $protectedPost, $MASKfield_name, $MASKnb_value_by_field, $MASKsize, $MASKseparat, $chiffres); } elseif ($protectedPost['BLACK_CHOICE'] == 2) { $aff .= $l->g(702) . ": </td><td>"; $aff = show_blacklist_fields($SERIALnb_field, $protectedPost, $SERIALfield_name, $SERIALnb_value_by_field, $SERIALsize, $SERIALseparat); //$aff.="</td></tr>"; }
$myids = mysql2_prepare('', array(), $my_id); } if (isset($_SESSION['OCS']['ADMIN_CONSOLE'])) { $edit = 0; } else { $edit = 3; } $no_restrict = array("OCS_REPORT_NB_ALL_COMPUTOR"); $multi_search = array("OCS_REPORT_NB_NOTIFIED" => array("FIELD" => '', "COMP" => '', "VALUE" => ''), "OCS_REPORT_NB_ERR" => array("FIELD" => '', "COMP" => '', "VALUE" => ''), "OCS_REPORT_NB_CONTACT" => array("FIELD" => 'HARDWARE-LASTCOME', "COMP" => 'tall', "VALUE" => date($l->g(1242))), "OCS_REPORT_NB_INV" => array("FIELD" => 'HARDWARE-LASTDATE', "COMP" => 'tall', "VALUE" => date($l->g(1242))), "OCS_REPORT_NB_4_MOMENT" => array("FIELD" => 'HARDWARE-LASTCOME', "COMP" => 'small', "VALUE" => date($l->g(1242), mktime(0, 0, 0, date("m"), date("d") - $data_limit['GUI_REPORT_AGIN_MACH'], date("Y")))), "OCS_REPORT_NB_HARD_DISK_H" => array("FIELD" => '', "COMP" => '', "VALUE" => ''), "OCS_REPORT_OSNAME" => array("FIELD" => 'HARDWARE-OSNAME', "COMP" => '', "VALUE" => ''), "OCS_REPORT_USERAGENT" => array("FIELD" => 'HARDWARE-USERAGENT', "COMP" => 'exact', "VALUE" => ''), "OCS_REPORT_PROCESSORT" => array("FIELD" => 'HARDWARE-PROCESSORT', "COMP" => 'exact', "VALUE" => ''), "OCS_REPORT_RESOLUTION" => array("FIELD" => 'VIDEOS-RESOLUTION', "COMP" => '', "VALUE" => ''), "OCS_REPORT_WORKGROUP" => array("FIELD" => 'HARDWARE-WORKGROUP', "COMP" => 'exact', "VALUE" => ''), "OCS_REPORT_TAG" => array("FIELD" => 'ACCOUNTINFO-TAG', "COMP" => 'exact', "VALUE" => ''), "OCS_REPORT_IPSUBNET" => array("FIELD" => 'NETWORKS-IPSUBNET', "COMP" => 'exact', "VALUE" => ''), "OCS_REPORT_NB_LIMIT_FREQ_H" => array("FIELD" => 'HARDWARE-PROCESSORS', "COMP" => 'tall', "VALUE" => $data_limit['GUI_REPORT_PROC_MAX']), "OCS_REPORT_NB_LIMIT_FREQ_M" => array("FIELD" => 'HARDWARE-PROCESSORS', "COMP" => 'small', "VALUE" => $data_limit['GUI_REPORT_PROC_MINI']), "OCS_REPORT_NB_LIMIT_FREQ_B" => array("FIELD" => 'HARDWARE-PROCESSORS,HARDWARE-PROCESSORS', "COMP" => 'tall,small', "VALUE" => $data_limit['GUI_REPORT_PROC_MINI'] . ',' . $data_limit['GUI_REPORT_PROC_MAX']), "OCS_REPORT_NB_LIMIT_MEM_H" => array("FIELD" => 'HARDWARE-MEMORY', "COMP" => 'tall', "VALUE" => $data_limit['GUI_REPORT_RAM_MAX']), "OCS_REPORT_NB_LIMIT_MEM_M" => array("FIELD" => 'HARDWARE-MEMORY', "COMP" => 'small', "VALUE" => $data_limit['GUI_REPORT_RAM_MINI']), "OCS_REPORT_NB_LIMIT_MEM_B" => array("FIELD" => 'HARDWARE-MEMORY,HARDWARE-MEMORY', "COMP" => 'tall,small', "VALUE" => $data_limit['GUI_REPORT_RAM_MINI'] . ',' . $data_limit['GUI_REPORT_RAM_MAX']), "OCS_REPORT_NB_NOTIFIED" => array("FIELD" => 'DEVICES-DOWNLOAD', "COMP" => 'exact', "VALUE" => 'NULL', 'VALUE2' => $l->g(482), 'TYPE_FIELD' => "SelFieldValue"), "OCS_REPORT_NB_ERR" => array("FIELD" => 'DEVICES-DOWNLOAD', "COMP" => 'exact', "VALUE" => 'NULL', 'VALUE2' => "***" . $l->g(956) . "***", 'TYPE_FIELD' => "SelFieldValue")); $table = array("OCS_REPORT_WORKGROUP" => "hardware", "OCS_REPORT_TAG" => "accountinfo", "OCS_REPORT_IPSUBNET" => "networks", "OCS_REPORT_NB_NOTIFIED" => "devices", "OCS_REPORT_NB_ERR" => "devices", "OCS_REPORT_OSNAME" => "hardware", "OCS_REPORT_USERAGENT" => "hardware", "OCS_REPORT_PROCESSORT" => "hardware", "OCS_REPORT_RESOLUTION" => "videos", "OCS_REPORT_NB_LIMIT_FREQ_H" => "hardware", "OCS_REPORT_NB_LIMIT_FREQ_M" => "hardware", "OCS_REPORT_NB_LIMIT_FREQ_B" => "hardware", "OCS_REPORT_NB_LIMIT_MEM_H" => "hardware", "OCS_REPORT_NB_LIMIT_MEM_M" => "hardware", "OCS_REPORT_NB_LIMIT_MEM_B" => "hardware", "OCS_REPORT_NB_ALL_COMPUTOR" => "hardware", "OCS_REPORT_NB_COMPUTOR" => "hardware", "OCS_REPORT_NB_CONTACT" => "hardware", "OCS_REPORT_NB_INV" => "hardware", "OCS_REPORT_NB_4_MOMENT" => "hardware", "OCS_REPORT_NB_SNMP" => "snmp", "OCS_REPORT_NB_HARD_DISK_H" => "drives", "OCS_REPORT_NB_HARD_DISK_M" => "drives", "OCS_REPORT_NB_HARD_DISK_B" => "drives", "OCS_REPORT_NB_IPDISCOVER" => "nk", "OCS_REPORT_NB_LAST_INV" => "hardware"); $table_field = array("OCS_REPORT_WORKGROUP" => array($l->g(33) => "workgroup"), "OCS_REPORT_TAG" => array($_SESSION['OCS']['TAG_LBL']['TAG'] => "tag"), "OCS_REPORT_IPSUBNET" => array($l->g(316) => "ipsubnet"), "OCS_REPORT_NB_NOTIFIED" => "devices", "OCS_REPORT_NB_ERR" => "devices", "OCS_REPORT_OSNAME" => array($l->g(25) => "osname"), "OCS_REPORT_USERAGENT" => array($l->g(218) => "useragent"), "OCS_REPORT_PROCESSORT" => array($l->g(350) => "processort"), "OCS_REPORT_RESOLUTION" => array($l->g(62) => "resolution"), "OCS_REPORT_NB_LIMIT_FREQ_H" => "hardware", "OCS_REPORT_NB_LIMIT_FREQ_M" => "hardware", "OCS_REPORT_NB_LIMIT_FREQ_B" => "hardware", "OCS_REPORT_NB_LIMIT_MEM_H" => "hardware", "OCS_REPORT_NB_LIMIT_MEM_M" => "hardware", "OCS_REPORT_NB_LIMIT_MEM_B" => "hardware", "OCS_REPORT_NB_ALL_COMPUTOR" => "hardware", "OCS_REPORT_NB_COMPUTOR" => "hardware", "OCS_REPORT_NB_CONTACT" => "hardware", "OCS_REPORT_NB_INV" => "hardware", "OCS_REPORT_NB_4_MOMENT" => "hardware", "OCS_REPORT_NB_SNMP" => "snmp", "OCS_REPORT_NB_HARD_DISK_H" => "drives", "OCS_REPORT_NB_HARD_DISK_M" => "drives", "OCS_REPORT_NB_HARD_DISK_B" => "drives", "OCS_REPORT_NB_IPDISCOVER" => "networks", "OCS_REPORT_NB_LAST_INV" => array("NAME" => "NAME", "ID" => "ID", $l->g(25) => "osname", $l->g(218) => "useragent")); $link = array("OCS_REPORT_WORKGROUP" => array("RELOAD" => 'OCS_REPORT_WORKGROUP'), "OCS_REPORT_TAG" => array("RELOAD" => 'OCS_REPORT_TAG'), "OCS_REPORT_IPSUBNET" => array("RELOAD" => 'OCS_REPORT_IPSUBNET'), "OCS_REPORT_NB_NOTIFIED" => array("PAGE" => 'ms_multi_search'), "OCS_REPORT_NB_ERR" => array("PAGE" => 'ms_multi_search'), "OCS_REPORT_OSNAME" => array("RELOAD" => 'OCS_REPORT_OSNAME'), "OCS_REPORT_USERAGENT" => array("RELOAD" => 'OCS_REPORT_USERAGENT'), "OCS_REPORT_PROCESSORT" => array("RELOAD" => 'OCS_REPORT_PROCESSORT'), "OCS_REPORT_RESOLUTION" => array("RELOAD" => 'OCS_REPORT_RESOLUTION'), "OCS_REPORT_NB_LIMIT_FREQ_H" => array("PAGE" => 'ms_multi_search'), "OCS_REPORT_NB_LIMIT_FREQ_M" => array("PAGE" => 'ms_multi_search'), "OCS_REPORT_NB_LIMIT_FREQ_B" => array("PAGE" => 'ms_multi_search'), "OCS_REPORT_NB_LIMIT_MEM_H" => array("PAGE" => 'ms_multi_search'), "OCS_REPORT_NB_LIMIT_MEM_M" => array("PAGE" => 'ms_multi_search'), "OCS_REPORT_NB_LIMIT_MEM_B" => array("PAGE" => 'ms_multi_search'), "OCS_REPORT_NB_ALL_COMPUTOR" => '', "OCS_REPORT_NB_COMPUTOR" => array("PAGE" => 'ms_all_computers'), "OCS_REPORT_NB_CONTACT" => array("PAGE" => 'ms_multi_search'), "OCS_REPORT_NB_INV" => array("PAGE" => 'ms_multi_search'), "OCS_REPORT_NB_4_MOMENT" => array("PAGE" => 'ms_multi_search'), "OCS_REPORT_NB_SNMP" => array("PAGE" => 'ms_snmp'), "OCS_REPORT_NB_IPDISCOVER" => array("PAGE" => 'ms_ipdiscover'), "OCS_REPORT_NB_LAST_INV" => array("RELOAD" => 'OCS_REPORT_NB_LAST_INV')); //all fields repart on categories $repart = array("OCS_REPORT_WORKGROUP" => "ELSE", "OCS_REPORT_TAG" => "ELSE", "OCS_REPORT_IPSUBNET" => "ELSE", "OCS_REPORT_NB_NOTIFIED" => "ELSE", "OCS_REPORT_NB_ERR" => "ELSE", "OCS_REPORT_OSNAME" => "SOFT", "OCS_REPORT_USERAGENT" => "SOFT", "OCS_REPORT_PROCESSORT" => "HARD", "OCS_REPORT_RESOLUTION" => "HARD", "OCS_REPORT_NB_LIMIT_FREQ_H" => "HARD", "OCS_REPORT_NB_LIMIT_FREQ_M" => "HARD", "OCS_REPORT_NB_LIMIT_FREQ_B" => "HARD", "OCS_REPORT_NB_LIMIT_MEM_H" => "HARD", "OCS_REPORT_NB_LIMIT_MEM_M" => "HARD", "OCS_REPORT_NB_LIMIT_MEM_B" => "HARD", "OCS_REPORT_NB_ALL_COMPUTOR" => "ACTIVITY", "OCS_REPORT_NB_COMPUTOR" => "ACTIVITY", "OCS_REPORT_NB_CONTACT" => "ACTIVITY", "OCS_REPORT_NB_INV" => "ACTIVITY", "OCS_REPORT_NB_4_MOMENT" => "ACTIVITY", "OCS_REPORT_NB_SNMP" => "ACTIVITY", "OCS_REPORT_NB_HARD_DISK_H" => "HARD", "OCS_REPORT_NB_HARD_DISK_M" => "HARD", "OCS_REPORT_NB_HARD_DISK_B" => "HARD", "OCS_REPORT_NB_IPDISCOVER" => "ACTIVITY", "OCS_REPORT_NB_LAST_INV" => "ACTIVITY"); //all lbl fields $lbl_field = array("OCS_REPORT_WORKGROUP" => $l->g(778), "OCS_REPORT_TAG" => $l->g(779), "OCS_REPORT_IPSUBNET" => $l->g(780), "OCS_REPORT_NB_NOTIFIED" => $l->g(781), "OCS_REPORT_NB_ERR" => $l->g(782), "OCS_REPORT_OSNAME" => $l->g(783), "OCS_REPORT_USERAGENT" => $l->g(784), "OCS_REPORT_PROCESSORT" => $l->g(785), "OCS_REPORT_RESOLUTION" => $l->g(786), "OCS_REPORT_NB_LIMIT_FREQ_H" => $l->g(787) . " <b>" . show_modif($data_limit['GUI_REPORT_PROC_MAX'], "GUI_REPORT_PROC_MAX", $edit, '', array('JAVASCRIPT' => valid_modif("GUI_REPORT_PROC_MAX"))) . "</b> " . $l->g(1239), "OCS_REPORT_NB_LIMIT_FREQ_M" => $l->g(788) . " <b>" . show_modif($data_limit['GUI_REPORT_PROC_MINI'], "GUI_REPORT_PROC_MINI", $edit, '', array('JAVASCRIPT' => valid_modif("GUI_REPORT_PROC_MINI"))) . "</b> " . $l->g(1239), "OCS_REPORT_NB_LIMIT_FREQ_B" => $l->g(789) . " <b>" . $data_limit['GUI_REPORT_PROC_MINI'] . "</b> " . $l->g(1239) . " " . $l->g(582) . " <b>" . $data_limit['GUI_REPORT_PROC_MAX'] . "</b> " . $l->g(1239), "OCS_REPORT_NB_LIMIT_MEM_H" => $l->g(790) . " <b>" . show_modif($data_limit['GUI_REPORT_RAM_MAX'], "GUI_REPORT_RAM_MAX", $edit, '', array('JAVASCRIPT' => valid_modif("GUI_REPORT_RAM_MAX"))) . "</b> " . $l->g(1240), "OCS_REPORT_NB_LIMIT_MEM_M" => $l->g(791) . " <b>" . show_modif($data_limit['GUI_REPORT_RAM_MINI'], "GUI_REPORT_RAM_MINI", $edit, '', array('JAVASCRIPT' => valid_modif("GUI_REPORT_RAM_MINI"))) . "</b> " . $l->g(1240), "OCS_REPORT_NB_LIMIT_MEM_B" => $l->g(792) . " <b>" . $data_limit['GUI_REPORT_RAM_MINI'] . "</b> " . $l->g(1240) . " " . $l->g(582) . " <b>" . $data_limit['GUI_REPORT_RAM_MAX'] . "</b> " . $l->g(1240), "OCS_REPORT_NB_ALL_COMPUTOR" => $l->g(793), "OCS_REPORT_NB_COMPUTOR" => $l->g(794), "OCS_REPORT_NB_CONTACT" => $l->g(795), "OCS_REPORT_NB_INV" => $l->g(796), "OCS_REPORT_NB_4_MOMENT" => $l->g(797) . " <b>" . show_modif($data_limit['GUI_REPORT_AGIN_MACH'], "GUI_REPORT_AGIN_MACH", $edit, '', array('JAVASCRIPT' => valid_modif("GUI_REPORT_AGIN_MACH"))) . "</b> " . $l->g(496), "OCS_REPORT_NB_HARD_DISK_H" => $l->g(813) . " <b>" . show_modif($data_limit['GUI_REPORT_DD_MAX'], "GUI_REPORT_DD_MAX", $edit, '', array('JAVASCRIPT' => valid_modif("GUI_REPORT_DD_MAX"))) . "</b> " . $l->g(1240), "OCS_REPORT_NB_HARD_DISK_M" => $l->g(814) . " <b>" . show_modif($data_limit['GUI_REPORT_DD_MINI'], "GUI_REPORT_DD_MINI", $edit, '', array('JAVASCRIPT' => valid_modif("GUI_REPORT_DD_MINI"))) . "</b> " . $l->g(1240), "OCS_REPORT_NB_HARD_DISK_B" => $l->g(815) . " <b>" . $data_limit['GUI_REPORT_DD_MINI'] . "</b> " . $l->g(1240) . " " . $l->g(582) . " <b>" . $data_limit['GUI_REPORT_DD_MAX'] . "</b> " . $l->g(1240), "OCS_REPORT_NB_IPDISCOVER" => $l->g(913), "OCS_REPORT_NB_LAST_INV" => $l->g(914) . " <b>" . show_modif($data_limit['GUI_REPORT_LAST_DIFF'], "GUI_REPORT_LAST_DIFF", $edit, '', array('JAVASCRIPT' => valid_modif("GUI_REPORT_LAST_DIFF"))) . "</b> " . $l->g(496), "OCS_REPORT_NB_SNMP" => $l->g(1241)); $sql_field = array("OCS_REPORT_WORKGROUP" => array('ARG' => array('count(distinct workgroup) c', $table["OCS_REPORT_WORKGROUP"], '')), "OCS_REPORT_TAG" => array('ARG' => array('count(distinct tag) c', $table["OCS_REPORT_TAG"], '')), "OCS_REPORT_IPSUBNET" => array('ARG' => array('count(distinct ipsubnet) c', $table["OCS_REPORT_IPSUBNET"], '')), "OCS_REPORT_NB_NOTIFIED" => array('SQL' => "select %s from %s where NAME='%s' and TVALUE is null", 'ARG' => array('count(distinct hardware_id) c', $table["OCS_REPORT_NB_NOTIFIED"], 'DOWNLOAD')), "OCS_REPORT_NB_ERR" => array('SQL' => "select %s from %s where NAME='%s' and TVALUE like '%s'", 'ARG' => array('count(distinct hardware_id) c', $table["OCS_REPORT_NB_ERR"], "DOWNLOAD", "ERR_%")), "OCS_REPORT_OSNAME" => array('ARG' => array('count(distinct osname) c', $table["OCS_REPORT_OSNAME"], '')), "OCS_REPORT_USERAGENT" => array('ARG' => array('count(distinct useragent) c', $table["OCS_REPORT_USERAGENT"], '')), "OCS_REPORT_PROCESSORT" => array('ARG' => array('count(distinct processort) c', $table["OCS_REPORT_PROCESSORT"], '')), "OCS_REPORT_RESOLUTION" => array('ARG' => array('count(distinct resolution) c', $table["OCS_REPORT_RESOLUTION"], '')), "OCS_REPORT_NB_LIMIT_FREQ_H" => array('ARG' => array('count(id) c', $table["OCS_REPORT_NB_LIMIT_FREQ_H"], "where processors >= " . $data_limit['GUI_REPORT_PROC_MAX'])), "OCS_REPORT_NB_LIMIT_FREQ_M" => array('ARG' => array('count(id) c', $table["OCS_REPORT_NB_LIMIT_FREQ_M"], "where processors <= " . $data_limit['GUI_REPORT_PROC_MINI'])), "OCS_REPORT_NB_LIMIT_FREQ_B" => array('ARG' => array('count(id) c', $table["OCS_REPORT_NB_LIMIT_FREQ_B"], "where processors <= " . $data_limit['GUI_REPORT_PROC_MAX'] . " and processors >= " . $data_limit['GUI_REPORT_PROC_MINI'])), "OCS_REPORT_NB_LIMIT_MEM_H" => array('ARG' => array('count(id) c', $table["OCS_REPORT_NB_LIMIT_MEM_H"], "where memory >= " . $data_limit['GUI_REPORT_RAM_MAX'])), "OCS_REPORT_NB_LIMIT_MEM_M" => array('ARG' => array('count(id) c', $table["OCS_REPORT_NB_LIMIT_MEM_M"], "where memory <= " . $data_limit['GUI_REPORT_RAM_MINI'])), "OCS_REPORT_NB_LIMIT_MEM_B" => array('ARG' => array('count(id) c', $table["OCS_REPORT_NB_LIMIT_MEM_B"], "where memory <= " . $data_limit['GUI_REPORT_RAM_MAX'] . " and memory >= " . $data_limit['GUI_REPORT_RAM_MINI'])), "OCS_REPORT_NB_ALL_COMPUTOR" => array('ARG' => array('count(id) c', $table["OCS_REPORT_NB_ALL_COMPUTOR"], '')), "OCS_REPORT_NB_COMPUTOR" => array('ARG' => array('count(id) c', $table["OCS_REPORT_NB_COMPUTOR"], '')), "OCS_REPORT_NB_CONTACT" => array('SQL' => "select %s from %s where lastcome >= date_format(sysdate(),'%s')", 'ARG' => array('count(id) c', $table["OCS_REPORT_NB_CONTACT"], "%Y-%m-%d 00:00:00")), "OCS_REPORT_NB_INV" => array('SQL' => "select %s from %s where lastdate > date_format(sysdate(),'%s')", 'ARG' => array('count(id) c', $table["OCS_REPORT_NB_INV"], "%Y-%m-%d 00:00:00")), "OCS_REPORT_NB_4_MOMENT" => array('ARG' => array('count(id) c', $table["OCS_REPORT_NB_4_MOMENT"], "where unix_timestamp(lastcome) < unix_timestamp(sysdate())-(" . $data_limit['GUI_REPORT_AGIN_MACH'] . "*86400)")), "OCS_REPORT_NB_HARD_DISK_H" => array('SQL' => "select %s from %s where type='%s' and free>%s", 'ARG' => array('count(distinct(hardware_id)) c', $table["OCS_REPORT_NB_HARD_DISK_H"], "Hard Drive", $data_limit['GUI_REPORT_DD_MAX'])), "OCS_REPORT_NB_HARD_DISK_M" => array('SQL' => "select %s from %s where type='%s' and free<%s", 'ARG' => array('count(distinct(hardware_id)) c', $table["OCS_REPORT_NB_HARD_DISK_M"], "Hard Drive", $data_limit['GUI_REPORT_DD_MINI'])), "OCS_REPORT_NB_HARD_DISK_B" => array('SQL' => "select %s from %s where type='%s' and free<%s and free>=%s", 'ARG' => array('count(distinct(hardware_id)) c', $table["OCS_REPORT_NB_HARD_DISK_B"], "Hard Drive", $data_limit['GUI_REPORT_DD_MAX'], $data_limit['GUI_REPORT_DD_MINI'])), "OCS_REPORT_NB_IPDISCOVER" => array('SQL' => "select %s c from netmap ", 'ARG' => array(count_noinv_network_devices())), "OCS_REPORT_NB_LAST_INV" => array('ARG' => array('count(id) c', $table["OCS_REPORT_NB_LAST_INV"], " where floor((unix_timestamp(lastcome) - unix_timestamp(lastdate) )/86400) >= " . $data_limit['GUI_REPORT_LAST_DIFF'] . " ")), "OCS_REPORT_NB_SNMP" => array('ARG' => array('count(id) c', $table["OCS_REPORT_NB_SNMP"], ''))); function define_tab($data_on = array()) { global $l; $data_on['ACTIVITY'] = mb_strtoupper($l->g(798), 'UTF-8'); $data_on['SOFT'] = mb_strtoupper($l->g(20), 'UTF-8'); $data_on['HARD'] = mb_strtoupper($l->g(799), 'UTF-8'); $data_on['ELSE'] = mb_strtoupper($l->g(800), 'UTF-8'); if ($_SESSION['OCS']['profile']->getConfigValue('CONSOLE') == "YES") { //$data_on['ADMIN']['CONFIG']=mb_strtoupper($l->g(107)); $data_on['ADMIN']['MSG'] = mb_strtoupper($l->g(915), 'UTF-8'); if (!isset($default)) { $default = 'MSG'; } }
$list_fields = array($_SESSION['OCS']['TAG_LBL']['TAG'] => 'tag', 'SUP' => 'tag', 'CHECK' => 'tag'); $list_col_cant_del = array('ID' => 'ID', 'SUP' => 'SUP', 'CHECK' => 'CHECK'); $default_fields = $list_fields; $sql = prepare_sql_tab($list_fields, array('SUP', 'CHECK')); $sql['SQL'] .= " FROM tags where login='******'"; array_push($sql['ARG'], $protectedGet['id']); $tab_options['ARG_SQL'] = $sql['ARG']; $tab_options['ARG_SQL_COUNT'] = $protectedGet['id']; $tab_options['FILTRE'] = array($_SESSION['OCS']['TAG_LBL']['TAG'] => $_SESSION['OCS']['TAG_LBL']['TAG']); $tab_options['table_name'] = $table_name; ajaxtab_entete_fixe($list_fields, $default_fields, $tab_options, $list_col_cant_del); //traitement par lot del_selection($form_name); if (is_array($info_value_tag) and !isset($protectedPost['use_generic_0'])) { $type = 2; } else { $type = 0; $info_value_tag = $protectedPost['newtag']; } $select_choise = show_modif($info_value_tag, 'newtag', $type); echo $l->g(617) . " " . $_SESSION['OCS']['TAG_LBL']['TAG'] . ": " . $select_choise; echo "<input type='submit' name='ADD_TAG' value='" . $l->g(13) . "'><br>"; echo show_modif(array($l->g(358)), 'use_generic', 5, $form_name); echo close_form(); if ($ajax) { ob_end_clean(); tab_req($list_fields, $default_fields, $list_col_cant_del, $sql['SQL'], $tab_options); } ?>
} elseif ($key == 'ERR_') { $_SESSION['OCS']['SQL_DATA_FIXE'][$table_name][$key] = $sql_data_fixe_ter . " group by FILEID"; } } } } $tab_options['COLOR']['ERR_'] = 'RED'; $tab_options['COLOR']['SUCC'] = 'GREEN'; $tab_options['COLOR']['NOTI'] = 'GREY'; $tab_options['COLOR']['NO_NOTIF'] = 'BLACK'; $tab_options['FILTRE'] = array('FILEID' => 'Timestamp', 'NAME' => $l->g(49)); $tab_options['TYPE']['ZIP'] = $protectedPost['SHOW_SELECT']; $tab_options['FIELD_REPLACE_VALUE_ALL_TIME'] = 'FILEID'; $tab_options['form_name'] = $form_name; $tab_options['table_name'] = $table_name; $result_exist = ajaxtab_entete_fixe($list_fields, $default_fields, $tab_options, $list_col_cant_del); //only for profils who can activate packet if (!$cant_active) { del_selection($form_name); if ($protectedPost['SHOW_SELECT'] == 'download') { $config_input = array('MAXLENGTH' => 10, 'SIZE' => 15); $activ_manuel = show_modif($protectedPost['manualActive'], 'manualActive', 0, '', $config_input); echo "<b>" . $l->g(476) . "</b> " . $l->g(475) . ": " . $activ_manuel . ""; echo "<a href='#' OnClick='manualActive();'><img src='image/activer.png'></a>"; } } echo close_form(); if ($ajax) { ob_end_clean(); tab_req($list_fields, $default_fields, $list_col_cant_del, $querypack['SQL'], $tab_options); }
$list_categories['IGNORED'] = "IGNORED"; $list_categories['UNCHANGED'] = "UNCHANGED"; $sql_list_categories = "select distinct(formatted) name from dico_soft where formatted!=extracted order by formatted"; $result_list_categories = mysqli_query($_SESSION['OCS']["readServer"], $sql_list_categories); while ($item_list_categories = mysqli_fetch_object($result_list_categories)) { $list_categories[$item_list_categories->name] = $item_list_categories->name; } //définition de toutes les options possibles $choix_affect['NEW_CAT'] = $l->g(385); $choix_affect['EXIST_CAT'] = $l->g(387); $trans .= show_modif($choix_affect, "AFFECT_TYPE", '2', $form_name); if ($protectedPost['AFFECT_TYPE'] == 'EXIST_CAT') { $trans .= show_modif($list_categories, "EXIST_CAT", '2'); $verif_field = "EXIST_CAT"; } elseif ($protectedPost['AFFECT_TYPE'] == 'NEW_CAT') { $trans .= show_modif(stripslashes($protectedPost['NEW_CAT']), "NEW_CAT", '0'); $verif_field = "NEW_CAT"; } if ($protectedPost['AFFECT_TYPE'] != '') { $trans .= "<input type='button' name='TRANSF' value='" . $l->g(13) . "' onclick='return verif_field(\"" . $verif_field . "\",\"TRANS\",\"" . $form_name . "\");'>"; } echo "<tr><td>" . $search . "<input type='submit' value='" . $l->g(393) . "'><input type='button' value='" . $l->g(396) . "' onclick='return pag(\"RESET\",\"RESET\",\"" . $form_name . "\");'>"; if ($result_exist != FALSE) { echo "<div align=right> " . $trans . "</div>"; } echo "</td></tr></table>"; echo '</div>'; echo "<input type='hidden' name='RESET' id='RESET' value=''>"; echo "<input type='hidden' name='TRANS' id='TRANS' value=''>"; echo "<input type='hidden' name='SUP_CAT' id='SUP_CAT' value=''>"; echo close_form();
//require_once('fichierConf.class.php'); $form_name = 'admin_search'; //$ban_head='no'; //require_once("header.php"); if ($protectedPost['onglet'] != $protectedPost['old_onglet']) { $onglet = $protectedPost['onglet']; $old_onglet = $protectedPost['old_onglet']; unset($protectedPost); $protectedPost['old_onglet'] = $old_onglet; $protectedPost['onglet'] = $onglet; } if ($protectedGet['origine'] != "mach") { if (isset($protectedGet['idchecked']) and $protectedGet['idchecked'] != "") { $choise_req_selection['REQ'] = $l->g(584); $choise_req_selection['SEL'] = $l->g(585); $select_choise = show_modif($choise_req_selection, 'CHOISE', 2, $form_name); } echo "<font color=red><b>"; if ($protectedPost['CHOISE'] == 'REQ' or $protectedGet['idchecked'] == '' or $protectedPost['CHOISE'] == '') { echo $l->g(901); $list_id = $_SESSION['OCS']['ID_REQ']; } if ($protectedPost['CHOISE'] == 'SEL') { echo $l->g(902); $list_id = $protectedGet['idchecked']; } //gestion tableau if (is_array($list_id)) { $list_id = implode(",", $list_id); } } else {
$tab_typ_champ[$i]['INPUT_TYPE'] = $convert_type[$field_of_accountinfo['LIST_TYPE'][$id]]; $tab_typ_champ[$i]['CONFIG']['JAVASCRIPT'] = $java . " onclick='document.getElementById(\"check" . $truename . "\").checked = true' "; //$tab_typ_champ[$i]['DEFAULT_VALUE']=$protectedPost[$truename]; $tab_name[$i] = $lbl; $i++; } } tab_modif_values($tab_name, $tab_typ_champ, array('TAG_MODIF' => $protectedPost['MODIF'], 'FIELD_FORMAT' => $type_field[$protectedPost['MODIF']]), array('title' => $l->g(895))); } elseif ($protectedPost['onglet'] == "SUP_PACK") { echo "<div class='mvt_bordure'>"; $queryDetails = "select d_a.fileid,d_a.name \n\t\t\t\t\t\t\t\t\tfrom download_available d_a, download_enable d_e \n\t\t\t\t\t\t\t\t\twhere d_e.FILEID=d_a.FILEID group by d_a.NAME order by 1 desc"; $resultDetails = mysql2_query_secure($queryDetails, $_SESSION['OCS']["readServer"]); while ($val = mysqli_fetch_array($resultDetails)) { $List[$val["fileid"]] = $val["name"]; } $select = show_modif($List, 'pack_list', 2, $form_name); echo $l->g(970) . ": " . $select; if ($protectedPost['pack_list'] != "") { $sql = "select count(*) c, tvalue from download_enable d_e,devices d\n\t\t\t\t\t\t\twhere d.name='DOWNLOAD' and d.IVALUE=d_e.ID and d_e.fileid='%s'\n\t\t\t\t\t\t\tand d.hardware_id in "; $arg = array($protectedPost['pack_list']); $tab_result = mysql2_prepare($sql, $arg, $list_id); $sql = $tab_result['SQL'] . " group by tvalue"; $result = mysql2_query_secure($sql, $_SESSION['OCS']["readServer"], $tab_result['ARG']); while ($item = mysqli_fetch_object($result)) { if ($item->tvalue == "") { $value = $l->g(482); } else { $value = $item->tvalue; } echo "<br>" . $item->c . " " . $l->g(1023) . " " . $value . " " . $l->g(1024); }
function gestion_col($entete, $data, $list_col_cant_del, $form_name, $tab_name, $list_fields, $default_fields, $id_form = 'form') { global $protectedPost, $l; //search in cookies columns values if (isset($_COOKIE[$tab_name]) and $_COOKIE[$tab_name] != '' and !isset($_SESSION['OCS']['col_tab'][$tab_name])) { $col_tab = explode("///", $_COOKIE[$tab_name]); foreach ($col_tab as $key => $value) { $_SESSION['OCS']['col_tab'][$tab_name][$value] = $value; } } if (isset($protectedPost['SUP_COL']) and $protectedPost['SUP_COL'] != "") { unset($_SESSION['OCS']['col_tab'][$tab_name][$protectedPost['SUP_COL']]); } if ($protectedPost['restCol' . $tab_name]) { $_SESSION['OCS']['col_tab'][$tab_name][$protectedPost['restCol' . $tab_name]] = $protectedPost['restCol' . $tab_name]; } if ($protectedPost['RAZ'] != "") { unset($_SESSION['OCS']['col_tab'][$tab_name]); $_SESSION['OCS']['col_tab'][$tab_name] = $default_fields; } if (!isset($_SESSION['OCS']['col_tab'][$tab_name])) { $_SESSION['OCS']['col_tab'][$tab_name] = $default_fields; } //add all fields we must have if (is_array($list_col_cant_del)) { if (!is_array($_SESSION['OCS']['col_tab'][$tab_name])) { $_SESSION['OCS']['col_tab'][$tab_name] = array(); } foreach ($list_col_cant_del as $key => $value) { if (!in_array($key, $_SESSION['OCS']['col_tab'][$tab_name])) { $_SESSION['OCS']['col_tab'][$tab_name][$key] = $key; } } } if (is_array($entete)) { if (!is_array($_SESSION['OCS']['col_tab'][$tab_name])) { $_SESSION['OCS']['col_tab'][$tab_name] = array(); } foreach ($entete as $k => $v) { if (in_array($k, $_SESSION['OCS']['col_tab'][$tab_name])) { $data_with_filter['entete'][$k] = $v; if (!isset($list_col_cant_del[$k])) { $data_with_filter['entete'][$k] .= "<a href=# onclick='return pag(\"" . xml_encode($k) . "\",\"SUP_COL\",\"" . $id_form . "\");'><img src=image/delete-small.png></a>"; } } else { $list_rest[$k] = $v; } } } if (is_array($data)) { if (!is_array($_SESSION['OCS']['col_tab'][$tab_name])) { $_SESSION['OCS']['col_tab'][$tab_name] = array(); } foreach ($data as $k => $v) { foreach ($v as $k2 => $v2) { if (in_array($k2, $_SESSION['OCS']['col_tab'][$tab_name])) { $data_with_filter['data'][$k][$k2] = $v2; } } } } if (is_array($list_rest)) { //$list_rest=lbl_column($list_rest); $select_restCol = $l->g(349) . ": " . show_modif($list_rest, 'restCol' . $tab_name, 2, $form_name); $select_restCol .= "<a href=# OnClick='pag(\"" . $tab_name . "\",\"RAZ\",\"" . $id_form . "\");'><img src=image/delete-small.png></a></td></tr></table>"; //</td></tr><tr><td align=center> echo $select_restCol; } else { echo "</td></tr></table>"; } echo "<input type='hidden' id='SUP_COL' name='SUP_COL' value=''>"; echo "<input type='hidden' id='TABLE_NAME' name='TABLE_NAME' value='" . $tab_name . "'>"; echo "<input type='hidden' id='RAZ' name='RAZ' value=''>"; return $data_with_filter; }
$protectedPost['onglet'] = 'CONNEXION'; } if ($protectedPost['onglet'] == 'CONNEXION' or $protectedPost['onglet'] == 'BAD CONNEXION') { $ms_cfg_file = $_SESSION['OCS']['LOG_DIR'] . "log.csv"; if (!is_readable($ms_cfg_file)) { return "NO_FILES"; } $fd = fopen($ms_cfg_file, "r"); $max = 0; $array_profil[7] = $l->g(1259); $array_profil[30] = $l->g(1260); $array_profil['ALL'] = $l->g(215); if (!isset($protectedPost['REST'])) { $protectedPost['REST'] = 7; } $stats .= $l->g(1251) . ": " . show_modif($array_profil, "REST", 2, $form_name) . "<br>"; if (isset($protectedPost['REST']) and $protectedPost['REST'] != 'ALL') { $lastWeek = time() - $protectedPost['REST'] * 24 * 60 * 60; } //msg_error(time()."=>".$lastWeek); //echo date('d/m/Y', $lastWeek) ; while (!feof($fd)) { $line = trim(fgets($fd, 256)); $trait = explode(';', $line); if ($trait[3] == $protectedPost['onglet']) { $h = explode(' ', $trait[1]); $time = explode('/', $h[0]); //echo mktime(0, 0, 0, $time[1], $time[0], $time[2])." => ".$lastWeek."<br>" ; if (mktime(0, 0, 0, $time[1], $time[0], $time[2]) >= $lastWeek) { $find_connexion[$h[0]] = $find_connexion[$h[0]] + 1; if ($find_connexion[$h[0]] > $max) {
function fields_conditions_rules($num, $entete = 'NO') { global $l, $protectedPost; if ($entete != 'NO') { $tab .= "<tr bgcolor='#C7D9F5'><td>" . $l->g(675) . "</td><td>" . $l->g(676) . "</td><td>" . $l->g(677) . "</td><td>" . $l->g(678) . "</td></tr>"; } $CFIELD = array('NAME' => $l->g(679), 'IPADDRESS' => '@IP', 'IPSUBNET' => 'IPSUBNET', 'WORKGROUP' => $l->g(680), 'USERID' => $l->g(681)); $OP = array('EGAL' => "=", 'DIFF' => "<>", 'LIKE' => 'LIKE'); if (!isset($protectedPost["PRIORITE_" . $num])) { $protectedPost["PRIORITE_" . $num] = $num; } $tab .= "<tr><td>" . show_modif($protectedPost["PRIORITE_" . $num], "PRIORITE_" . $num, '0') . "</td>"; $tab .= "<td>" . show_modif($CFIELD, "CFIELD_" . $num, '2') . "</td>"; $tab .= "<td>" . show_modif($OP, "OP_" . $num, '2') . "</td>"; $tab .= "<td>" . show_modif($CFIELD, "COMPTO_" . $num, '2') . "</td>"; return $tab; }
$list_col_cant_del = array('SUP' => 'SUP', 'CHECK' => 'CHECK'); $default_fields = array('TAG' => 'tag'); $sql = prepare_sql_tab($list_fields, $list_col_cant_del); $sql['SQL'] = "SELECT tag FROM tags where login='******'"; $sql['ARG'] = array($protectedGet["id"]); $tab_options['ARG_SQL'] = $sql['ARG']; $queryDetails = $sql['SQL']; $tab_options['LBL']['SUP'] = $l->g(122); ajaxtab_entete_fixe($list_fields, $default_fields, $tab_options, $list_col_cant_del); $img['image/delete.png'] = $l->g(162); del_selection($form_name); if (is_array($info_value_tag) and !isset($protectedPost['use_generic_0'])) { $type = 2; } else { $type = 0; $info_value_tag = $protectedPost['newtag']; } $select_choise = show_modif($info_value_tag, 'newtag', $type); echo "<br>"; echo $l->g(617) . " " . $_SESSION['OCS']['TAG_LBL']['TAG'] . ": " . $select_choise; echo "<input type='submit' name='ADD_TAG' value='" . $l->g(13) . "'><br>"; //echo show_modif(array($l->g(358)),'use_generic',5,$form_name); echo $l->g(358); echo close_form(); if ($ajax) { ob_end_clean(); tab_req($list_fields, $default_fields, $list_col_cant_del, $queryDetails, $tab_options); } ?>
if ($_SESSION['OCS']['profile']->getRestriction('TELEDIFF_VISIBLE', 'YES') == "YES") { $sql_download .= " where d_a.comment not like '%[VISIBLE=0]%'"; } $sql_download .= " order by 2"; $opt3Select = array("DEVICES-DOWNLOAD" => $sort_list_3Select["DEVICES-DOWNLOAD"], "DEVICES-DOWNLOAD-SQL1" => $sql_download, "DEVICES-DOWNLOAD-SQL2" => "select '***" . $l->g(509) . "***' as 'NAME' union select '***" . $l->g(548) . "***' union select '***" . $l->g(956) . "***' union select '***" . $l->g(957) . "***' union select '" . $l->g(482) . "' union select distinct TVALUE from devices where name='DOWNLOAD' and tvalue!='' order by 1", "DEVICES-DOWNLOAD-SELECT" => array('exact' => $l->g(507), 'diff' => $l->g(508))); $optArray = array_merge($optSelectField, $opt2SelectField, $opt2Select, $optSelect, $optSelect2Field, $opt3Select); $sort_list = array_merge($sort_accountinfo, $sort_list, $sort_list_3Select, $sort_list_Select2Field, $sort_list_2Select, $sort_list_2SelectField, $sort_list_Select); $countHl++; $optArray_trait[$l->g(32)] = "... " . $l->g(32) . " ..."; foreach ($sort_list as $key => $value) { $optArray_trait[$key] = ucfirst($value); $countHl++; } asort($optArray_trait); $protectedPost['multiSearch'] = $l->g(32); $aff_field_search = $l->g(31) . ": " . show_modif($optArray_trait, 'multiSearch', 2, $form_name, array('DEFAULT' => 'NO')); $aff_field_search .= "<img src='image/delete-small.png' onclick='pag(\"ok\",\"reset\",\"" . $form_name . "\");' alt='" . $l->g(41) . "' style='margin-left:20px'>"; echo "<div class='mlt_bordure'>"; echo "<div class='field'>" . $aff_field_search . "</div>"; if (isset($_SESSION['OCS']['multiSearch']) and $_SESSION['OCS']['multiSearch'] != null) { $c = 0; foreach ($_SESSION['OCS']['multiSearch'] as $k => $v) { if (!isset($alreadyExist[$v])) { $alreadyExist[$v] = 'YES'; $ajout = ''; } else { $ajout = $v; } $color = $c % 2 == 0 ? "#F2F2F2" : "#FFFFFF"; show_ligne($v, $color, $k, $ajout, $form_name); $c++;
echo "<tr><td align =center colspan=10>"; if (isset($protectedPost['CHOISE']) and $protectedPost['CHOISE'] != "") { echo $select; echo "</td></tr>"; //if user want give up or go out of the group if ($protectedPost['NEW_RAZ'] == "RAZ" or $protectedPost['NEW_RAZ'] == "ADD") { $List = $all_groups; } if ($protectedPost['NEW_RAZ'] == "DEL") { $List = $groupDelList; } if ($protectedPost['NEW_RAZ'] == "NEW") { $nom = show_modif($protectedPost['NAME_GROUP'], 'NAME_GROUP', 0, ''); $lbl = show_modif($protectedPost['LBL_GROUP'], 'LBL_GROUP', 1, ''); $addgroup = "<tr><td align=center>" . $l->g(49) . ":</td><td align=left>" . $nom . "</td></tr>"; $addgroup .= "<tr><td align=center>" . $l->g(53) . ":</td><td align=left>" . $lbl . "</td></tr>"; $addgroup .= $valid; echo $addgroup; } if ($protectedPost['NEW_RAZ'] == "RAZ" or $protectedPost['NEW_RAZ'] == "DEL" or $protectedPost['NEW_RAZ'] == "ADD") { $select = show_modif($List, 'group_list', 2, ''); //list of choise $groupList = "<tr><td align =center>"; $groupList .= $select; $groupList .= "</td></tr>"; $groupList .= $valid; echo $groupList; } } echo "</td></tr></table>"; echo close_form();