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


PHP Html::showDateFormItem方法代码示例

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


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

示例1: showSelector

 /**
  * Show a date selector
  * @param  datetime $date1    date of start
  * @param  datetime $date2    date of ending
  * @param  string $randname random string (to prevent conflict in js selection)
  * @return nothing
  */
 static function showSelector($date1, $date2, $randname)
 {
     $request_string = self::getRequestString($_GET);
     echo "<div class='center'><form method='POST' action='?{$request_string}' name='form'" . " id='mreporting_date_selector'>\n";
     echo "<table class='tab_cadre'><tr class='tab_bg_1'>";
     echo '<td><table><tr class="tab_bg_1">';
     echo "<td>";
     Html::showDateFormItem("date1" . $randname, $date1, false);
     echo "</td>\n";
     echo "<td>";
     Html::showDateFormItem("date2" . $randname, $date2, false);
     echo "</td>\n";
     self::getReportSelectors();
     echo "</tr></table></td>";
     echo "<td rowspan='2' class='center'>";
     echo "<input type='submit' class='button' name='submit' Value=\"" . _sx('button', 'Post') . "\">";
     echo "</td>\n";
     echo "<td class='center'>";
     $_SERVER['REQUEST_URI'] .= "&date1" . $randname . "=" . $date1;
     $_SERVER['REQUEST_URI'] .= "&date2" . $randname . "=" . $date2;
     Bookmark::showSaveButton(Bookmark::URI);
     echo "</td>\n";
     echo "</tr>";
     echo "</table>";
     Html::closeForm();
     echo "</div>\n";
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:34,代码来源:misc.class.php

示例2: displaySearchForm

function displaySearchForm()
{
    global $_SERVER;
    echo "<form action='" . $_SERVER["PHP_SELF"] . "' method='post'>";
    echo "<table class='tab_cadre' cellpadding='5'>";
    echo "<tr class='tab_bg_1' align='center'>";
    echo "<td>";
    echo __('Starting date', 'fusioninventory') . " :";
    echo "</td>";
    echo "<td width='120'>";
    Html::showDateFormItem("glpi_plugin_fusioninventory_date_start", $_SESSION['glpi_plugin_fusioninventory_date_start']);
    echo "</td>";
    echo "<td>";
    echo __('Ending date', 'fusioninventory') . " :";
    echo "</td>";
    echo "<td width='120'>";
    Html::showDateFormItem("glpi_plugin_fusioninventory_date_end", $_SESSION['glpi_plugin_fusioninventory_date_end']);
    echo "</td>";
    echo "<td>";
    echo "<input type='submit' name='reset' value='reset' class='submit' />";
    echo "</td>";
    echo "<td>";
    echo "<input type='submit' value='Valider' class='submit' />";
    echo "</td>";
    echo "</tr>";
    echo "</table>";
    Html::closeForm();
}
开发者ID:korial29,项目名称:fusioninventory-for-glpi,代码行数:28,代码来源:printerlogreport.php

示例3: displayCriteria

 public function displayCriteria()
 {
     $this->getReport()->startColumn();
     echo $this->getCriteriaLabel($this->getName()) . '&nbsp;:';
     $this->getReport()->endColumn();
     $this->getReport()->startColumn();
     Html::showDateFormItem($this->getName(), $this->getDate(), false);
     $this->getReport()->endColumn();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:9,代码来源:datecriteria.class.php

示例4: displayCriteria

 public function displayCriteria()
 {
     $this->getReport()->startColumn();
     $name = $this->getCriteriaLabel($this->getName());
     if ($name) {
         echo "{$name}, ";
     }
     echo $this->getCriteriaLabel($this->getName() . "_1") . '&nbsp;:';
     $this->getReport()->endColumn();
     $this->getReport()->startColumn();
     Html::showDateFormItem($this->getName() . "_1", $this->getStartDate(), false);
     $this->getReport()->endColumn();
     $this->getReport()->startColumn();
     if ($name) {
         echo "{$name}, ";
     }
     echo $this->getCriteriaLabel($this->getName() . "_2") . '&nbsp;:';
     $this->getReport()->endColumn();
     $this->getReport()->startColumn();
     Html::showDateFormItem($this->getName() . "_2", $this->getEndDate(), false);
     $this->getReport()->endColumn();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:22,代码来源:dateintervalcriteria.class.php

示例5: showForm


//.........这里部分代码省略.........
         echo "</td>";
     }
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Password') . "</td>";
     echo "<td>";
     //aeskey enregistre
     if (isset($hash_id) && $aeskey->getFromDBByHash($hash_id) && $aeskey->fields["name"]) {
         echo Html::hidden('good_hash', array('value' => $hash, 'id' => 'good_hash'));
         echo Html::hidden('aeskey', array('value' => $aeskey->fields["name"], 'id' => 'aeskey', 'autocomplete' => 'off'));
         echo Html::hidden('encrypted_password', array('value' => $this->fields["encrypted_password"], 'id' => 'encrypted_password'));
         echo Html::hidden('wrong_key_locale', array('value' => __('Wrong encryption key', 'accounts'), 'id' => 'wrong_key_locale'));
         echo Html::scriptBlock("auto_decrypt();");
     }
     echo "<input type='text' name='hidden_password' id='hidden_password' size='30' >";
     echo "</td>";
     if ($_SESSION['glpiactiveprofile']['interface'] == 'central') {
         echo "<td>" . __('Affected Group', 'accounts') . "</td><td>";
         if (self::canCreate()) {
             Dropdown::show('Group', array('value' => $this->fields["groups_id"], 'condition' => '`is_itemgroup`'));
         } else {
             echo Dropdown::getDropdownName("glpi_groups", $this->fields["groups_id"]);
         }
         echo "</td>";
     } else {
         echo "<td>" . __('Affected Group', 'accounts') . ":\t</td><td>";
         echo Dropdown::getDropdownName("glpi_groups", $this->fields["groups_id"]);
         echo "</td>";
     }
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Creation date') . "</td>";
     echo "<td>";
     Html::showDateFormItem("date_creation", $this->fields["date_creation"], true, true);
     echo "</td>";
     echo "<td>" . __('Technician in charge of the hardware') . "</td>";
     echo "<td>";
     User::dropdown(array('name' => "users_id_tech", 'value' => $this->fields["users_id_tech"], 'entity' => $this->fields["entities_id"], 'right' => 'interface'));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Expiration date') . "&nbsp;";
     Html::showToolTip(nl2br(__('Empty for infinite', 'accounts')));
     echo "</td>";
     echo "<td>";
     Html::showDateFormItem("date_expiration", $this->fields["date_expiration"], true, true);
     echo "</td>";
     echo "<td>" . __('Group in charge of the hardware') . "</td><td>";
     Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'condition' => '`is_assign`'));
     echo "</td>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Others') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "others");
     echo "</td>";
     echo "<td>" . __('Location') . "</td><td>";
     Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td colspan = '4'>";
     echo "<table cellpadding='2' cellspacing='2' border='0'><tr><td>";
     echo __('Comments') . "</td></tr>";
     echo "<tr><td class='center'>";
     echo "<textarea cols='125' rows='3' name='comment'>" . $this->fields["comment"] . "</textarea>";
     echo "</td></tr></table>";
