當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Software::checkGlobal方法代碼示例

本文整理匯總了PHP中Software::checkGlobal方法的典型用法代碼示例。如果您正苦於以下問題:PHP Software::checkGlobal方法的具體用法?PHP Software::checkGlobal怎麽用?PHP Software::checkGlobal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Software的用法示例。


在下文中一共展示了Software::checkGlobal方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Computer

along with reports. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
// Original Author of file: Remi Collet
// Purpose of file:
// ----------------------------------------------------------------------
$USEDBREPLICATE = 1;
$DBCONNECTION_REQUIRED = 1;
// Really a big SQL request
include "../../../../inc/includes.php";
includeLocales("histoinst");
plugin_reports_checkRight('reports', "histoinst", "r");
$computer = new Computer();
$computer->checkGlobal('r');
$software = new Software();
$software->checkGlobal('r');
//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"]) {
        echo "<br />";
    } else {
開發者ID:geldarr,項目名稱:hack-space,代碼行數:31,代碼來源:histoinst.php

示例2: Computer

           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"]) {
        echo "<br />";
    } else {
開發者ID:paisdelconocimiento,項目名稱:glpi-smartcities,代碼行數:31,代碼來源:histoinst.php


注:本文中的Software::checkGlobal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。