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


PHP Html::openArrowMassives方法代码示例

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


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

示例1: showForm

 function showForm($target)
 {
     global $DB;
     $rand = mt_rand();
     $query = "SELECT *\n                 FROM `" . $this->getTable() . "`\n                 ORDER BY `states_id` ASC ";
     if ($result = $DB->query($query)) {
         $number = $DB->numrows($result);
         if ($number != 0) {
             echo "<div align='center'><form method='post' name='massiveaction_form{$rand}' id='massiveaction_form{$rand}'  action=\"{$target}\">";
             echo "<table class='tab_cadre_fixe' cellpadding='5'>";
             echo "<tr>";
             echo "<th></th><th>" . _n('Status', 'Statuses', 2) . "</th>";
             echo "</tr>";
             while ($ligne = $DB->fetch_array($result)) {
                 $ID = $ligne["id"];
                 echo "<tr class='tab_bg_1'>";
                 echo "<td width='10' class='center'>";
                 echo "<input type='hidden' name='id' value='{$ID}'>";
                 echo "<input type='checkbox' name='item[{$ID}]' value='1'>";
                 echo "</td>";
                 echo "<td>" . Dropdown::getDropdownName("glpi_states", $ligne["states_id"]) . "</td>";
                 echo "</tr>";
             }
             Html::openArrowMassives("massiveaction_form{$rand}", true);
             Html::closeArrowMassives(array('delete_state' => __('Delete permanently')));
             echo "</table>";
             Html::closeForm();
             echo "</div>";
         }
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:31,代码来源:notificationstate.class.php

示例2: showForm

 function showForm()
 {
     global $DB;
     $query = "SELECT * FROM\n               `" . $this->getTable() . "`\n               ORDER BY `states_id` ASC";
     if ($result = $DB->query($query)) {
         $number = $DB->numrows($result);
         if ($number != 0) {
             echo "<form method='post' name='massiveaction_form' id='massiveaction_form' action='" . $this->getFormURL() . "'>";
             echo "<div align='center'>";
             echo "<table class='tab_cadre_fixe' cellpadding='5'>";
             echo "<tr>";
             echo "<th>" . __('Status') . "</th><th></th>";
             echo "</tr>";
             while ($ligne = $DB->fetch_array($result)) {
                 $ID = $ligne["id"];
                 echo "<tr class='tab_bg_1'>";
                 echo "<td width='10'>";
                 echo "<input type='checkbox' name='item[{$ID}]'";
                 if (isset($_POST['check']) && $_POST['check'] == 'all') {
                     echo " checked ";
                 }
                 echo ">";
                 echo "</td>";
                 echo "<td>" . Dropdown::getDropdownName("glpi_states", $ligne["states_id"]) . "</td>";
                 echo "</tr>";
             }
             echo "</table></div>";
             Html::openArrowMassives("massiveaction_form", true);
             Html::closeArrowMassives(array('delete_state' => _sx('button', 'Delete permanently')));
             Html::closeForm();
             echo "<div align='center'><form method='post' action='" . $this->getFormURL() . "'>";
             echo "<table class='tab_cadre_fixe' cellpadding='5'><tr ><th colspan='2'>";
             echo __('Disposal status', 'financialreports') . " : </th></tr>";
             echo "<tr class='tab_bg_1'><td>";
             Dropdown::show('State', array('name' => "states_id", 'value' => $ligne["states_id"]));
             echo "</td>";
             echo "<td>";
             echo "<div align='center'>";
             echo "<input type='submit' name='add_state' value='" . _sx('button', 'Post') . "' class='submit' >";
             echo "</div></td></tr>";
             echo "</table>";
             Html::closeForm();
             echo "</div>";
         } else {
             echo "<div align='center'><form method='post' action='" . $this->getFormURL() . "'>";
             echo "<table class='tab_cadre' cellpadding='5'><tr ><th colspan='2'>";
             echo __('Disposal status', 'financialreports') . " : </th></tr>";
             echo "<tr class='tab_bg_1'><td>";
             Dropdown::show('State', array('name' => "states_id"));
             echo "</td>";
             echo "<td>";
             echo "<div align='center'>";
             echo "<input type='submit' name='add_state' value='" . _sx('button', 'Post') . "' class='submit' >";
             echo "</div></td></tr>";
             echo "</table>";
             Html::closeForm();
             echo "</div>";
         }
     }
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:60,代码来源:config.class.php

示例3: manageGroup

 function manageGroup($groups_id)
 {
     global $CFG_GLPI;
     $group = new Group();
     if (Session::haveRight('group', 'w')) {
         echo "<form method='post' name='' id='manageGroup' action=\"" . $CFG_GLPI['root_doc'] . "/plugins/escalade/front/group_group.form.php\">";
     }
     echo "<table width='950' class='tab_cadre_fixe'>";
     echo "<tr>";
     echo "<th colspan='2'>";
     echo "Escalade";
     echo "</th>";
     echo "</tr>";
     $gg_found = $this->find("groups_id_source='{$groups_id}'");
     if (Session::haveRight('group', 'w')) {
         $groups_id_used = array();
         foreach ($gg_found as $gg) {
             $groups_id_used[] = $gg['groups_id_destination'];
         }
         echo "<tr>";
         echo "<td colspan='2' align='center'>";
         Dropdown::show('Group', array('name' => 'groups_id_destination', 'condition' => "is_assign=1", 'used' => $groups_id_used));
         echo "<input type='hidden' name='groups_id_source' value='" . $groups_id . "' />";
         echo "&nbsp;<input type='submit' class='submit' name='addgroup' value='" . _sx('button', 'Add') . "'/>";
         echo "</td>";
         echo "</tr>";
     }
     foreach ($gg_found as $gg_id => $gg) {
         $group->getFromDB($gg['groups_id_destination']);
         echo "<tr class='tab_bg_1'>";
         echo "<td width='30'>";
         if (Session::haveRight('group', 'w')) {
             echo "<input type='checkbox' name='delgroup[]' value='{$gg_id}' />";
         }
         echo "</td>";
         echo "<td>";
         echo $group->getLink(true);
         echo "</td>";
         echo "</tr>";
     }
     echo "</table>";
     if (Session::haveRight('group', 'w')) {
         Html::openArrowMassives("manageGroup", true);
         Html::closeArrowMassives(array('deleteitem' => _sx('button', 'Delete permanently')));
     }
     Html::closeForm();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:47,代码来源:group_group.class.php

示例4: showForm

 function showForm($target)
 {
     global $CFG_GLPI;
     $categories = getAllDatasFromTable($this->getTable());
     if (!empty($categories)) {
         echo "<div align='center'>";
         $rand = mt_rand();
         echo "<form method='post' name='massiveaction_form_ticket{$rand}' \n                                    id='massiveaction_form_ticket{$rand}' action='" . $target . "'>";
         echo "<table class='tab_cadre_fixe' cellpadding='5'>";
         echo "<tr>";
         echo "<th></th><th>" . __('Category of created tickets', 'resources') . "</th>";
         echo "</tr>";
         foreach ($categories as $categorie) {
             $ID = $categorie["id"];
             echo "<tr class='tab_bg_1'>";
             echo "<td class='center' width='10'>";
             echo "<input type='hidden' name='id' value='{$ID}'>";
             echo "<input type='checkbox' name='item[{$ID}]' value='1'>";
             echo "</td>";
             echo "<td>" . Dropdown::getDropdownName("glpi_itilcategories", $categorie["ticketcategories_id"]) . "</td>";
             echo "</tr>";
         }
         Html::openArrowMassives("massiveaction_form_ticket{$rand}", true);
         Html::closeArrowMassives(array('delete_ticket' => __s('Delete permanently')));
         echo "</table>";
         Html::closeForm();
         echo "</div>";
     } else {
         echo "<div align='center'><form method='post'  action='" . $target . "'>";
         echo "<table class='tab_cadre_fixe' cellpadding='5'><tr ><th colspan='2'>";
         echo __('Category of created tickets', 'resources') . "</th></tr>";
         echo "<tr class='tab_bg_1'><td>";
         Dropdown::show('ITILCategory', array('name' => "ticketcategories_id"));
         echo "</td>";
         echo "<td>";
         echo "<div align='center'>";
         echo "<input type='submit' name='add_ticket' value=\"" . _sx('button', 'Add') . "\" \n                                                                                 class='submit'>";
         echo "</div></td></tr>";
         echo "</table>";
         Html::closeForm();
         echo "</div>";
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:43,代码来源:ticketcategory.class.php

示例5: manageGroup

 function manageGroup($groups_id)
 {
     global $DB, $CFG_GLPI;
     $group = new Group();
     $a_groups_tmp = $group->find('', '`name`');
     $a_groups = array();
     foreach ($a_groups_tmp as $data) {
         $a_groups[$data['id']] = $data['name'];
     }
     unset($a_groups[$groups_id]);
     echo "<form method='post' name='' id=''  action=\"" . $CFG_GLPI['root_doc'] . "/plugins/escalation/front/group_group.form.php\">";
     echo "<table width='950' class='tab_cadre_fixe'>";
     echo "<tr>";
     echo "<th colspan='2'>";
     echo "Escalade";
     echo "</th>";
     echo "</tr>";
     $query = "SELECT * FROM `" . $this->getTable() . "`\n         WHERE `groups_id_source`='" . $groups_id . "'";
     $result = $DB->query($query);
     echo "<tr>";
     echo "<td colspan='2' align='center'>";
     while ($data = $DB->fetch_array($result)) {
         unset($a_groups[$data['groups_id_destination']]);
     }
     Dropdown::showFromArray("groups_id_destination", $a_groups);
     echo "<input type='hidden' name='groups_id_source' value='" . $groups_id . "' />";
     echo "&nbsp;<input type='submit' class='submit' name='addgroup' value='" . __('Add') . "'/>";
     echo "</td>";
     echo "</tr>";
     $result = $DB->query($query);
     while ($data = $DB->fetch_array($result)) {
         $group->getFromDB($data['groups_id_destination']);
         echo "<tr class='tab_bg_1'>";
         echo "<td width='30'>";
         echo "<input type='checkbox' name='delgroup[]' value='" . $data['id'] . "' />";
         echo "</td>";
         echo "<td>";
         echo $group->getName();
         echo "</td>";
         echo "</tr>";
     }
     echo "</table>";
     Html::openArrowMassives("delgroup", true);
     Html::closeArrowMassives(array('deleteitem' => __('Delete permanently')));
     Html::closeForm();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:46,代码来源:group_group.class.php

示例6: showForItem

 static function showForItem(CommonDBTM $item)
 {
     global $DB, $LANG;
     if (!$item->canView()) {
         return false;
     }
     //       if (PluginSimcardSimcard::canCreate()) {
     //       	 if ($item->canEdit($item->getField('id'))) {
     // 	         $url = Toolbox::getItemTypeFormURL('PluginSimcardSimcard');
     // 	         $url.= "?itemtype=".$item->getType()."&items_id=".$item->getID()."&id=-1";
     // 	         echo "<div class='center'><a href='$url'>".__s('New SIM card', 'simcard')."</a></div><br>";
     //       	 }
     //       }
     $results = getAllDatasFromTable(getTableForItemType(__CLASS__), "`items_id` = '" . $item->getID() . "' AND `itemtype`='" . get_class($item) . "'");
     echo "<div class='spaced'>";
     echo "<form id='items' name='items' method='post' action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
     echo "<table class='tab_cadre_fixehov'>";
     echo "<tr><th colspan='6'>" . __s('Associated item') . "</th></tr>";
     if (!empty($results)) {
         echo "<tr><th></th>";
         echo "<th>" . __s('Entity') . "</th>";
         echo "<th>" . __s('Name') . "</th>";
         echo "<th>" . __s('IMSI') . "</th>";
         echo "<th>" . __s('Inventory number') . "</th>";
         echo "</tr>";
         foreach ($results as $data) {
             $tmp = new PluginSimcardSimcard();
             $tmp->getFromDB($data['plugin_simcard_simcards_id']);
             echo "<tr>";
             echo "<td>";
             if (PluginSimcardSimcard::canDelete()) {
                 echo "<input type='checkbox' name='todelete[" . $data['id'] . "]'>";
             }
             echo "</td>";
             echo "<td>";
             echo Dropdown::getDropdownName('glpi_entities', $tmp->fields['entities_id']);
             echo "</td>";
             echo "<td>";
             echo $tmp->getLink();
             echo "</td>";
             echo "<td>";
             echo $tmp->fields['serial'];
             echo "</td>";
             echo "<td>";
             echo $tmp->fields['otherserial'];
             echo "</td>";
             echo "</tr>";
         }
     }
     if (PluginSimcardSimcard::canUpdate()) {
         echo "<tr class='tab_bg_1'><td colspan='4' class='center'>";
         echo "<input type='hidden' name='items_id' value='" . $item->getID() . "'>";
         echo "<input type='hidden' name='itemtype' value='" . $item->getType() . "'>";
         $used = array();
         $query = "SELECT `id`\n                   FROM `glpi_plugin_simcard_simcards`\n                   WHERE `is_template`='0'\n                      AND `id` IN (SELECT `plugin_simcard_simcards_id`\n                                   FROM `glpi_plugin_simcard_simcards_items`)";
         foreach ($DB->request($query) as $use) {
             $used[] = $use['id'];
         }
         Dropdown::show('PluginSimcardSimcard', array('name' => "plugin_simcard_simcards_id", 'entity' => $item->fields['entities_id'], 'used' => $used));
         echo "</td>";
         echo "<td colspan='2' class='center' class='tab_bg_2'>";
         echo "<input type='submit' name='additem' value=\"" . _sx('button', 'Save') . "\" class='submit'>";
         echo "</td></tr>";
         if (!empty($results)) {
             Html::openArrowMassives('items', true);
             Html::closeArrowMassives(array('delete_items' => _sx('button', 'Disconnect')));
         }
     }
     echo "</table>";
     Html::closeForm();
     echo "</div>";
 }
开发者ID:picaro04,项目名称:simcard,代码行数:72,代码来源:simcard_item.class.php

示例7: showForItem


//.........这里部分代码省略.........
             echo "</tr>\n";
         }
         //Software licenses
         $params = array('is_dynamic' => 1, 'is_deleted' => 1, 'computers_id' => $ID);
         $first = true;
         $query = "SELECT `csv`.`id` AS `id`,\n                           `sv`.`name` AS `version`,\n                           `s`.`name` AS `software`\n                    FROM `glpi_computers_softwarelicenses` AS csv\n                    LEFT JOIN `glpi_softwarelicenses` AS sv\n                       ON (`csv`.`softwarelicenses_id` = `sv`.`id`)\n                    LEFT JOIN `glpi_softwares` AS s\n                       ON (`sv`.`softwares_id` = `s`.`id`)\n                    WHERE `csv`.`is_deleted` = '1'\n                          AND `csv`.`is_dynamic` = '1'\n                          AND `csv`.`computers_id` = '{$ID}'";
         foreach ($DB->request($query) as $line) {
             $header = true;
             if ($first) {
                 echo "<tr><th colspan='2'>" . SoftwareLicense::getTypeName(2) . "</th>" . "</tr>\n";
                 $first = false;
             }
             echo "<tr class='tab_bg_1'><td class='center' width='10'>";
             echo "<input type='checkbox' name='Computer_SoftwareLicense[" . $line['id'] . "]'></td>";
             echo "<td class='left' width='95%'>" . $line['software'] . " " . $line['version'] . "</td>";
             echo "</tr>\n";
         }
     }
     $first = true;
     $item = new NetworkPort();
     $params = array('is_dynamic' => 1, 'is_deleted' => 1, 'items_id' => $ID, 'itemtype' => $itemtype);
     $params['FIELDS'] = array('id');
     foreach ($DB->request('glpi_networkports', $params) as $line) {
         $item->getFromDB($line['id']);
         $header = true;
         if ($first) {
             echo "<tr><th colspan='2'>" . NetworkPort::getTypeName(2) . "</th></tr>\n";
             $first = false;
         }
         echo "<tr class='tab_bg_1'><td class='center' width='10'>";
         echo "<input type='checkbox' name='NetworkPort[" . $line['id'] . "]'></td>";
         echo "<td class='left' width='95%'>" . $item->getName() . "</td>";
         echo "</tr>\n";
     }
     $first = true;
     $item = new NetworkName();
     $params = array('`glpi_networknames`.`is_dynamic`' => 1, '`glpi_networknames`.`is_deleted`' => 1, '`glpi_networknames`.`itemtype`' => 'NetworkPort', '`glpi_networknames`.`items_id`' => '`glpi_networkports`.`id`', '`glpi_networkports`.`items_id`' => $ID, '`glpi_networkports`.`itemtype`' => $itemtype);
     $params['FIELDS'] = array('glpi_networknames' => 'id');
     foreach ($DB->request(array('glpi_networknames', 'glpi_networkports'), $params) as $line) {
         $item->getFromDB($line['id']);
         $header = true;
         if ($first) {
             echo "<tr><th colspan='2'>" . NetworkName::getTypeName(2) . "</th></tr>\n";
             $first = false;
         }
         echo "<tr class='tab_bg_1'><td class='center' width='10'>";
         echo "<input type='checkbox' name='NetworkName[" . $line['id'] . "]'></td>";
         echo "<td class='left' width='95%'>" . $item->getName() . "</td>";
         echo "</tr>\n";
     }
     $first = true;
     $item = new IPAddress();
     $params = array('`glpi_ipaddresses`.`is_dynamic`' => 1, '`glpi_ipaddresses`.`is_deleted`' => 1, '`glpi_ipaddresses`.`itemtype`' => 'Networkname', '`glpi_ipaddresses`.`items_id`' => '`glpi_networknames`.`id`', '`glpi_networknames`.`itemtype`' => 'NetworkPort', '`glpi_networknames`.`items_id`' => '`glpi_networkports`.`id`', '`glpi_networkports`.`items_id`' => $ID, '`glpi_networkports`.`itemtype`' => $itemtype);
     $params['FIELDS'] = array('glpi_ipaddresses' => 'id');
     foreach ($DB->request(array('glpi_ipaddresses', 'glpi_networknames', 'glpi_networkports'), $params) as $line) {
         $item->getFromDB($line['id']);
         $header = true;
         if ($first) {
             echo "<tr><th colspan='2'>" . IPAddress::getTypeName(2) . "</th></tr>\n";
             $first = false;
         }
         echo "<tr class='tab_bg_1'><td class='center' width='10'>";
         echo "<input type='checkbox' name='IPAddress[" . $line['id'] . "]'></td>";
         echo "<td class='left' width='95%'>" . $item->getName() . "</td>";
         echo "</tr>\n";
     }
     $types = Item_Devices::getDeviceTypes();
     $nb = 0;
     foreach ($types as $old => $type) {
         $nb += countElementsInTable(getTableForItemType($type), "`items_id`='{$ID}'\n                                         AND `itemtype`='{$itemtype}'\n                                         AND `is_dynamic`='1'\n                                         AND `is_deleted`='1'");
     }
     if ($nb) {
         $header = true;
         echo "<tr><th colspan='2'>" . _n('Component', 'Components', 2) . "</th></tr>\n";
         foreach ($types as $old => $type) {
             $associated_type = str_replace('Item_', '', $type);
             $associated_table = getTableForItemType($associated_type);
             $fk = getForeignKeyFieldForTable($associated_table);
             $query = "SELECT `i`.`id`,\n                             `t`.`designation` AS `name`\n                      FROM `" . getTableForItemType($type) . "` AS i\n                      LEFT JOIN `{$associated_table}` AS t\n                         ON (`t`.`id` = `i`.`{$fk}`)\n                      WHERE `itemtype` = '{$itemtype}'\n                            AND `items_id` = '{$ID}'\n                            AND `is_dynamic` = '1'\n                            AND `is_deleted` = '1'";
             foreach ($DB->request($query) as $data) {
                 echo "<tr class='tab_bg_1'><td class='center' width='10'>";
                 echo "<input type='checkbox' name='" . $type . "[" . $data['id'] . "]'></td>";
                 echo "<td class='left' width='95%'>";
                 printf(__('%1$s: %2$s'), $associated_type::getTypeName(), $data['name']);
                 echo "</td></tr>\n";
             }
         }
     }
     if ($header) {
         echo "</table>";
         Html::openArrowMassives('lock_form', true);
         Html::closeArrowMassives(array('unlock' => _sx('button', 'Unlock')));
     } else {
         echo "<tr class='tab_bg_2'>";
         echo "<td class='center' colspan='2'>" . __('No locked item') . "</td></tr>";
         echo "</table>";
     }
     Html::closeForm();
     echo "</div>\n";
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:lock.class.php

示例8: showOrderReception


//.........这里部分代码省略.........
             echo "<tr class='tab_bg_1 center'>";
             echo "<td></td>";
             echo "<td align='center'>" . $item->getTypeName() . "</td>";
             echo "<td align='center'>" . Dropdown::getDropdownName("glpi_manufacturers", $data_ref["manufacturers_id"]) . "</td>";
             echo "<td>" . $reference->getReceptionReferenceLink($data_ref) . "</td>";
             $total = $order_item->getTotalQuantityByRefAndDiscount($orders_id, $references_id, $data_ref["price_taxfree"], $data_ref["discount"]);
             echo "<td>" . $order_item->getDeliveredQuantity($orders_id, $references_id, $data_ref["price_taxfree"], $data_ref["discount"]) . " / " . $total . "</td>";
             echo "</tr></table>";
             echo "<div class='center' id='reception{$rand}' style='display:none'>";
             echo "<form method='post' name='order_reception_form{$rand}' id='order_reception_form{$rand}'" . " action=\"" . Toolbox::getItemTypeFormURL("PluginOrderReception") . "\">";
             echo "<table class='tab_cadre_fixe'>";
             echo "<tr>";
             echo "<th width='15'></th>";
             if ($typeRef != 'SoftwareLicense') {
                 echo "<th>" . __("ID") . "</th>";
             }
             echo "<th>" . __("Reference") . "</th>";
             echo "<th>" . __("Status") . "</th>";
             echo "<th>" . __("Delivery date") . "</th>";
             echo "<th>" . __("Delivery form") . "</th>";
             echo "<th>" . __("Delivery status", "order") . "</th>";
             echo "</tr>";
             $query = "SELECT `glpi_plugin_order_orders_items`.`id` AS IDD,\n                             `glpi_plugin_order_references`.`id` AS id,\n                             `glpi_plugin_order_references`.`templates_id`,\n                             `glpi_plugin_order_orders_items`.`states_id`,\n                             `glpi_plugin_order_orders_items`.`comment`,\n                             `glpi_plugin_order_orders_items`.`plugin_order_deliverystates_id`,\n                             `glpi_plugin_order_orders_items`.`delivery_date`,\n                             `glpi_plugin_order_orders_items`.`delivery_number`,\n                             `glpi_plugin_order_references`.`name`,\n                             `glpi_plugin_order_references`.`itemtype`,\n                             `glpi_plugin_order_orders_items`.`items_id`\n                    FROM `glpi_plugin_order_orders_items`, `glpi_plugin_order_references`\n                    WHERE `plugin_order_orders_id` = '{$orders_id}'\n                    AND `glpi_plugin_order_orders_items`.`plugin_order_references_id` = '" . $references_id . "'\n                    AND `glpi_plugin_order_orders_items`.`plugin_order_references_id` = `glpi_plugin_order_references`.`id`\n                    AND `glpi_plugin_order_orders_items`.`discount` LIKE '" . $discount . "'\n                    AND `glpi_plugin_order_orders_items`.`price_taxfree` LIKE '" . $price_taxfree . "' ";
             if ($typeRef == 'SoftwareLicense') {
                 $query .= " GROUP BY `glpi_plugin_order_references`.`name` ";
             }
             $query .= " ORDER BY `glpi_plugin_order_references`.`name` ";
             $result = $DB->query($query);
             $num = $DB->numrows($result);
             while ($data = $DB->fetch_array($result)) {
                 $random = mt_rand();
                 $detailID = $data["IDD"];
                 Session::addToNavigateListItems($this->getType(), $detailID);
                 echo "<tr class='tab_bg_2'>";
                 $status = 1;
                 if ($typeRef != 'SoftwareLicense') {
                     $status = $this->checkThisItemStatus($detailID, PluginOrderOrder::ORDER_DEVICE_NOT_DELIVRED);
                 }
                 if ($order_order->canDeliver() && $status) {
                     echo "<td width='15' align='left'>";
                     $sel = "";
                     if (isset($_GET["select"]) && $_GET["select"] == "all") {
                         $sel = "checked";
                     }
                     echo "<input type='checkbox' name='item[" . $detailID . "]' value='1' {$sel}>";
                     echo "</td>";
                 } else {
                     echo "<td width='15' align='left'></td>";
                 }
                 if ($typeRef != 'SoftwareLicense') {
                     echo "<td align='center'>" . $data["IDD"] . "&nbsp;";
                     Html::showTooltip($data['comment']);
                     echo "</td>";
                 }
                 echo "<td align='center'>" . $reference->getReceptionReferenceLink($data) . "</td>";
                 echo "<td align='center'>";
                 $link = Toolbox::getItemTypeFormURL($this->getType());
                 if ($canedit && $data["states_id"] == PluginOrderOrder::ORDER_DEVICE_DELIVRED) {
                     echo "<a href=\"" . $link . "?id=" . $data["IDD"] . "\">";
                 }
                 echo $this->getReceptionStatus($detailID);
                 if ($canedit && $data["states_id"] == PluginOrderOrder::ORDER_DEVICE_DELIVRED) {
                     echo "</a>";
                 }
                 echo "</td>";
                 echo "<td align='center'>" . Html::convDate($data["delivery_date"]) . "</td>";
                 echo "<td align='center'>" . $data["delivery_number"] . "</td>";
                 echo "<td align='center'>" . Dropdown::getDropdownName("glpi_plugin_order_deliverystates", $data["plugin_order_deliverystates_id"]) . "</td>";
                 echo "<input type='hidden' name='id[{$detailID}]' value='{$detailID}'>";
                 echo "<input type='hidden' name='name[{$detailID}]' value='" . $data["name"] . "'>";
                 echo "<input type='hidden' name='plugin_order_references_id[{$detailID}]' value='" . $data["id"] . "'>";
                 echo "<input type='hidden' name='itemtype[{$detailID}]' value='" . $data["itemtype"] . "'>";
                 echo "<input type='hidden' name='templates_id[{$detailID}]' value='" . $data["templates_id"] . "'>";
                 echo "<input type='hidden' name='states_id[{$detailID}]' value='" . $data["states_id"] . "'>";
             }
             echo "</table>";
             if ($order_order->canDeliver() && $this->checkItemStatus($orders_id, $references_id, PluginOrderOrder::ORDER_DEVICE_NOT_DELIVRED)) {
                 Html::openArrowMassives("order_reception_form{$rand}", true);
                 echo "<input type='hidden' name='plugin_order_orders_id' value='{$orders_id}'>";
                 $this->dropdownReceptionActions($typeRef, $references_id, $orders_id);
                 Html::closeArrowMassives(array());
                 $rand = mt_rand();
                 if ($typeRef != 'SoftwareLicense') {
                     echo "<div id='massreception" . $orders_id . $rand . "'></div>\n";
                     echo "<script type='text/javascript' >\n";
                     echo "function viewmassreception" . $orders_id . "{$rand}(){\n";
                     $params = array('plugin_order_orders_id' => $orders_id, 'plugin_order_references_id' => $references_id);
                     Ajax::updateItemJsCode("massreception" . $orders_id . $rand, $CFG_GLPI["root_doc"] . "/plugins/order/ajax/massreception.php", $params, false);
                     echo "};";
                     echo "</script>\n";
                     echo "<p><a href='javascript:viewmassreception" . $orders_id . "{$rand}();'>";
                     echo __("Take item delivery (bulk)", "order") . "</a></p><br>\n";
                 }
             }
             Html::closeForm();
             echo "</div>";
         }
         echo "<br>";
     }
 }
开发者ID:biet-j,项目名称:order,代码行数:101,代码来源:reception.class.php

示例9: showFormInfos

 /**
  *
  * Display additional information form from Model form
  * @param PluginDatainjectionModel $model
  */
 static function showFormInfos(PluginDatainjectionModel $model)
 {
     $canedit = $model->can($model->fields['id'], UPDATE);
     self::showAddInfo($model, $canedit);
     $model->loadInfos();
     $nb = count($model->getInfos());
     if ($nb > 0) {
         echo "<form method='post' name='info_form' id='info_form' action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
         echo "<table class='tab_cadre_fixe'>";
         echo "<tr>";
         if ($canedit) {
             echo "<th>&nbsp;</th>";
         }
         echo "<th>" . __('Tables', 'datainjection') . "</th>";
         echo "<th>" . __('Fields', 'datainjection') . "</th>";
         echo "<th>" . __('Mandatory information', 'datainjection') . "</th>";
         echo "</tr>";
         foreach ($model->getInfos() as $info) {
             $info->fields = Toolbox::stripslashes_deep($info->fields);
             $infos_id = $info->fields['id'];
             echo "<tr class='tab_bg_1'>";
             if ($canedit) {
                 echo "<td width='10'>";
                 $sel = "";
                 if (isset($_GET["select"]) && $_GET["select"] == "all") {
                     $sel = "checked";
                 }
                 echo "<input type='checkbox' name='item[" . $infos_id . "]' value='1' {$sel}>";
                 echo "</td>";
             }
             echo "<td class='center'>";
             $rand = PluginDatainjectionInjectionType::dropdownLinkedTypes($info, array('primary_type' => $model->fields['itemtype']));
             echo "</td>";
             echo "<td class='center'><span id='span_field_{$infos_id}'></span></td>";
             echo "<td class='center'><span id='span_mandatory_{$infos_id}'></span></td></tr>";
         }
         if ($canedit) {
             echo "<tr>";
             echo "<td class='tab_bg_2 center' colspan='4'>";
             echo "<input type='hidden' name='models_id' value='" . $model->fields['id'] . "'>";
             echo "<input type='submit' name='update' value='" . _sx('button', 'Save') . "' class='submit'>";
             echo "</td></tr>";
             Html::openArrowMassives("info_form", true);
             Html::closeArrowMassives(array('delete' => __('Delete permanently')));
         }
         echo "</table>";
         Html::closeForm();
     }
 }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:54,代码来源:info.class.php

示例10: showForItem

 static function showForItem(CommonDBTM $item)
 {
     global $DB, $LANG;
     if (!$item->can($item->getID(), 'r')) {
         return false;
     }
     if (Session::haveRight('simcard', 'w')) {
         $url = Toolbox::getItemTypeFormURL('PluginSimcardSimcard');
         $url .= "?itemtype=" . $item->getType() . "&items_id=" . $item->getID() . "&id=-1";
         echo "<div class='center'><a href='{$url}'>" . $LANG['plugin_simcard'][10] . "</a></div><br>";
     }
     $results = getAllDatasFromTable(getTableForItemType(__CLASS__), "`items_id` = '" . $item->getID() . "' AND `itemtype`='" . get_class($item) . "'");
     echo "<div class='spaced'>";
     echo "<form id='items' name='items' method='post' action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
     echo "<table class='tab_cadre_fixehov'>";
     echo "<tr><th colspan='6'>" . $LANG['document'][19] . "</th></tr>";
     if (!empty($results)) {
         echo "<tr><th></th>";
         echo "<th>" . $LANG['entity'][0] . "</th>";
         echo "<th>" . $LANG['common'][16] . "</th>";
         echo "<th>" . $LANG['common'][19] . "</th>";
         echo "<th>" . $LANG['common'][20] . "</th>";
         echo "</tr>";
         foreach ($results as $data) {
             $tmp = new PluginSimcardSimcard();
             $tmp->getFromDB($data['plugin_simcard_simcards_id']);
             echo "<tr>";
             echo "<td>";
             if (Session::haveRight('simcard', 'w')) {
                 echo "<input type='checkbox' name='todelete[" . $data['id'] . "]'>";
             }
             echo "</td>";
             echo "<td>";
             echo Dropdown::getDropdownName('glpi_entities', $tmp->fields['entities_id']);
             echo "</td>";
             echo "<td>";
             echo $tmp->getLink();
             echo "</td>";
             echo "<td>";
             echo $tmp->fields['serial'];
             echo "</td>";
             echo "<td>";
             echo $tmp->fields['otherserial'];
             echo "</td>";
             echo "</tr>";
         }
     }
     if (Session::haveRight('simcard', 'w')) {
         echo "<tr class='tab_bg_1'><td colspan='4' class='center'>";
         echo "<input type='hidden' name='items_id' value='" . $item->getID() . "'>";
         echo "<input type='hidden' name='itemtype' value='" . $item->getType() . "'>";
         $used = array();
         $query = "SELECT `id`\n                   FROM `glpi_plugin_simcard_simcards`\n                   WHERE `is_template`='0'\n                      AND `id` IN (SELECT `plugin_simcard_simcards_id`\n                                   FROM `glpi_plugin_simcard_simcards_items`)";
         foreach ($DB->request($query) as $use) {
             $used[$use['id']] = $use['id'];
         }
         Dropdown::show('PluginSimcardSimcard', array('name' => "plugin_simcard_simcards_id", 'entity' => $item->fields['entities_id'], 'used' => $used));
         echo "</td>";
         echo "<td colspan='2' class='center' class='tab_bg_2'>";
         echo "<input type='submit' name='additem' value=\"" . $LANG['buttons'][8] . "\" class='submit'>";
         echo "</td></tr>";
         if (!empty($results)) {
             Html::openArrowMassives('items');
             Html::closeArrowMassives(array('delete_items' => $LANG['buttons'][10]));
         }
     }
     echo "</table>";
     Html::closeForm();
     echo "</div>";
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:70,代码来源:simcard_item.class.php

示例11: showOrderSupplierSurvey

 public static function showOrderSupplierSurvey($ID)
 {
     global $DB, $CFG_GLPI;
     $order = new PluginOrderOrder();
     $order->getFromDB($ID);
     $survey = new self();
     $table = getTableForItemType(__CLASS__);
     Session::initNavigateListItems(__CLASS__, __("Order", "order") . " = " . $order->fields["name"]);
     $candelete = $order->can($ID, DELETE);
     $query = "SELECT * FROM `{$table}` WHERE `plugin_order_orders_id` = '{$ID}' ";
     $result = $DB->query($query);
     $rand = mt_rand();
     echo "<div class='center'>";
     echo "<form method='post' name='show_suppliersurvey{$rand}' id='show_suppliersurvey{$rand}' " . " action=\"" . Toolbox::getItemTypeFormURL(__CLASS__) . "\">";
     echo "<input type='hidden' name='plugin_order_orders_id' value='" . $ID . "'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr><th colspan='5'>" . __("Supplier quality", "order") . "</th></tr>";
     echo "<tr><th>&nbsp;</th>";
     echo "<th>" . __("Supplier") . "</th>";
     echo "<th>" . __("Note", "order") . "</th>";
     echo "<th>" . __("Comment on survey", "order") . "</th>";
     echo "</tr>";
     if ($DB->numrows($result) > 0) {
         while ($data = $DB->fetch_array($result)) {
             Session::addToNavigateListItems(__CLASS__, $data['id']);
             echo "<input type='hidden' name='item[" . $data["id"] . "]' value='" . $ID . "'>";
             echo "<tr class='tab_bg_1 center'>";
             echo "<td>";
             if ($candelete) {
                 echo "<input type='checkbox' name='check[" . $data["id"] . "]'";
                 if (isset($_POST['check']) && $_POST['check'] == 'all') {
                     echo " checked ";
                 }
                 echo ">";
             }
             echo "</td>";
             $link = Toolbox::getItemTypeFormURL(__CLASS__);
             echo "<td><a href='" . $link . "?id=" . $data["id"] . "&plugin_order_orders_id=" . $ID . "'>" . Dropdown::getDropdownName("glpi_suppliers", $data["suppliers_id"]) . "</a></td>";
             echo "<td>";
             $total = $survey->getTotalNotation($ID);
             echo $total . " / 10";
             echo "</td>";
             echo "<td>";
             echo $data["comment"];
             echo "</td>";
             echo "</tr>";
         }
         echo "</table>";
         if ($candelete) {
             echo "<div class='center'>";
             Html::openArrowMassives("show_suppliersurvey{$rand}", true);
             Html::closeArrowMassives(array("delete" => __("Delete permanently")));
             echo "</div>";
         }
     } else {
         echo "</table>";
     }
     Html::closeForm();
     echo "</div>";
 }
开发者ID:equinoxefr,项目名称:order,代码行数:60,代码来源:surveysupplier.class.php

示例12: seePreImport


//.........这里部分代码省略.........
             }
             //////////////////////HEADER///////////////
             if ($output_type == Search::HTML_OUTPUT) {
                 echo "<form method='post' name='massiveaction_form' id='massiveaction_form' action=\"../ajax/massiveaction.php\">";
             }
             //echo Search::displaySearchHeader($output_type,0); //table + div
             if ($canedit) {
                 $nbcols = 11 + $colsup;
             } else {
                 $nbcols = 10 + $colsup;
             }
             $LIST_LIMIT = $_SESSION['glpilist_limit'];
             $begin_display = $p['start'];
             $end_display = $p['start'] + $LIST_LIMIT;
             foreach ($toview as $key => $val) {
                 $linkto = '';
                 if (!isset($searchopt["PluginManufacturersimportsPreImport"][$val]['nosort']) || !$searchopt["PluginManufacturersimportsPreImport"][$val]['nosort']) {
                     $linkto = "{$target}?itemtype=" . $p['itemtype'] . "&amp;manufacturers_id=" . $p['manufacturers_id'] . "&amp;imported=" . $p['imported'] . "&amp;sort=" . $val . "&amp;order=" . ($p['order'] == "ASC" ? "DESC" : "ASC") . "&amp;start=" . $p['start'] . $globallinkto;
                 }
             }
             echo Search::showHeader($output_type, $end_display - $begin_display + 1, $nbcols);
             echo Search::showNewLine($output_type);
             $header_num = 1;
             echo Search::showHeaderItem($output_type, "", $header_num);
             echo Search::showHeaderItem($output_type, __('Name'), $header_num, $linkto, $p['sort'] == $val, $p['order']);
             if (Session::isMultiEntitiesMode()) {
                 echo Search::showHeaderItem($output_type, __('Entity'), $header_num);
             }
             echo Search::showHeaderItem($output_type, __('Serial number'), $header_num);
             echo $supplier->showItemTitle($output_type, $header_num);
             echo Search::showHeaderItem($output_type, __('Financial and administrative information'), $header_num);
             echo Search::showHeaderItem($output_type, __('Supplier attached', 'manufacturersimports'), $header_num);
             echo Search::showHeaderItem($output_type, __('New warranty attached', 'manufacturersimports'), $header_num);
             echo Search::showHeaderItem($output_type, _n('Link', 'Links', 1), $header_num);
             echo Search::showHeaderItem($output_type, _n('Status', 'Statuses', 1), $header_num);
             echo $supplier->showDocTitle($output_type, $header_num);
             // End Line for column headers
             echo Search::showEndLine($output_type);
             $i = $p['start'];
             if (isset($_GET['export_all'])) {
                 $i = 0;
             }
             if ($i > 0) {
                 $DB->data_seek($result, $i);
             }
             $row_num = 1;
             while ($i < $numrows && $i < $end_display) {
                 $i++;
                 $item_num = 1;
                 $line = $DB->fetch_array($result);
                 $compSerial = $line['serial'];
                 $compId = $line['id'];
                 $model = $line["model_name"];
                 if (!$line["itemtype"]) {
                     $line["itemtype"] = $p['itemtype'];
                 }
                 self::showImport($row_num, $item_num, $line, $output_type, $p['manufacturers_id'], $line["import_status"], $p['imported']);
                 //1.show already imported items && import_status not failed
                 if ($p['imported'] == 1) {
                     $total += 1;
                 }
             }
             echo "<tr class='tab_bg_1'><td colspan='" . ($canedit ? 11 + $colsup : 10 + $colsup) . "'>";
             echo sprintf(__('Total number of devices to import %s', 'manufacturersimports'), $total);
             echo "</td></tr>";
             // Close Table
             $title = "";
             // Create title
             if ($output_type == Search::PDF_OUTPUT_PORTRAIT || $output_type == Search::PDF_OUTPUT_LANDSCAPE) {
                 $title .= PluginManufacturersimportsPreImport::getTypeName(2) . " " . $suppliername;
             }
             echo Search::showFooter($output_type, $title);
             //massive action
             if ($canedit && $output_type == Search::HTML_OUTPUT) {
                 if ($_SESSION['glpilist_limit'] < Toolbox::get_max_input_vars()) {
                     Html::openArrowMassives("massiveaction_form", false);
                     self::dropdownMassiveAction($compId, $p['itemtype'], $p['manufacturers_id'], $p['start'], $p['imported']);
                     Html::closeArrowMassives(array());
                 } else {
                     echo "<table class='tab_cadre' width='80%'><tr class='tab_bg_1'>" . "<td><span class='b'>";
                     echo __('Selection too large, massive action disabled.') . "</span>";
                     if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {
                         echo "<br>" . __('To increase the limit: change max_input_vars or suhosin.post.max_vars in php configuration.');
                     }
                     echo "</td></tr></table>";
                 }
                 Html::closeForm();
             } else {
                 echo "</table>";
                 echo "</div>";
             }
             echo "<br>";
             if ($output_type == Search::HTML_OUTPUT) {
                 self::printPager($p['start'], $numrows, $target, $parameters, $p['itemtype']);
             }
         } else {
             echo "<div align='center'><b>" . __('No device finded', 'manufacturersimports') . "</b></div>";
         }
     }
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:101,代码来源:preimport.class.php

示例13: showExportForm

 /**
  * show Export Form from popup.php
  * for odt export
  */
 function showExportForm($opt)
 {
     global $LANG;
     $classname = $opt["classname"];
     if ($classname) {
         echo "<div align='center'>";
         echo "<form method='POST' action='export.php?switchto=odtall&classname=" . $classname . "' \n                     id='exportform' name='exportform'>\n";
         echo "<table class='tab_cadre_fixe'>";
         echo "<tr><th colspan='4'>";
         echo $LANG['plugin_mreporting']["export"][0];
         echo "</th></tr>";
         $reports = $this->getAllReports(false, $opt);
         foreach ($reports as $class => $report) {
             $i = 0;
             $nb_per_line = 2;
             $graphs = array();
             foreach ($report['functions'] as $function) {
                 if ($function['gtype'] === "sunburst") {
                     continue;
                 }
                 if ($function['is_active']) {
                     $graphs[$classname][$function['category_func']][] = $function;
                 }
             }
             foreach ($graphs[$classname] as $cat => $graph) {
                 echo "<tr class='tab_bg_1'><th colspan='4'>" . $cat . "</th></tr>";
                 foreach ($graph as $k => $v) {
                     if ($v['is_active']) {
                         if ($i % $nb_per_line == 0) {
                             if ($i != 0) {
                                 echo "</tr>";
                             }
                             echo "<tr class='tab_bg_1'>";
                         }
                         echo "<td>";
                         echo "<input type='checkbox' name='check[" . $v['function'] . $classname . "]'";
                         if (isset($_POST['check']) && $_POST['check'] == 'all') {
                             echo " checked ";
                         }
                         echo ">";
                         echo "</td>";
                         echo "<td>";
                         echo "<img src='" . $v['pic'] . "' />&nbsp;";
                         echo $v['title'];
                         echo "</td>";
                         $i++;
                     }
                 }
                 while ($i % $nb_per_line != 0) {
                     echo "<td width='10'>&nbsp;</td>";
                     echo "<td>&nbsp;</td>";
                     $i++;
                 }
             }
             echo "</tr>";
         }
         echo "<tr class='tab_bg_2'>";
         echo "<td colspan ='4' class='center'>";
         echo "<div align='center'>";
         echo "<table><tr class='tab_bg_2'>";
         echo "<td>";
         echo __("Begin date");
         echo "</td>";
         echo "<td>";
         $date1 = strftime("%Y-%m-%d", time() - 30 * 24 * 60 * 60);
         Html::showDateFormItem("date1", $date1, true);
         echo "</td>";
         echo "<td>";
         echo __("End date");
         echo "</td>";
         echo "<td>";
         $date2 = strftime("%Y-%m-%d");
         Html::showDateFormItem("date2", $date2, true);
         echo "</td>";
         echo "</tr>";
         echo "</table>";
         echo "</div>";
         echo "</td>";
         echo "</tr>";
         echo "</table>";
         Html::openArrowMassives("exportform", true);
         $option[0] = $LANG['plugin_mreporting']["export"][3];
         $option[1] = $LANG['plugin_mreporting']["export"][4];
         Dropdown::showFromArray("withdata", $option, array());
         echo "&nbsp;";
         echo "<input type='button' id='export_submit'  value='" . __("Export") . "' class='submit'>";
         echo "</td></tr>";
         echo "</table>";
         Html::closeForm();
         echo "</div>";
         echo "<script type='text/javascript'>\n            Ext.get('export_submit').on('click', function () {\n               //get new crsf\n               Ext.Ajax.request({\n                  url: '../ajax/get_new_crsf_token.php',\n                  success: function(response, opts) {\n                     var token = response.responseText;\n                     Ext.select('#exportform input[name=_glpi_csrf_token]').set({'value': token});\n                     document.getElementById('exportform').submit();\n                  }\n               });\n            });\n         </script>";
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:97,代码来源:common.class.php

示例14: execute


//.........这里部分代码省略.........
                         $param .= "{$key}=" . urlencode($val);
                     }
                 }
                 Dropdown::showOutputFormat();
                 Html::closeForm();
                 echo "</td></tr>";
                 echo "</table></div>";
                 Html::printPager($start, $nbtot, $_SERVER['PHP_SELF'], $param);
             }
         }
     }
     if (!isset($_POST["display_type"]) || $_POST["display_type"] == Search::HTML_OUTPUT) {
         if (isset($options['withmassiveaction']) && class_exists($options['withmassiveaction'])) {
             echo "<form method='post' name='massiveaction_form' id='massiveaction_form' action=\"" . $CFG_GLPI["root_doc"] . "/front/massiveaction.php\">";
         }
     }
     plugin_reports_checkRight($this->plug, $this->name, "r");
     if ($res && $nbtot > 0) {
         $nbcols = $DB->num_fields($res);
         $nbrows = $DB->numrows($res);
         echo Search::showHeader($output_type, $nbrows, $nbcols, true);
         echo Search::showNewLine($output_type);
         $num = 1;
         // fill $sqlcols with default sql query fields so we can validate $columns
         $sqlcols = array();
         for ($i = 0; $i < $nbcols; $i++) {
             $colname = $DB->field_name($res, $i);
             $sqlcols[] = $colname;
         }
         $colsname = array();
         // if $columns is not empty, display $columns
         if (count($this->columns) > 0) {
             foreach ($this->columns as $colname => $column) {
                 // display only $columns that are valid
                 if (in_array($colname, $sqlcols)) {
                     $column->showTitle($output_type, $num);
                     $colsname[$colname] = $column;
                 }
             }
         } else {
             // else display default columns from SQL query
             foreach ($sqlcols as $colname) {
                 $column = new PluginReportsColumn($colname, $colname);
                 $column->showTitle($output_type, $num);
                 $colsname[$colname] = $column;
             }
         }
         echo Search::showEndLine($output_type);
         $prev = "";
         for ($row_num = 2; $row = $DB->fetch_assoc($res); $row_num++) {
             $crt = "";
             foreach ($this->group_by as $colname) {
                 if (isset($row[$colname])) {
                     $crt .= $row[$colname] . "####";
                 }
             }
             echo Search::showNewLine($output_type);
             $num = 1;
             foreach ($colsname as $colname => $column) {
                 //If value needs to be modified on the fly
                 if (isset($this->columns_mapping[$colname]) && isset($this->columns_mapping[$colname][$row[$colname]])) {
                     $new_value = $this->columns_mapping[$colname][$row[$colname]];
                     $row[$colname] = $new_value;
                 }
                 if (!in_array($colname, $this->group_by)) {
                     $column->showValue($output_type, $row, $num, $row_num);
                 } else {
                     if ($crt == $prev) {
                         $column->showValue($output_type, $output_type == Search::CSV_OUTPUT ? $row : array(), $num, $row_num);
                     } else {
                         $column->showValue($output_type, $row, $num, $row_num, true);
                     }
                 }
             }
             // Each column
             echo Search::showEndLine($output_type);
             $prev = $crt;
         }
         // Each row
         if (isset($options['withtotal']) && $options['withtotal']) {
             echo Search::showNewLine($output_type);
             $num = 1;
             foreach ($colsname as $colname => $column) {
                 $column->showTotal($output_type, $num, $row_num);
             }
             echo Search::showEndLine($output_type);
         }
     }
     echo Search::showFooter($output_type, $title);
     if (!isset($_POST["display_type"]) || $_POST["display_type"] == Search::HTML_OUTPUT) {
         if (isset($options['withmassiveaction']) && class_exists($options['withmassiveaction'])) {
             Html::openArrowMassives("massiveaction_form", true);
             Dropdown::showForMassiveAction($options['withmassiveaction']);
             $options = array();
             Html::closeArrowMassives($options);
             Html::closeForm();
         }
         Html::footer();
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:autoreport.class.php

示例15: showItemFromPlugin


//.........这里部分代码省略.........
         echo "<td colspan='3' class='center'><b>";
         if ($computer_tot != 0) {
             echo __('Total Servers', 'racks') . " : " . $computer_tot . " (" . $computer_size_tot . __('U', 'racks') . ")<br>";
         }
         if ($networking_tot != 0) {
             echo __('Total Network equipements', 'racks') . " : " . $networking_tot . " (" . $networking_size_tot . __('U', 'racks') . ")<br>";
         }
         if ($peripheral_tot != 0) {
             echo __('Total Peripherals', 'racks') . " : " . $peripheral_tot . " (" . $peripheral_size_tot . __('U', 'racks') . ")<br>";
         }
         if ($others_tot != 0) {
             echo __('Total Others', 'racks') . " : " . $others_tot . " (" . $others_size_tot . __('U', 'racks') . ")<br>";
         }
         //number of U availables
         $available = $PluginRacksRack->fields['rack_size'] - $computer_size_tot - $networking_size_tot - $peripheral_size_tot - $others_size_tot;
         if ($available > 0) {
             echo "<font color='green'>" . $available . " " . __('U availables', 'racks') . "</font>";
         } else {
             echo "<font color='red'>" . $available . " " . __('U availables', 'racks') . "</font>";
         }
         echo "</b></td>";
         echo "<td colspan='3' class='center'><b>" . __('Total power Cords', 'racks') . " : " . $nbcordons_tot . "</b><br>";
         echo "<b>" . __('Amperage on power Cords', 'racks') . " : " . $cordons_amps_tot . " " . __('amps', 'racks') . "</b></td>";
         echo "<td class='center'><b>" . Html::formatNumber($amps_tot, true) . " " . __('amps', 'racks') . "</b></td>";
         echo "<td class='center'><b>" . Html::formatNumber($dissip_tot, true) . " ";
         $PluginRacksConfig->getUnit("dissipation");
         echo "</b></td>";
         echo "<td class='center'><b>" . Html::formatNumber($flow_rate_tot, true) . " ";
         $PluginRacksConfig->getUnit("rate");
         echo "</b></td>";
         echo "<td class='center'><b>" . Html::formatNumber($weight_tot, true) . " ";
         $PluginRacksConfig->getUnit("weight");
         echo "</b></td>";
         echo "</tr>";
         echo "</table></div>";
         if ($canedit) {
             Html::openArrowMassives("racks_form{$rand}", true);
             Html::closeArrowMassives(array('deleteDevice' => _sx('button', 'Delete permanently')));
         } else {
             echo "<input type='hidden' name='rack_size' value='" . $PluginRacksRack->fields['rack_size'] . "'>";
             echo "</table></div>";
         }
         Html::closeForm();
         ////////////////////////////////////////////////////
         // Recherche des racks a gauche et a droite
         // Recuperation de la rangee
         $qPos = "SELECT `name`\n                                                        FROM `glpi_plugin_racks_roomlocations`\n                                                        WHERE `id` = '" . $PluginRacksRack->fields['plugin_racks_roomlocations_id'] . "' ";
         $rPos = $DB->query($qPos);
         $nbPos = $DB->numrows($rPos);
         $pos = "";
         $next = "";
         $prev = "";
         if ($nbPos != 0) {
             $dataPos = $DB->fetch_array($rPos);
             $pos = $dataPos['name'];
         }
         // Incrementation & docrementation de la lettre de rang
         if (!empty($pos)) {
             // Z is the last letter...
             if ($pos[0] != "Z") {
                 $next = chr(ord($pos[0]) + 1);
                 for ($h = 1; $h < strlen($pos); $h++) {
                     $next .= $pos[$h];
                 }
             }
             // A is the first letter....
             if ($pos[0] != "A") {
                 $prev = chr(ord($pos[0]) - 1);
                 for ($h = 1; $h < strlen($pos); $h++) {
                     $prev .= $pos[$h];
                 }
             }
             $qLeft = "SELECT `glpi_plugin_racks_racks`.`id`, `glpi_plugin_racks_roomlocations`.`name`\n            FROM `glpi_plugin_racks_racks`\n            LEFT JOIN `glpi_plugin_racks_roomlocations`\n            ON (`glpi_plugin_racks_roomlocations`.`id` = `glpi_plugin_racks_racks`.`plugin_racks_roomlocations_id`)\n            WHERE `glpi_plugin_racks_racks`.`is_deleted` = '0' AND `glpi_plugin_racks_roomlocations`.`name` = '" . $prev . "' " . getEntitiesRestrictRequest(" AND ", "glpi_plugin_racks_racks", '', '', $PluginRacksRack->maybeRecursive());
             $rLeft = $DB->query($qLeft);
             $nb = $DB->numrows($rLeft);
             echo "<br><br>";
             echo "<div align='center'><table border='0' width='950px'><tr><td class='left'>";
             if ($nb != 0) {
                 $left_racks = $DB->fetch_array($rLeft);
                 echo "<a href =\"" . $CFG_GLPI["root_doc"] . "/plugins/racks/front/rack.form.php?id=" . $left_racks['id'] . "\">\n               <img src=\"" . $CFG_GLPI["root_doc"] . "/pics/left.png\" alt=''>&nbsp;" . __('Left rack enclosure', 'racks') . " " . $left_racks['name'] . "</a>";
             } else {
                 echo __('No rack enclosure on the left', 'racks');
             }
             echo "</td>";
             echo "<td>";
             echo "</td>";
             echo "<td class='right'>";
             $qRight = "SELECT `glpi_plugin_racks_racks`.`id`, `glpi_plugin_racks_roomlocations`.`name`\n            FROM `glpi_plugin_racks_racks`\n            LEFT JOIN `glpi_plugin_racks_roomlocations`\n            ON (`glpi_plugin_racks_roomlocations`.`id` = `glpi_plugin_racks_racks`.`plugin_racks_roomlocations_id`)\n            WHERE `glpi_plugin_racks_racks`.`is_deleted` = '0' AND `glpi_plugin_racks_roomlocations`.`name` = '" . $next . "' " . getEntitiesRestrictRequest(" AND ", "glpi_plugin_racks_racks", '', '', $PluginRacksRack->maybeRecursive());
             $rRight = $DB->query($qRight);
             $nb = $DB->numrows($rRight);
             if ($nb != 0) {
                 $right_racks = $DB->fetch_array($rRight);
                 echo "<a href =\"" . $CFG_GLPI["root_doc"] . "/plugins/racks/front/rack.form.php?id=" . $right_racks['id'] . "\">" . __('Right rack enclosure', 'racks') . " " . $right_racks['name'] . "&nbsp;<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/right.png\" alt=''></a>";
             } else {
                 echo __('No rack enclosure on the right', 'racks');
             }
             echo "</td></tr></table></div>";
         }
     }
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:101,代码来源:rack_item.class.php


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