当前位置: 首页>>代码示例>>PHP>>正文


PHP Stat::getItems方法代码示例

本文整理汇总了PHP中Stat::getItems方法的典型用法代码示例。如果您正苦于以下问题:PHP Stat::getItems方法的具体用法?PHP Stat::getItems怎么用?PHP Stat::getItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Stat的用法示例。


在下文中一共展示了Stat::getItems方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: commonFooter

if (empty($_REQUEST["dropdown"]) || !class_exists($_REQUEST["dropdown"])) {
    // Do nothing
    commonFooter();
    exit;
}
$item = new $_REQUEST["dropdown"]();
if (!$item instanceof CommonDevice) {
    // echo "Dropdown";
    $type = "comp_champ";
    $val = Stat::getItems($itemtype, $_REQUEST["date1"], $_REQUEST["date2"], $_REQUEST["dropdown"]);
    $params = array('type' => $type, 'dropdown' => $_REQUEST["dropdown"], 'date1' => $_REQUEST["date1"], 'date2' => $_REQUEST["date2"], 'start' => $_REQUEST["start"]);
} else {
    //   echo "Device";
    $type = "device";
    $field = $_REQUEST["dropdown"];
    $val = Stat::getItems($itemtype, $_REQUEST["date1"], $_REQUEST["date2"], $_REQUEST["dropdown"]);
    $params = array('type' => $type, 'dropdown' => $_REQUEST["dropdown"], 'date1' => $_REQUEST["date1"], 'date2' => $_REQUEST["date2"], 'start' => $_REQUEST["start"]);
}
/*printPager($_REQUEST['start'],count($val),$CFG_GLPI['root_doc'].'/front/stat.location.php',
  "date1=".$_REQUEST["date1"]."&date2=".$_REQUEST["date2"]."&dropdown=".$_REQUEST["dropdown"],
  'Stat',$params);*/
