[ Index ]
osCommerce Docs :: PHP Cross Reference For osCommerce 2.2 MS2
Provided By OSCdox.com

/admin/ -> index.php (source)

[Summary view]

   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) 2003 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://www.oscommerce.com/community.php/forum" target="_blank">' . BOX_ENTRY_SUPPORT_FORUMS . '</a><br>' .
 119                                   '<a href="http://www.oscommerce.com/community.php/mlists" target="_blank">' . BOX_ENTRY_MAILING_LISTS . '</a><br>' .
 120                                   '<a href="http://www.oscommerce.com/community.php/bugs" target="_blank">' . BOX_ENTRY_BUG_REPORTS . '</a><br>' .
 121                                   '<a href="http://www.oscommerce.com/community.php/faq" target="_blank">' . BOX_ENTRY_FAQ . '</a><br>' .
 122                                   '<a href="http://www.oscommerce.com/community.php/irc" target="_blank">' . BOX_ENTRY_LIVE_DISCUSSIONS . '</a><br>' .
 123                                   '<a href="http://www.oscommerce.com/community.php/cvs" target="_blank">' . BOX_ENTRY_CVS_REPOSITORY . '</a><br>' .
 124                                   '<a href="http://www.oscommerce.com/about.php/portal" target="_blank">' . BOX_ENTRY_INFORMATION_PORTAL . '</a>');
 125  
 126    $box = new box;
 127    echo $box->menuBox($heading, $contents);
 128  
 129    echo '<br>';
 130  
 131    $orders_contents = '';
 132    $orders_status_query = tep_db_query("select orders_status_name, orders_status_id from " . TABLE_ORDERS_STATUS . " where language_id = '" . $languages_id . "'");
 133    while ($orders_status = tep_db_fetch_array($orders_status_query)) {
 134      $orders_pending_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS . " where orders_status = '" . $orders_status['orders_status_id'] . "'");
 135      $orders_pending = tep_db_fetch_array($orders_pending_query);
 136      $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>';
 137    }
 138    $orders_contents = substr($orders_contents, 0, -4);
 139  
 140    $heading = array();
 141    $contents = array();
 142  
 143    $heading[] = array('params' => 'class="menuBoxHeading"',
 144                       'text'  => BOX_TITLE_ORDERS);
 145  
 146    $contents[] = array('params' => 'class="infoBox"',
 147                        'text'  => $orders_contents);
 148  
 149    $box = new box;
 150    echo $box->menuBox($heading, $contents);
 151  
 152    echo '<br>';
 153  
 154    $customers_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS);
 155    $customers = tep_db_fetch_array($customers_query);
 156    $products_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS . " where products_status = '1'");
 157    $products = tep_db_fetch_array($products_query);
 158    $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS);
 159    $reviews = tep_db_fetch_array($reviews_query);
 160  
 161    $heading = array();
 162    $contents = array();
 163  
 164    $heading[] = array('params' => 'class="menuBoxHeading"',
 165                       'text'  => BOX_TITLE_STATISTICS);
 166  
 167    $contents[] = array('params' => 'class="infoBox"',
 168                        'text'  => BOX_ENTRY_CUSTOMERS . ' ' . $customers['count'] . '<br>' .
 169                                   BOX_ENTRY_PRODUCTS . ' ' . $products['count'] . '<br>' .
 170                                   BOX_ENTRY_REVIEWS . ' ' . $reviews['count']);
 171  
 172    $box = new box;
 173    echo $box->menuBox($heading, $contents);
 174  
 175    echo '<br>';
 176  
 177    $contents = array();
 178  
 179    if (getenv('HTTPS') == 'on') {
 180      $size = ((getenv('SSL_CIPHER_ALGKEYSIZE')) ? getenv('SSL_CIPHER_ALGKEYSIZE') . '-bit' : '<i>' . BOX_CONNECTION_UNKNOWN . '</i>');
 181      $contents[] = array('params' => 'class="infoBox"',
 182                          'text' => tep_image(DIR_WS_ICONS . 'locked.gif', ICON_LOCKED, '', '', 'align="right"') . sprintf(BOX_CONNECTION_PROTECTED, $size));
 183    } else {
 184      $contents[] = array('params' => 'class="infoBox"',
 185                          'text' => tep_image(DIR_WS_ICONS . 'unlocked.gif', ICON_UNLOCKED, '', '', 'align="right"') . BOX_CONNECTION_UNPROTECTED);
 186    }
 187  
 188    $box = new box;
 189    echo $box->tableBlock($contents);
 190  ?>
 191                      </td>
 192                    </tr>
 193                  </table></td>
 194                  <td width="460"><table border="0" width="460" height="390" cellspacing="0" cellpadding="2">
 195                    <tr>
 196                      <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 197                        <tr><?php echo tep_draw_form('languages', 'index.php', '', 'get'); ?>
 198                          <td class="heading"><?php echo HEADING_TITLE; ?></td>
 199                          <td align="right"><?php echo tep_draw_pull_down_menu('language', $languages_array, $languages_selected, 'onChange="this.form.submit();"'); ?></td>
 200                        </form></tr>
 201                      </table></td>
 202                    </tr>
 203  <?php
 204    $col = 2;
 205    $counter = 0;
 206    for ($i = 0, $n = sizeof($cat); $i < $n; $i++) {
 207      $counter++;
 208      if ($counter < $col) {
 209        echo '                  <tr>' . "\n";
 210      }
 211  
 212      echo '                    <td><table border="0" cellspacing="0" cellpadding="2">' . "\n" .
 213           '                      <tr>' . "\n" .
 214           '                        <td><a href="' . $cat[$i]['href'] . '">' . tep_image(DIR_WS_IMAGES . 'categories/' . $cat[$i]['image'], $cat[$i]['title'], '32', '32') . '</a></td>' . "\n" .
 215           '                        <td><table border="0" cellspacing="0" cellpadding="2">' . "\n" .
 216           '                          <tr>' . "\n" .
 217           '                            <td class="main"><a href="' . $cat[$i]['href'] . '" class="main">' . $cat[$i]['title'] . '</a></td>' . "\n" .
 218           '                          </tr>' . "\n" .
 219           '                          <tr>' . "\n" .
 220           '                            <td class="sub">';
 221  
 222      $children = '';
 223      for ($j = 0, $k = sizeof($cat[$i]['children']); $j < $k; $j++) {
 224        $children .= '<a href="' . $cat[$i]['children'][$j]['link'] . '" class="sub">' . $cat[$i]['children'][$j]['title'] . '</a>, ';
 225      }
 226      echo substr($children, 0, -2);
 227  
 228      echo '</td> ' . "\n" .
 229           '                          </tr>' . "\n" .
 230           '                        </table></td>' . "\n" .
 231           '                      </tr>' . "\n" .
 232           '                    </table></td>' . "\n";
 233  
 234      if ($counter >= $col) {
 235        echo '                  </tr>' . "\n";
 236        $counter = 0;
 237      }
 238    }
 239  ?>
 240                  </table></td>
 241                </tr>
 242              </table></td>
 243            </tr>
 244          </table></td>
 245        </tr>
 246        <tr>
 247          <td><?php require (DIR_WS_INCLUDES . 'footer.php'); ?></td>
 248        </tr>
 249      </table></td>
 250    </tr>
 251  </table>
 252  
 253  </body>
 254  
 255  </html>


Generated: Tue Nov 4 23:53:39 2003
Hosted By :: AABox.com
Cross-referenced by PHPXref 0.4