[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/phpsysinfo/includes/ -> table_hardware.php (source)

   1  <?php
   2  //
   3  // phpSysInfo - A PHP System Information Script
   4  // http://phpsysinfo.sourceforge.net/
   5  //
   6  // This program is free software; you can redistribute it and/or
   7  // modify it under the terms of the GNU General Public License
   8  // as published by the Free Software Foundation; either version 2
   9  // of the License, or (at your option) any later version.
  10  //
  11  // This program is distributed in the hope that it will be useful,
  12  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14  // GNU General Public License for more details.
  15  //
  16  // You should have received a copy of the GNU General Public License
  17  // along with this program; if not, write to the Free Software
  18  // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  19  //
  20  // $Id: table_hardware.php 17475 2004-11-28 19:01:45Z  $
  21  
  22  $sys = sys_cpu();
  23  
  24  $ar_buf = sys_pcibus(); 
  25  
  26  if (count($ar_buf)) {
  27      for ($i=0;$i<sizeof($ar_buf);$i++) {
  28          $pci_devices .= $ar_buf[$i] . '<br>';
  29      }
  30  } else {
  31      $pci_devices .= '<i>'. $text['none'] . '</i>';
  32  }
  33  
  34  $ar_buf = sys_idebus(); 
  35  
  36  ksort($ar_buf);
  37  
  38  if (count($ar_buf)) {
  39      while (list($key, $value) = each($ar_buf)) {
  40          $ide_devices .= $key . ': ' . $ar_buf[$key]['model'];
  41          if (isset($ar_buf[$key]['capacity'])) {
  42              $ide_devices .= ' (Capacity: ' . sprintf('%.2f', $ar_buf[$key]['capacity'] / (1024 * 1024 * 2)) . ' GB )';
  43          }
  44          $ide_devices .= '<br>';
  45      }
  46  } else {
  47      $ide_devices .= '<i>' . $text['none']. '</i>';
  48  }
  49  
  50  $ar_buf = sys_scsibus(); 
  51  
  52  if (count($ar_buf)) {
  53      for ($i=0;$i<sizeof($ar_buf);$i++) {
  54          $scsi_devices .= $ar_buf[$i] . '<br>';
  55      }
  56  } else {
  57      $scsi_devices .= '<i>' . $text['none'] . '</i>';
  58  }
  59  
  60  
  61  $_text = '<table border="0" width="90%" align="center">'
  62         . '<tr><td><font size="-1">'. $text['numcpu'] .'</font></td><td><font size="-1">' . $sys['cpus'] . '</font></td></tr>'
  63         . '<tr><td><font size="-1">'. $text['cpumodel'] .'</font></td><td><font size="-1">' . $sys['model'] . '</font></td></tr>'
  64         . '<tr><td><font size="-1">'. $text['mhz'] .'</font></td><td><font size="-1">' . $sys['mhz'] . ' MHz</font></td></tr>'
  65         . '<tr><td><font size="-1">'. $text['cache'] .'</font></td><td><font size="-1">' . $sys['cache'] . '</font></td></tr>'
  66         . '<tr><td><font size="-1">'. $text['bogomips'] .'</font></td><td><font size="-1">' . $sys['bogomips'] . '</font></td></tr>'
  67         . '<tr><td><font size="-1">'. $text['pci'] .'</font></td><td><font size="-1">' . $pci_devices . '</font></td></tr>'
  68         . '<tr><td><font size="-1">'. $text['ide'] .'</font></td><td><font size="-1">' . $ide_devices . '</font></td></tr>'
  69         . '<tr><td><font size="-1">'. $text['scsi'] .'</font></td><td><font size="-1">' . $scsi_devices . '</font></td></tr>'
  70         . '</table>';
  71  
  72  $tpl->set_var('hardware', makebox($text['hardware'], $_text, '100%'));
  73  
  74  ?>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7