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


PHP Computer::checkGlobal方法代码示例

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


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

示例1: Computer

GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with reports. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
// Original Author of file: Benoit Machiavello
// ----------------------------------------------------------------------
$USEDBREPLICATE = 1;
$DBCONNECTION_REQUIRED = 1;
// Really a big SQL request
include "../../../../inc/includes.php";
includeLocales("histohard");
plugin_reports_checkRight('reports', "histohard", "r");
$computer = new Computer();
$computer->checkGlobal('r');
//TRANS: The name of the report = History of last hardware's installations
Html::header(__("histohard_report_title", 'reports'), $_SERVER['PHP_SELF'], "utils", "report");
Report::title();
echo "<div class='center'>";
echo "<table class='tab_cadrehov'>\n";
echo "<tr class='tab_bg_1 center'>" . "<th colspan='5'>" . __("History of last hardware's installations", 'reports') . "</th></tr>\n";
echo "<tr><th>" . __('Date of inventory', 'reports') . "</th>" . "<th>" . __('User') . "</th>" . "<th>" . __('Network device') . "</th>" . "<th>" . __(-'Field') . "</th>" . "<th>" . __('Modification', 'reports') . "</th></tr>\n";
$sql = "SELECT `glpi_logs`.`date_mod` AS dat, `linked_action`, `itemtype`, `itemtype_link`,\n               `old_value`, `new_value`, `glpi_computers`.`id` AS cid, `name`, `user_name`\n        FROM `glpi_logs`\n        LEFT JOIN `glpi_computers` ON (`glpi_logs`.`items_id` = `glpi_computers`.`id`)\n        WHERE `glpi_logs`.`date_mod` > DATE_SUB(Now(), INTERVAL 21 DAY)\n              AND `itemtype` = 'Computer'\n              AND `linked_action` IN (" . Log::HISTORY_CONNECT_DEVICE . ",\n                                      " . Log::HISTORY_DISCONNECT_DEVICE . ",\n                                      " . Log::HISTORY_DELETE_DEVICE . ",\n                                      " . Log::HISTORY_UPDATE_DEVICE . ",\n                                      " . Log::HISTORY_ADD_DEVICE . ")\n              AND `glpi_computers`.`entities_id` = '" . $_SESSION["glpiactive_entity"] . "'\n        ORDER BY `glpi_logs`.`id` DESC\n        LIMIT 0,100";
$result = $DB->query($sql);
$prev = "";
$class = "tab_bg_2";
while ($data = $DB->fetch_array($result)) {
    if ($prev == $data["dat"] . $data["name"]) {
        echo "</td></tr><tr class='" . $prevclass . " top'><td></td><td></td><td></td><td>";
    } else {
开发者ID:geldarr,项目名称:hack-space,代码行数:31,代码来源:histohard.php

示例2: Copyright

@copyright Copyright (c) 2009-2015 Reports plugin team
@license   AGPL License 3.0 or (at your option) any later version
           http://www.gnu.org/licenses/agpl-3.0-standalone.html
@link      https://forge.indepnet.net/projects/reports
@link      http://www.glpi-project.org/
@since     2009
--------------------------------------------------------------------------
*/
$USEDBREPLICATE = 1;
$DBCONNECTION_REQUIRED = 1;
// Really a big SQL request
include "../../../../inc/includes.php";
includeLocales("histoinst");
Session::checkRight("plugin_reports_histoinst", READ);
$computer = new Computer();
$computer->checkGlobal(READ);
$software = new Software();
$software->checkGlobal(READ);
//TRANS: The name of the report = History of last software's installations
Html::header(__('histoinst_report_title', 'reports'), $_SERVER['PHP_SELF'], "utils", "report");
Report::title();
echo "<div class='center'>";
echo "<table class='tab_cadrehov' cellpadding='5'>\n";
echo "<tr class='tab_bg_1 center'>" . "<th colspan='4'>" . __("History of last software's installations", "reports") . "</th></tr>\n";
echo "<tr class='tab_bg_2'><th>" . __('Date of inventory', 'reports') . "</th>" . "<th>" . __('User') . "</th>" . "<th>" . __("Computer's name") . "</th>" . "<th>" . sprintf(__('%1$s (%2$s)'), _n('Software', 'Software', 1), __('version')) . "</th></tr>\n";
$sql = "SELECT a.`date_mod` AS dat, a.`new_value`, `glpi_computers`.`id` AS cid, `name`,\n               a.`user_name`\n        FROM (SELECT `date_mod`, `new_value`, `user_name`, `items_id`, `id`\n              FROM `glpi_logs`\n              WHERE `glpi_logs`.`date_mod` > DATE_SUB(Now(), INTERVAL 21 DAY)\n                    AND `linked_action` = '" . Log::HISTORY_INSTALL_SOFTWARE . "'\n                    AND `itemtype` = 'Computer') a\n        LEFT JOIN `glpi_computers` ON (a.`items_id` = `glpi_computers`.`id`)\n        WHERE `glpi_computers`.`entities_id` = '" . $_SESSION["glpiactive_entity"] . "'\n        ORDER BY a.`id` DESC\n        LIMIT 0,200";
$result = $DB->query($sql);
$prev = "";
$class = "tab_bg_2";
while ($data = $DB->fetch_array($result)) {
    if ($prev == $data["dat"] . $data["name"]) {
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:31,代码来源:histoinst.php


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