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


PHP Stat::title方法代碼示例

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


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

示例1: date

if (isset($_GET["date2"])) {
    $_POST["date2"] = $_GET["date2"];
}
if (empty($_POST["date1"]) && empty($_POST["date2"])) {
    $year = date("Y") - 1;
    $_POST["date1"] = date("Y-m-d", mktime(1, 0, 0, date("m"), date("d"), $year));
    $_POST["date2"] = date("Y-m-d");
}
if (!empty($_POST["date1"]) && !empty($_POST["date2"]) && strcmp($_POST["date2"], $_POST["date1"]) < 0) {
    $tmp = $_POST["date1"];
    $_POST["date1"] = $_POST["date2"];
    $_POST["date2"] = $tmp;
}
if (!isset($_GET["start"])) {
    $_GET["start"] = 0;
}
Stat::title();
echo "<div class='center'><form method='post' name='form' action='stat.item.php'>";
echo "<table class='tab_cadre'><tr class='tab_bg_2'>";
echo "<td class='right'>" . __('Start date') . "</td><td>";
Html::showDateField("date1", array('value' => $_POST["date1"]));
echo "</td><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' => $_POST["date2"]));
echo "</td></tr>";
echo "</table>";
Html::closeForm();
echo "</div>";
Stat::showItems($_SERVER['PHP_SELF'], $_POST["date1"], $_POST["date2"], $_GET['start']);
Html::footer();
開發者ID:jose-martins,項目名稱:glpi,代碼行數:31,代碼來源:stat.item.php

示例2: displayCriteriasForm

 /**
  * Display a common search criterias form
  * @param target the form's target
  * @param params the search criterias
  */
 function displayCriteriasForm()
 {
     global $HEADER_LOADED;
     //Get criteria's values
     $this->manageCriteriasValues();
     //Display Html::header is output is HTML
     if (isset($_POST["display_type"]) && $_POST["display_type"] != Search::HTML_OUTPUT) {
         return;
     }
     if (!$HEADER_LOADED) {
         $title = $this->title;
         if ($this->subname) {
             $title = sprintf(__('%1$s - %2$s'), $title, $this->subname);
         }
         if (isStat($this->name)) {
             Html::header($title, $_SERVER['PHP_SELF'], "maintain", "stat");
             Stat::title();
         } else {
             Html::header($title, $_SERVER['PHP_SELF'], "utils", "report");
             Report::title();
         }
     }
     plugin_reports_checkRight($this->plug, $this->name, "r");
     //Display form only if there're criterias
     if (!empty($this->criterias)) {
         echo "<div class='center'>";
         echo "<form method='post' name='form' action='" . $_SERVER['PHP_SELF'] . "'>";
         echo "<table class='tab_cadre_fixe'>";
         echo "<tr><th colspan='6'>" . __('Search criteria', 'reports');
         //If form is validated, then display the bookmark button
         if ($this->criteriasValidated()) {
             //Add parameters to uri to be saved as bookmarks
             $_SERVER["REQUEST_URI"] = $this->buildBookmarkUrl();
             Bookmark::showSaveButton(Bookmark::URI, isStat($this->name) ? 'PluginReportsStat' : 'PluginReportsReport');
         }
         echo "</th></tr>\n";
         //Display each criteria's html selection item
         foreach ($this->criterias as $criteria) {
             $criteria->displayCriteria();
         }
         $this->closeColumn();
         echo "<tr class='tab_bg_2'><td colspan='4' class='center'>";
         echo "<input type='submit' name='find' value='" . _sx('button', 'Search') . "' class='submit'>";
         echo "</td></tr>";
         echo "</table></div>";
         Html::closeForm();
     }
 }
開發者ID:geldarr,項目名稱:hack-space,代碼行數:53,代碼來源:autoreport.class.php


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