ID; //echo $GET['systemid']; if ($GET['systemid'] == "") return $l->g(837); } //you can see computer's detail by md5(deviceid) if (isset($GET['crypt'])){ $querydeviceid = "SELECT ID FROM hardware WHERE md5(deviceid)='%s'"; $argdevicedid=($GET['crypt']); $resultdeviceid = mysql2_query_secure($querydeviceid, $_SESSION['OCS']["readServer"],$argdevicedid); $item = mysql_fetch_object($resultdeviceid); $GET['systemid']=$item -> ID; //echo $GET['systemid']; if ($GET['systemid'] == "") return $l->g(837); } //si le systemid de la machine existe if (isset($GET['systemid']) and !isset($systemid)) $systemid = $GET['systemid']; //probl�me sur l'id //echo $systemid; if ($systemid == "" or !is_numeric($systemid)) return $l->g(837); //recherche des infos de la machine $querydeviceid = "SELECT * FROM hardware h left join accountinfo a on a.hardware_id=h.id WHERE h.id=".$systemid." "; if ($_SESSION['OCS']['RESTRICTION']['GUI'] == "YES" and isset($_SESSION['OCS']['mesmachines']) and $_SESSION['OCS']['mesmachines'] != '' and !isset($GET['crypt'])) $querydeviceid .= " and (".$_SESSION['OCS']['mesmachines']." or a.tag is null or a.tag='')"; $resultdeviceid = mysql_query($querydeviceid, $_SESSION['OCS']["readServer"]) or mysql_error($_SESSION['OCS']["readServer"]); $item = mysql_fetch_object($resultdeviceid); if ( $item -> ID == ""){ return $l->g(837); } return $item; } function subnet_name($systemid){ if (!is_numeric($systemid)) return false; $reqSub = "select NAME,NETID from subnet left join networks on networks.ipsubnet = subnet.netid where networks.status='Up' and hardware_id=".$systemid; $resSub = mysql_query($reqSub, $_SESSION['OCS']["readServer"]) or die(mysql_error($_SESSION['OCS']["readServer"])); while($valSub = mysql_fetch_object( $resSub )){ $returnVal[]=$valSub->NAME." (".$valSub->NETID.")"; } return $returnVal; } function print_item_header($text) { echo "

"; echo ""; echo ""; echo ""; echo "
".mb_strtoupper($text)."

"; } function bandeau($data,$lbl,$link=array()){ global $protectedGet,$pages_refs; if (!is_array($link)) $link=array(); $data=data_encode_utf8($data); $nb_col=2; echo ""; echo "
"; echo " "; $i=0; foreach ($data as $name=>$value){ if (trim($value) != ''){ if ($i == $nb_col){ echo ""; $i=0; } if (!array_key_exists($name,$link)){ //$value=htmlentities($value,ENT_COMPAT,'UTF-8'); $value=strip_tags_array($value); } if ($name == "IPADDR") { $value = preg_replace('/([x0-9])\//', '$1 / ',$value); } echo ""; $i++; } } echo "
 ".$lbl[$name].": ".$value."
"; } function show_packages($systemid,$page="ms_computer"){ global $l,$pages_refs,$ii,$td3,$td2,$td4; $query="SELECT a.name, d.tvalue,d.ivalue,d.comments,e.fileid, e.pack_loc,h.name as name_server,h.id,a.comment FROM devices d left join download_enable e on e.id=d.ivalue LEFT JOIN download_available a ON e.fileid=a.fileid LEFT JOIN hardware h on h.id=e.server_id WHERE d.name='DOWNLOAD' and a.name != '' and pack_loc != '' AND d.hardware_id=%s union SELECT '%s', d.tvalue,d.ivalue,d.comments,e.fileid, '%s',h.name,h.id,a.comment FROM devices d left join download_enable e on e.id=d.ivalue LEFT JOIN download_available a ON e.fileid=a.fileid LEFT JOIN hardware h on h.id=e.server_id WHERE d.name='DOWNLOAD' and a.name is null and pack_loc is null AND d.hardware_id=%s"; $arg_query=array($systemid,$l->g(1129),$l->g(1129),$systemid); $resDeploy = mysql2_query_secure($query, $_SESSION['OCS']["readServer"],$arg_query); if( mysql_num_rows( $resDeploy )>0 ) { while( $valDeploy = mysql_fetch_array( $resDeploy ) ) { $ii++; $td3 = $ii%2==0?$td2:$td4; if ((strpos($valDeploy["comment"], "[VISIBLE=1]") or strpos($valDeploy["comment"], "[VISIBLE=]") or (!isset($_SESSION['OCS']['RESTRICTION']['TELEDIFF_VISIBLE']) and strpos($valDeploy["comment"], "[VISIBLE=0]")) or !strpos($valDeploy["comment"], "[VISIBLE")) or (isset($_SESSION['OCS']['RESTRICTION']['TELEDIFF_VISIBLE']) and $_SESSION['OCS']['RESTRICTION']['TELEDIFF_VISIBLE'] == "NO" and preg_match("[VISIBLE=0]", $valDeploy["comment"]))){ //echo $valDeploy["comment"]; // echo $_SESSION['OCS']['RESTRICTION']['TELEDIFF_VISIBLE']; echo ""; echo ""; echo $td3.$l->g(498)." ".$valDeploy["name"].""; if (isset($valDeploy["fileid"])) echo "(".$valDeploy["fileid"].")"; if ($valDeploy["name_server"]!="") echo " (".$l->g(499)." redistrib: ".$valDeploy["name_server"].""; else echo " (".$l->g(499).": ".$valDeploy["pack_loc"]." "; echo ")"; if ($page == "ms_computer"){ echo $td3.$l->g(81).": ".($valDeploy["tvalue"]!=""?$valDeploy["tvalue"]:$l->g(482)); echo ($valDeploy["comments"]!=""?" (".$valDeploy["comments"].")":""); echo ""; if( $_SESSION['OCS']['CONFIGURATION']['TELEDIFF']=="YES" ) { echo "$td3 ".$l->g(122).""; }elseif (strstr($valDeploy["tvalue"], 'ERR_')){ echo $td3."".$l->g(113).""; if ($valDeploy["name"] != "PAQUET SUPPRIME") echo $td3."".$l->g(1246).""; }elseif (strstr($valDeploy["tvalue"], 'NOTIFIED')){ if (isset($valDeploy["comments"]) and strtotime ($valDeploy["comments"])"; } } }else{ if( $_SESSION['OCS']['CONFIGURATION']['TELEDIFF'] == "YES" ) echo "$td3 ".$l->g(122).""; show_stat($valDeploy["fileid"]); echo ""; //print_r($valDeploy); } echo ""; } } } } ?>