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


PHP Html::formatNumber方法代码示例

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


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

示例1: pdfForTicket

 static function pdfForTicket(PluginPdfSimplePDF $pdf, Ticket $job)
 {
     global $CFG_GLPI, $DB;
     $ID = $job->getField('id');
     //////////////followups///////////
     $query = "SELECT *\n                FROM `glpi_ticketcosts`\n                WHERE `tickets_id` = '{$ID}'\n                ORDER BY `begin_date`";
     $result = $DB->query($query);
     if (!$DB->numrows($result)) {
         $pdf->setColumnsSize(100);
         $pdf->displayLine(__('No ticket cost for this ticket', 'pdf'));
     } else {
         $pdf->setColumnsSize(60, 20, 20);
         $pdf->displayTitle("<b>" . TicketCost::getTypeName($DB->numrows($result)), __('Ticket duration'), CommonITILObject::getActionTime($job->fields['actiontime']) . "</b>");
         $pdf->setColumnsSize(20, 10, 10, 10, 10, 10, 10, 10, 10);
         $pdf->setColumnsAlign('center', 'center', 'center', 'left', 'right', 'right', 'right', 'right', 'right');
         $pdf->displayTitle("<b><i>" . __('Name') . "</i></b>", "<b><i>" . __('Begin date') . "</i></b>", "<b><i>" . __('End date') . "</i></b>", "<b><i>" . __('Budget') . "</i></b>", "<b><i>" . __('Duration') . "</i></b>", "<b><i>" . __('Time cost') . "</i></b>", "<b><i>" . __('Fixed cost') . "</i></b>", "<b><i>" . __('Material cost') . "</i></b>", "<b><i>" . __('Total cost') . "</i></b>");
         while ($data = $DB->fetch_array($result)) {
             $cost = TicketCost::computeTotalCost($data['actiontime'], $data['cost_time'], $data['cost_fixed'], $data['cost_material']);
             $pdf->displayLine($data['name'], Html::convDate($data['begin_date']), Html::convDate($data['end_date']), Dropdown::getDropdownName('glpi_budgets', $data['budgets_id']), CommonITILObject::getActionTime($data['actiontime']), Html::formatNumber($data['cost_time']), Html::formatNumber($data['cost_fixed']), Html::formatNumber($data['cost_material']), Html::formatNumber($cost));
             $total_time += $data['actiontime'];
             $total_costtime += $data['actiontime'] * $data['cost_time'] / HOUR_TIMESTAMP;
             $total_fixed += $data['cost_fixed'];
             $total_material += $data['cost_material'];
             $total += $cost;
         }
         $pdf->setColumnsSize(50, 10, 10, 10, 10, 10);
         $pdf->setColumnsAlign('right', 'right', 'right', 'right', 'right', 'right');
         $pdf->displayLine('<b>' . __('Total'), CommonITILObject::getActionTime($total_time), Html::formatNumber($total_costtime), Html::formatNumber($total_fixed), Html::formatNumber($total_material), Html::formatNumber($total));
     }
     $pdf->displaySpace();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:31,代码来源:ticketcost.class.php

示例2: pdfForComputer

 static function pdfForComputer(PluginPdfSimplePDF $pdf, Computer $item)
 {
     global $DB;
     $ID = $item->getField('id');
     // From ComputerVirtualMachine::showForComputer()
     $virtualmachines = getAllDatasFromTable('glpi_computervirtualmachines', "`computers_id` = '{$ID}'");
     $pdf->setColumnsSize(100);
     if (count($virtualmachines)) {
         $pdf->displayTitle("<b>" . __('List of virtual machines') . "</b>");
         $pdf->setColumnsSize(20, 8, 8, 8, 25, 8, 8, 15);
         $pdf->setColumnsAlign('left', 'center', 'center', 'center', 'left', 'right', 'right', 'left');
         $typ = explode(' ', __('Virtualization system'));
         $sys = explode(' ', __('Virtualization model'));
         $sta = explode(' ', __('State of the virtual machine'));
         $pdf->displayTitle(__('Name'), $typ[0], $sys[0], $sta[0], __('UUID'), __('CPU'), __('Mio'), __('Machine'));
         foreach ($virtualmachines as $virtualmachine) {
             $name = '';
             if ($link_computer = ComputerVirtualMachine::findVirtualMachine($virtualmachine)) {
                 $computer = new Computer();
                 if ($computer->getFromDB($link_computer)) {
                     $name = $computer->getName();
                 }
             }
             $pdf->displayLine($virtualmachine['name'], Html::clean(Dropdown::getDropdownName('glpi_virtualmachinetypes', $virtualmachine['virtualmachinetypes_id'])), Html::clean(Dropdown::getDropdownName('glpi_virtualmachinesystems', $virtualmachine['virtualmachinesystems_id'])), Html::clean(Dropdown::getDropdownName('glpi_virtualmachinestates', $virtualmachine['virtualmachinestates_id'])), $virtualmachine['uuid'], $virtualmachine['vcpu'], Html::clean(Html::formatNumber($virtualmachine['ram'], false, 0)), $name);
         }
     } else {
         $pdf->displayTitle("<b>" . __('No virtual machine associated with the computer') . "</b>");
     }
     // From ComputerVirtualMachine::showForVirtualMachine()
     if ($item->fields['uuid']) {
         $where = "`uuid`" . ComputerVirtualMachine::getUUIDRestrictRequest($item->fields['uuid']);
         $hosts = getAllDatasFromTable('glpi_computervirtualmachines', $where);
         if (count($hosts)) {
             $pdf->setColumnsSize(100);
             $pdf->displayTitle("<b>" . __('List of host machines') . "</b>");
             $pdf->setColumnsSize(26, 37, 37);
             $pdf->displayTitle(__('Name'), __('Operating system'), __('Entity'));
             $computer = new Computer();
             foreach ($hosts as $host) {
                 if ($computer->getFromDB($host['computers_id'])) {
                     $pdf->displayLine($computer->getName(), Html::clean(Dropdown::getDropdownName('glpi_operatingsystems', $computer->getField('operatingsystems_id'))), Html::clean(Dropdown::getDropdownName('glpi_entities', $computer->getEntityID())));
                 }
             }
         }
     }
     $pdf->displaySpace();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:47,代码来源:computervirtualmachine.class.php

示例3: pdfForComputer

 static function pdfForComputer(PluginPdfSimplePDF $pdf, Computer $item)
 {
     global $DB;
     $ID = $item->getField('id');
     $query = "SELECT `glpi_filesystems`.`name` AS fsname, `glpi_computerdisks`.*\n                FROM `glpi_computerdisks`\n                LEFT JOIN `glpi_filesystems`\n                  ON (`glpi_computerdisks`.`filesystems_id` = `glpi_filesystems`.`id`)\n                WHERE (`computers_id` = '" . $ID . "')";
     $result = $DB->query($query);
     $pdf->setColumnsSize(100);
     if ($DB->numrows($result) > 0) {
         $pdf->displayTitle("<b>" . _n('Volume', 'Volumes', 2) . "</b>");
         $pdf->setColumnsSize(22, 23, 22, 11, 11, 11);
         $pdf->displayTitle('<b>' . __('Name'), __('Partition'), _('Mount point'), __('Type'), __('Global size'), __('Free size') . '</b>');
         $pdf->setColumnsAlign('left', 'left', 'left', 'center', 'right', 'right');
         while ($data = $DB->fetch_assoc($result)) {
             $pdf->displayLine('<b>' . Toolbox::decodeFromUtf8(empty($data['name']) ? $data['ID'] : $data['name'], "windows-1252") . '</b>', $data['device'], $data['mountpoint'], Html::clean(Dropdown::getDropdownName('glpi_filesystems', $data["filesystems_id"])), sprintf(__('%s Mio'), Html::clean(Html::formatNumber($data['totalsize'], false, 0))), sprintf(__('%s Mio'), Html::clean(Html::formatNumber($data['freesize'], false, 0))));
         }
     } else {
         $pdf->displayTitle("<b>" . __('No volume found', 'pdf') . "</b>");
     }
     $pdf->displaySpace();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:20,代码来源:computerdisk.class.php

示例4: pdfForItem

 static function pdfForItem(PluginPdfSimplePDF $pdf, CommonDBTM $item)
 {
     global $CFG_GLPI;
     $ID = $item->getField('id');
     if (!Session::haveRight("infocom", "r")) {
         return false;
     }
     $ic = new Infocom();
     $pdf->setColumnsSize(100);
     if ($ic->getFromDBforDevice(get_class($item), $ID)) {
         $pdf->displayTitle("<b>" . __('Financial and administrative information') . "</b>");
         $pdf->setColumnsSize(50, 50);
         $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Supplier') . "</i></b>", Html::clean(Dropdown::getDropdownName("glpi_suppliers", $ic->fields["suppliers_id"]))), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Budget') . "</i></b>", Html::clean(Dropdown::getDropdownName("glpi_budgets", $ic->fields["budgets_id"]))));
         $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Order number') . "</i></b>", $ic->fields["order_number"]), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Order date') . "</i></b>", Html::convDate($ic->fields["order_date"])));
         $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Immobilization number') . "</i></b>", $ic->fields["immo_number"]), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Date of purchase') . "</i></b>", Html::convDate($ic->fields["buy_date"])));
         $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Invoice number') . "</i></b>", $ic->fields["bill"]), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Delivery date') . "</i></b>", Html::convDate($ic->fields["delivery_date"])));
         $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Delivery form') . "</i></b>", $ic->fields["delivery_number"]), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Startup date') . "</i></b>", Html::convDate($ic->fields["use_date"])));
         $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Value') . "</i></b>", Html::clean(Html::formatNumber($ic->fields["value"]))), "<b><i>" . sprintf(__('%1$s: %2$s'), _('Date of last physical inventory') . "</i></b>", Html::convDate($ic->fields["inventory_date"])));
         $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Warranty extension value') . "</i></b>", Html::clean(Html::formatNumber($ic->fields["warranty_value"]))), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Amortization duration') . "</i></b>", sprintf(__('%1$s (%2$s)'), sprintf(_n('%d year', '%d years', $ic->fields["sink_time"]), $ic->fields["sink_time"]), Infocom::getAmortTypeName($ic->fields["sink_type"]))));
         $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Account net value') . "</i></b>", Infocom::Amort($ic->fields["sink_type"], $ic->fields["value"], $ic->fields["sink_time"], $ic->fields["sink_coeff"], $ic->fields["warranty_date"], $ic->fields["use_date"], $CFG_GLPI['date_tax'], "n")), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Amortization coefficient') . "</i></b>", $ic->fields["sink_coeff"]));
         $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('TCO (value + tracking cost)') . "</i></b>", Html::clean(Infocom::showTco($item->getField('ticket_tco'), $ic->fields["value"]))), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Monthly TCO') . "</i></b>", Html::clean(Infocom::showTco($item->getField('ticket_tco'), $ic->fields["value"], $ic->fields["warranty_date"]))));
         PluginPdfCommon::mainLine($pdf, $ic, 'comment');
         $pdf->setColumnsSize(100);
         $pdf->displayTitle("<b>" . __('Warranty information') . "</b>");
         $pdf->setColumnsSize(50, 50);
         $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Start date of warranty') . "</i></b>", Html::convDate($ic->fields["warranty_date"])), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Warranty duration') . "</i></b>", sprintf(__('%1$s - %2$s'), sprintf(_n('%d month', '%d months', $ic->fields["warranty_duration"]), $ic->fields["warranty_duration"]), sprintf(__('Valid to %s'), Infocom::getWarrantyExpir($ic->fields["buy_date"], $ic->fields["warranty_duration"])))));
         $col1 = "<b><i>" . __('Alarms on financial and administrative information') . "</i></b>";
         if ($ic->fields["alert"] == 0) {
             $col1 = sprintf(__('%1$s: %2$s'), $col1, __('No'));
         } else {
             if ($ic->fields["alert"] == 4) {
                 $col1 = sprintf(__('%1$s: %2$s'), $col1, __('Warranty expiration date'));
             }
         }
         $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Warranty information') . "</i></b>", $ic->fields["warranty_info"]), $col1);
     } else {
         $pdf->displayTitle("<b>" . __('No financial information', 'pdf') . "</b>");
     }
     $pdf->displaySpace();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:40,代码来源:infocom.class.php

示例5: showForContract

 /**
  * Print the contract costs
  *
  * @param $contract               Contract object
  * @param $withtemplate  boolean  Template or basic item (default '')
  *
  * @return Nothing (call to classes members)
  **/
 static function showForContract(Contract $contract, $withtemplate = '')
 {
     global $DB, $CFG_GLPI;
     $ID = $contract->fields['id'];
     if (!$contract->getFromDB($ID) || !$contract->can($ID, READ)) {
         return false;
     }
     $canedit = $contract->can($ID, UPDATE);
     echo "<div class='center'>";
     $query = "SELECT *\n                FROM `glpi_contractcosts`\n                WHERE `contracts_id` = '{$ID}'\n                ORDER BY `begin_date`";
     $rand = mt_rand();
     if ($canedit) {
         echo "<div id='viewcost" . $ID . "_{$rand}'></div>\n";
         echo "<script type='text/javascript' >\n";
         echo "function viewAddCost" . $ID . "_{$rand}() {\n";
         $params = array('type' => __CLASS__, 'parenttype' => 'Contract', 'contracts_id' => $ID, 'id' => -1);
         Ajax::updateItemJsCode("viewcost" . $ID . "_{$rand}", $CFG_GLPI["root_doc"] . "/ajax/viewsubitem.php", $params);
         echo "};";
         echo "</script>\n";
         echo "<div class='center firstbloc'>" . "<a class='vsubmit' href='javascript:viewAddCost" . $ID . "_{$rand}();'>";
         echo __('Add a new cost') . "</a></div>\n";
     }
     if ($result = $DB->query($query)) {
         echo "<table class='tab_cadre_fixehov'>";
         echo "<tr><th colspan='5'>" . self::getTypeName($DB->numrows($result)) . "</th></tr>";
         if ($DB->numrows($result)) {
             echo "<tr><th>" . __('Name') . "</th>";
             echo "<th>" . __('Begin date') . "</th>";
             echo "<th>" . __('End date') . "</th>";
             echo "<th>" . __('Budget') . "</th>";
             echo "<th>" . __('Cost') . "</th>";
             echo "</tr>";
             Session::initNavigateListItems(__CLASS__, sprintf(__('%1$s = %2$s'), Contract::getTypeName(1), $contract->getName()));
             $total = 0;
             while ($data = $DB->fetch_assoc($result)) {
                 echo "<tr class='tab_bg_2' " . ($canedit ? "style='cursor:pointer' onClick=\"viewEditCost" . $data['contracts_id'] . "_" . $data['id'] . "_{$rand}();\"" : '') . ">";
                 $name = empty($data['name']) ? sprintf(__('%1$s (%2$s)'), $data['name'], $data['id']) : $data['name'];
                 echo "<td>";
                 printf(__('%1$s %2$s'), $name, Html::showToolTip($data['comment'], array('display' => false)));
                 if ($canedit) {
                     echo "\n<script type='text/javascript' >\n";
                     echo "function viewEditCost" . $data['contracts_id'] . "_" . $data["id"] . "_{$rand}() {\n";
                     $params = array('type' => __CLASS__, 'parenttype' => 'Contract', 'contracts_id' => $data["contracts_id"], 'id' => $data["id"]);
                     Ajax::updateItemJsCode("viewcost" . $ID . "_{$rand}", $CFG_GLPI["root_doc"] . "/ajax/viewsubitem.php", $params);
                     echo "};";
                     echo "</script>\n";
                 }
                 echo "</td>";
                 echo "<td>" . Html::convDate($data['begin_date']) . "</td>";
                 echo "<td>" . Html::convDate($data['end_date']) . "</td>";
                 echo "<td>" . Dropdown::getDropdownName('glpi_budgets', $data['budgets_id']) . "</td>";
                 echo "<td class='numeric'>" . Html::formatNumber($data['cost']) . "</td>";
                 $total += $data['cost'];
                 echo "</tr>";
                 Session::addToNavigateListItems(__CLASS__, $data['id']);
             }
             echo "<tr class='b noHover'><td colspan='3'>&nbsp;</td>";
             echo "<td class='right'>" . __('Total cost') . '</td>';
             echo "<td class='numeric'>" . Html::formatNumber($total) . '</td></tr>';
         } else {
             echo "<tr><th colspan='5'>" . __('No item found') . "</th></tr>";
         }
         echo "</table>";
     }
     echo "</div><br>";
 }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:74,代码来源:contractcost.class.php

