[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-ocs/sources/www/ -> machine.php (source)

   1  <?
   2  //====================================================================================
   3  // OCS INVENTORY REPORTS
   4  // Copyleft Pierre LEMMET 2005
   5  // Web: http://ocsinventory.sourceforge.net
   6  //
   7  // This code is open source and may be copied and modified as long as the source
   8  // code is always made freely available.
   9  // Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt
  10  //====================================================================================
  11  //Modified on 12/13/2005
  12  
  13  $_GET["sessid"] = isset( $_POST["sessid"] ) ? $_POST["sessid"] : $_GET["sessid"];
  14  if( isset($_GET["sessid"])){
  15      session_id($_GET["sessid"]);
  16      session_start();
  17      
  18      if( !isset($_SESSION["loggeduser"]) ) {
  19          die("FORBIDDEN");
  20      }
  21  }
  22  else
  23      die("FORBIDDEN");
  24  
  25  require  ('preferences.php');
  26  
  27  if (isset($_GET['systemid'])) {
  28      $systemid = $_GET['systemid'];
  29      if ($systemid == "")
  30      {
  31          echo "Please Supply A System ID";
  32          die();
  33      }
  34  }
  35  elseif (isset($_POST['systemid'])) {
  36      $systemid = $_POST['systemid'];
  37  }
  38  
  39  if (isset($_GET['state']))
  40  {
  41      $state = $_GET['state'];
  42      if ($state == "MAJ")
  43          echo "<script language='javascript'>window.location.reload();</script>\n";        
  44  }// fin if
  45  
  46  if( isset( $_GET["suppack"] ) ) {
  47      if( $_SESSION["justAdded"] == false )
  48          @mysql_query("DELETE FROM devices WHERE ivalue=".$_GET["suppack"]." AND hardware_id='$systemid' AND name='DOWNLOAD'", $_SESSION["writeServer"]);
  49      else $_SESSION["justAdded"] = false;
  50  }
  51  else 
  52      $_SESSION["justAdded"] = false;
  53  
  54  $queryMachine    = "SELECT * FROM hardware WHERE (ID=$systemid)";
  55  $result   = mysql_query( $queryMachine, $_SESSION["readServer"] ) or mysql_error($_SESSION["readServer"]);
  56  $item     = mysql_fetch_object($result);
  57  
  58  echo "<html>\n";
  59  echo "<head>\n";
  60  echo "<TITLE>$aff -$systemid</TITLE>\n";
  61  echo "<LINK REL='StyleSheet' TYPE='text/css' HREF='css/ocsreports.css'>\n";
  62  
  63  incPicker();
  64  
  65  echo "<script language='javascript'>\n";
  66  echo "\tfunction Ajouter_donnees(systemid)\n";
  67  echo "\t{\n";
  68  echo "\t\twindow.open(\"./machine.php?action=ajouter_donnees&systemid=\" + systemid, \"_self\");\n";
  69  echo "\t}\n\n";
  70  echo "\tfunction MAJ_donnees(systemid,sessid)\n";
  71  echo "\t{\n";
  72  echo "\t\twindow.open(\"./machine.php?action=MAJ_donnees&sessid=\" +sessid+ \"&systemid=\" + systemid, \"_self\");\n";
  73  echo "\t}\n";
  74  echo "</script>\n";
  75  echo "</head>\n";
  76  echo "<body style='font: Tahoma' alink='#000000' vlink='#000000' link='#000000' bgcolor='#ffffff' text='#000000'>\n";
  77  
  78  // COMPUTER SUMMARY
  79  $tdhdpb = "<td  align='left' width='20%'>";
  80  $tdhfpb = "</td>";
  81  $tdhd = "<td  align='left' width='20%'><b>";
  82  $tdhf = ":</b></td>";
  83  
  84  echo "<table width='100%' border='0' bgcolor='#C7D9F5' style='border: solid thin; border-color:#A1B1F9'><tr><td width='50%'>";
  85  
  86  echo "<table width='80%' align='center' border='0' bgcolor='#C7D9F5'>";
  87  echo "<tr>".$tdhd.$l->g(49).$tdhf.$tdhdpb.utf8_decode($item->NAME).$tdhfpb."</tr>";
  88  echo "<tr>".$tdhd.$l->g(33).$tdhf.$tdhdpb.utf8_decode($item->WORKGROUP).$tdhfpb."</tr>";
  89  echo "<tr>".$tdhd.$l->g(46).$tdhf.$tdhdpb.dateTimeFromMysql(utf8_decode($item->LASTDATE)).$tdhfpb."</tr>";
  90  echo "<tr>".$tdhd.$l->g(34).$tdhf.$tdhdpb.utf8_decode($item->IPADDR).$tdhfpb."</tr>";
  91  echo "<tr>".$tdhd.$l->g(24).$tdhf.$tdhdpb.utf8_decode($item->USERID).$tdhfpb."</tr>";
  92  echo "<tr>".$tdhd.$l->g(26).$tdhf.$tdhdpb.utf8_decode($item->MEMORY).$tdhfpb."</tr>";
  93  echo "<tr>".$tdhd.$l->g(50).$tdhf.$tdhdpb.utf8_decode($item->SWAP).$tdhfpb."</tr>";
  94  
  95  echo getNetName($systemid);
  96  
  97  echo "</table></td><td>";
  98  
  99  echo "<table width='90%' align='center' border='0' bgcolor='#C7D9F5'>";
 100  echo "<tr>".$tdhd.$l->g(274).$tdhf.$tdhdpb.utf8_decode($item->OSNAME).$tdhfpb."</tr>";
 101  echo "<tr>".$tdhd.$l->g(275).$tdhf.$tdhdpb.utf8_decode($item->OSVERSION).$tdhfpb."</tr>";
 102  echo "<tr>".$tdhd.$l->g(286).$tdhf.$tdhdpb.utf8_decode($item->OSCOMMENTS).$tdhfpb."</tr>";
 103  echo "<tr>".$tdhd.$l->g(51).$tdhf.$tdhdpb.utf8_decode($item->WINCOMPANY).$tdhfpb."</tr>";
 104  echo "<tr>".$tdhd.$l->g(348).$tdhf.$tdhdpb.utf8_decode($item->WINOWNER).$tdhfpb."</tr>";
 105  echo "<tr>".$tdhd.$l->g(111).$tdhf.$tdhdpb.utf8_decode($item->WINPRODID).$tdhfpb."</tr>";
 106  echo "<tr>".$tdhd.$l->g(553).$tdhf.$tdhdpb.utf8_decode($item->WINPRODKEY).$tdhfpb."</tr>";
 107  echo "<tr>".$tdhd.$l->g(357).$tdhf.$tdhdpb.utf8_decode($item->USERAGENT).$tdhfpb."</tr>";
 108  
 109  echo "</table></td></tr></table>";
 110  //*/// END COMPUTER SUMMARY
 111  
 112  echo "<br><table width='100%' border='1' bgcolor='#C7D9F5' cellpadding='4' style='border: solid thin; border-color:#A1B1F9'>";
 113  echo "<tr>";
 114  echo "<td  align='right' width='15%'><b>Description:</td>";
 115  echo "<td  width='85%'>".utf8_decode($item->DESCRIPTION)."</td>";
 116  echo "</tr>";
 117  echo "</table>";
 118  
 119  if( isset($_GET["action"]) || isset($_POST["action_form"]) ) {
 120      include ("ajout_maj.php");
 121      die();
 122  }
 123  
 124  if( ! isset($_GET["option"]) ) {
 125      $opt = $l->g(56);
 126  }
 127  else {
 128      $opt = stripslashes(urldecode($_GET["option"]));
 129  }
 130  
 131  $td1      = "<td height=20px id='color' align='center'><FONT FACE='tahoma' SIZE=2 color=blue><b>";
 132  $td2      = "<td height=20px bgcolor='white' align='center'>";
 133  $td3      = $td2;
 134  $td4      = "<td height=20px bgcolor='#F0F0F0' align='center'>";
 135  $lblAdm = Array($l->g(56), $l->g(500));
 136  $imgAdm = Array("adm", "spec");
 137  $lblHdw = Array($l->g(54), $l->g(26), $l->g(63), $l->g(92), $l->g(61), $l->g(96), $l->g(82), $l->g(93), $l->g(271), $l->g(272));
 138  $imgHdw = Array("processeur", "memoire","stockage","disque","video","son","reseau", "controleur", "slot","port" );
 139  $lblSof = Array($l->g(273), $l->g(20), $l->g(211));
 140  $imgSof = Array("bios", "logiciels", "registre");
 141  $lblOut = Array($l->g(97),$l->g(91),$l->g(79),$l->g(270));
 142  $imgOut = Array("moniteur", "peripherique", "imprimante", "modem");
 143  echo "<br><br>";
 144  
 145  echo "<table width='80%' border=0 align='center' cellpadding='0' cellspacing='0'>
 146          <tr>
 147              <td align='left'>
 148                  <table width='100%' align='left' border=0 cellpadding='0' cellspacing='0'>
 149                      <tr>";
 150                              //bleu
 151                              $cpt = 0;
 152                              foreach( $imgHdw as $im ) {
 153                                  echo img($im, $lblHdw[$cpt], isAvail($lblHdw[$cpt]), $opt );
 154                                  $cpt++;
 155                              }
 156                              echo "                        
 157                      </tr>
 158                  </table>
 159              </td>
 160          </tr>
 161          <tr>
 162              <td>&nbsp;</td>
 163          </tr>
 164          <tr>
 165              <td align='left'>
 166                  <table width='100%' align='left' border=0 cellpadding='0' cellspacing='0'>                    
 167                      <tr>";
 168                          //jaune
 169                          echo img($imgAdm[0],$lblAdm[0], isAvail($lblAdm[0]), $opt);
 170                          echo img($imgAdm[1],$lblAdm[1], true, $opt);
 171                          
 172                          echo "<td width='80px'>&nbsp;</td>";
 173                          //rouge
 174                          $cpt = 0;
 175                          foreach( $imgSof as $im ) {
 176                              echo img($im, $lblSof[$cpt], isAvail($lblSof[$cpt]), $opt );
 177                              $cpt++;
 178                          }
 179                          
 180                          //vert
 181                          $cpt = 0;
 182                          foreach( $imgOut as $im ) {
 183                              echo img($im, $lblOut[$cpt], isAvail($lblOut[$cpt]), $opt );
 184                              $cpt++;
 185                          }
 186                          echo "
 187                      </tr>
 188                  </table>
 189              </td>
 190          </tr>
 191      </table>";
 192  
 193          
 194  /*for($i=0;$i<18;$i++) {
 195      echo"<a href='machine.php?sessid=".session_id()."&systemid=".urlencode(stripslashes($systemid))."&option=$i'>".$tab[$i]."</a>";
 196      if($i==8)    echo"<br>";
 197  }*/
 198  echo"<br><br><br>";
 199  
 200  if($_GET["tout"]==1)
 201  {
 202      print_inventory($systemid);
 203      print_perso($systemid);
 204      print_proc($systemid);
 205      print_memories($systemid);
 206      print_storages($systemid);
 207      print_drives($systemid);
 208      print_bios($systemid);
 209      print_sounds($systemid);
 210      print_videos($systemid);
 211      print_inputs($systemid);
 212      print_monitors($systemid);
 213      print_networks($systemid);
 214      print_ports($systemid);
 215      print_printers($systemid);
 216      print_controllers($systemid);
 217      print_slots($systemid);
 218      print_softwares($systemid);
 219      print_modems($systemid);
 220      print_registry($systemid);
 221  }
 222  
 223  switch ($opt) :
 224      case $l->g(56) : print_inventory($systemid);
 225                          break;
 226      case $l->g(54) : print_proc($systemid);
 227                          break;
 228      case $l->g(26)  : print_memories($systemid);
 229                          break;
 230      case $l->g(63)  : print_storages($systemid);
 231                          break;
 232      case $l->g(92)  : print_drives($systemid);
 233                          break;
 234      case $l->g(273)  : print_bios($systemid);
 235                          break;
 236      case $l->g(96)  : print_sounds($systemid);
 237                          break;
 238      case $l->g(61)  : print_videos($systemid);
 239                          break;
 240      case $l->g(91)  : print_inputs($systemid);
 241                          break;
 242      case $l->g(97)  : print_monitors($systemid);
 243                          break;
 244      case $l->g(82) : print_networks($systemid);
 245                          break;
 246      case $l->g(272) : print_ports($systemid);
 247                          break;
 248      case $l->g(79) : print_printers($systemid);
 249                          break;
 250      case $l->g(93) : print_controllers($systemid);
 251                          break;
 252      case $l->g(271) : print_slots($systemid);
 253                          break;
 254      case $l->g(20) : print_softwares($systemid);
 255                          break;
 256      case $l->g(270) : print_modems($systemid);    
 257                          break;
 258      case $l->g(211) : print_registry($systemid);
 259                          break;
 260      case $l->g(500) : print_perso($systemid);
 261                          break;
 262      default: print_inventory($systemid);
 263                          break;
 264      endswitch;                    
 265  
 266  echo "<br><table align='center'> <tr><td width =50%>";
 267  echo "<a style=\"text-decoration:underline\" onClick=print()>".$l->g(214)."</a></td>";
 268  if(!isset($_GET["tout"]))
 269          echo"<td width=50%><a style=\"text-decoration:underline\" href=\"machine.php?sessid=".session_id()."&systemid=".urlencode(stripslashes($systemid))."&tout=1\">".$l->g(215)."</a></td>";
 270          
 271  echo "</tr></table></body>";
 272  echo "</html>";
 273  exit;
 274  
 275  function print_perso($systemid) {
 276      global $l, $td1, $td2, $td3, $td4;
 277      $i=0;
 278      $queryDetails = "SELECT * FROM devices WHERE hardware_id=$systemid";
 279      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 280                      
 281          echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 282      
 283      //echo "<tr><td>&nbsp;&nbsp;</td> $td1 "."Libellé"." </td> $td1 "."Valeur"." </td><td>&nbsp;</td></tr>";        
 284      while($item=mysql_fetch_array($resultDetails,MYSQL_ASSOC)) {
 285          $optPerso[ $item["NAME"] ][ "IVALUE" ] = $item["IVALUE"];
 286          $optPerso[ $item["NAME"] ][ "TVALUE" ] = $item["TVALUE"];
 287      }    
 288      
 289      $ii++; $td3 = $ii%2==0?$td2:$td4;
 290      //IPDISCOVER
 291      echo "<tr><td bgcolor='white' align='center' valign='center'>".(isset($optPerso["IPDISCOVER"])&&$optPerso["IPDISCOVER"]["IVALUE"]!=1?"<img width='15px' src='image/red.png'>":"&nbsp;")."</td>&nbsp;</td>";
 292      echo $td3.$l->g(489)."</td>";    
 293      if( isset( $optPerso["IPDISCOVER"] )) {        
 294          if( $optPerso["IPDISCOVER"]["IVALUE"]==0 ) echo $td3.$l->g(490)."</td>";    
 295          else if( $optPerso["IPDISCOVER"]["IVALUE"]==2 ) echo $td3.$l->g(491)." ".$optPerso["IPDISCOVER"]["TVALUE"]."</td>";
 296          else if( $optPerso["IPDISCOVER"]["IVALUE"]==1 ) echo $td3.$l->g(492)." ".$optPerso["IPDISCOVER"]["TVALUE"]."</td>";
 297      }
 298      else {
 299          echo $td3.$l->g(493)."</td>";
 300      }
 301      if( $_SESSION["lvluser"]==SADMIN )
 302          echo "$td3<a href='index.php?multi=23&systemid=$systemid'>".$l->g(115)."</a></td>";
 303      echo "</tr>";
 304      
 305      $ii++; $td3 = $ii%2==0?$td2:$td4;
 306      //FREQUENCY
 307      echo "<tr><td bgcolor='white' align='center' valign='center'>".(isset($optPerso["FREQUENCY"])?"<img width='15px' src='image/red.png'>":"&nbsp;")."</td>";
 308      echo $td3.$l->g(494)."</td>";
 309      if( isset( $optPerso["FREQUENCY"] )) {
 310          if( $optPerso["FREQUENCY"]["IVALUE"]==0 ) echo $td3.$l->g(485)."</td>";
 311          else if( $optPerso["FREQUENCY"]["IVALUE"]==-1 ) echo $td3.$l->g(486)."</td>";
 312          else echo $td3.$l->g(495)." ".$optPerso["FREQUENCY"]["IVALUE"]." ".$l->g(496)."</td>";
 313      }
 314      else {
 315          echo $td3.$l->g(497)."</td>";
 316      }
 317      if( $_SESSION["lvluser"]==SADMIN )
 318          echo "$td3<a href='index.php?multi=22&systemid=$systemid'>".$l->g(115)."</a></td>";        
 319      echo "</tr>";
 320      
 321      //TELEDEPLOY
 322      $resDeploy = @mysql_query("SELECT a.name, d.tvalue,d.ivalue, e.pack_loc  FROM devices d, download_available a, download_enable e 
 323      WHERE d.name='DOWNLOAD' AND e.fileid=a.fileid AND e.id=d.ivalue AND d.hardware_id=$systemid"); 
 324       
 325      if( mysql_num_rows( $resDeploy )>0 ) {
 326              
 327          while( $valDeploy = mysql_fetch_array( $resDeploy ) ) {
 328              $ii++; $td3 = $ii%2==0?$td2:$td4;
 329              echo "<tr>";
 330              echo "<td bgcolor='white' align='center' valign='center'><img width='15px' src='image/red.png'></td>";
 331              echo $td3.$l->g(498)." <b>".$valDeploy["name"]."</b> (".$l->g(499).": ".$valDeploy["pack_loc"]." )</td>";            
 332              echo $td3.$l->g(81).": ".($valDeploy["tvalue"]!=""?$valDeploy["tvalue"]:$l->g(482))."</td>";
 333              if( $_SESSION["lvluser"]==SADMIN )    
 334                  echo "$td3 <a href='machine.php?suppack=".$valDeploy["ivalue"]."&sessid=".session_id().
 335                  "&systemid=".urlencode($systemid)."&option=".urlencode($l->g(500))."'>".$l->g(122)."</a></td>";
 336              echo "</tr>";
 337          }
 338      }
 339      if( $_SESSION["lvluser"]==SADMIN )
 340          echo "<tr><td colspan='10' align='right'><a href='index.php?multi=24&systemid=$systemid'>".$l->g(501)."</a></td></tr>";    
 341      echo "</table><br>";
 342  }
 343  
 344  function print_proc($systemid)
 345  {
 346      global $l,$td1,$td3;
 347      print_item_header($l->g(54));
 348      $queryDetails = "SELECT * FROM hardware WHERE (id=$systemid)";
 349      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or mysql_error($_SESSION["readServer"]);
 350      $item = mysql_fetch_object($resultDetails);
 351      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 352      echo "<tr>";
 353      echo "$td1 ".$l->g(66)." </td> $td1 ".$l->g(377)." </td> $td1 ".$l->g(55)."</td></tr>";
 354      echo "<tr>";
 355      echo "$td3".utf8_decode($item->PROCESSORT)."</td>
 356            $td3".utf8_decode($item->PROCESSORS)."</td>
 357            $td3".utf8_decode($item->PROCESSORN)."</td>";
 358      echo "</tr>";
 359      echo "</table>";
 360  }
 361  
 362  function print_videos($systemid)
 363  {
 364      global $l, $td1, $td2, $td3, $td4;
 365  
 366      $queryDetails  = "SELECT * FROM videos WHERE (hardware_id = $systemid)";
 367      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));    
 368          
 369      if( mysql_num_rows($resultDetails) == 0 )         return;
 370      print_item_header($l->g(61));
 371      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 372      echo "<tr> $td1 ".$l->g(49)." </td> $td1 ".$l->g(276)." </td>  $td1 ".$l->g(26)." (MB)</td> $td1 ".$l->g(62)."</td></tr>";    
 373      
 374      while($item = mysql_fetch_object($resultDetails))
 375      {
 376          $ii++; $td3 = $ii%2==0?$td2:$td4;
 377          echo "<tr>
 378               $td3".utf8_decode($item->NAME)."      </td>
 379               $td3".utf8_decode($item->CHIPSET)."   </td>
 380               $td3".utf8_decode($item->MEMORY)."    </td>
 381               $td3".utf8_decode($item->RESOLUTION)."</td>
 382               </tr>";
 383      }
 384      echo "</table><br>";        
 385  }
 386  
 387  function print_storages($systemid)
 388  {    
 389      global $l, $td1, $td2, $td3, $td4;
 390      
 391      $queryDetails  = "SELECT * FROM storages WHERE (hardware_id=$systemid)";
 392      
 393      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));    
 394      
 395      if ( mysql_num_rows($resultDetails) == 0 )     return;
 396      print_item_header($l->g(63));
 397      
 398      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 399      echo "<tr>  $td1 ".$l->g(64)."   </td>   $td1 ".$l->g(65)."         </td>
 400                    $td1 ".$l->g(53)."  </td>    $td1 ".$l->g(66)."         </td>
 401                    $td1 ".$l->g(67)." (MB) </td> </tr>";
 402  
 403      while($item = mysql_fetch_object($resultDetails))
 404      {    $ii++; $td3 = $ii%2==0?$td2:$td4;
 405          echo "<tr>";
 406          echo "$td3".utf8_decode($item->MANUFACTURER)."</td>
 407                $td3".utf8_decode($item->MODEL)."       </td>
 408                $td3".utf8_decode($item->DESCRIPTION)." </td>
 409                 $td3".utf8_decode($item->TYPE)."        </td>
 410                 $td3".utf8_decode($item->DISKSIZE)."    </td>    ";
 411          echo "</tr>";
 412      }
 413      echo "</table><br>";        
 414  }
 415  
 416  function print_sounds($systemid)
 417  {    
 418      global $l,$td1,$td2,$td3,$td4;
 419      
 420      $queryDetails  = "SELECT * FROM sounds WHERE (hardware_id=$systemid)";
 421      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 422      
 423      if ( mysql_num_rows($resultDetails) == 0 )     return;
 424      print_item_header($l->g(96));
 425      
 426      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 427      echo "<tr> $td1 ".$l->g(64)." </td> $td1 ".$l->g(49)." </td> $td1 ".$l->g(53)." </td> </tr>";
 428  
 429      while($item = mysql_fetch_object($resultDetails))
 430      {    $ii++; $td3 = $ii%2==0?$td2:$td4;
 431          echo "<tr>";
 432          echo "$td3".utf8_decode($item->MANUFACTURER)."</td>
 433                $td3".utf8_decode($item->NAME)."        </td>
 434                $td3".utf8_decode($item->DESCRIPTION)." </td>";
 435          echo "</tr>";
 436      }
 437      echo "</table><br>";        
 438  }
 439  
 440  function print_softwares($systemid)
 441  {    
 442      global    $l, $td1, $td2, $td3, $td4;
 443      
 444      $queryDetails  = "SELECT * FROM softwares WHERE (hardware_id=$systemid)";
 445      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 446      
 447      if ( mysql_num_rows($resultDetails) == 0 )         return;    
 448      print_item_header($l->g(20));    
 449      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 450          
 451      //echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 452      echo "<tr> $td1 ".$l->g(69)."     </td> $td1 ".$l->g(49)."     </td>   $td1 ".$l->g(277)."  </td>   $td1 ".$l->g(295)."  </td>";
 453                // $td1 $rep     </td> $td1 $com     </td>  </tr>";
 454  
 455      while($item = mysql_fetch_object($resultDetails))
 456      {    $ii++; $td3 = $ii%2==0?$td2:$td4;    
 457          echo "<tr>";
 458          echo "$td3".htmlentities(utf8_decode($item->PUBLISHER))."</td>
 459                $td3".htmlentities(utf8_decode($item->NAME))."     </td>
 460                $td3".utf8_decode($item->VERSION)."  </td>
 461                $td3".htmlentities(utf8_decode($item->FOLDER))."     </td>";
 462          /*      $td3".utf8_decode($item->FOLDER)."   </td>
 463                $td3".utf8_decode($item->COMMENTS)." </td>";*/
 464          echo "</tr>";
 465      }
 466      echo "</table><br>";        
 467  }
 468  
 469  function print_slots($systemid)
 470  {    
 471      global    $l, $td1, $td2, $td3, $td4;
 472  
 473      $queryDetails  = "SELECT * FROM slots WHERE (hardware_id=$systemid)";
 474      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 475      
 476      if ( mysql_num_rows($resultDetails) == 0 )        return;
 477      print_item_header($l->g(271));
 478      
 479      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 480      echo "<tr> $td1 ".$l->g(49)."  </td> $td1 ".$l->g(53)."  </td>  $td1 ".$l->g(70)." </td>";
 481      echo "</tr>";
 482  
 483      while($item = mysql_fetch_object($resultDetails))
 484      {    $ii++; $td3 = $ii%2==0?$td2:$td4;
 485          echo "<tr>";
 486          echo "$td3".utf8_decode($item->NAME)."       </td>
 487                $td3".utf8_decode($item->DESCRIPTION)."</td>
 488                $td3".utf8_decode($item->DESIGNATION)."</td>";    
 489          echo "</tr>";
 490      }
 491      echo "</table><br>";        
 492  }
 493  
 494  function print_printers($systemid)
 495  {    
 496      global $l, $td1, $td2, $td3, $td4;
 497      
 498      $queryDetails  = "SELECT * FROM printers WHERE (hardware_id=$systemid)";
 499      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 500      if ( mysql_num_rows($resultDetails) == 0 )     return;
 501      print_item_header($l->g(79));
 502          
 503      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 504      echo "<tr>  $td1 ".$l->g(49)."   </td>  $td1 ".$l->g(278)." </td>  $td1 ".$l->g(279)."   </td>  </tr>";
 505  
 506      while($item = mysql_fetch_object($resultDetails))
 507      {    $ii++; $td3 = $ii%2==0?$td2:$td4;
 508          echo "<tr>
 509                $td3".utf8_decode($item->NAME)."   </td>
 510                  $td3".utf8_decode($item->DRIVER)." </td>
 511                $td3".utf8_decode($item->PORT)."   </td>
 512               </tr>";
 513      }
 514          echo "</table><br>";        
 515  }
 516  
 517  function print_registry($systemid)
 518  {
 519      global $l, $td1, $td2, $td4, $td3;
 520      $queryDetails = "SELECT * FROM registry WHERE (hardware_id=$systemid)";
 521      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 522      if(mysql_num_rows($resultDetails)==0) return;    
 523      print_item_header($l->g(211));
 524      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 525      echo "<tr>";
 526      echo "$td1 ".$l->g(212)."</td>
 527      $td1 ".$l->g(213)."</td>
 528      ";
 529      echo "</tr>";
 530  
 531      while($item = mysql_fetch_object($resultDetails))
 532      {    $ii++; $td3 = $ii%2==0?$td2:$td4;
 533          echo "<tr>";
 534          echo "$td3 ".utf8_decode($item->NAME)."</td>
 535          $td3 ".utf8_decode($item->REGVALUE)."</td>
 536          ";
 537          echo "</tr>";
 538      }
 539      echo "</table><br>";        
 540  }
 541  
 542  
 543  function print_ports($systemid)
 544  {    
 545      global $l, $td1, $td2, $td3, $td4;
 546      
 547      $queryDetails  = "SELECT * FROM ports WHERE (hardware_id=$systemid)";
 548      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 549      
 550      if ( mysql_num_rows($resultDetails) == 0 )        return;    
 551      print_item_header($l->g(272));
 552      
 553      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 554      echo "<tr> $td1 ".$l->g(66)."   </td>  $td1 ".$l->g(49)."   </td> $td1 ".$l->g(88)."   </td>  $td1 ".$l->g(53)."   </td> </tr>";
 555  
 556      while($item = mysql_fetch_object($resultDetails))
 557      {    $ii++; $td3 = $ii%2==0?$td2:$td4;
 558          echo "<tr>
 559                $td3".utf8_decode($item->TYPE)."        </td>
 560                 $td3".utf8_decode($item->NAME)."        </td>
 561                $td3".utf8_decode($item->CAPTION)."     </td>
 562                $td3".utf8_decode($item->DESCRIPTION)." </td>
 563                </tr>";
 564      }
 565      echo "</table><br>";        
 566  }
 567  
 568  function print_networks($systemid)
 569  {    
 570      global $l, $td1, $td2, $td3, $td4;
 571      
 572      $queryDetails  = "SELECT * FROM networks WHERE (hardware_id=$systemid)";
 573      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 574      if ( mysql_num_rows($resultDetails) == 0 )     return;
 575      print_item_header($l->g(82));
 576      
 577      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 578      echo "<tr> $td1 ".$l->g(53)."   </td>  $td1 ".$l->g(66)." </td>
 579            $td1 ".$l->g(268)."        </td>  $td1 ".$l->g(95)." </td> $td1 ".$l->g(81)."     </td>
 580            $td1 ".$l->g(34)."        </td>  $td1 ".$l->g(208)."</td>  $td1 ".$l->g(207)." </td>
 581            $td1 ".$l->g(331)."     </td>$td1 ".$l->g(281)."     </td></tr>";
 582  
 583      while($item = mysql_fetch_object($resultDetails)) {    
 584          $ii++; $td3 = $ii%2==0?$td2:$td4;
 585          echo "<tr>
 586          $td3".utf8_decode($item->DESCRIPTION)."</td>
 587          $td3".utf8_decode($item->TYPE)."       </td>
 588          $td3".utf8_decode($item->SPEED)."      </td>
 589          $td3".utf8_decode($item->MACADDR)."    </td>
 590          $td3".utf8_decode($item->STATUS)."     </td>
 591          $td3".utf8_decode($item->IPADDRESS)."  </td>
 592          $td3".utf8_decode($item->IPMASK)."     </td>
 593          $td3".utf8_decode($item->IPGATEWAY)."  </td>
 594          $td3".utf8_decode($item->IPSUBNET)."   </td>
 595          $td3".utf8_decode($item->IPDHCP)."     </td></tr>";
 596      }
 597      echo "</table><br>";    
 598  }
 599  
 600  function print_monitors($systemid)
 601  {    
 602      global $l, $td1, $td2, $td3, $td4;
 603  
 604      $queryDetails = "SELECT * FROM monitors WHERE (hardware_id=$systemid)";
 605      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 606      
 607      
 608      if(mysql_num_rows($resultDetails)==0)         return;
 609      print_item_header($l->g(97));
 610      
 611      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 612      echo "<tr>  $td1 ".$l->g(64)." </td>  $td1 ".$l->g(80)."  </td>   $td1 ".$l->g(360)." </td>  $td1 ".$l->g(66)." </td>$td1 ".$l->g(36)." </td></tr>";
 613  
 614      while($item = mysql_fetch_object($resultDetails))
 615      {    $ii++; $td3 = $ii%2==0?$td2:$td4;
 616          echo "<tr>
 617              $td3".utf8_decode($item->MANUFACTURER)." </td>
 618              $td3".utf8_decode($item->CAPTION)."      </td>
 619              $td3".utf8_decode($item->DESCRIPTION)."  </td>
 620              $td3".utf8_decode($item->TYPE)."         </td>
 621              $td3".utf8_decode($item->SERIAL)."         </td>
 622          </tr>";
 623      }
 624      echo "</table><br>";        
 625  }
 626  
 627  function print_modems($systemid)
 628  {    
 629      global $l, $td1, $td2, $td3, $td4;
 630      
 631      $queryDetails  = "SELECT * FROM modems WHERE (hardware_id=$systemid)";
 632      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 633      
 634      
 635      if ( mysql_num_rows($resultDetails) == 0 )     return;
 636      print_item_header($l->g(270));
 637      
 638      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 639      echo "<tr> $td1 ".$l->g(49)."  </td> $td1 ".$l->g(65)."  </td> $td1 ".$l->g(53)."  </td> $td1 ".$l->g(66)."  </td> </tr>";
 640  
 641      while($item = mysql_fetch_object($resultDetails))
 642      {    $ii++; $td3 = $ii%2==0?$td2:$td4;
 643          echo "<tr>
 644                $td3".utf8_decode($item->NAME)."        </td>
 645                 $td3".utf8_decode($item->MODEL)."       </td>
 646                $td3".utf8_decode($item->DESCRIPTION)." </td>
 647                $td3".utf8_decode($item->TYPE).        "</td>
 648                </tr>";
 649      }
 650      echo "</table><br>";        
 651  }
 652  
 653  function print_memories($systemid)
 654  {    
 655      global $l, $td1, $td2, $td3, $td4;
 656  
 657      $queryDetails  = "SELECT * FROM memories WHERE (hardware_id=$systemid) ORDER BY capacity ASC";
 658      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 659          
 660      
 661      if ( mysql_num_rows($resultDetails) == 0 )     return;
 662      print_item_header($l->g(26));
 663      
 664      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 665      echo "<tr>";
 666      echo "$td1 ".$l->g(80)."  </td>  $td1 ".$l->g(53)."  </td>  $td1 ".$l->g(83)." (MB)  </td> $td1 ".$l->g(283)."    </td>
 667            $td1 ".$l->g(66)."  </td>  $td1 ".$l->g(268)."  </td>  $td1 ".$l->g(94)."      </td> </tr>";
 668  
 669      while($item = mysql_fetch_object($resultDetails))
 670      {    $ii++; $td3 = $ii%2==0?$td2:$td4;
 671          echo "<tr>
 672                $td3 ".utf8_decode($item->CAPTION)."     </td>
 673                $td3 ".utf8_decode($item->DESCRIPTION)." </td>
 674                $td3 ".utf8_decode($item->CAPACITY)."    </td>
 675                $td3 ".utf8_decode($item->PURPOSE)."     </td>
 676                $td3 ".utf8_decode($item->TYPE)."        </td>
 677                $td3 ".utf8_decode($item->SPEED)."       </td>
 678                $td3 ".utf8_decode($item->NUMSLOTS)."    </td>
 679                </tr>";
 680      }
 681      echo "</table><br>";        
 682  }
 683  
 684  function print_inputs($systemid)
 685  {    
 686      global $l, $td1, $td2, $td3, $td4;
 687  
 688      $queryDetails = "SELECT * FROM inputs WHERE (hardware_id=$systemid)";
 689      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 690      
 691      
 692      if ( mysql_num_rows($resultDetails) == 0 )         return;
 693      print_item_header($l->g(91));
 694      
 695      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 696      echo "<tr>";
 697      echo "$td1 ".$l->g(66)."   </td>   $td1 ".$l->g(64)."   </td>    $td1 ".$l->g(80)."   </td>
 698            $td1 ".$l->g(53)."   </td>   $td1 ".$l->g(84)." </td></tr>";
 699  
 700      while($item = mysql_fetch_object($resultDetails))
 701      {    $ii++; $td3 = $ii%2==0?$td2:$td4;
 702          echo "<tr>
 703                $td3 ".utf8_decode($item->TYPE)."        </td>
 704                $td3 ".utf8_decode($item->MANUFACTURER)."</td>
 705                $td3 ".utf8_decode($item->CAPTION)."     </td>
 706                $td3 ".utf8_decode($item->DESCRIPTION)." </td>
 707                $td3 ".utf8_decode($item->INTERFACE)."   </td>
 708               </tr>";
 709      }
 710      echo "</table><br>";        
 711  }
 712  
 713  function print_drives($systemid)
 714  {    
 715      global $l, $td1, $td2, $td3, $td4;
 716      
 717      $queryDetails  = "SELECT * FROM drives WHERE (hardware_id=$systemid)";
 718      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 719      
 720      
 721      if ( mysql_num_rows($resultDetails) == 0 )         return;
 722      print_item_header($l->g(92));
 723      
 724      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 725      echo "<tr>";
 726      echo "$td1 ".$l->g(85)."     </td>  $td1 ".$l->g(66)."       </td> $td1 ".$l->g(86)."  </td>
 727            $td1 ".$l->g(87)." (MB) </td> $td1 ".$l->g(88)." (MB)   </td></tr>";
 728  
 729      while($item = mysql_fetch_object($resultDetails))
 730      {    $ii++; $td3 = $ii%2==0?$td2:$td4;
 731          echo "<tr>
 732                $td3 ".utf8_decode($item->LETTER)."     </td>
 733                $td3 ".utf8_decode($item->TYPE)."       </td>
 734                $td3 ".utf8_decode($item->FILESYSTEM)." </td>
 735                $td3 ".utf8_decode($item->TOTAL)."      </td>
 736                $td3 ".utf8_decode($item->FREE)."       </td>
 737                </tr>";
 738      }
 739      echo "</table><br>";        
 740  }
 741  
 742  function print_bios($systemid)
 743  {    
 744      global $l, $td1, $td2, $td3, $td4;
 745      
 746      $queryDetails  = "SELECT * FROM bios WHERE (hardware_id=$systemid)";
 747      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 748      
 749      
 750      if ( mysql_num_rows($resultDetails) == 0 )     return;
 751      print_item_header($l->g(273));
 752      
 753      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 754      echo "<tr>$td1 ".$l->g(36)."  </td>      $td1 ".$l->g(64)."  </td>      $td1 ".$l->g(65)."   </td>      $td1 ".$l->g(284)."  </td>
 755            $td1 ".$l->g(209)."  </td> $td1 ".$l->g(210)."  </td> </tr>";
 756            
 757      $item = mysql_fetch_object($resultDetails);    
 758      echo "<tr>";
 759      echo "$td3".utf8_decode($item->SSN)." </td>
 760      $td3".utf8_decode($item->SMANUFACTURER)." </td>
 761            $td3".utf8_decode($item->SMODEL)."        </td>
 762            $td3".utf8_decode($item->BMANUFACTURER)." </td>
 763            $td3".utf8_decode($item->BVERSION)."      </td>
 764            $td3".utf8_decode($item->BDATE)."         </td>";
 765      echo "</tr>";
 766      echo "</table><br>";
 767  }
 768  
 769  function print_comments($systemid)
 770  {
 771      global $com, $td1, $td2, $td3, $td4;
 772  
 773      $queryDetails  = "SELECT * FROM comments WHERE (hardware_id=$systemid)";
 774      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 775          
 776      if ( mysql_num_rows($resultDetails) == 0 )      return;
 777      print_item_header($l->g(51));
 778      
 779      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 780      echo "<tr >";
 781      echo "$td1 ".$l->g(51)."</td>";
 782      echo "</tr>";
 783      
 784      while($item = mysql_fetch_object($resultDetails))
 785      {    $ii++; $td3 = $ii%2==0?$td2:$td4;
 786          echo "<tr>";
 787          echo "$td3".utf8_decode($item->COMMENTS)."</td>";
 788          echo "</tr>";
 789      }
 790      echo "</table><br>";
 791  }
 792  
 793  function print_controllers($systemid)
 794  {
 795      global $l, $td1, $td2, $td3, $td4;
 796      
 797      $queryDetails  = "SELECT * FROM controllers WHERE (hardware_id=$systemid)";
 798      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 799      
 800      if ( mysql_num_rows($resultDetails) == 0 )      return;
 801      print_item_header($l->g(93));
 802          
 803      echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 804      echo "<tr > $td1 ".$l->g(64)." </td> $td1 ".$l->g(49)." </td> $td1 ".$l->g(66)." </td></tr>";
 805  
 806      while($item = mysql_fetch_object($resultDetails))
 807      {    $ii++; $td3 = $ii%2==0?$td2:$td4;
 808          echo "<tr>
 809                  $td3 ".utf8_decode($item->MANUFACTURER)."</td>
 810                    $td3 ".utf8_decode($item->NAME)."        </td>
 811                    $td3 ".utf8_decode($item->TYPE)."        </td>
 812              </tr>";
 813      }
 814      echo "</table><br>";    
 815  }
 816  
 817  function print_inventory($systemid)
 818  {
 819      global $l, $td1, $td2, $td3, $td4;
 820      
 821      $queryDetails = "SELECT * FROM accountinfo WHERE hardware_id=$systemid";
 822      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 823      $item=mysql_fetch_array($resultDetails,MYSQL_ASSOC);
 824      if( $item ) {            
 825          $label_bouton = "<input onmouseover=\"this.style.background='#FFFFFF';\" onmouseout=\"this.style.background='#C7D9F5'\" class='bouton' type='button' value='".$l->g(103)."' onClick='MAJ_donnees(\"$systemid\",\"".session_id()."\");' $event_mouse>";
 826          echo "<td  align='middle' width='20%'>$label_bouton</td>";
 827              
 828          echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
 829          echo "<tr > $td1 ".$l->g(223)." </td> $td1 ".$l->g(224)." </td></tr>";        
 830          
 831          $indType=-1;
 832          foreach ($item as $k=>$v) {
 833              $indType++;
 834              if( strcasecmp($k,"DEVICEID")==0 || strcasecmp($k,"UNITID")==0|| strcasecmp($k,"HARDWARE_ID")==0)
 835                  continue;
 836              if(strcasecmp($k,TAG_NAME)==0)
 837                  $k = TAG_LBL;
 838              
 839              $ii++; $td3 = $ii%2==0?$td2:$td4;
 840              
 841              if(mysql_field_type($resultDetails,$indType)=="date")
 842                  $v = dateFromMysql($v);
 843                  
 844              echo "<tr>$td3 $k</td>$td3 $v</tr>";        
 845          }        
 846          
 847          echo "</table><br>";
 848      }    
 849  }
 850  
 851  function getNetName($did) {
 852      global $tdhd,$tdhf,$tdhdpb,$tdhfpb,$l;
 853      
 854      //echo "<tr>"$tdhd.$l->g(50).$tdhf.      $tdhdpb.VAL.$tdhfpb."</tr>";
 855              
 856      $reqSub = "SELECT name FROM subnet s,networks n WHERE s.netid=n.ipsubnet AND n.hardware_id=$did";
 857      $resSub = mysql_query($reqSub, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
 858      $indice = 1;
 859      $returnVal = "<tr>".$tdhd.$l->g(304)." ".$indice.$tdhf;    
 860  
 861      while($valSub = mysql_fetch_array( $resSub )){
 862          if($indice != 1) {
 863              $returnVal .= "</tr><tr>".$tdhd.$l->g(304)." ".$indice.$tdhf;
 864          }
 865          $indice++;
 866          $returnVal .= $tdhdpb.$valSub["name"].$tdhfpb;
 867      }    
 868      
 869      $queryDetails  = "SELECT ipsubnet FROM networks WHERE hardware_id=$did AND ipsubnet NOT IN(SELECT netid FROM subnet)";
 870      $resultDetails = mysql_query($queryDetails, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));    
 871      while($item = mysql_fetch_array($resultDetails)) {
 872          if($indice != 1) {
 873              $returnVal .= "</tr><tr>".$tdhfpb.$tdhd.$l->g(304)." ".$indice.$tdhf;
 874          }
 875          $returnVal .= $tdhdpb.$item["ipsubnet"].$tdhfpb;
 876          $indice++;
 877      }
 878      
 879      return     $returnVal;
 880  }
 881  
 882  function print_item_header($text)
 883  {
 884      echo "<br><br><table align=\"center\"  width='100%'  cellpadding='4'>";
 885      echo "<tr>";
 886      echo "<td align='center' width='100%'><b><font color='blue'>".strtoupper($text)."</font></b></td>";
 887      echo "</tr>";
 888      echo "</table><br>";    
 889  }
 890  
 891  function img($i,$a,$avail,$opt) {
 892      global $systemid;
 893  
 894      if( $opt == $a ) {
 895          $suff = "_a";
 896      }
 897      
 898      if( $avail ) {
 899          $href = "<a href='machine.php?sessid=".session_id()."&systemid=".urlencode($systemid)."&option=".urlencode($a)."'>";
 900          $fhref = "</a>";
 901          $img = "<img title=\"".htmlspecialchars($a)."\" src='image/{$i}{$suff}.png' />";
 902      }
 903      else {
 904          $href = "";
 905          $fhref = "";
 906          $img = "<img title=\"".htmlspecialchars($a)."\" src='image/{$i}_d.png' />";
 907      }
 908      
 909      return "<td width='80px'>".$href.$img.$fhref."</td>";
 910  
 911  }
 912  
 913  function isAvail($lbl) {
 914      global $systemid,$l;
 915  
 916      switch (stripslashes(urldecode($lbl))) {
 917          case $l->g(56) : $tble = "accountinfo";
 918                              break;
 919          case $l->g(26)  : $tble = "memories";
 920                              break;
 921          case $l->g(63)  : $tble = "storages";
 922                              break;
 923          case $l->g(92)  : $tble = "drives";
 924                              break;
 925          case $l->g(273)  : $tble = "bios";
 926                              break;
 927          case $l->g(96)  : $tble = "sounds";
 928                              break;
 929          case $l->g(61)  : $tble = "videos";
 930                              break;
 931          case $l->g(91)  : $tble = "inputs";
 932                              break;
 933          case $l->g(97)  : $tble = "monitors";
 934                              break;
 935          case $l->g(82) : $tble = "networks";
 936                              break;
 937          case $l->g(272) : $tble = "ports";
 938                              break;
 939          case $l->g(79) : $tble = "printers";
 940                              break;
 941          case $l->g(93) : $tble = "controllers";
 942                              break;
 943          case $l->g(271) : $tble = "slots";
 944                              break;
 945          case $l->g(20) : $tble = "softwares";
 946                              break;
 947          case $l->g(270) : $tble = "modems";    
 948                              break;
 949          case $l->g(211) : $tble = "registry";
 950                              break;    
 951          case $l->g(54):    return true;
 952          default: echo "bug";
 953                              break;
 954      }
 955      $resAv = mysql_query("SELECT hardware_id FROM $tble WHERE hardware_id=$systemid", $_SESSION["readServer"] );
 956      //echo "SELECT hardware_id FROM $tble WHERE hardware_id=$systemid";
 957      $valAvail = mysql_num_rows( $resAv );
 958      return ($valAvail>0);
 959  }
 960  ?>


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1