// 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'));
    }
    if (isset($data['solved']) && is_array($data['solved'])) {
        foreach ($data['solved'] as $key => $val) {
            $cleandata[html_clean($key)] = $val;
        }
        PluginMobileStat::showGraph(array($LANG['stats'][11] => $cleandata), array('title' => $LANG['stats'][11], 'showtotal' => 1, 'unit' => $LANG['stats'][35], 'type' => 'pie'));
    }
}
Example #2
0
echo "<h2>pager</h2>";
*/
$val = PluginMobileStat::getItems($_REQUEST["date1"], $_REQUEST["date2"], $_REQUEST["type"]);
$params = array('type' => $_REQUEST["type"], 'field' => $field, '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);
          
echo "</div>";*/
//echo $_REQUEST["type"];
//$itemtype = $_REQUEST["type"];
//$itemtype = "Ticket";
if (!$_REQUEST['showgraph']) {
    PluginMobileStat::show($itemtype, $_REQUEST["type"], $_REQUEST["date1"], $_REQUEST["date2"], $_REQUEST['start'], $val);
} else {
    $data = Stat::getDatas($itemtype, $_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['5'])) {
        foreach ($data['solved'] as $key => $val) {
            $newkey = html_clean($key);
            $cleandata[$newkey] = $val;
        }
        Stat::showGraph(array($LANG['stats'][11] => $cleandata), array('title' => $LANG['stats'][11], 'showtotal' => 1, 'unit' => $LANG['stats'][35], 'type' => 'pie'));