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


PHP Printer::getID方法代码示例

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


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

示例1: showForm

 function showForm(Printer $item, $options = array())
 {
     // ** Get link OID fields
     $mapping_name = array();
     $id = $item->getID();
     $a_cartridges = $this->find("`printers_id`='" . $id . "'");
     echo "<div align='center'><form method='post' name='snmp_form' id='snmp_form'\n                 action=\"" . $options['target'] . "\">";
     echo "<table class='tab_cadre' cellpadding='5' width='950'>";
     echo "<tr class='tab_bg_1'>";
     echo "<th align='center' colspan='3'>";
     echo __('Cartridge(s)', 'fusioninventory');
     echo "</th>";
     echo "</tr>";
     asort($mapping_name);
     $mapping = new PluginFusioninventoryMapping();
     foreach ($a_cartridges as $a_cartridge) {
         echo "<tr class='tab_bg_1'>";
         echo "<td align='center'>";
         $mapping->getFromDB($a_cartridge['plugin_fusioninventory_mappings_id']);
         echo $mapping->getTranslation($mapping->fields);
         echo " : ";
         echo "</td>";
         echo "<td align='center'>";
         echo "</td>";
         echo "<td align='center'>";
         if ($a_cartridge['state'] == 100000) {
             echo __('OK');
         } else {
             if ($a_cartridge['state'] < 0) {
                 $a_cartridge['state'] = $a_cartridge['state'] * -1;
                 echo $a_cartridge['state'];
                 echo ' ' . __('remaining pages', 'fusioninventory');
             } else {
                 PluginFusioninventoryDisplay::bar($a_cartridge['state']);
             }
         }
         echo "</td>";
         echo "</tr>";
     }
     echo "</table>";
     Html::closeForm();
     echo "</div>";
 }
开发者ID:korial29,项目名称:fusioninventory-for-glpi,代码行数:43,代码来源:printercartridge.class.php

示例2: showForm

 function showForm(Printer $item, $options = array())
 {
     global $DB;
     Session::checkRight('plugin_fusioninventory_printer', READ);
     $id = $item->getID();
     if (!($data = $this->find("`printers_id`='" . $id . "'", '', 1))) {
         // Add in database if not exist
         $input = array();
         $input['printers_id'] = $id;
         $_SESSION['glpi_plugins_fusinvsnmp_table'] = 'glpi_printers';
         $ID_tn = $this->add($input);
         $this->getFromDB($ID_tn);
     } else {
         foreach ($data as $datas) {
             $this->fields = $datas;
         }
     }
     // Form printer informations
     echo "<div align='center'>";
     echo "<form method='post' name='snmp_form' id='snmp_form'\n                 action=\"" . $options['target'] . "\">";
     echo "<table class='tab_cadre' cellpadding='5' width='950'>";
     echo "<tr class='tab_bg_1'>";
     echo "<th colspan='4'>";
     echo __('SNMP information', 'fusioninventory');
     echo "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td align='center'>";
     echo __('Sysdescr', 'fusioninventory');
     echo "</td>";
     echo "<td>";
     echo "<textarea name='sysdescr' cols='45' rows='5'>";
     echo $this->fields['sysdescr'];
     echo "</textarea>";
     echo "</td>";
     echo "<td align='center'>";
     echo __('Last inventory', 'fusioninventory') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     echo Html::convDateTime($this->fields['last_fusioninventory_update']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td align='center'></td>";
     echo "<td align='center'>";
     echo "</td>";
     echo "<td align='center'>" . __('SNMP authentication', 'fusioninventory') . "&nbsp;:</td>";
     echo "<td align='center'>";
     PluginFusioninventoryConfigSecurity::auth_dropdown($this->fields["plugin_fusioninventory_configsecurities_id"]);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_2 center'>";
     echo "<td colspan='4'>";
     echo "<div align='center'>";
     echo "<input type='hidden' name='id' value='" . $id . "'>";
     echo "<input type='submit' name='update' value=\"" . __('Update') . "\" class='submit' >";
     echo "</td>";
     echo "</tr>";
     echo "</table>";
     Html::closeForm();
     echo "</div>";
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:62,代码来源:printer.class.php

示例3: Printer

 function post_updateItem($history = 1)
 {
     if (in_array('pages', $this->updates)) {
         $printer = new Printer();
         if ($printer->getFromDB($this->fields['printers_id']) && ($this->fields['pages'] > $printer->getField('last_pages_counter') || $this->oldvalues['pages'] == $printer->getField('last_pages_counter'))) {
             $printer->update(array('id' => $printer->getID(), 'last_pages_counter' => $this->fields['pages']));
         }
     }
     parent::post_updateItem($history);
 }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:10,代码来源:cartridge.class.php


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