示例6: giveItem


//.........这里部分代码省略.........
                     $count_display++;
                     if (!empty($data[$num][$k]['name'])) {
                         $out .= empty($out) ? '' : self::LBBR;
                         $out .= "<a href='mailto:" . $data[$num][$k]['name'] . "'>" . $data[$num][$k]['name'];
                         $out .= "</a>";
                     }
                 }
                 return empty($out) ? "&nbsp;" : $out;
             case "weblink":
                 $orig_link = trim($data[$num][0]['name']);
                 if (!empty($orig_link)) {
                     // strip begin of link
                     $link = preg_replace('/https?:\\/\\/(www[^\\.]*\\.)?/', '', $orig_link);
                     $link = preg_replace('/\\/$/', '', $link);
                     if (Toolbox::strlen($link) > $CFG_GLPI["url_maxlength"]) {
                         $link = Toolbox::substr($link, 0, $CFG_GLPI["url_maxlength"]) . "...";
                     }
                     return "<a href=\"" . formatOutputWebLink($orig_link) . "\" target='_blank'>{$link}</a>";
                 }
                 return "&nbsp;";
             case "count":
             case "number":
                 $out = "";
                 $count_display = 0;
                 for ($k = 0; $k < $data[$num]['count']; $k++) {
                     if (strlen(trim($data[$num][$k]['name'])) > 0) {
                         if ($count_display) {
                             $out .= self::LBBR;
                         }
                         $count_display++;
                         if (isset($searchopt[$ID]['toadd']) && isset($searchopt[$ID]['toadd'][$data[$num][$k]['name']])) {
                             $out .= $searchopt[$ID]['toadd'][$data[$num][$k]['name']];
                         } else {
                             $number = str_replace(' ', '&nbsp;', Html::formatNumber($data[$num][$k]['name'], false, 0));
                             $out .= Dropdown::getValueWithUnit($number, $unit);
                         }
                     }
                 }
                 return $out;
             case "decimal":
                 $out = "";
                 $count_display = 0;
                 for ($k = 0; $k < $data[$num]['count']; $k++) {
                     if (strlen(trim($data[$num][$k]['name'])) > 0) {
                         if ($count_display) {
                             $out .= self::LBBR;
                         }
                         $count_display++;
                         if (isset($searchopt[$ID]['toadd']) && isset($searchopt[$ID]['toadd'][$data[$num][$k]['name']])) {
                             $out .= $searchopt[$ID]['toadd'][$data[$num][$k]['name']];
                         } else {
                             $number = str_replace(' ', '&nbsp;', Html::formatNumber($data[$num][$k]['name']));
                             $out .= Dropdown::getValueWithUnit($number, $unit);
                         }
                     }
                 }
                 return $out;
             case "bool":
                 $out = "";
                 $count_display = 0;
                 for ($k = 0; $k < $data[$num]['count']; $k++) {
                     if (strlen(trim($data[$num][$k]['name'])) > 0) {
                         if ($count_display) {
                             $out .= self::LBBR;
                         }
                         $count_display++;
开发者ID:jose-martins,项目名称:glpi,代码行数:67,代码来源:search.class.php

示例7: showForItem


//.........这里部分代码省略.........
             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'>";
             echo "<td>" . __('Value') . "</td>";
             echo "<td><input type='text' name='value' {$option} value='" . Html::formatNumber($ic->fields["value"], true) . "' size='14'></td>";
             echo "</td>";
             echo "<td>" . __('Date of last physical inventory') . "</td><td>";
             Html::showDateFormItem("inventory_date", $ic->fields["inventory_date"], true, $editcalendar);
             echo "</td></tr>";
             echo "<tr class='tab_bg_1'>";
             echo "<td>" . __('Warranty extension value') . "</td>";
             echo "<td><input type='text' {$option} name='warranty_value' value='" . Html::formatNumber($ic->fields["warranty_value"], true) . "' size='14'></td>";
             echo "<td rowspan='5'>" . __('Comments') . "</td>";
             echo "<td rowspan='5' class='middle'>";
             echo "<textarea cols='45' rows='9' name='comment' >" . $ic->fields["comment"];
             echo "</textarea></td></tr>\n";
             echo "<tr class='tab_bg_1'>";
             echo "<td>" . __('Account net value') . "</td><td>";
             echo Html::formatNumber(self::Amort($ic->fields["sink_type"], $ic->fields["value"], $ic->fields["sink_time"], $ic->fields["sink_coeff"], $ic->fields["warranty_date"], $ic->fields["use_date"], $date_tax, "n"));
             echo "</td></tr>";
             echo "<tr class='tab_bg_1'>";
             echo "<td>" . __('Amortization type') . "</td><td >";
             if ($withtemplate == 2) {
                 echo self::getAmortTypeName($ic->fields["sink_type"]);
             } else {
                 self::dropdownAmortType("sink_type", $ic->fields["sink_type"]);
             }
             echo "</td></tr>";
             echo "<tr class='tab_bg_1'>";
             echo "<td>" . __('Amortization duration') . "</td><td>";
             if ($withtemplate == 2) {
                 printf(_n('%d year', '%d years', $ic->fields["sink_time"]), $ic->fields["sink_time"]);
             } else {
                 Dropdown::showNumber("sink_time", array('value' => $ic->fields["sink_time"], 'max' => 15, 'unit' => 'year'));
             }
             echo "</td></tr>";
             echo "<tr class='tab_bg_1'>";
开发者ID:gaforeror,项目名称:glpi,代码行数:67,代码来源:infocom.class.php

示例8: header

include "../../../inc/includes.php";
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
if (!defined('GLPI_ROOT')) {
    die("Can not acces directly to this file");
}
Session::checkCentralAccess();
if ($_POST["plugin_order_references_id"] > 0) {
    $reference_supplier = new PluginOrderReference_Supplier();
    $price = $reference_supplier->getPriceByReferenceAndSupplier($_POST["plugin_order_references_id"], $_POST["suppliers_id"]);
    switch ($_POST["update"]) {
        case 'quantity':
            echo "<input type='text' name='quantity' size='5'>";
            break;
        case 'priceht':
            echo "<input type='text' name='price' value=\"" . Html::formatNumber($price, true) . "\" size='5'>";
            break;
        case 'pricediscounted':
            echo "<input type='text' name='discount' size='5' value='0'>";
            break;
        case 'taxe':
            $config = PluginOrderConfig::getConfig();
            PluginOrderOrderTax::Dropdown(array('name' => "plugin_order_ordertaxes_id", 'value' => $config->getDefaultTaxes(), 'display_emptychoice' => true, 'emptylabel' => __("No VAT", "order")));
            break;
        case 'validate':
            echo "<input type='hidden' name='itemtype' value='" . $_POST["itemtype"] . "' class='submit' >";
            echo "<input type='hidden' name='plugin_order_references_id' value='" . $_POST["plugin_order_references_id"] . "' class='submit' >";
            echo "<input type='submit' name='add_item' value=\"" . __("Add") . "\" class='submit' >";
            break;
    }
} else {
开发者ID:ukef,项目名称:order,代码行数:31,代码来源:referencedetail.php

示例9: showForBudget

 public static function showForBudget($budgets_id)
 {
     global $DB, $CFG_GLPI;
     $table = getTableForItemType(__CLASS__);
     $query = "SELECT *\n                FROM `{$table}`\n                WHERE `budgets_id` = '{$budgets_id}'\n                AND `is_template`='0'\n                ORDER BY `entities_id`, `name` ";
     $result = $DB->query($query);
     $nb = $DB->numrows($result);
     echo "<div class='center'>";
     if ($nb) {
         $start = isset($_REQUEST["start"]) ? $_REQUEST["start"] : 0;
         $query_limit = $query . " LIMIT " . intval($start) . "," . intval($_SESSION['glpilist_limit']);
         Html::printAjaxPager(__("Linked orders", "order"), $start, $nb);
         echo "<table class='tab_cadre_fixe'>";
         echo "<tr>";
         echo "<th style='width:15%;'>" . _n("Action", "Actions", 2) . "</th>";
         echo "<th>" . __("Name") . "</th>";
         echo "<th>" . __("Order status", "order") . "</th>";
         echo "<th>" . __("Entity") . "</th>";
         echo "<th>" . __("Price tax free", "order") . "</th>";
         echo "<th>" . __("Price ATI", "order") . "</th>";
         echo "</tr>";
         $total = 0;
         foreach ($DB->request($query_limit) as $data) {
             $PluginOrderOrder_Item = new PluginOrderOrder_Item();
             $prices = $PluginOrderOrder_Item->getAllPrices($data["id"]);
             $postagewithTVA = $PluginOrderOrder_Item->getPricesATI($data["port_price"], Dropdown::getDropdownName("glpi_plugin_order_ordertaxes", $data["plugin_order_ordertaxes_id"]));
             $total += $prices["priceTTC"] + $postagewithTVA;
             $link = Toolbox::getItemTypeFormURL(__CLASS__);
             echo "<tr class='tab_bg_1' align='center'>";
             echo "<td>";
             echo "<a href=\"" . $link . "?unlink_order=unlink_order&id=" . $data["id"] . "\">" . __("Unlink", "order") . "</a>";
             echo "</td>";
             echo "<td>";
             if (self::canView()) {
                 echo "<a href=\"" . $link . "?id=" . $data["id"] . "\">" . $data["name"] . "</a>";
             } else {
                 echo $data["name"];
             }
             echo "</td>";
             echo "<td>";
             echo Dropdown::getDropdownName(getTableForItemType('PluginOrderOrderState'), $data["plugin_order_orderstates_id"]);
             echo "</td>";
             echo "<td>";
             echo Dropdown::getDropdownName("glpi_entities", $data["entities_id"]);
             echo "</td>";
             echo "<td>";
             echo Html::formatNumber($prices["priceHT"]);
             echo "</td>";
             echo "<td>";
             echo Html::formatNumber($prices["priceTTC"] + $postagewithTVA);
             echo "</td>";
             echo "</tr>";
         }
         echo "</table></div>";
         echo "<br><div class='center'>";
         echo "<table class='tab_cadre' width='15%'>";
         echo "<tr class='tab_bg_2'><td>" . __("Budget already used") . ": </td>";
         echo "<td>";
         echo Html::formatNumber($total) . "</td>";
         echo "</tr>";
         echo "</table></div>";
     } else {
         echo "<table class='tab_cadre_fixe'>";
         echo "<tr><td class='center'>" . __("No item to display") . "</td></tr>";
         echo "</table>";
     }
 }
开发者ID:pluginsGLPI,项目名称:order,代码行数:67,代码来源:order.class.php

示例10: header

include "../../../inc/includes.php";
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
if (!defined('GLPI_ROOT')) {
    die("Can not acces directly to this file");
}
Session::checkCentralAccess();
if ($_POST["plugin_order_references_id"] > 0) {
    $reference_supplier = new PluginOrderReference_Supplier();
    $price = $reference_supplier->getPriceByReferenceAndSupplier($_POST["plugin_order_references_id"], $_POST["suppliers_id"]);
    switch ($_POST["update"]) {
        case 'quantity':
            echo "<input type='number' name='quantity' class='quantity'>";
            break;
        case 'priceht':
            echo "<input type='number' step='" . PLUGIN_ORDER_NUMBER_STEP . "' name='price' value='" . Html::formatNumber($price, true) . "' class='decimal'>";
            break;
        case 'pricediscounted':
            echo "<input type='number' step='" . PLUGIN_ORDER_NUMBER_STEP . "' name='discount' class='smalldecimal' value='0'>";
            break;
        case 'taxe':
            $config = PluginOrderConfig::getConfig();
            PluginOrderOrderTax::Dropdown(array('name' => "plugin_order_ordertaxes_id", 'value' => $config->getDefaultTaxes(), 'display_emptychoice' => true, 'emptylabel' => __("No VAT", "order")));
            break;
        case 'validate':
            echo "<input type='hidden' name='itemtype' value='" . $_POST["itemtype"] . "' class='submit' >";
            echo "<input type='hidden' name='plugin_order_references_id' value='" . $_POST["plugin_order_references_id"] . "' class='submit' >";
            echo "<input type='submit' name='add_item' value=\"" . __("Add") . "\" class='submit' >";
            break;
    }
} else {
开发者ID:equinoxefr,项目名称:order,代码行数:31,代码来源:referencedetail.php

示例11: showForm

 function showForm($ID, $options = array())
 {
     global $CFG_GLPI;
     $this->initForm($ID, $options);
     $this->showTabs($options);
     $this->showFormHeader($options);
     echo "<tr class='tab_bg_1'><td>" . __('Name') . "</td>";
     echo "<td>";
     $opt = array();
     if (isset($options['helpdesk_id']) && !empty($options['helpdesk_id'])) {
         $help = new $options['helpdesk_itemtype']();
         if ($help->getFromDB($options['helpdesk_id'])) {
             $opt['value'] = $help->fields["name"];
             echo "<input type='hidden' name='helpdesk_id' value='" . $options['helpdesk_id'] . "'>";
             echo "<input type='hidden' name='helpdesk_itemtype' value='" . $options['helpdesk_itemtype'] . "'>";
         }
     }
     Html::autocompletionTextField($this, "name", $opt);
     echo "</td>";
     //Projet parent
     echo "<td>" . __('Parent project', 'projet') . "</td>";
     echo "<td>";
     PluginProjetProjet_Projet::displayLinkedProjetsTo($ID, $options['withtemplate']);
     if ($this->canCreate() && $options['withtemplate'] < 2) {
         $rand_linked_projet = mt_rand();
         echo "&nbsp;";
         if (!PluginProjetProjet_Projet::getParentProjetsTo($ID)) {
             echo "<img onClick=\"Ext.get('linkedprojet{$rand_linked_projet}').setDisplayed('block')\"\n                       title=\"" . _x('button', 'Add') . "\" alt=\"" . _x('button', 'Add') . "\"\n                       class='pointer' src='" . $CFG_GLPI["root_doc"] . "/pics/add_dropdown.png'>";
         }
         echo "<div style='display:none' id='linkedprojet{$rand_linked_projet}'>";
         PluginProjetProjet_Projet::dropdownLinks('_link[link]', isset($values["_link"]) ? $values["_link"]['link'] : '');
         echo "&nbsp;";
         PluginProjetProjet_Projet::dropdownParent("_link[plugin_projet_projets_id_2]", isset($values["_link"]) ? $values["_link"]['plugin_projet_projets_id_2'] : '', array('id' => $this->fields["id"], 'entities_id' => $this->fields["entities_id"]));
         echo "<input type='hidden' name='_link[plugin_projet_projets_id_1]' value='{$ID}'>\n";
         echo "&nbsp;";
         echo "</div>";
         if (isset($values["_link"]) && !empty($values["_link"]['plugin_projet_projets_id_2'])) {
             echo "<script language='javascript'>Ext.get('linkedprojet{$rand_linked_projet}').\n                   setDisplayed('block');</script>";
         }
     }
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'><td colspan='2'>" . _n('Responsible', 'Responsibles', 2, 'projet') . "</td>";
     echo "<td colspan='2'>" . __('Planification', 'projet') . "</td></tr>";
     echo "<tr class='tab_bg_1'><td>" . __('User') . "</td><td>";
     User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
     echo "</td>";
     echo "<td>" . __('Start date') . "</td><td>";
     Html::showDateFormItem("date_begin", $this->fields["date_begin"], true, true);
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'><td>" . __('Group') . "</td><td>";
     Dropdown::show('Group', array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"]));
     echo "</td>";
     echo "<td>" . __('End date') . "</td><td>";
     Html::showDateFormItem("date_end", $this->fields["date_end"], true, true);
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'><td>" . __('Estimated duration', 'projet');
     echo "</td>";
     echo "<td>";
     $toadd = array();
     for ($i = 9; $i <= 100; $i++) {
         $toadd[] = $i * DAY_TIMESTAMP;
     }
     Dropdown::showTimeStamp("estimatedtime", array('min' => 0, 'max' => 8 * DAY_TIMESTAMP, 'value' => $this->fields["estimatedtime"], 'addfirstminutes' => false, 'inhours' => false, 'toadd' => $toadd));
     echo "</td>\n";
     echo "<td>" . __('Effective duration', 'projet') . "&nbsp;";
     Html::showToolTip(nl2br(__('Total of effective duration of project tasks', 'projet')));
     echo "</td>";
     echo "<td>" . self::getProjectForecast($ID) . "</td></tr>";
     echo "<tr class='tab_bg_2'><td>";
     echo __('Estimated duration', 'projet') . "&nbsp;" . __('in hours', 'projet');
     echo "</td><td>";
     $time = floor($this->fields["estimatedtime"]);
     $out = Html::formatNumber($time / HOUR_TIMESTAMP, 2);
     echo sprintf(_n('%s hour', '%s hours', $out), $out);
     echo "</td><td>" . __('Linked tickets duration', 'projet') . "&nbsp;";
     Html::showToolTip(nl2br(__('Total of duration of linked tickets for project', 'projet')));
     echo "</td>";
     echo "<td>" . self::getProjectDuration($ID) . "</td></tr>";
     //status
     echo "<tr class='tab_bg_1'><td>" . __('State') . "</td><td>";
     Dropdown::show('PluginProjetProjetState', array('value' => $this->fields["plugin_projet_projetstates_id"]));
     echo "</td>";
     echo "<td>" . __('Display on the global Gantt', 'projet') . "</td><td>";
     Dropdown::showYesNo("show_gantt", $this->fields["show_gantt"]);
     echo "</td></tr>";
     //advance
     echo "<tr class='tab_bg_1'><td>" . __('Progress') . "</td><td>";
     $advance = floor($this->fields["advance"]);
     echo "<select name='advance'>";
     for ($i = 0; $i < 101; $i += 5) {
         echo "<option value='{$i}' ";
         if ($advance == $i) {
             echo "selected";
         }
         echo " >{$i}</option>";
     }
     echo "</select> %";
     echo "<td>" . __('Associable to a ticket') . "</td><td>";
     Dropdown::showYesNo('is_helpdesk_visible', $this->fields['is_helpdesk_visible']);
     echo "</td></tr>";
//.........这里部分代码省略.........
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:projet.class.php

示例12: showModels

 function showModels($itemtype, $id, $rand)
 {
     global $DB;
     $PluginRacksConfig = new PluginRacksConfig();
     $link = Toolbox::getItemTypeFormURL($itemtype);
     $table = getTableForItemType($itemtype);
     $search = Toolbox::getItemTypeSearchURL($itemtype);
     echo "<table class='tab_cadre_fixe' cellpadding='5'>";
     echo "<tr class='tab_bg_1'>";
     echo "<th>&nbsp;</th>";
     echo "<th>" . __('Equipment', 'racks') . "</th>";
     echo "<th>" . __('Total Current', 'racks') . "<br>(" . __('amps', 'racks') . ")</th>";
     echo "<th>" . __('Power supplies number', 'racks') . "</th>";
     echo "<th>" . __('Calorific waste', 'racks') . "<br> (";
     // Dissipation calorifique
     $PluginRacksConfig->getUnit("dissipation");
     echo ")</th>";
     echo "<th>" . __('Flow Rate', 'racks') . "<br> (";
     // Débit d'air frais
     $PluginRacksConfig->getUnit("rate");
     echo ")</th>";
     echo "<th>" . __('Size') . " (" . __('U', 'racks') . ")</th>";
     echo "<th>" . __('Weight', 'racks') . "<br> (";
     // poids
     $PluginRacksConfig->getUnit("weight");
     echo ")</th>";
     echo "<th>" . __('Full-depth item', 'racks') . "</th>";
     echo "</tr>";
     $modelid = -1;
     $result = $DB->query("SELECT *\n                        FROM `" . $this->getTable() . "` " . ($itemtype != -1 ? "WHERE `itemtype` = '{$itemtype}'" : "") . " ");
     while ($data = $DB->fetch_assoc($result)) {
         $modelid = $data['model_id'];
         $id = $data['id'];
         echo "<tr class='tab_bg_1'>";
         echo "<td class='center'>";
         echo "<input type='checkbox' name='item[{$id}]' value='1'>";
         echo "</td>";
         echo "<td>";
         echo "<a href=\"" . $link . "?id=" . $modelid . "\">";
         echo Dropdown::getDropdownName($table, $modelid);
         echo "</a>";
         echo "</td>";
         echo "<td>" . Html::formatNumber($data['amps'], true) . "</td>";
         echo "<td>" . $data['nb_alim'] . "</td>";
         echo "<td>" . Html::formatNumber($data['dissipation'], true) . "</td>";
         echo "<td>" . Html::formatNumber($data['flow_rate'], true) . "</td>";
         echo "<td>" . $data['size'] . "</td>";
         echo "<td>" . Html::formatNumber($data['weight'], true) . "</td>";
         echo "<td>" . Dropdown::getYesNo($data['length']) . "</td>";
     }
     echo "<tr class='tab_bg_1'><td colspan='10'>";
     if ($this->canCreate()) {
         echo "<div align='center'><a onclick= \"if ( markCheckboxes('massiveaction_form{$rand}') ) return false;\" href='#'>" . __('Check all') . "</a>";
         echo " - <a onclick= \"if ( unMarkCheckboxes('massiveaction_form{$rand}') ) return false;\" href='#'>" . __('Uncheck all') . "</a> ";
         echo "<input type='submit' name='deleteSpec' value=\"" . __s('Delete permanently') . "\" class='submit' ></div></td></tr>";
         echo "<tr class='tab_bg_1 right'><td colspan='10'>";
         echo "<a href=\"" . $search . "\">";
         echo __('Add specifications for servers models', 'racks');
         echo "</a>";
         echo "</td></tr>";
     }
     echo "</table>";
     Html::closeForm();
     echo "</div>";
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:65,代码来源:itemspecification.class.php

示例13: showItemFromPlugin


//.........这里部分代码省略.........
                         } else {
                             $name = $device["name"];
                         }
                         echo "<input type='hidden' name='plugin_racks_racks_id' value='" . $PluginRacksRack->fields['id'] . "'>";
                         echo "<input type='hidden' name='rack_size' value='" . $PluginRacksRack->fields['rack_size'] . "'>";
                         echo "<input type='hidden' name='type" . $data["id"] . "' value='" . $data["itemtype"] . "'>";
                         echo "<input type='hidden' name='items_id" . $data["id"] . "' value='" . $data["items_id"] . "'>";
                         echo "<input type='hidden' name='plugin_racks_itemspecifications_id" . $data["id"] . "' value='" . $data["plugin_racks_itemspecifications_id"] . "'>";
                         echo "<input type='hidden' name='update_server' value='1'>";
                         echo "<input type='hidden' name='faces_id' value='" . $face . "'>";
                         if ($data["itemtype"] != 'PluginRacksOtherModel') {
                             echo "<td class='center' " . (isset($data['is_deleted']) && $data['is_deleted'] ? "class='tab_bg_2_2'" : "") . " >" . $name . "</td>";
                         } else {
                             $PluginRacksOther = new PluginRacksOther();
                             $PluginRacksOther->GetfromDB($data["items_id"]);
                             echo "<td class='center'><input type='text' name='name" . $data["id"] . "' value='" . $PluginRacksOther->fields["name"] . "' size='10'></td>";
                         }
                         echo "<td class='center'>" . $item::getTypeName(2) . "</td>";
                         $linkmodel = Toolbox::getItemTypeFormURL($modelclass);
                         echo "<td class='center'><a href=\"" . $linkmodel . "?id=" . $device_spec["modelid"] . "\">" . $device_spec["model"] . " (" . $device_spec["size"] . "U)</a></td>";
                         echo "<td class='center'>";
                         echo Dropdown::getDropdownName("glpi_plugin_racks_connections", $data["first_powersupply"]);
                         echo "</td>";
                         echo "<td class='center'>";
                         echo Dropdown::getDropdownName("glpi_plugin_racks_connections", $data["second_powersupply"]);
                         echo "</td>";
                         echo "<td class='center'>" . $nbcordons . "</td>";
                         if ($data["amps"] == '0.0000') {
                             $amps = $device_spec["amps"];
                         } else {
                             $amps = $data["amps"];
                         }
                         $cordons_amps_tot += $amps * $nbcordons;
                         echo "<td class='center'>" . Html::formatNumber($amps, true) . "</td>";
                         if ($data["dissipation"] == '0.0000') {
                             $dissipation = $device_spec["dissipation"];
                         } else {
                             $dissipation = $data["dissipation"];
                         }
                         echo "<td class='center'>" . Html::formatNumber($dissipation, true) . "</td>";
                         if ($data["flow_rate"] == '0.0000') {
                             $flow_rate = $device_spec["flow_rate"];
                         } else {
                             $flow_rate = $data["flow_rate"];
                         }
                         echo "<td class='center'>" . Html::formatNumber($flow_rate, true) . "</td>";
                         if ($data["weight"] == '0.0000') {
                             $weight = $device_spec["weight"];
                         } else {
                             $weight = $data["weight"];
                         }
                         echo "<td class='center'>" . Html::formatNumber($weight, true) . "</td>";
                         echo "</tr>";
                         if ($data["amps"] == '0.0000') {
                             $amps_tot += $device_spec["amps"];
                         } else {
                             $amps_tot += $data["amps"];
                         }
                         if ($data["flow_rate"] == '0.0000') {
                             $flow_rate_tot += $device_spec["flow_rate"];
                         } else {
                             $flow_rate_tot += $data["flow_rate"];
                         }
                         if ($data["dissipation"] == '0.0000') {
                             $dissip_tot += $device_spec["dissipation"];
                         } else {
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:67,代码来源:rack_item.class.php

示例14: giveItem


//.........这里部分代码省略.........
                     if (!empty($val)) {
                         $out .= empty($out) ? '' : '<br>';
                         $out .= "<a href='mailto:{$split2['0']}'>{$split2['0']}</a>";
                     }
                 }
                 return empty($out) ? "&nbsp;" : $out;
             case "weblink":
                 $orig_link = trim($data[$NAME . $num]);
                 if (!empty($orig_link)) {
                     // strip begin of link
                     $link = preg_replace('/https?:\\/\\/(www[^\\.]*\\.)?/', '', $orig_link);
                     $link = preg_replace('/\\/$/', '', $link);
                     if (Toolbox::strlen($link) > $CFG_GLPI["url_maxlength"]) {
                         $link = Toolbox::substr($link, 0, $CFG_GLPI["url_maxlength"]) . "...";
                     }
                     return "<a href=\"" . formatOutputWebLink($orig_link) . "\" target='_blank'>{$link}</a>";
                 }
                 return "&nbsp;";
             case "number":
                 if (isset($searchopt[$ID]['forcegroupby']) && $searchopt[$ID]['forcegroupby']) {
                     $out = "";
                     $split = explode("\$\$\$\$", $data[$NAME . $num]);
                     $count_display = 0;
                     for ($k = 0; $k < count($split); $k++) {
                         if (strlen(trim($split[$k])) > 0) {
                             $split2 = self::explodeWithID("\$\$", $split[$k]);
                             if ($count_display) {
                                 $out .= "<br>";
                             }
                             $count_display++;
                             if (isset($searchopt[$ID]['toadd']) && isset($searchopt[$ID]['toadd'][$split2[0]])) {
                                 $out .= $searchopt[$ID]['toadd'][$split2[0]];
                             } else {
                                 $number = str_replace(' ', '&nbsp;', Html::formatNumber($split2[0], false, 0));
                                 $out .= Dropdown::getValueWithUnit($number, $unit);
                             }
                         }
                     }
                     return $out;
                 }
                 if (isset($searchopt[$ID]['toadd']) && isset($searchopt[$ID]['toadd'][$data[$NAME . $num]])) {
                     return $searchopt[$ID]['toadd'][$data[$NAME . $num]];
                 } else {
                     $number = str_replace(' ', '&nbsp;', Html::formatNumber($data[$NAME . $num], false, 0));
                     return Dropdown::getValueWithUnit($number, $unit);
                 }
             case "decimal":
                 if (isset($searchopt[$ID]['forcegroupby']) && $searchopt[$ID]['forcegroupby']) {
                     $out = "";
                     $split = explode("\$\$\$\$", $data[$NAME . $num]);
                     $count_display = 0;
                     for ($k = 0; $k < count($split); $k++) {
                         if (strlen(trim($split[$k])) > 0) {
                             $split2 = self::explodeWithID("\$\$", $split[$k]);
                             if ($count_display) {
                                 $out .= "<br>";
                             }
                             $count_display++;
                             if (isset($searchopt[$ID]['toadd']) && isset($searchopt[$ID]['toadd'][$split2[0]])) {
                                 $out .= $searchopt[$ID]['toadd'][$split2[0]];
                             } else {
                                 $number = str_replace(' ', '&nbsp;', Html::formatNumber($split2[0]));
                                 $out .= Dropdown::getValueWithUnit($number, $unit);
                             }
                         }
                     }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:67,代码来源:searcha.class.php

示例15: generatePdf

 function generatePdf($itemtype, $data, $saveas)
 {
     global $CFG_GLPI, $PDF, $DB;
     $ID = $data["id"];
     //name
     if (!empty($data["name"])) {
         $name_item = Toolbox::decodeFromUtf8($data["name"]);
     } else {
         $name_item = "";
     }
     //user
     if (!empty($data["users_id"])) {
         $user_item = Toolbox::decodeFromUtf8(Html::clean(getUserName($data["users_id"])));
     } else {
         if (!empty($data["groups_id"])) {
             $user_item = Toolbox::decodeFromUtf8(Dropdown::getDropdownName("glpi_groups", $data["groups_id"]));
         } else {
             $user_item = "";
         }
     }
     //fabricant
     if (!empty($data["manufacturers_id"])) {
         $fabricant_item = Toolbox::decodeFromUtf8(Dropdown::getDropdownName("glpi_manufacturers", $data["manufacturers_id"]));
     } else {
         $fabricant_item = "";
     }
     //serial
     if (!empty($data["serial"])) {
         $serial_item = Toolbox::decodeFromUtf8($data["serial"]);
     } else {
         $serial_item = "";
     }
     $class = $itemtype . "Type";
     $item = new $class();
     $typefield = getForeignKeyFieldForTable(getTableForItemType($itemtype . "Type"));
     $item->getFromDB($data[$typefield]);
     if (!empty($typefield) && !empty($item->fields["name"])) {
         $type_item = Toolbox::decodeFromUtf8($item->fields["name"]);
     } else {
         $type_item = "";
     }
     //infocoms
     $ic = new Infocom();
     if ($ic->getfromDBforDevice($itemtype, $ID)) {
         //immobilizationsheets_item
         if (!empty($ic->fields["immo_number"])) {
             $immobilizationsheets_item = Toolbox::decodeFromUtf8($ic->fields["immo_number"]);
         } else {
             $immobilizationsheets_item = "";
         }
         //buy_date
         if (!empty($ic->fields["buy_date"])) {
             $buy_date_item = Toolbox::decodeFromUtf8(Html::convdate($ic->fields["buy_date"]));
         } else {
             $buy_date_item = "";
         }
         //use_date
         if (!empty($ic->fields["use_date"])) {
             $use_date_item = Toolbox::decodeFromUtf8(Html::convdate($ic->fields["use_date"]));
         } else {
             $use_date_item = "";
         }
         //order_number
         if (!empty($ic->fields["order_number"])) {
             $order_number_item = Toolbox::decodeFromUtf8($ic->fields["order_number"]);
         } else {
             $order_number_item = "";
         }
         //value_item
         if (!empty($ic->fields["value"])) {
             $value_item = Toolbox::decodeFromUtf8(Html::clean(Html::formatNumber($ic->fields["value"])));
         } else {
             $value_item = "";
         }
         //sink_time
         if (!empty($ic->fields["sink_time"])) {
             $sink_time_item = Toolbox::decodeFromUtf8(sprintf(_n('%d year', '%d years', $ic->fields["sink_time"]), $ic->fields["sink_time"]));
         } else {
             $sink_time_item = "";
         }
         //sink_type
         if (!empty($ic->fields["sink_type"])) {
             $sink_type_item = Toolbox::decodeFromUtf8(Infocom::getAmortTypeName($ic->fields["sink_type"]));
         } else {
             $sink_type_item = "";
         }
     } else {
         $immobilizationsheets_item = "";
         $buy_date_item = "";
         $use_date_item = "";
         $order_number_item = "";
         $value_item = "";
         $sink_time_item = "";
         $sink_type_item = "";
     }
     //composants
     $devtypes = self::getDeviceTypes();
     if ($itemtype == 'Computer') {
         $device2 = new $devtypes[2]();
         $query2 = "SELECT `deviceprocessors_id`\n                  FROM `" . getTableForItemType('items_' . $devtypes[2]) . "`\n                  WHERE `items_id` = '{$ID}'";
//.........这里部分代码省略.........
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:item.class.php


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