[ Index ] |
|
Code source de vtiger CRM 5.0.2 |
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: hddtemp.php,v 1.8 2005/12/31 17:25:26 bigmichi1 Exp $ 21 22 function xml_hddtemp($hddtemp) { 23 global $hddtemp_avail; 24 $data = $hddtemp->temperature($hddtemp_avail); 25 26 $_text = " <HDDTemp>\n"; 27 if (sizeof($data) > 0) { 28 for ($i=0, $max = sizeof($data); $i < $max; $i++) { 29 $_text .= " <Item>\n"; 30 $_text .= " <Label>" . htmlspecialchars($data[$i]['label'], ENT_QUOTES) . "</Label>\n"; 31 $_text .= " <Value>" . htmlspecialchars($data[$i]['value'], ENT_QUOTES) . "</Value>\n"; 32 $_text .= " <Model>" . htmlspecialchars($data[$i]['model'], ENT_QUOTES) . "</Model>\n"; 33 $_text .= " </Item>\n"; 34 } 35 } 36 $_text .= " </HDDTemp>\n"; 37 38 return $_text; 39 } 40 41 function html_hddtemp() { 42 global $XPath; 43 global $text; 44 global $sensor_program; 45 46 $textdir = direction(); 47 $scale_factor = 2; 48 $_text = ""; 49 $maxvalue = "+60"; 50 51 if ($XPath->match("/phpsysinfo/HDDTemp")) { 52 for ($i=1, $max = sizeof($XPath->getDataParts('/phpsysinfo/HDDTemp')); $i < $max; $i++) { 53 if( $XPath->getData("/phpsysinfo/HDDTemp/Item[$i]/Value") != 0) { 54 $_text .= " <tr>\n"; 55 $_text .= " <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">". $XPath->getData("/phpsysinfo/HDDTemp/Item[$i]/Model") . "</font></td>\n"; 56 $_text .= " <td align=\"" . $textdir['left'] . "\" valign=\"top\" nowrap><font size=\"-1\">"; 57 $_text .= create_bargraph($XPath->getData("/phpsysinfo/HDDTemp/Item[$i]/Value"), $maxvalue, $scale_factor); 58 $_text .= " " . round($XPath->getData("/phpsysinfo/HDDTemp/Item[$i]/Value")) . " " . $text['degree_mark'] . "</font></td>\n"; 59 $_text .= " <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">". $maxvalue . " " . $text['degree_mark'] . "</font></td></tr>\n"; 60 } 61 } 62 }; 63 if (strlen($_text) > 0 && empty($sensor_program)) { 64 $_text = " <tr>\n" 65 . " <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['s_label'] . "</b></font></td>\n" 66 . " <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['s_value'] . "</b></font></td>\n" 67 . " <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['s_limit'] . "</b></font></td>\n" 68 . " </tr>" . $_text; 69 } 70 return $_text; 71 }; 72 73 function wml_hddtemp() { 74 global $XPath; 75 global $text; 76 77 if ($XPath->match("/phpsysinfo/HDDTemp")) { 78 for ($i = 1; $i < sizeof($XPath->getDataParts('/phpsysinfo/HDDTemp')); $i++) { 79 if( $XPath->getData("/phpsysinfo/HDDTemp/Item[$i]/Value") != 0) { 80 $_text .= "<p>\n"; 81 $_text .= $XPath->getData("/phpsysinfo/HDDTemp/Item[$i]/Model") . ": " . round($XPath->getData("/phpsysinfo/HDDTemp/Item[$i]/Value")) . " " . str_replace("º", "", $text['degree_mark']) . "</p>\n"; 82 } 83 } 84 }; 85 return $_text; 86 } 87 88 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 10:22:19 2007 | par Balluche grâce à PHPXref 0.7 |