Beispiel #1
0
         break;
     case ITEM_VALUE_TYPE_UINT64:
         $h_table = "history_uint";
         break;
     case ITEM_VALUE_TYPE_TEXT:
         $h_table = "history_text";
         break;
     default:
         $h_table = "history_str";
 }
 $result = DBselect('SELECT h.clock,h.value,i.valuemapid ' . ' FROM ' . $h_table . ' h, items i ' . ' WHERE h.itemid=i.itemid ' . ' AND i.itemid=' . $_REQUEST['itemid'] . $cond_clock . ' ORDER BY clock desc', $limit);
 if (!isset($_REQUEST["plaintext"])) {
     $table = new CTableInfo();
     $table->SetHeader(array(S_TIMESTAMP, S_VALUE));
     $table->AddOption('id', 'graph');
     $table->ShowStart();
     // to solve memory leak we call 'Show' method by steps
 } else {
     echo "<pre>\n";
 }
 COpt::profiling_start("history");
 while ($row = DBfetch($result)) {
     if ($DB['TYPE'] == "ORACLE" && $item_type == ITEM_VALUE_TYPE_TEXT) {
         if (isset($row["value"])) {
             $row["value"] = $row["value"]->load();
         } else {
             $row["value"] = "";
         }
     }
     if ($row["valuemapid"] > 0) {
         $value = replace_value_by_map($row["value"], $row["valuemapid"]);