开发者ID:puchadesc,项目名称:accounts,代码行数:67,代码来源:account.class.php

示例6: showForm

 function showForm($ID, $options = array())
 {
     $this->initForm($ID, $options);
     $this->showFormHeader($options);
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Name') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "name");
     echo "</td>";
     echo "<td>" . __('User') . "</td><td>";
     User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Location') . "</td><td>";
     Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
     echo "</td>";
     echo "<td>" . __('Type') . "</td><td>";
     Dropdown::show('PluginBadgesBadgeType', array('name' => "plugin_badges_badgetypes_id", 'value' => $this->fields["plugin_badges_badgetypes_id"], 'entity' => $this->fields["entities_id"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Serial number') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "serial");
     echo "</td>";
     echo "<td>" . __('Status') . "</td><td>";
     State::dropdown(array('value' => $this->fields["states_id"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Affectation date', 'badges') . "</td>";
     echo "<td>";
     Html::showDateFormItem("date_affectation", $this->fields["date_affectation"], true, true);
     echo "</td>";
     echo "<td>" . __('Associable to a ticket') . "</td><td>";
     Dropdown::showYesNo('is_helpdesk_visible', $this->fields['is_helpdesk_visible']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Date of end of validity', 'badges');
     echo "</td>";
     echo "<td>";
     Html::showDateFormItem("date_expiration", $this->fields["date_expiration"], true, true);
     echo "</td>";
     echo "<td colspan='2'>";
     printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Comments') . "</td>";
     echo "<td class='center' colspan='3'><textarea cols='115' rows='5' name='comment' >" . $this->fields["comment"] . "</textarea>";
     echo "</td>";
     echo "</tr>";
     $this->showFormButtons($options);
     return true;
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:57,代码来源:badge.class.php

示例7: showGraph


//.........这里部分代码省略.........
        $group = '';
        switch ($timeUnit) {
            case 'day':
                $group = "GROUP BY `printers_id`, `year`, `month`, `day`";
                break;
            case 'week':
                $group = "GROUP BY `printers_id`, `year`, `month`, `week`";
                break;
            case 'month':
                $group = "GROUP BY `printers_id`, `year`, `month`";
                break;
            case 'year':
                $group = "GROUP BY `printers_id`, `year`";
                break;
        }
        echo "<form method='post' name='snmp_form' id='snmp_form' action='" . $CFG_GLPI['root_doc'] . "/plugins/fusioninventory/front/printer_info.form.php'>";
        echo "<table class='tab_cadre' cellpadding='5' width='950'>";
        $mapping = new PluginFusioninventoryMapping();
        $maps = $mapping->find("`itemtype`='Printer'");
        foreach ($maps as $mapfields) {
            if (!isset($mapfields["shortlocale"])) {
                $mapfields["shortlocale"] = $mapfields["locale"];
            }
            $pagecounters[$mapfields['name']] = $mapping->getTranslation($mapfields);
        }
        echo "<tr class='tab_bg_1'>";
        echo "<th colspan='4'>";
        echo __('Printed page counter', 'fusioninventory');
        echo "</th>";
        echo "</tr>";
        echo "<tr class='tab_bg_1'>";
        echo "<td class='left'>" . __('Start date') . "&nbsp;:</td>";
        echo "<td class='left'>";
        Html::showDateFormItem("graph_begin", $begin);
        echo "</td>";
        echo "<td class='left'>" . __('Time unit', 'fusioninventory') . "&nbsp;:</td>";
        echo "<td class='left'>";
        $elementsTime = array('day' => _n('Day', 'Days', 1), 'week' => __('Week'), 'month' => _n('Month', 'Months', 1), 'year' => __('Year', 'fusioninventory'));
        Dropdown::showFromArray('graph_timeUnit', $elementsTime, array('value' => $timeUnit));
        echo "</td>";
        echo "</tr>";
        echo "<tr class='tab_bg_1'>";
        echo "<td class='left'>" . __('End date') . "&nbsp;:</td>";
        echo "<td class='left'>";
        Html::showDateFormItem("graph_end", $end);
        echo "</td>";
        echo "<td class='left'>" . __('Display', 'fusioninventory') . "&nbsp;:</td>";
        echo "<td class='left'>";
        $elements = array('total' => __('Total counter', 'fusioninventory'), 'day' => __('pages per day', 'fusioninventory'));
        Dropdown::showFromArray('graph_type', $elements, array('value' => $graphType));
        echo "</td>";
        echo "</tr>";
        echo "<tr class='tab_bg_2'>";
        echo "<td class='center' colspan='4'>\n              <input type='submit' class='submit' name='graph_plugin_fusioninventory_printer_period'\n                      value='" . __('Update') . "'/>";
        echo "</td>";
        echo "</tr>\n";
        echo "<tr>";
        echo "<th colspan='4'>" . __('Printers to compare', 'fusioninventory') . "</th>";
        echo "</tr>";
        echo "<tr class='tab_bg_1'>";
        echo "<td class='left' rowspan='3'>" . __('Printer') . "&nbsp;:</td>";
        echo "<td class='left' rowspan='3'>";
        echo $printersList;
        echo "</td>";
        echo "<td class='left'>" . __('Add a printer', 'fusioninventory') . "&nbsp;:</td>";
        echo "<td class='left'>";
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:67,代码来源:printerlog.class.php

示例8: showForm

 /**
  * Display the budget form
  *
  * @param $ID integer ID of the item
  * @param $options array
  *     - target filename : where to go when done.
  *     - withtemplate boolean : template or basic item
  *
  *@return boolean item found
  **/
 function showForm($ID, $options = array(""))
 {
     global $CFG_GLPI;
     $this->initForm($ID, $options);
     $this->showTabs($options);
     $this->showFormHeader($options);
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Name') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "name", array('value' => $this->fields["name"]));
     echo "</td>";
     echo "<td>" . __('Budget volume', 'resources') . "</td>";
     echo "<td>";
     Dropdown::show('PluginResourcesBudgetType', array('value' => $this->fields["plugin_resources_budgettypes_id"], 'entity' => $this->fields["entities_id"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Profession', 'resources') . "</td>";
     echo "<td>";
     $params = array('name' => 'plugin_resources_professions_id', 'value' => $this->fields['plugin_resources_professions_id'], 'entityt' => $this->fields["entities_id"], 'action' => $CFG_GLPI["root_doc"] . "/plugins/resources/ajax/dropdownRank.php", 'span' => 'span_rank', 'sort' => true);
     PluginResourcesResource::showGenericDropdown('PluginResourcesProfession', $params);
     echo "</td>";
     echo "<td>" . __('Rank', 'resources') . "</td><td>";
     echo "<span id='span_rank' name='span_rank'>";
     if ($this->fields["plugin_resources_ranks_id"] > 0) {
         echo Dropdown::getDropdownName('glpi_plugin_resources_ranks', $this->fields["plugin_resources_ranks_id"]);
     } else {
         _e('None');
     }
     echo "</span></td></tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Budget volume', 'resources') . "</td>";
     echo "<td>";
     $options = array('value' => 0);
     Html::autocompletionTextField($this, 'volume', $options);
     echo "</td><td>" . __('Type of budget volume', 'resources') . "</td><td>";
     Dropdown::show('PluginResourcesBudgetVolume', array('value' => $this->fields["plugin_resources_budgetvolumes_id"], 'entity' => $this->fields["entities_id"]));
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Begin date') . "</td>";
     echo "<td>";
     Html::showDateFormItem("begin_date", $this->fields["begin_date"], true, true);
     echo "</td>";
     echo "<td>" . __('End date') . "</td>";
     echo "<td>";
     Html::showDateFormItem("end_date", $this->fields["end_date"], true, true);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td class='center' colspan='6'>";
     printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"]));
     echo "</td>";
     echo "</tr>";
     if ($_SESSION['glpiactiveprofile']['interface'] != 'central') {
         $options['candel'] = false;
     }
     $this->showFormButtons($options);
     $this->addDivForTabs();
     return true;
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:70,代码来源:budget.class.php

示例9: __

    }
    $INSELECT .= "</optgroup>";
}
echo "<div class='center'><form method='get' name='form' action='stat.tracking.php'>";
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'>" . __('Start date') . "</td><td>";
Html::showDateFormItem("date1", $_GET["date1"]);
echo "</td>";
echo "<td class='right'>" . __('Show graphics') . "</td>";
echo "<td rowspan='2' class='center'>";
echo "<input type='hidden' name='itemtype' value=\"" . $_GET["itemtype"] . "\">";
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::showDateFormItem("date2", $_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::show($_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']);
开发者ID:geldarr,项目名称:hack-space,代码行数:31,代码来源:stat.tracking.php

示例10: showForItem

 /**
  * Show Infocom form for an item (not a standard showForm)
  *
  * @param $item                  CommonDBTM object
  * @param $withtemplate integer  template or basic item (default '')
  **/
 static function showForItem(CommonDBTM $item, $withtemplate = '')
 {
     global $CFG_GLPI;
     // Show Infocom or blank form
     if (!Session::haveRight("infocom", "r")) {
         return false;
     }
     if (!$item) {
         echo "<div class='spaced'>" . __('Requested item not found') . "</div>";
     } else {
         $date_tax = $CFG_GLPI["date_tax"];
         $dev_ID = $item->getField('id');
         $ic = new self();
         $option = "";
         if ($withtemplate == 2) {
             $option = " readonly ";
         }
         if (!strpos($_SERVER['PHP_SELF'], "infocoms-show") && in_array($item->getType(), array('CartridgeItem', 'ConsumableItem', 'Software'))) {
             echo "<div class='firstbloc center'>" . __('For this type of item, the financial and administrative information are only a model for the items which you should add.') . "</div>";
         }
         if (!$ic->getFromDBforDevice($item->getType(), $dev_ID)) {
             $input = array('itemtype' => $item->getType(), 'items_id' => $dev_ID, 'entities_id' => $item->getEntityID());
             if ($ic->can(-1, "w", $input) && $withtemplate != 2) {
                 echo "<div class='spaced b'>";
                 echo "<table class='tab_cadre_fixe'><tr class='tab_bg_1'><th>";
                 echo sprintf(__('%1$s - %2$s'), $item->getTypeName(1), $item->getName()) . "</th></tr>";
                 echo "<tr class='tab_bg_1'><td class='center'>";
                 Html::showSimpleForm($CFG_GLPI["root_doc"] . "/front/infocom.form.php", 'add', __('Enable the financial and administrative information'), array('itemtype' => $item->getType(), 'items_id' => $dev_ID));
                 echo "</td></tr></table></div>";
             }
         } else {
             // getFromDBforDevice
             $canedit = $ic->can($ic->fields['id'], "w") && $withtemplate != 2;
             if ($canedit) {
                 echo "<form name='form_ic' method='post' action='" . $CFG_GLPI["root_doc"] . "/front/infocom.form.php'>";
             }
             echo "<div class='spaced'>";
             echo "<table class='tab_cadre" . (!strpos($_SERVER['PHP_SELF'], "infocoms-show") ? "_fixe" : "") . "'>";
             echo "<tr><th colspan='4'>" . __('Financial and administrative information') . "</th></tr>";
             echo "<tr class='tab_bg_1'>";
             echo "<td>" . __('Supplier') . "</td>";
             echo "<td>";
             if ($withtemplate == 2) {
                 echo Dropdown::getDropdownName("glpi_suppliers", $ic->fields["suppliers_id"]);
             } else {
                 Supplier::dropdown(array('value' => $ic->fields["suppliers_id"], 'entity' => $item->getEntityID()));
             }
             echo "</td>";
             if (Session::haveRight("budget", "r")) {
                 echo "<td>" . __('Budget') . "</td><td >";
                 Budget::dropdown(array('value' => $ic->fields["budgets_id"], 'entity' => $item->getEntityID(), 'comments' => 1));
             } else {
                 echo "<td colspan='2'>";
             }
             echo "</td></tr>";
             // Can edit calendar ?
             $editcalendar = $withtemplate != 2;
             echo "<tr class='tab_bg_1'>";
             echo "<td>" . __('Order number') . "</td>";
             echo "<td >";
             Html::autocompletionTextField($ic, "order_number", array('option' => $option));
             echo "</td>";
             echo "<td>" . __('Order date') . "</td><td>";
             Html::showDateFormItem("order_date", $ic->fields["order_date"], true, $editcalendar);
             echo "</td></tr>";
             echo "<tr class='tab_bg_1'>";
             $istemplate = '';
             if ($item->isTemplate() || in_array($item->getType(), array('CartridgeItem', 'ConsumableItem', 'Software'))) {
                 $istemplate = '*';
             }
             echo "<td>" . sprintf(__('%1$s%2$s'), __('Immobilization number'), $istemplate) . "</td>";
             echo "<td>";
             $objectName = autoName($ic->fields["immo_number"], "immo_number", $withtemplate == 2, 'Infocom', $item->getEntityID());
             Html::autocompletionTextField($ic, "immo_number", array('value' => $objectName, 'option' => $option));
             echo "</td>";
             echo "<td>" . __('Date of purchase') . "</td><td>";
             Html::showDateFormItem("buy_date", $ic->fields["buy_date"], true, $editcalendar);
             echo "</td></tr>";
             echo "<tr class='tab_bg_1'>";
             echo "<td>" . __('Invoice number') . "</td>";
             echo "<td>";
             Html::autocompletionTextField($ic, "bill", array('option' => $option));
             echo "</td>";
             echo "<td>" . __('Delivery date') . "</td><td>";
             Html::showDateFormItem("delivery_date", $ic->fields["delivery_date"], true, $editcalendar);
             echo "</td></tr>";
             echo "<tr class='tab_bg_1'>";
             echo "<td>" . __('Delivery form') . "</td><td>";
             Html::autocompletionTextField($ic, "delivery_number", array('option' => $option));
             echo "</td>";
             echo "<td>" . __('Startup date') . "</td><td>";
             Html::showDateFormItem("use_date", $ic->fields["use_date"], true, $editcalendar);
             echo "</td></tr>";
             echo "<tr class='tab_bg_1'>";
//.........这里部分代码省略.........
开发者ID:gaforeror,项目名称:glpi,代码行数:101,代码来源:infocom.class.php

示例11: header

it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
$AJAX_INCLUDE = 1;
include '../inc/includes.php';
// Send UTF8 Headers
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
Session::checkLoginUser();
if (isset($_POST['value']) && strcmp($_POST['value'], '0') == 0) {
    if ($_POST['withtime']) {
        Html::showDateTimeFormItem($_POST['name'], $_POST['specificvalue']);
    } else {
        Html::showDateFormItem($_POST['name'], $_POST['specificvalue']);
    }
} else {
    echo "<input type='hidden' name='" . $_POST['name'] . "' value='" . $_POST['value'] . "'>";
}
开发者ID:gaforeror,项目名称:glpi,代码行数:31,代码来源:genericdate.php

示例12: showForm

 /**
  * Print the Software / license form
  *
  * @param $ID        integer  Id of the version or the template to print
  * @param $options   array    of possible options:
  *     - target form target
  *     - softwares_id ID of the software for add process
  *
  * @return true if displayed  false if item not found or not right to display
  **/
 function showForm($ID, $options = array())
 {
     global $CFG_GLPI;
     $softwares_id = -1;
     if (isset($options['softwares_id'])) {
         $softwares_id = $options['softwares_id'];
     }
     if (!Session::haveRight("software", "w")) {
         return false;
     }
     if ($ID < 0) {
         // Create item
         $this->fields['softwares_id'] = $softwares_id;
         $this->fields['number'] = 1;
         $soft = new Software();
         if ($soft->getFromDB($softwares_id) && in_array($_SESSION['glpiactive_entity'], getAncestorsOf('glpi_entities', $soft->getEntityID()))) {
             $options['entities_id'] = $soft->getEntityID();
         }
     }
     $this->initForm($ID, $options);
     $this->showTabs($options);
     $this->showFormHeader($options);
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . Software::getTypeName(1) . "</td>";
     echo "<td>";
     if ($ID > 0) {
         $softwares_id = $this->fields["softwares_id"];
     } else {
         echo "<input type='hidden' name='softwares_id' value='{$softwares_id}'>";
     }
     echo "<a href='software.form.php?id=" . $softwares_id . "'>" . Dropdown::getDropdownName("glpi_softwares", $softwares_id) . "</a>";
     echo "</td>";
     echo "<td>" . __('Type') . "</td>";
     echo "<td>";
     SoftwareLicenseType::dropdown(array('value' => $this->fields["softwarelicensetypes_id"]));
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Name') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "name");
     echo "</td>";
     echo "<td>" . __('Serial number') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "serial");
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Purchase version') . "</td>";
     echo "<td>";
     SoftwareVersion::dropdown(array('name' => "softwareversions_id_buy", 'softwares_id' => $this->fields["softwares_id"], 'value' => $this->fields["softwareversions_id_buy"]));
     echo "</td>";
     echo "<td>" . __('Inventory number') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "otherserial");
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Version in use') . "</td>";
     echo "<td>";
     SoftwareVersion::dropdown(array('name' => "softwareversions_id_use", 'softwares_id' => $this->fields["softwares_id"], 'value' => $this->fields["softwareversions_id_use"]));
     echo "</td>";
     echo "<td rowspan='" . ($ID > 0 ? '4' : '3') . "' class='middle'>" . __('Comments') . "</td>";
     echo "<td class='center middle' rowspan='" . ($ID > 0 ? '4' : '3') . "'>";
     echo "<textarea cols='45' rows='5' name='comment' >" . $this->fields["comment"] . "</textarea>";
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . _x('quantity', 'Number') . "</td>";
     echo "<td>";
     Dropdown::showInteger("number", $this->fields["number"], 1, 1000, 1, array(-1 => __('Unlimited')));
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Expiration') . "</td>";
     echo "<td>";
     Html::showDateFormItem('expire', $this->fields["expire"]);
     Alert::displayLastAlert('SoftwareLicense', $ID);
     echo "</td></tr>\n";
     if ($ID > 0) {
         echo "<tr class='tab_bg_1'>";
         echo "<td>" . __('Last update') . "</td>";
         echo "<td>" . ($this->fields["date_mod"] ? Html::convDateTime($this->fields["date_mod"]) : __('Never'));
         echo "</td></tr>";
     }
     $this->showFormButtons($options);
     $this->addDivForTabs();
     return true;
 }
开发者ID:gaforeror,项目名称:glpi,代码行数:94,代码来源:softwarelicense.class.php

示例13: checkAvailability

 /**
  * Show the availability of a user
  *
  * @since version 0.83
  *
  * @param $who    ID of the user
  * @param $begin  begin date to check (default '')
  * @param $end    end date to check (default '')
  *
  * @return Nothing (display function)
  **/
 static function checkAvailability($who, $begin = '', $end = '')
 {
     global $CFG_GLPI, $DB;
     if (empty($who)) {
         return false;
     }
     if (empty($begin)) {
         $begin = date("Y-m-d");
     }
     if (empty($end)) {
         $end = date("Y-m-d");
     }
     if ($end < $begin) {
         $end = $begin;
     }
     $realbegin = $begin . " " . $CFG_GLPI["planning_begin"];
     $realend = $end . " " . $CFG_GLPI["planning_end"];
     // Use get method to check availability
     echo "<div class='center'><form method='GET' name='form' action='planning.php'>\n";
     echo "<table class='tab_cadre'>";
     echo "<tr class='tab_bg_1'><th colspan='2'>" . __('Availability') . "</th>";
     echo "<th colspan='3'>" . getUserName($who) . "</th></tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Start') . "</td>\n";
     echo "<td>";
     Html::showDateFormItem("begin", $begin, false);
     echo "</td>\n";
     echo "<td>" . __('End') . "</td>\n";
     echo "<td>";
     Html::showDateFormItem("end", $end, false);
     echo "</td>\n";
     echo "<td rowspan='2' class='center'>";
     echo "<input type='hidden' name='users_id' value=\"{$who}\">";
     echo "<input type='submit' class='submit' name='checkavailability' value=\"" . _sx('button', 'Search') . "\">";
     echo "</td>\n";
     echo "</tr>";
     echo "</table>";
     Html::closeForm();
     echo "</div>\n";
     $params = array('who' => $who, 'who_group' => 0, 'begin' => $realbegin, 'end' => $realend);
     $interv = array();
     foreach ($CFG_GLPI['planning_types'] as $itemtype) {
         $interv = array_merge($interv, $itemtype::populatePlanning($params));
     }
     // Print Headers
     echo "<br><div class='center'><table class='tab_cadre_fixe'>";
     $colnumber = 1;
     $plan_begin = explode(":", $CFG_GLPI["planning_begin"]);
     $plan_end = explode(":", $CFG_GLPI["planning_end"]);
     $begin_hour = intval($plan_begin[0]);
     $end_hour = intval($plan_end[0]);
     if ($plan_end[1] != 0) {
         $end_hour++;
     }
     $colsize = floor((100 - 15) / ($end_hour - $begin_hour));
     // Print Headers
     echo "<tr class='tab_bg_1'><th width='15%'>&nbsp;</th>";
     for ($i = $begin_hour; $i < $end_hour; $i++) {
         $from = ($i < 10 ? '0' : '') . $i;
         //          $to   = ((($i+1) < 10)?'0':'').($i+1);
         echo "<th width='{$colsize}%' colspan='4'>" . $from . ":00</th>";
         $colnumber += 4;
     }
     echo "</tr>";
     $day_begin = strtotime($realbegin);
     $day_end = strtotime($realend);
     for ($time = $day_begin; $time < $day_end; $time += DAY_TIMESTAMP) {
         $current_day = date('Y-m-d', $time);
         echo "<tr><th>" . Html::convDate($current_day) . "</th>";
         $begin_quarter = $begin_hour * 4;
         $end_quarter = $end_hour * 4;
         for ($i = $begin_quarter; $i < $end_quarter; $i++) {
             $begin_time = date("Y-m-d H:i:s", strtotime($current_day) + $i * HOUR_TIMESTAMP / 4);
             $end_time = date("Y-m-d H:i:s", strtotime($current_day) + ($i + 1) * HOUR_TIMESTAMP / 4);
             // Init activity interval
             $begin_act = $end_time;
             $end_act = $begin_time;
             reset($interv);
             while ($data = current($interv)) {
                 if ($data["begin"] >= $begin_time && $data["end"] <= $end_time) {
                     // In
                     if ($begin_act > $data["begin"]) {
                         $begin_act = $data["begin"];
                     }
                     if ($end_act < $data["end"]) {
                         $end_act = $data["end"];
                     }
                     unset($interv[key($interv)]);
                 } else {
//.........这里部分代码省略.........
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:planning.class.php

示例14: displaySearchForm

function displaySearchForm()
{
    global $_SERVER, $_GET, $CFG_GLPI;
    echo "<form action='" . $_SERVER["PHP_SELF"] . "' method='post'>";
    echo "<table class='tab_cadre' cellpadding='5'>";
    echo "<tr class='tab_bg_1' align='center'>";
    echo "<td>";
    echo __('Initial contract period') . " :";
    $values = array();
    $values["sup"] = ">";
    $values["inf"] = "<";
    $values["equal"] = "=";
    if (isset($_GET["contains"][1])) {
        if (strstr($_GET["contains"][1], "lt;")) {
            $_GET["dropdown_sup_inf"] = "inf";
            $_GET["dropdown_calendar"] = str_replace("lt;", "", $_GET["contains"][1]);
            $_GET["dropdown_calendar"] = str_replace("&", "", $_GET["dropdown_calendar"]);
            $_GET["dropdown_calendar"] = str_replace("\\", "", $_GET["dropdown_calendar"]);
            $_GET["dropdown_calendar"] = str_replace("'", "", $_GET["dropdown_calendar"]);
            $_GET["dropdown_calendar"] = str_replace(" 00:00:00", "", $_GET["dropdown_calendar"]);
            $_GET["contains"][1] = "<" . $_GET["dropdown_calendar"];
        }
        if (strstr($_GET["contains"][1], "gt;")) {
            $_GET["dropdown_sup_inf"] = "sup";
            $_GET["dropdown_calendar"] = str_replace("gt;", "", $_GET["contains"][1]);
            $_GET["dropdown_calendar"] = str_replace("&", "", $_GET["dropdown_calendar"]);
            $_GET["dropdown_calendar"] = str_replace("\\", "", $_GET["dropdown_calendar"]);
            $_GET["dropdown_calendar"] = str_replace("'", "", $_GET["dropdown_calendar"]);
            $_GET["dropdown_calendar"] = str_replace(" 00:00:00", "", $_GET["dropdown_calendar"]);
            $_GET["contains"][1] = ">" . $_GET["dropdown_calendar"];
        }
        if (strstr($_GET["contains"][1], "LIKE")) {
            $_GET["dropdown_sup_inf"] = "equal";
            $_GET["dropdown_calendar"] = str_replace("=", "", $_GET["contains"][1]);
            $_GET["dropdown_calendar"] = str_replace("&", "", $_GET["dropdown_calendar"]);
            $_GET["dropdown_calendar"] = str_replace("\\", "", $_GET["dropdown_calendar"]);
            $_GET["dropdown_calendar"] = str_replace("'", "", $_GET["dropdown_calendar"]);
            $_GET["dropdown_calendar"] = str_replace("%", "", $_GET["dropdown_calendar"]);
            $_GET["dropdown_calendar"] = str_replace("LIKE ", "", $_GET["dropdown_calendar"]);
            $_GET["contains"][1] = "LIKE '" . $_GET["dropdown_calendar"] . "%'";
        }
    }
    Dropdown::showFromArray("dropdown_sup_inf", $values, array('value' => isset($_GET["dropdown_sup_inf"]) ? $_GET["dropdown_sup_inf"] : "sup"));
    echo "</td>\n      <td width='120'>";
    Html::showDateFormItem("dropdown_calendar", isset($_GET["dropdown_calendar"]) ? $_GET["dropdown_calendar"] : 0);
    echo "</td>";
    echo "<td>" . __('Location') . "</td>";
    echo "<td>";
    Dropdown::show("Location", array('name' => "location", 'value' => isset($_GET["location"]) ? $_GET["location"] : ""));
    echo "</td>";
    // Display Reset search
    echo "<td>";
    echo "<a href='" . $CFG_GLPI["root_doc"] . "/plugins/fusioninventory/report/ports_date_connections.php?reset_search=reset_search' ><img title=\"" . __('Blank') . "\" alt=\"" . __('Blank') . "\" src='" . $CFG_GLPI["root_doc"] . "/pics/reset.png' class='calendrier'></a>";
    echo "</td>";
    echo "<td>";
    //Add parameters to uri to be saved as bookmarks
    $_SERVER["REQUEST_URI"] = buildBookmarkUrl($_SERVER["REQUEST_URI"], $_GET);
    Bookmark::showSaveButton(Bookmark::SEARCH, 'PluginFusioninventoryNetworkport2');
    echo "</td>";
    echo "<td>";
    echo "<input type='submit' value='Valider' class='submit' />";
    echo "</td>";
    echo "</tr>";
    echo "</table>";
    Html::closeForm();
}
开发者ID:korial29,项目名称:fusioninventory-for-glpi,代码行数:66,代码来源:ports_date_connections.php

示例15: showForm

 public function showForm($ID, $options = array())
 {
     $this->initForm($ID, $options);
     $this->showFormHeader($options);
     $order_order = new PluginOrderOrder();
     $order_order->getFromDB($this->getOrdersID());
     $order_reference = new PluginOrderReference();
     $order_reference->getFromDB($this->fields["plugin_order_references_id"]);
     $canedit = $order_order->can($this->getOrdersID(), UPDATE) && !$order_order->canUpdateOrder() && !$order_order->isCanceled();
     echo "<input type='hidden' name='plugin_order_orders_id' value='" . $this->getOrdersID() . "'>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __("Reference") . ": </td>";
     echo "<td>";
     $data = array();
     $data["id"] = $this->fields["plugin_order_references_id"];
     $data["name"] = $order_reference->fields["name"];
     echo $order_reference->getReceptionReferenceLink($data);
     echo "</td>";
     echo "<td>" . __("Taken delivery", "order") . "</td>";
     echo "<td>";
     Dropdown::showYesNo('states_id', $this->fields['states_id']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __("Delivery form") . ": </td>";
     echo "<td>";
     if ($canedit) {
         Html::autocompletionTextField($this, "delivery_number");
     } else {
         echo $this->fields["delivery_number"];
     }
     echo "</td>";
     echo "<td>" . __("Delivery date") . ": </td>";
     echo "<td>";
     if ($canedit) {
         Html::showDateFormItem("delivery_date", $this->fields["delivery_date"], true, 1);
     } else {
         echo Html::convDate($this->fields["delivery_date"]);
     }
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __("Delivery status", "order") . ": </td>";
     echo "<td>";
     if ($canedit) {
         PluginOrderDeliveryState::Dropdown(array('name' => "plugin_order_deliverystates_id", 'value' => $this->fields["plugin_order_deliverystates_id"]));
     } else {
         echo Dropdown::getDropdownName("glpi_plugin_order_deliverystates", $this->fields["plugin_order_deliverystates_id"]);
     }
     echo "</td>";
     echo "<td>" . __("Bill", "order") . "</td>";
     echo "<td>";
     if (Session::haveRight("plugin_order_bill", UPDATE)) {
         PluginOrderBill::Dropdown(array('name' => "plugin_order_bills_id", 'value' => $this->fields["plugin_order_bills_id"]));
     } elseif (Session::haveRight("plugin_order_bill", UPDATE)) {
         echo Dropdown::getDropdownName("glpi_plugin_order_bills", $this->fields["plugin_order_bills_id"]);
     }
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'><td>";
     //comments of order
     echo __("Comments") . ": </td>";
     echo "<td colspan='3'>";
     if ($canedit) {
         echo "<textarea cols='100' rows='4' name='delivery_comment'>" . $this->fields["delivery_comment"] . "</textarea>";
     } else {
         echo $this->fields["delivery_comment"];
     }
     echo "</td>";
     echo "</tr>";
     $options['candel'] = false;
     $this->showFormButtons($options);
     return true;
 }
开发者ID:biet-j,项目名称:order,代码行数:74,代码来源:reception.class.php


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