if (!$_REQUEST['showgraph']) {
    PluginMobileStat::show($type, $_REQUEST["date1"], $_REQUEST["date2"], $_REQUEST['start'], $val, $_REQUEST["dropdown"]);
} else {
    $data = Stat::getDatas($type, $_REQUEST["date1"], $_REQUEST["date2"], $_REQUEST['start'], $val, $_REQUEST["dropdown"]);
    if (isset($data['opened']) && is_array($data['opened'])) {
        foreach ($data['opened'] as $key => $val) {
            $cleandata[html_clean($key)] = $val;
        }
        PluginMobileStat::showGraph(array($LANG['stats'][5] => $cleandata), array('title' => $LANG['stats'][5], 'showtotal' => 1, 'unit' => $LANG['stats'][35], 'type' => 'pie'));
    }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:31,代码来源:stat.locationccc.php

示例2: showDateFormItem

echo "<table class='tab_cadre'>";
echo "<tr class='tab_bg_2'><td rowspan='2' class='center'>";
echo "<select name='type'>" . $INSELECT . "</select></td>";
echo "<td class='right'>" . $LANG['search'][8] . "&nbsp;:</td><td>";
showDateFormItem("date1", $_REQUEST["date1"]);
echo "</td>";
echo "<td class='right'>" . $LANG['stats'][7] . "&nbsp;:</td>";
echo "<td rowspan='2' class='center'>";
echo "<input type='submit' class='button' name='submit' value=\"" . $LANG['buttons'][7] . "\"></td></tr>";
echo "<tr class='tab_bg_2'><td class='right'>" . $LANG['search'][9] . "&nbsp;:</td><td>";
showDateFormItem("date2", $_REQUEST["date2"]);
echo "</td><td class='center'>";
Dropdown::showYesNo('showgraph', $_REQUEST['showgraph']);
echo "</td></tr>";
echo "</table></form></div>";
$val = Stat::getItems($_REQUEST["date1"], $_REQUEST["date2"], $_REQUEST["type"]);
$params = array('type' => $_REQUEST["type"], 'date1' => $_REQUEST["date1"], 'date2' => $_REQUEST["date2"], 'start' => $_REQUEST["start"]);
printPager($_REQUEST['start'], count($val), $CFG_GLPI['root_doc'] . '/front/stat.tracking.php', "date1=" . $_REQUEST["date1"] . "&amp;date2=" . $_REQUEST["date2"] . "&amp;type=" . $_REQUEST["type"] . "&amp;showgraph=" . $_REQUEST["showgraph"], 'Stat', $params);
if (!$_REQUEST['showgraph']) {
    Stat::show($_REQUEST["type"], $_REQUEST["date1"], $_REQUEST["date2"], $_REQUEST['start'], $val);
} else {
    $data = Stat::getDatas($_REQUEST["type"], $_REQUEST["date1"], $_REQUEST["date2"], $_REQUEST['start'], $val);
    if (isset($data['opened']) && is_array($data['opened'])) {
        foreach ($data['opened'] as $key => $val) {
            $newkey = html_clean($key);
            $cleandata[$newkey] = $val;
        }
        Stat::showGraph(array($LANG['stats'][5] => $cleandata), array('title' => $LANG['stats'][5], 'showtotal' => 1, 'unit' => $LANG['stats'][35], 'type' => 'pie'));
    }
    if (isset($data['solved']) && is_array($data['solved'])) {
        foreach ($data['solved'] as $key => $val) {
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:31,代码来源:stat.tracking.php

示例3: switch

     break;
 case 'Stat':
     if (isset($_GET["item_type_param"])) {
         $params = Toolbox::decodeArrayFromInput($_GET["item_type_param"]);
         switch ($params["type"]) {
             case "comp_champ":
                 $val = Stat::getItems($_GET["itemtype"], $params["date1"], $params["date2"], $params["dropdown"]);
                 Stat::showTable($_GET["itemtype"], $params["type"], $params["date1"], $params["date2"], $params["start"], $val, $params["dropdown"]);
                 break;
             case "device":
                 $val = Stat::getItems($_GET["itemtype"], $params["date1"], $params["date2"], $params["dropdown"]);
                 Stat::showTable($_GET["itemtype"], $params["type"], $params["date1"], $params["date2"], $params["start"], $val, $params["dropdown"]);
                 break;
             default:
                 $val2 = isset($params['value2']) ? $params['value2'] : 0;
                 $val = Stat::getItems($_GET["itemtype"], $params["date1"], $params["date2"], $params["type"], $val2);
                 Stat::showTable($_GET["itemtype"], $params["type"], $params["date1"], $params["date2"], $params["start"], $val, $val2);
         }
     } else {
         if (isset($_GET["type"]) && $_GET["type"] == "hardwares") {
             Stat::showItems("", $_GET["date1"], $_GET["date2"], $_GET['start']);
         }
     }
     break;
 default:
     // Plugin case
     if ($plug = isPluginItemType($_GET["item_type"])) {
         if (Plugin::doOneHook($plug['plugin'], 'dynamicReport', $_GET)) {
             exit;
         }
     }
开发者ID:btry,项目名称:glpi,代码行数:31,代码来源:report.dynamic.php

示例4: array

echo "</form>";
if (empty($_GET["dropdown"]) || !($item = getItemForItemtype($_GET["dropdown"]))) {
    // Do nothing
    Html::footer();
    exit;
}
if (!$item instanceof CommonDevice) {
    // echo "Dropdown";
    $type = "comp_champ";
    $val = Stat::getItems($_GET['itemtype'], $_GET["date1"], $_GET["date2"], $_GET["dropdown"]);
    $params = array('type' => $type, 'dropdown' => $_GET["dropdown"], 'date1' => $_GET["date1"], 'date2' => $_GET["date2"], 'start' => $_GET["start"]);
} else {
    //   echo "Device";
    $type = "device";
    $field = $_GET["dropdown"];
    $val = Stat::getItems($_GET['itemtype'], $_GET["date1"], $_GET["date2"], $_GET["dropdown"]);
    $params = array('type' => $type, 'dropdown' => $_GET["dropdown"], 'date1' => $_GET["date1"], 'date2' => $_GET["date2"], 'start' => $_GET["start"]);
}
Html::printPager($_GET['start'], count($val), $CFG_GLPI['root_doc'] . '/front/stat.location.php', "date1=" . $_GET["date1"] . "&amp;date2=" . $_GET["date2"] . "&amp;itemtype=" . $_GET['itemtype'] . "&amp;dropdown=" . $_GET["dropdown"], 'Stat', $params);
if (!$_GET['showgraph']) {
    Stat::showTable($_GET['itemtype'], $type, $_GET["date1"], $_GET["date2"], $_GET['start'], $val, $_GET["dropdown"]);
} else {
    $data = Stat::getDatas($_GET['itemtype'], $type, $_GET["date1"], $_GET["date2"], $_GET['start'], $val, $_GET["dropdown"]);
    if (isset($data['opened']) && is_array($data['opened'])) {
        foreach ($data['opened'] as $key => $val) {
            $cleandata[Html::clean($key)] = $val;
        }
        Stat::showGraph(array(__('Number opened') => $cleandata), array('title' => __('Number opened'), 'showtotal' => 1, 'unit' => __('Tickets'), 'type' => 'pie'));
    }
    if (isset($data['solved']) && is_array($data['solved'])) {
        foreach ($data['solved'] as $key => $val) {
开发者ID:glpi-project,项目名称:glpi,代码行数:31,代码来源:stat.location.php

示例5: array

Html::showDateField("date1", array('value' => $_GET["date1"]));
echo "</td>";
echo "<td class='right'>" . __('Show graphics') . "</td>";
echo "<td rowspan='2' class='center'>";
echo "<input type='submit' class='submit' name='submit' value=\"" . __s('Display report') . "\"></td>" . "</tr>";
echo "<tr class='tab_bg_2'><td class='right'>" . __('End date') . "</td><td>";
Html::showDateField("date2", array('value' => $_GET["date2"]));
echo "</td><td class='center'>";
echo "<input type='hidden' name='value2' value='" . $_GET["value2"] . "'>";
Dropdown::showYesNo('showgraph', $_GET['showgraph']);
echo "</td></tr>";
echo "</table>";
// form using GET method : CRSF not needed
echo "</form>";
echo "</div>";
$val = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"], $_GET["value2"]);
$params = array('type' => $_GET["type"], 'date1' => $_GET["date1"], 'date2' => $_GET["date2"], 'value2' => $_GET["value2"], 'start' => $_GET["start"]);
Html::printPager($_GET['start'], count($val), $CFG_GLPI['root_doc'] . '/front/stat.tracking.php', "date1=" . $_GET["date1"] . "&amp;date2=" . $_GET["date2"] . "&amp;type=" . $_GET["type"] . "&amp;showgraph=" . $_GET["showgraph"] . "&amp;itemtype=" . $_GET["itemtype"] . "&amp;value2=" . $_GET['value2'], 'Stat', $params);
if (!$_GET['showgraph']) {
    Stat::showTable($_GET["itemtype"], $_GET["type"], $_GET["date1"], $_GET["date2"], $_GET['start'], $val, $_GET['value2']);
} else {
    $data = Stat::getDatas($_GET["itemtype"], $_GET["type"], $_GET["date1"], $_GET["date2"], $_GET['start'], $val, $_GET['value2']);
    if (isset($data['opened']) && is_array($data['opened'])) {
        foreach ($data['opened'] as $key => $val) {
            $newkey = Toolbox::unclean_cross_side_scripting_deep(Html::clean($key));
            $cleandata[$newkey] = $val;
        }
        Stat::showGraph(array(__('Number opened') => $cleandata), array('title' => __('Number opened'), 'showtotal' => 1, 'unit' => $item->getTypeName(Session::getPluralNumber()), 'type' => 'pie'));
    }
    if (isset($data['solved']) && is_array($data['solved'])) {
        foreach ($data['solved'] as $key => $val) {
开发者ID:glpi-project,项目名称:glpi,代码行数:31,代码来源:stat.tracking.php

示例6: sprintf

        $val1 = $_GET["id"];
        $val2 = $_GET["champ"];
        if ($item = getItemForItemtype($_GET["champ"])) {
            $device_table = $item->getTable();
            $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["champ"]);
            $query = "SELECT `designation`\n                    FROM `" . $device_table . "`\n                    WHERE `id` = '" . $_GET['id'] . "'";
            $result = $DB->query($query);
            $title = sprintf(__('%1$s: %2$s'), $item->getTypeName(), $DB->result($result, 0, "designation"));
        }
        break;
    case "comp_champ":
        $val1 = $_GET["id"];
        $val2 = $_GET["champ"];
        if ($item = getItemForItemtype($_GET["champ"])) {
            $table = $item->getTable();
            $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["champ"]);
            $title = sprintf(__('%1$s: %2$s'), $item->getTypeName(), Dropdown::getDropdownName($table, $_GET["id"]));
        }
        break;
}
// Found next and prev items
$foundkey = -1;
foreach ($values as $key => $val) {
    if ($val['id'] == $_GET["id"]) {
        $foundkey = $key;
    }
}
if ($foundkey >= 0) {
    if (isset($values[$foundkey + 1])) {
        $next = $values[$foundkey + 1]['id'];
    }
开发者ID:kipman,项目名称:glpi,代码行数:31,代码来源:stat.graph.php

示例7: unserialize

     KnowbaseItem::showList($_GET, $_GET["is_faq"]);
     break;
 case 'Stat':
     if (isset($_GET["item_type_param"])) {
         $params = unserialize(stripslashes($_GET["item_type_param"]));
         switch ($params["type"]) {
             case "comp_champ":
                 $val = Stat::getItems($params["date1"], $params["date2"], $params["dropdown"]);
                 Stat::show($params["type"], $params["date1"], $params["date2"], $params["start"], $val, $params["dropdown"]);
                 break;
             case "device":
                 $val = Stat::getItems($params["date1"], $params["date2"], $params["dropdown"]);
                 Stat::show($params["type"], $params["date1"], $params["date2"], $params["start"], $val, $params["dropdown"]);
                 break;
             default:
                 $val = Stat::getItems($params["date1"], $params["date2"], $params["type"]);
                 Stat::show($params["type"], $params["date1"], $params["date2"], $params["start"], $val);
         }
     } else {
         if (isset($_GET["type"]) && $_GET["type"] == "hardwares") {
             Stat::showItems("", $_GET["date1"], $_GET["date2"], $_GET['start']);
         }
     }
     break;
 default:
     // Plugin case
     if ($plug = isPluginItemType($_GET["item_type"])) {
         if (doOneHook($plug['plugin'], 'dynamicReport', $_GET)) {
             exit;
         }
     }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:31,代码来源:report.dynamic.php


注:本文中的Stat::getItems方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。