本文整理汇总了PHP中mysql2_prepare函数的典型用法代码示例。如果您正苦于以下问题:PHP mysql2_prepare函数的具体用法?PHP mysql2_prepare怎么用?PHP mysql2_prepare使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysql2_prepare函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: look_config_default_values
function look_config_default_values($field_name, $like = '', $default_values = '')
{
if ($like == '') {
$sql = "select NAME,IVALUE,TVALUE,COMMENTS from config where NAME in ";
$arg_sql = array();
$arg = mysql2_prepare($sql, $arg_sql, $field_name);
} else {
$arg['SQL'] = "select NAME,IVALUE,TVALUE,COMMENTS from config where NAME like '%s'";
$arg['ARG'] = $field_name;
}
$resdefaultvalues = mysql2_query_secure($arg['SQL'], $_SESSION['OCS']["readServer"], $arg['ARG']);
while ($item = mysqli_fetch_object($resdefaultvalues)) {
$result['name'][$item->NAME] = $item->NAME;
$result['ivalue'][$item->NAME] = $item->IVALUE;
$result['tvalue'][$item->NAME] = $item->TVALUE;
$result['comments'][$item->NAME] = $item->COMMENTS;
}
if (is_array($default_values)) {
foreach ($default_values as $key => $value) {
$key = strtolower($key);
if (is_array($value)) {
foreach ($value as $name => $val) {
if (!isset($result[$key][$name]) or $result[$key][$name] == '') {
$result[$key][$name] = $val;
}
}
}
}
}
return $result;
}
示例2: delete_list_user
function delete_list_user($list_to_delete)
{
$table = array('tags' => 'login', 'operators' => 'id');
foreach ($table as $table_name => $field) {
$arg_sql = array($table_name, $field);
$sql_delete = "delete from %s where %s in ";
$sql_delete = mysql2_prepare($sql_delete, $arg_sql, $list_to_delete);
mysql2_query_secure($sql_delete['SQL'], $_SESSION['OCS']["writeServer"], $sql_delete['ARG']);
}
}
示例3: erase
function erase($NAME)
{
global $protectedPost, $protectedGet, $list_hardware_id, $tab_hadware_id;
// if it's for group or a machine
if (isset($list_hardware_id)) {
$sql = "DELETE FROM devices WHERE name='%s' AND hardware_id='%s'";
$arg = array($NAME, $protectedGet["idchecked"]);
mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg);
} else {
//else : request
$sql = "DELETE FROM devices WHERE name='%s' AND hardware_id in ";
$arg_sql = array($NAME);
$arg = mysql2_prepare($sql, $arg_sql, $tab_hadware_id);
mysql2_query_secure($arg['SQL'], $_SESSION['OCS']["writeServer"], $arg['ARG']);
}
}
示例4: array
$list_col_cant_del = array('NAME' => 'NAME', 'CHECK' => 'CHECK', $l->g(35));
$default_fields2 = array($l->g(95) => $l->g(95), $l->g(36) => $l->g(36), $l->g(23) . ": " . $l->g(46) => $l->g(23) . ": " . $l->g(46), $l->g(23) . ": " . $l->g(34) => $l->g(23) . ": " . $l->g(34));
$default_fields = array_merge($default_fields, $default_fields2);
if ($_SESSION['OCS']['profile']->getConfigValue('DELETE_COMPUTERS') == "YES") {
$list_fields['SUP'] = 'h.ID';
$list_col_cant_del['SUP'] = 'SUP';
}
$sql = prepare_sql_tab($list_fields, array('SUP', 'CHECK'));
$sql['SQL'] .= " from hardware h left join accountinfo a on h.id=a.hardware_id ";
$sql['SQL'] .= ",bios b, ";
$sql['SQL'] .= " networks n where h.id=n.hardware_id ";
$sql['SQL'] .= " and h.id=b.hardware_id and h.id in ";
$sql = mysql2_prepare($sql['SQL'], $sql['ARG'], $list_id[$protectedPost['detail']]);
if (($protectedPost['detail'] == "macaddress" or $protectedPost['detail'] == "macaddress_serial") and count($list_info) > 0) {
$sql['SQL'] .= " and n.macaddr in ";
$sql = mysql2_prepare($sql['SQL'], $sql['ARG'], $list_info[$protectedPost['detail']]);
}
$sql['SQL'] .= " group by h.id ";
$tab_options['ARG_SQL'] = $sql['ARG'];
$tab_options['FILTRE'] = array('NAME' => $l->g(35), 'b.ssn' => $l->g(36), 'n.macaddr' => $l->g(95));
$tab_options['LBL_POPUP']['SUP'] = 'NAME';
$tab_options['LBL']['SUP'] = $l->g(122);
$result_exist = ajaxtab_entete_fixe($list_fields, $default_fields, $tab_options, $list_col_cant_del);
if ($result_exist != "" and $_SESSION['OCS']['profile']->getConfigValue('DELETE_COMPUTERS') == "YES") {
echo "<a href=# OnClick='confirme(\"\",\"DEL_SEL\",\"" . $form_name . "\",\"DEL_ALL\",\"" . $l->g(900) . "\");'><img src='image/delete.png' title='Supprimer' ></a>";
echo "<input type='hidden' id='DEL_ALL' name='DEL_ALL' value=''>";
}
echo "<p><input type='submit' value='" . $l->g(177) . "' name='FUSION'></p>";
echo "<input type=hidden name=old_detail id=old_detail value='" . $protectedPost['detail'] . "'>";
}
echo close_form();
示例5: active_option
function active_option($name, $list_id, $packid, $tvalue = '')
{
global $l;
desactive_option($name, $list_id, $packid);
$sql_active = "insert into devices (HARDWARE_ID, NAME, IVALUE,TVALUE) select ID,'%s','%s',";
if ($tvalue == '') {
$sql_active .= "null from hardware where id in ";
$arg_active = array($name, $packid);
} else {
$sql_active .= "'%s' from hardware where id in ";
$arg_active = array($name, $packid, $tvalue);
}
//$lbl_log=$l->g(601)." ".$id_pack." => ".$list_id;
$sql = mysql2_prepare($sql_active, $arg_active, $list_id);
$res_active = mysql2_query_secure($sql['SQL'], $_SESSION['OCS']["writeServer"], $sql['ARG'], $l->g(512));
return mysqli_affected_rows($_SESSION['OCS']["writeServer"]);
}
示例6: array
//this name is already exist
if ($val_verif['c'] > 0) {
$ERROR = $l->g(1067);
}
} else {
//name can't be null
$ERROR = $l->g(1068);
}
//can not contain special characters
if (preg_match('/[^0-9A-Za-z]/', $protectedPost['newfield']) and isset($protectedGet['admin'])) {
$ERROR .= $l->g(1178) . ' : <i>' . $l->g(1070) . "</i> " . $l->g(1179) . " <br>";
}
if (!isset($ERROR)) {
$sql_insert = "insert into " . $table . " (" . $fields . ") VALUES ";
$arg_sql = array();
$insert = mysql2_prepare($sql_insert, $arg_sql, $array_values);
mysql2_query_secure($insert['SQL'], $_SESSION['OCS']["writeServer"], $insert['ARG']);
// mysql_query( "INSERT INTO ".$table." (".$fields.") VALUES('".$values."')", $_SESSION['OCS']["writeServer"]) or mysql_error($_SESSION['OCS']["writeServer"]);
//If we add a field, you must add a new colonm in downloadwk_pack table
if ($table == "downloadwk_fields") {
$id = mysql_insert_id($_SESSION['OCS']["writeServer"]);
if (is_numeric($id)) {
if ($protectedPost["newtype"] == 1) {
$type = "LONGTEXT";
} elseif ($protectedPost["newtype"] == 8) {
$type = "BLOB";
} else {
$type = "VARCHAR(255)";
}
$sql_add_column = "ALTER TABLE downloadwk_pack ADD COLUMN fields_" . $id . " " . $type . " default NULL";
mysql2_query_secure($sql_add_column, $_SESSION['OCS']["writeServer"]);
示例7: array
$and_where = "";
if (isset($_SESSION['OCS']['USE_NEW_SOFT_TABLES']) and $_SESSION['OCS']['USE_NEW_SOFT_TABLES'] == 1) {
$sql_re['SQL'] = "select " . $info_name_soft['table'] . ".name , \n\t\t\t\t\t\t\tcount(s." . $info_name_soft['field_name_soft'] . ") nb, \n\t\t\t\t\t\t\ts." . $info_name_soft['field_name_soft'] . " id \n\t\t\t\t\t\tfrom softwares s \n\t\t\t\t\t\t\tleft join " . $info_name_soft['table'] . " \n\t\t\t\t\t\t\ton " . $info_name_soft['table'] . ".id=s." . $info_name_soft['field_name_soft'] . " ";
} else {
$sql_re['SQL'] = "select s." . $info_name_soft['field_name_soft'] . " , \n\t\t\t\t\t\tcount(s." . $info_name_soft['field_name_soft'] . ") nb, \n\t\t\t\t\t\ts." . $info_name_soft['field_name_soft'] . " id from softwares s ";
}
if (isset($_SESSION['OCS']["mesmachines"]) and $_SESSION['OCS']["mesmachines"] != '') {
$sql_re['SQL'] .= ",accountinfo a where " . $_SESSION['OCS']["mesmachines"] . " and a.hardware_id=s.HARDWARE_ID";
$and_where = " and ";
} else {
$and_where = " where ";
}
//$_SESSION['OCS']["forcedRequest"]=$sql['SQL'].$and_where." name in (".$forcedRequest.")";
$sql_re['SQL'] .= $and_where . " s." . $info_name_soft['field_name_soft'] . " in ";
$sql_re['ARG'] = array();
$sql = mysql2_prepare($sql_re['SQL'], $sql_re['ARG'], $list_soft);
//$sql['ARG']=('".implode("','",$list_soft)."')";
//$sql.=$fin_sql;
} elseif (!isset($list_soft)) {
$and_where = "";
$sql['SQL'] = "select " . $info_name_soft['table'] . "." . $info_name_soft['field'] . ", count(s." . $info_name_soft['field_name_soft'] . ") nb,\n\t\t\t\t\t s." . $info_name_soft['field_name_soft'] . " id from softwares s";
if (isset($_SESSION['OCS']['USE_NEW_SOFT_TABLES']) and $_SESSION['OCS']['USE_NEW_SOFT_TABLES'] == 1) {
$sql['SQL'] .= " left join " . $info_name_soft['table'] . " on " . $info_name_soft['table'] . ".id=s." . $info_name_soft['field_name_soft'] . " ";
}
$sql['ARG'] = array();
if (isset($_SESSION['OCS']["mesmachines"]) and $_SESSION['OCS']["mesmachines"] != '') {
$sql['SQL'] .= ",accountinfo a where " . $_SESSION['OCS']["mesmachines"] . " and a.hardware_id=s.HARDWARE_ID";
$and_where = " and ";
} else {
$and_where = " where ";
}
示例8: id_without_idgroups
function id_without_idgroups($list_id)
{
$sql = "select id from hardware where deviceid <> '_SYSTEMGROUP_' \n\t\t\t\t\t\t\t\t\t\tAND deviceid <> '_DOWNLOADGROUP_' \n\t\t\t\t\t\t\t\t\t\tAND id in ";
$arg = array();
$sql = mysql2_prepare($sql, $arg, $list_id);
$result = mysql2_query_secure($sql['SQL'], $_SESSION['OCS']["readServer"], $sql['ARG']);
while ($item = mysqli_fetch_object($result)) {
$res[$item->id] = $item->id;
}
return $res;
}
示例9: show_modif
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);
$arg['SQL'] .= " GROUP BY netid) \n\t\t\t\tnon_ident on non_ident.RSX=inv.RSX \n\t\t\t\t) toto";
$tab_options['ARG_SQL'] = $arg['ARG'];
$list_fields = array('LBL_RSX' => 'LBL_RSX', 'RSX' => 'ID', 'INVENTORIE' => 'INVENTORIE', 'NON_INVENTORIE' => 'NON_INVENTORIE', 'IPDISCOVER' => 'IPDISCOVER', 'IDENTIFIE' => 'IDENTIFIE');
if ($_SESSION['OCS']['CONFIGURATION']['IPDISCOVER'] == "YES") {
$list_fields['SUP'] = 'ID';
}
$list_fields['PERCENT_BAR'] = 'pourcentage';
$table_name = "IPDISCOVER";
$default_fields = $list_fields;
$list_col_cant_del = array('RSX' => 'RSX', 'SUP' => 'SUP');
$tab_options['LIEN_LBL']['INVENTORIE'] = 'index.php?' . PAG_INDEX . '=' . $pages_refs['ms_custom_info'] . '&head=1&prov=inv&value=';
$tab_options['LIEN_CHAMP']['INVENTORIE'] = 'ID';
$tab_options['LIEN_TYPE']['INVENTORIE'] = 'POPUP';
$tab_options['POPUP_SIZE']['INVENTORIE'] = "width=900,height=600";
$tab_options['NO_LIEN_CHAMP']['INVENTORIE'] = array(0);
示例10: count_noinv_network_devices
function count_noinv_network_devices($dpt_choise = '')
{
$array_sub = find_all_subnet($dpt_choise);
$arg_count = array();
$sql_count = "SELECT COUNT(DISTINCT mac) as c\n\t\t\t\t\tFROM netmap n \n\t\t\t\t\tLEFT OUTER JOIN networks ns ON ns.macaddr = mac \n\t\t\t\t\tWHERE 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 netid in ";
$detail_query = mysql2_prepare($sql_count, $arg_count, $array_sub);
if (!isset($_SESSION['OCS']['COUNT_CONSOLE']['OCS_REPORT_NB_IPDISCOVER']) and $dpt_choise == '') {
$res_count = mysql2_query_secure($detail_query['SQL'], $_SESSION['OCS']["readServer"], $detail_query['ARG']);
$val_count = mysqli_fetch_array($res_count);
return $val_count['c'];
} else {
return $_SESSION['OCS']['COUNT_CONSOLE']['OCS_REPORT_NB_IPDISCOVER'];
}
}
示例11: array
$fields = array("a.tag" => $_SESSION['OCS']['TAG_LBL']['TAG'], $alias_name_soft => $l->g(20), "h.name" => $l->g(23), "h.userid" => $l->g(24), "h.description" => $l->g(53), "h.lastdate" => $l->g(728));
/*$result_search_soft = mysql2_query_secure( $sql['SQL'], $_SESSION['OCS']["readServer"],$sql['ARG']);
while($item_search_soft = mysqli_fetch_object($result_search_soft)){
$soft[]=$item_search_soft->name;
}*/
$sql = prepare_sql_tab(array_keys($fields));
$sql['SQL'] .= " from accountinfo a, (select hardware_id, " . $info_name_soft["field_name_soft"] . " as sname from softwares where " . $info_name_soft["field_name_soft"] . " in ";
$sql = mysql2_prepare($sql['SQL'], $sql['ARG'], $list_soft);
$sql['SQL'] .= ") s";
if (isset($_SESSION['OCS']['USE_NEW_SOFT_TABLES']) and $_SESSION['OCS']['USE_NEW_SOFT_TABLES'] == 1) {
$sql['SQL'] .= " left join (select id, name as " . $alias_name_soft . " from " . $info_name_soft['table'] . ") cache on cache.id=s.sname ";
}
$sql['SQL'] .= ",hardware h \n\t\t\t\t\twhere a.hardware_id=h.id and s.hardware_id=h.id ";
if (isset($_SESSION['OCS']['TAGS'])) {
$sql['SQL'] .= " and a.tag in ";
$sql = mysql2_prepare($sql['SQL'], $sql['ARG'], $_SESSION['OCS']['TAGS']);
}
$sql['SQL'] .= " order by h.name";
} else {
$fields = array('nb' => $l->g(55), 'name' => $l->g(20));
}
//echo generate_secure_sql($sql['SQL'],$sql['ARG']);
//die();
$toBeWritten = implode($separator, $fields) . "\r\n";
if (ini_get("zlib.output-compression")) {
ini_set("zlib.output-compression", "Off");
}
header("Pragma: public");
header("Expires: 0");
header("Cache-control: must-revalidate, post-check=0, pre-check=0");
header("Cache-control: private", false);
示例12: is_mine_computer
function is_mine_computer($id)
{
if (isset($_SESSION['OCS']['TAGS']) and is_array($_SESSION['OCS']['TAGS'])) {
$sql = "select hardware_id from accountinfo where hardware_id = %s and tag in ";
$arg = array($id);
$sql = mysql2_prepare($sql, $arg, $_SESSION['OCS']['TAGS']);
$result = mysql2_query_secure($sql['SQL'], $_SESSION['OCS']["readServer"], $sql['ARG']);
$item = mysqli_fetch_object($result);
if (isset($item->hardware_id)) {
return true;
} else {
return false;
}
}
return true;
}
示例13: elseif
$max_order++;
if ($type_field[$name] == "varchar(10)" or $type_field[$name] == "date") {
$type = 6;
$type_field[$name] = "varchar(10)";
} elseif ($type_field[$name] == "blob") {
$type = 5;
} elseif ($type_field[$name] == "varchar(255)") {
$type = 0;
} else {
$type = 0;
}
$sql = "insert into accountinfo_config ";
$arg = '';
$sql = mysql2_prepare($sql, $arg, $fields_table, true);
$values = array($type, $name, 1, $name . " (" . $l->g(2101) . ")", $max_order, 'COMPUTERS');
$sql = mysql2_prepare($sql['SQL'] . " VALUES ", $sql['ARG'], $values);
if (isset($protectedPost['EXE']) and $protectedPost['EXE'] != '') {
mysql2_query_secure($sql['SQL'], $_SESSION['OCS']["writeServer"], $sql['ARG']);
} else {
$add_lign_accountinfo_config[] = $sql['ARG'];
}
$sql_alter = "ALTER TABLE accountinfo CHANGE %s %s %s";
$arg = array($name, "fields_" . mysqli_insert_id($_SESSION['OCS']["writeServer"]), $type_field[$name]);
if (isset($protectedPost['EXE']) and $protectedPost['EXE'] != '') {
mysql2_query_secure($sql_alter, $_SESSION['OCS']["writeServer"], $arg);
addLog('SCRIPT_ADD_DATA_ACCOUNTINFO_CONFIG', $name);
} else {
$rename_col_accountinfo[] = $arg;
}
}
}
示例14: find_limit_values
// Copyleft Erwan GOALOU 2010 (erwan(at)ocsinventory-ng(pt)org)
// Web: http://www.ocsinventory-ng.org
//
// This code is open source and may be copied and modified as long as the source
// code is always made freely available.
// Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt
//====================================================================================
$data_limit = find_limit_values();
require_once 'require/function_ipdiscover.php';
if ($_SESSION['OCS']["TAGS"]) {
$sql_tag = mysql2_prepare('select id from hardware h, accountinfo a where a.hardware_id=h.id and a.tag in ', array(), $_SESSION['OCS']["TAGS"]);
$result = mysql2_query_secure($sql_tag['SQL'], $_SESSION['OCS']["readServer"], $sql_tag['ARG']);
while ($val = mysqli_fetch_object($result)) {
$my_id[] = $val->id;
}
$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));
示例15: insert_blacklist_table
function insert_blacklist_table($table, $field, $field_value)
{
global $l;
$i = 1;
$sql = "insert into %s ";
$arg = array($table);
$sql = mysql2_prepare($sql, $arg, $field, true);
$sql['SQL'] .= " value ";
$sql = mysql2_prepare($sql['SQL'], $sql['ARG'], $field_value);
// //no error
mysql2_query_secure($sql['SQL'], $_SESSION['OCS']["writeServer"], $sql['ARG']);
msg_success($l->g(655));
}