📄 main.php
字号:
<?php/* $Id: main.php 1498 2007-03-29 14:04:50Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2007 osCommerce This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2 (1991) as published by the Free Software Foundation.*/ $breadcrumb_array = array(); for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) { $category = $osC_CategoryTree->getData($cPath_array[$i]); $breadcrumb_array[] = osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))), '<b>' . $category['name'] . '</b>'); } $categories_array = array(); foreach ($osC_CategoryTree->getTree() as $value) { $categories_array[] = array('id' => $value['id'], 'text' => $value['title']); }?><h1><?php echo osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule()), $osC_Template->getPageTitle()); ?></h1><?php if ( $osC_MessageStack->size($osC_Template->getModule()) > 0 ) { echo $osC_MessageStack->output($osC_Template->getModule()); }?><div style="float: right;"> <form name="search" action="<?php echo osc_href_link_admin(FILENAME_DEFAULT); ?>" method="get"><?php echo osc_draw_hidden_field($osC_Template->getModule()); ?> <?php echo $osC_Language->get('operation_title_search') . ' ' . osc_draw_input_field('search') . osc_draw_pull_down_menu('cPath', array_merge(array(array('id' => '', 'text' => $osC_Language->get('top_category'))), $categories_array)) . '<input type="submit" value="GO" class="operationButton" />'; ?> <?php echo '<input type="button" value="' . $osC_Language->get('button_insert') . '" onclick="document.location.href=\'' . osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&page=' . $_GET['page'] . '&cPath=' . $_GET['cPath'] . '&search=' . $_GET['search'] . '&action=save') . '\';" class="infoBoxButton" />'; ?> </form></div><p><?php echo implode(' » ', $breadcrumb_array) . ' '; ?></p><?php $Qcategories = $osC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from :table_categories c, :table_categories_description cd where c.categories_id = cd.categories_id and cd.language_id = :language_id'); if ( isset($_GET['search']) && !empty($_GET['search']) ) { $Qcategories->appendQuery('and cd.categories_name like :categories_name'); $Qcategories->bindValue(':categories_name', '%' . $_GET['search'] . '%'); } else { $Qcategories->appendQuery('and c.parent_id = :parent_id'); $Qcategories->bindInt(':parent_id', $current_category_id); } $Qcategories->appendQuery('order by c.sort_order, cd.categories_name'); $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES); $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION); $Qcategories->bindInt(':language_id', $osC_Language->getID()); $Qcategories->setBatchLimit($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS); $Qcategories->execute();?><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><?php echo $Qcategories->getBatchTotalPages($osC_Language->get('batch_results_number_of_entries')); ?></td> <td align="right"><?php echo $Qcategories->getBatchPageLinks('page', $osC_Template->getModule() . '&cPath=' . $_GET['cPath'] . '&search=' . $_GET['search'], false); ?></td> </tr></table><form name="batch" action="#" method="post"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable"> <thead> <tr> <th><?php echo $osC_Language->get('table_heading_categories'); ?></th> <th width="150"><?php echo $osC_Language->get('table_heading_action'); ?></th> <th align="center" width="20"><?php echo osc_draw_checkbox_field('batchFlag', null, null, 'onclick="flagCheckboxes(this);"'); ?></th> </tr> </thead> <tfoot> <tr> <th align="right" colspan="2"><?php echo '<input type="image" src="' . osc_icon_raw('move.png') . '" title="' . $osC_Language->get('icon_move') . '" onclick="document.batch.action=\'' . osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&page=' . $_GET['page'] . '&cPath=' . $_GET['cPath'] . '&search=' . $_GET['search'] . '&action=batchMove') . '\';" /> <input type="image" src="' . osc_icon_raw('trash.png') . '" title="' . $osC_Language->get('icon_trash') . '" onclick="document.batch.action=\'' . osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&page=' . $_GET['page'] . '&cPath=' . $_GET['cPath'] . '&search=' . $_GET['search'] . '&action=batchDelete') . '\';" />'; ?></th> <th align="center" width="20"><?php echo osc_draw_checkbox_field('batchFlag', null, null, 'onclick="flagCheckboxes(this);"'); ?></th> </tr> </tfoot> <tbody><?php while ($Qcategories->next()) {?> <tr onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);"> <td><?php echo osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&cPath=' . $osC_CategoryTree->buildBreadcrumb($Qcategories->valueInt('categories_id'))), osc_icon('folder.png') . ' ' . $Qcategories->value('categories_name')); ?></td> <td align="right"><?php echo osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&page=' . $_GET['page'] . '&cPath=' . $_GET['cPath'] . '&search=' . $_GET['search'] . '&cID=' . $Qcategories->valueInt('categories_id') . '&action=save'), osc_icon('edit.png')) . ' ' . osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&page=' . $_GET['page'] . '&cPath=' . $_GET['cPath'] . '&search=' . $_GET['search'] . '&cID=' . $Qcategories->valueInt('categories_id') . '&action=move'), osc_icon('move.png')) . ' ' . osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&page=' . $_GET['page'] . '&cPath=' . $_GET['cPath'] . '&search=' . $_GET['search'] . '&cID=' . $Qcategories->valueInt('categories_id') . '&action=delete'), osc_icon('trash.png'));?> </td> <td align="center"><?php echo osc_draw_checkbox_field('batch[]', $Qcategories->valueInt('categories_id'), null, 'id="batch' . $Qcategories->valueInt('categories_id') . '"'); ?></td> </tr><?php }?> </tbody></table></form><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td style="opacity: 0.5; filter: alpha(opacity=50);"><?php echo '<b>' . $osC_Language->get('table_action_legend') . '</b> ' . osc_icon('edit.png') . ' ' . $osC_Language->get('icon_edit') . ' ' . osc_icon('move.png') . ' ' . $osC_Language->get('icon_move') . ' ' . osc_icon('trash.png') . ' ' . $osC_Language->get('icon_trash'); ?></td> <td align="right"><?php echo $Qcategories->getBatchPagesPullDownMenu('page', $osC_Template->getModule()); ?></td> </tr></table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -