[ Index ]
 

Code source de osCommerce 2.2ms2-060817

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/catalog/admin/ -> index.php (source)

   1  <?php
   2  /*
   3    $Id: index.php,v 1.19 2003/06/27 09:38:31 dgw_ Exp $
   4  
   5    osCommerce, Open Source E-Commerce Solutions
   6    http://www.oscommerce.com
   7  
   8    Copyright (c) 2006 osCommerce
   9  
  10    Released under the GNU General Public License
  11  */
  12  
  13    require ('includes/application_top.php');
  14  
  15    $cat = array(array('title' => BOX_HEADING_CONFIGURATION,
  16                       'image' => 'configuration.gif',
  17                       'href' => tep_href_link(FILENAME_CONFIGURATION, 'selected_box=configuration&gID=1'),
  18                       'children' => array(array('title' => BOX_CONFIGURATION_MYSTORE, 'link' => tep_href_link(FILENAME_CONFIGURATION, 'selected_box=configuration&gID=1')),
  19                                           array('title' => BOX_CONFIGURATION_LOGGING, 'link' => tep_href_link(FILENAME_CONFIGURATION, 'selected_box=configuration&gID=10')),
  20                                           array('title' => BOX_CONFIGURATION_CACHE, 'link' => tep_href_link(FILENAME_CONFIGURATION, 'selected_box=configuration&gID=11')))),
  21                 array('title' => BOX_HEADING_MODULES,
  22                       'image' => 'modules.gif',
  23                       'href' => tep_href_link(FILENAME_MODULES, 'selected_box=modules&set=payment'),
  24                       'children' => array(array('title' => BOX_MODULES_PAYMENT, 'link' => tep_href_link(FILENAME_MODULES, 'selected_box=modules&set=payment')),
  25                                           array('title' => BOX_MODULES_SHIPPING, 'link' => tep_href_link(FILENAME_MODULES, 'selected_box=modules&set=shipping')))),
  26                 array('title' => BOX_HEADING_CATALOG,
  27                       'image' => 'catalog.gif',
  28                       'href' => tep_href_link(FILENAME_CATEGORIES, 'selected_box=catalog'),
  29                       'children' => array(array('title' => CATALOG_CONTENTS, 'link' => tep_href_link(FILENAME_CATEGORIES, 'selected_box=catalog')),
  30                                           array('title' => BOX_CATALOG_MANUFACTURERS, 'link' => tep_href_link(FILENAME_MANUFACTURERS, 'selected_box=catalog')))),
  31                 array('title' => BOX_HEADING_LOCATION_AND_TAXES,
  32                       'image' => 'location.gif',
  33                       'href' => tep_href_link(FILENAME_COUNTRIES, 'selected_box=taxes'),
  34                       'children' => array(array('title' => BOX_TAXES_COUNTRIES, 'link' => tep_href_link(FILENAME_COUNTRIES, 'selected_box=taxes')),
  35                                           array('title' => BOX_TAXES_GEO_ZONES, 'link' => tep_href_link(FILENAME_GEO_ZONES, 'selected_box=taxes')))),
  36                 array('title' => BOX_HEADING_CUSTOMERS,
  37                       'image' => 'customers.gif',
  38                       'href' => tep_href_link(FILENAME_CUSTOMERS, 'selected_box=customers'),
  39                       'children' => array(array('title' => BOX_CUSTOMERS_CUSTOMERS, 'link' => tep_href_link(FILENAME_CUSTOMERS, 'selected_box=customers')),
  40                                           array('title' => BOX_CUSTOMERS_ORDERS, 'link' => tep_href_link(FILENAME_ORDERS, 'selected_box=customers')))),
  41                 array('title' => BOX_HEADING_LOCALIZATION,
  42                       'image' => 'localization.gif',
  43                       'href' => tep_href_link(FILENAME_CURRENCIES, 'selected_box=localization'),
  44                       'children' => array(array('title' => BOX_LOCALIZATION_CURRENCIES, 'link' => tep_href_link(FILENAME_CURRENCIES, 'selected_box=localization')),
  45                                           array('title' => BOX_LOCALIZATION_LANGUAGES, 'link' => tep_href_link(FILENAME_LANGUAGES, 'selected_box=localization')))),
  46                 array('title' => BOX_HEADING_REPORTS,
  47                       'image' => 'reports.gif',
  48                       'href' => tep_href_link(FILENAME_STATS_PRODUCTS_PURCHASED, 'selected_box=reports'),
  49                       'children' => array(array('title' => REPORTS_PRODUCTS, 'link' => tep_href_link(FILENAME_STATS_PRODUCTS_PURCHASED, 'selected_box=reports')),
  50                                           array('title' => REPORTS_ORDERS, 'link' => tep_href_link(FILENAME_STATS_CUSTOMERS, 'selected_box=reports')))),
  51                 array('title' => BOX_HEADING_TOOLS,
  52                       'image' => 'tools.gif',
  53                       'href' => tep_href_link(FILENAME_BACKUP, 'selected_box=tools'),
  54                       'children' => array(array('title' => TOOLS_BACKUP, 'link' => tep_href_link(FILENAME_BACKUP, 'selected_box=tools')),
  55                                           array('title' => TOOLS_BANNERS, 'link' => tep_href_link(FILENAME_BANNER_MANAGER, 'selected_box=tools')),
  56                                           array('title' => TOOLS_FILES, 'link' => tep_href_link(FILENAME_FILE_MANAGER, 'selected_box=tools')))));
  57  
  58    $languages = tep_get_languages();
  59    $languages_array = array();
  60    $languages_selected = DEFAULT_LANGUAGE;
  61    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
  62      $languages_array[] = array('id' => $languages[$i]['code'],
  63                                 'text' => $languages[$i]['name']);
  64      if ($languages[$i]['directory'] == $language) {
  65        $languages_selected = $languages[$i]['code'];
  66      }
  67    }
  68  ?>
  69  <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  70  <html <?php echo HTML_PARAMS; ?>>
  71  <head>
  72  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  73  <title><?php echo TITLE; ?></title>
  74  <style type="text/css"><!--
  75  a { color:#080381; text-decoration:none; }
  76  a:hover { color:#aabbdd; text-decoration:underline; }
  77  a.text:link, a.text:visited { color: #000000; text-decoration: none; }
  78  a:text:hover { color: #000000; text-decoration: underline; }
  79  a.main:link, a.main:visited { color: #ffffff; text-decoration: none; }
  80  A.main:hover { color: #ffffff; text-decoration: underline; }
  81  a.sub:link, a.sub:visited { color: #dddddd; text-decoration: none; }
  82  A.sub:hover { color: #dddddd; text-decoration: underline; }
  83  .heading { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 20px; font-weight: bold; line-height: 1.5; color: #D3DBFF; }
  84  .main { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 17px; font-weight: bold; line-height: 1.5; color: #ffffff; }
  85  .sub { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; line-height: 1.5; color: #dddddd; }
  86  .text { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; line-height: 1.5; color: #000000; }
  87  .menuBoxHeading { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #ffffff; font-weight: bold; background-color: #7187bb; border-color: #7187bb; border-style: solid; border-width: 1px; }
  88  .infoBox { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #080381; background-color: #f2f4ff; border-color: #7187bb; border-style: solid; border-width: 1px; }
  89  .smallText { font-family: Verdana, Arial, sans-serif; font-size: 10px; }
  90  //--></style>
  91  </head>
  92  <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
  93  
  94  <table border="0" width="600" height="100%" cellspacing="0" cellpadding="0" align="center" valign="middle">
  95    <tr>
  96      <td><table border="0" width="600" height="440" cellspacing="0" cellpadding="1" align="center" valign="middle">
  97        <tr bgcolor="#000000">
  98          <td><table border="0" width="600" height="440" cellspacing="0" cellpadding="0">
  99            <tr bgcolor="#ffffff" height="50">
 100              <td height="50"><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce', '204', '50'); ?></td>
 101              <td align="right" class="text" nowrap><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . HEADER_TITLE_ADMINISTRATION . '</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="' . tep_catalog_href_link() . '">' . HEADER_TITLE_ONLINE_CATALOG . '</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="http://www.oscommerce.com" target="_blank">' . HEADER_TITLE_SUPPORT_SITE . '</a>'; ?>&nbsp;&nbsp;</td>
 102            </tr>
 103            <tr bgcolor="#080381">
 104              <td colspan="2"><table border="0" width="460" height="390" cellspacing="0" cellpadding="2">
 105                <tr valign="top">
 106                  <td width="140" valign="top"><table border="0" width="140" height="390" cellspacing="0" cellpadding="2">
 107                    <tr>
 108                      <td valign="top"><br>
 109  <?php
 110    $heading = array();
 111    $contents = array();
 112  
 113    $heading[] = array('params' => 'class="menuBoxHeading"',
 114                       'text'  => 'osCommerce');
 115  
 116    $contents[] = array('params' => 'class="infoBox"',
 117                        'text'  => '<a href="http://www.oscommerce.com" target="_blank">' . BOX_ENTRY_SUPPORT_SITE . '</a><br>' .
 118                                   '<a href="http://forums.oscommerce.com" target="_blank">' . BOX_ENTRY_SUPPORT_FORUMS . '</a><br>' .
 119                                   '<a href="http://www.oscommerce.com/community/contributions" target="_blank">' . BOX_ENTRY_CONTRIBUTIONS . '</a>');
 120  
 121    $box = new box;
 122    echo $box->menuBox($heading, $contents);
 123  
 124    echo '<br>';
 125  
 126    $orders_contents = '';
 127    $orders_status_query = tep_db_query("select orders_status_name, orders_status_id from " . TABLE_ORDERS_STATUS . " where language_id = '" . $languages_id . "'");
 128    while ($orders_status = tep_db_fetch_array($orders_status_query)) {
 129      $orders_pending_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS . " where orders_status = '" . $orders_status['orders_status_id'] . "'");
 130      $orders_pending = tep_db_fetch_array($orders_pending_query);
 131      $orders_contents .= '<a href="' . tep_href_link(FILENAME_ORDERS, 'selected_box=customers&status=' . $orders_status['orders_status_id']) . '">' . $orders_status['orders_status_name'] . '</a>: ' . $orders_pending['count'] . '<br>';
 132    }
 133    $orders_contents = substr($orders_contents, 0, -4);
 134  
 135    $heading = array();
 136    $contents = array();
 137  
 138    $heading[] = array('params' => 'class="menuBoxHeading"',
 139                       'text'  => BOX_TITLE_ORDERS);
 140  
 141    $contents[] = array('params' => 'class="infoBox"',
 142                        'text'  => $orders_contents);
 143  
 144    $box = new box;
 145    echo $box->menuBox($heading, $contents);
 146  
 147    echo '<br>';
 148  
 149    $customers_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS);
 150    $customers = tep_db_fetch_array($customers_query);
 151    $products_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS . " where products_status = '1'");
 152    $products = tep_db_fetch_array($products_query);
 153    $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS);
 154    $reviews = tep_db_fetch_array($reviews_query);
 155  
 156    $heading = array();
 157    $contents = array();
 158  
 159    $heading[] = array('params' => 'class="menuBoxHeading"',
 160                       'text'  => BOX_TITLE_STATISTICS);
 161  
 162    $contents[] = array('params' => 'class="infoBox"',
 163                        'text'  => BOX_ENTRY_CUSTOMERS . ' ' . $customers['count'] . '<br>' .
 164                                   BOX_ENTRY_PRODUCTS . ' ' . $products['count'] . '<br>' .
 165                                   BOX_ENTRY_REVIEWS . ' ' . $reviews['count']);
 166  
 167    $box = new box;
 168    echo $box->menuBox($heading, $contents);
 169  
 170    echo '<br>';
 171  
 172    $contents = array();
 173  
 174    if (getenv('HTTPS') == 'on') {
 175      $size = ((getenv('SSL_CIPHER_ALGKEYSIZE')) ? getenv('SSL_CIPHER_ALGKEYSIZE') . '-bit' : '<i>' . BOX_CONNECTION_UNKNOWN . '</i>');
 176      $contents[] = array('params' => 'class="infoBox"',
 177                          'text' => tep_image(DIR_WS_ICONS . 'locked.gif', ICON_LOCKED, '', '', 'align="right"') . sprintf(BOX_CONNECTION_PROTECTED, $size));
 178    } else {
 179      $contents[] = array('params' => 'class="infoBox"',
 180                          'text' => tep_image(DIR_WS_ICONS . 'unlocked.gif', ICON_UNLOCKED, '', '', 'align="right"') . BOX_CONNECTION_UNPROTECTED);
 181    }
 182  
 183    $box = new box;
 184    echo $box->tableBlock($contents);
 185  ?>
 186                      </td>
 187                    </tr>
 188                  </table></td>
 189                  <td width="460"><table border="0" width="460" height="390" cellspacing="0" cellpadding="2">
 190                    <tr>
 191                      <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 192                        <tr><?php echo tep_draw_form('languages', 'index.php', '', 'get'); ?>
 193                          <td class="heading"><?php echo HEADING_TITLE; ?></td>
 194                          <td align="right"><?php echo tep_draw_pull_down_menu('language', $languages_array, $languages_selected, 'onChange="this.form.submit();"'); ?></td>
 195                        </form></tr>
 196                      </table></td>
 197                    </tr>
 198  <?php
 199    $col = 2;
 200    $counter = 0;
 201    for ($i = 0, $n = sizeof($cat); $i < $n; $i++) {
 202      $counter++;
 203      if ($counter < $col) {
 204        echo '                  <tr>' . "\n";
 205      }
 206  
 207      echo '                    <td><table border="0" cellspacing="0" cellpadding="2">' . "\n" .
 208           '                      <tr>' . "\n" .
 209           '                        <td><a href="' . $cat[$i]['href'] . '">' . tep_image(DIR_WS_IMAGES . 'categories/' . $cat[$i]['image'], $cat[$i]['title'], '32', '32') . '</a></td>' . "\n" .
 210           '                        <td><table border="0" cellspacing="0" cellpadding="2">' . "\n" .
 211           '                          <tr>' . "\n" .
 212           '                            <td class="main"><a href="' . $cat[$i]['href'] . '" class="main">' . $cat[$i]['title'] . '</a></td>' . "\n" .
 213           '                          </tr>' . "\n" .
 214           '                          <tr>' . "\n" .
 215           '                            <td class="sub">';
 216  
 217      $children = '';
 218      for ($j = 0, $k = sizeof($cat[$i]['children']); $j < $k; $j++) {
 219        $children .= '<a href="' . $cat[$i]['children'][$j]['link'] . '" class="sub">' . $cat[$i]['children'][$j]['title'] . '</a>, ';
 220      }
 221      echo substr($children, 0, -2);
 222  
 223      echo '</td> ' . "\n" .
 224           '                          </tr>' . "\n" .
 225           '                        </table></td>' . "\n" .
 226           '                      </tr>' . "\n" .
 227           '                    </table></td>' . "\n";
 228  
 229      if ($counter >= $col) {
 230        echo '                  </tr>' . "\n";
 231        $counter = 0;
 232      }
 233    }
 234  ?>
 235                  </table></td>
 236                </tr>
 237              </table></td>
 238            </tr>
 239          </table></td>
 240        </tr>
 241        <tr>
 242          <td><?php require(DIR_WS_INCLUDES . 'footer.php'); ?></td>
 243        </tr>
 244      </table></td>
 245    </tr>
 246  </table>
 247  
 248  </body>
 249  
 250  </html>


Généré le : Mon Nov 26 19:48:25 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics