コード例 #1
0
ファイル: Customers.php プロジェクト: kdexter/oscommerce
 public function __construct()
 {
     Registry::get('Language')->loadIniFile('modules/Dashboard/Customers.php');
     $this->_title = OSCOM::getDef('admin_indexmodules_customers_title');
     $this->_title_link = OSCOM::getLink(null, 'Customers');
     if (Access::hasAccess(OSCOM::getSite(), 'Customers')) {
         $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . '  <thead>' . '    <tr>' . '      <th>' . OSCOM::getDef('admin_indexmodules_customers_table_heading_customers') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_customers_table_heading_date') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_customers_table_heading_status') . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
         $Qcustomers = Registry::get('Database')->query('select customers_id, customers_gender, customers_lastname, customers_firstname, customers_status, date_account_created from :table_customers order by date_account_created desc limit 6');
         $Qcustomers->execute();
         $counter = 0;
         while ($Qcustomers->next()) {
             $customer_icon = osc_icon('people.png');
             if (ACCOUNT_GENDER > -1) {
                 switch ($Qcustomers->value('customers_gender')) {
                     case 'm':
                         $customer_icon = osc_icon('user_male.png');
                         break;
                     case 'f':
                         $customer_icon = osc_icon('user_female.png');
                         break;
                 }
             }
             $this->_data .= '    <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . '      <td>' . osc_link_object(OSCOM::getLink(null, 'Customers', 'cID=' . $Qcustomers->valueInt('customers_id') . '&action=save'), $customer_icon . '&nbsp;' . $Qcustomers->valueProtected('customers_firstname') . ' ' . $Qcustomers->valueProtected('customers_lastname')) . '</td>' . '      <td>' . $Qcustomers->value('date_account_created') . '</td>' . '      <td align="center">' . osc_icon($Qcustomers->valueInt('customers_status') === 1 ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif', null, null) . '</td>' . '    </tr>';
             $counter++;
         }
         $this->_data .= '  </tbody>' . '</table>';
     }
 }
コード例 #2
0
ファイル: Controller.php プロジェクト: hakankarar/oscommerce
 public static function hasAccess($application)
 {
     if (!isset($_SESSION[OSCOM::getSite()]['id'])) {
         $redirect = false;
         if ($application != 'Login') {
             $_SESSION[OSCOM::getSite()]['redirect_origin'] = $application;
             $redirect = true;
         }
         if ($redirect === true) {
             osc_redirect_admin(OSCOM::getLink(null, 'Login'));
         }
     }
     return Access::hasAccess(OSCOM::getSite(), $application);
 }
コード例 #3
0
ファイル: Reviews.php プロジェクト: kdexter/oscommerce
 public function __construct()
 {
     Registry::get('Language')->loadIniFile('modules/Dashboard/Reviews.php');
     $this->_title = OSCOM::getDef('admin_indexmodules_reviews_title');
     $this->_title_link = OSCOM::getLink(null, 'Reviews');
     if (Access::hasAccess(OSCOM::getSite(), 'Reviews')) {
         $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . '  <thead>' . '    <tr>' . '      <th>' . OSCOM::getDef('admin_indexmodules_reviews_table_heading_products') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_reviews_table_heading_language') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_reviews_table_heading_rating') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_reviews_table_heading_date') . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
         $Qreviews = Registry::get('Database')->query('select r.reviews_id, r.products_id, greatest(r.date_added, greatest(r.date_added, r.last_modified)) as date_last_modified, r.reviews_rating, pd.products_name, l.name as languages_name, l.code as languages_code from :table_reviews r left join :table_products_description pd on (r.products_id = pd.products_id and r.languages_id = pd.language_id), :table_languages l where r.languages_id = l.languages_id order by date_last_modified desc limit 6');
         $Qreviews->execute();
         $counter = 0;
         while ($Qreviews->next()) {
             $this->_data .= '    <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . '      <td>' . osc_link_object(OSCOM::getLink(null, 'Reviews', 'rID=' . $Qreviews->valueInt('reviews_id') . '&action=save'), osc_icon('reviews.png') . '&nbsp;' . $Qreviews->value('products_name')) . '</td>' . '      <td align="center">' . Registry::get('Language')->showImage($Qreviews->value('languages_code')) . '</td>' . '      <td align="center">' . osc_image('../images/stars_' . $Qreviews->valueInt('reviews_rating') . '.png', $Qreviews->valueInt('reviews_rating') . '/5') . '</td>' . '      <td>' . $Qreviews->value('date_last_modified') . '</td>' . '    </tr>';
             $counter++;
         }
         $this->_data .= '  </tbody>' . '</table>';
     }
 }
コード例 #4
0
ファイル: Orders.php プロジェクト: kdexter/oscommerce
 public function __construct()
 {
     Registry::get('Language')->loadIniFile('modules/Dashboard/Orders.php');
     $this->_title = OSCOM::getDef('admin_indexmodules_orders_title');
     $this->_title_link = OSCOM::getLink(null, 'Orders');
     if (Access::hasAccess(OSCOM::getSite(), 'Orders')) {
         $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . '  <thead>' . '    <tr>' . '      <th>' . OSCOM::getDef('admin_indexmodules_orders_table_heading_orders') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_orders_table_heading_total') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_orders_table_heading_date') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_orders_table_heading_status') . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
         $Qorders = Registry::get('Database')->query('select o.orders_id, o.customers_name, greatest(o.date_purchased, ifnull(o.last_modified, "1970-01-01")) as date_last_modified, s.orders_status_name, ot.text as order_total from :table_orders o, :table_orders_total ot, :table_orders_status s where o.orders_id = ot.orders_id and ot.class = "total" and o.orders_status = s.orders_status_id and s.language_id = :language_id order by date_last_modified desc limit 6');
         $Qorders->bindInt(':language_id', Registry::get('Language')->getID());
         $Qorders->execute();
         $counter = 0;
         while ($Qorders->next()) {
             $this->_data .= '    <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . '      <td>' . osc_link_object(OSCOM::getLink(null, 'Orders', 'oID=' . $Qorders->valueInt('orders_id') . '&action=save'), osc_icon('orders.png') . '&nbsp;' . $Qorders->valueProtected('customers_name')) . '</td>' . '      <td>' . strip_tags($Qorders->value('order_total')) . '</td>' . '      <td>' . $Qorders->value('date_last_modified') . '</td>' . '      <td>' . $Qorders->value('orders_status_name') . '</td>' . '    </tr>';
             $counter++;
         }
         $this->_data .= '  </tbody>' . '</table>';
     }
 }
コード例 #5
0
 public function __construct()
 {
     Registry::get('Language')->loadIniFile('modules/IndexModules/AdministratorsLog.php');
     $this->_title = OSCOM::getDef('admin_indexmodules_administratorslog_title');
     $this->_title_link = OSCOM::getLink(null, 'AdministratorsLog');
     if (Access::hasAccess(OSCOM::getSite(), 'AdministratorsLog')) {
         $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . '  <thead>' . '    <tr>' . '      <th>' . OSCOM::getDef('admin_indexmodules_administratorslog_table_heading_users') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_administratorslog_table_heading_module') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_administratorslog_table_heading_date') . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
         $Qlog = Registry::get('Database')->query('select count(al.id) as total, al.id, al.module, a.user_name, al.datestamp from :table_administrators_log al, :table_administrators a where al.module in (":modules") and al.administrators_id = a.id group by al.id order by al.id desc limit 6');
         $Qlog->bindRaw(':modules', implode('", "', array_keys($_SESSION[OSCOM::getSite()]['access'])));
         $Qlog->execute();
         $counter = 0;
         while ($Qlog->next()) {
             $this->_data .= '    <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . '      <td>' . osc_link_object(OSCOM::getLink(null, 'AdministratorsLog&lID=' . $Qlog->valueInt('id') . '&action=info'), osc_icon('log.png') . '&nbsp;' . $Qlog->valueProtected('user_name')) . '</td>' . '      <td>' . $Qlog->value('module') . ' (' . $Qlog->valueInt('total') . ')</td>' . '      <td>' . $Qlog->value('datestamp') . '</td>' . '    </tr>';
             $counter++;
         }
         $this->_data .= '  </tbody>' . '</table>';
     }
 }
コード例 #6
0
ファイル: ErrorLog.php プロジェクト: hakankarar/oscommerce
 public function __construct()
 {
     Registry::get('Language')->loadIniFile('modules/IndexModules/ErrorLog.php');
     $this->_title = OSCOM::getDef('admin_indexmodules_errorlog_title');
     $this->_title_link = OSCOM::getLink(null, 'ErrorLog');
     if (Access::hasAccess(OSCOM::getSite(), 'ErrorLog')) {
         $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . '  <thead>' . '    <tr>' . '      <th>' . OSCOM::getDef('admin_indexmodules_errorlog_table_heading_date') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_errorlog_table_heading_message') . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
         if (ErrorHandler::getTotalEntries() > 0) {
             $counter = 0;
             foreach (ErrorHandler::getAll(6) as $row) {
                 $this->_data .= '    <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . '      <td style="white-space: nowrap;">' . Registry::get('Template')->getIcon(16, 'errorlog.png') . '&nbsp;' . DateTime::getShort(DateTime::fromUnixTimestamp($row['timestamp']), true) . '</td>' . '      <td>' . osc_output_string_protected(substr($row['message'], 0, 60)) . '..</td>' . '    </tr>';
                 $counter++;
             }
         } else {
             $this->_data .= '    <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');">' . '      <td colspan="2">' . osc_icon('tick.png') . '&nbsp;' . OSCOM::getDef('admin_indexmodules_errorlog_no_errors_found') . '</td>' . '    </tr>';
         }
         $this->_data .= '  </tbody>' . '</table>';
     }
 }
コード例 #7
0
 public function __construct()
 {
     Registry::get('Language')->loadIniFile('modules/Dashboard/Products.php');
     $this->_title = OSCOM::getDef('admin_indexmodules_products_title');
     $this->_title_link = OSCOM::getLink(null, 'Products');
     if (Access::hasAccess(OSCOM::getSite(), 'Products')) {
         if (!isset($osC_Currencies)) {
             if (!class_exists('osC_Currencies')) {
                 include 'includes/classes/currencies.php';
             }
             $osC_Currencies = new osC_Currencies();
         }
         $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . '  <thead>' . '    <tr>' . '      <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_products') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_price') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_date') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_status') . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
         $Qproducts = Registry::get('PDO')->query('select products_id, greatest(products_date_added, products_last_modified) as date_last_modified from :table_products where parent_id is null order by date_last_modified desc limit 6');
         $Qproducts->execute();
         $counter = 0;
         while ($Qproducts->fetch()) {
             $data = osC_Products_Admin::get($Qproducts->valueInt('products_id'));
             $products_icon = osc_icon('products.png');
             $products_price = $data['products_price'];
             if (!empty($data['variants'])) {
                 $products_icon = osc_icon('attach.png');
                 $products_price = null;
                 foreach ($data['variants'] as $variant) {
                     if ($products_price === null || $variant['data']['price'] < $products_price) {
                         $products_price = $variant['data']['price'];
                     }
                 }
                 if ($products_price === null) {
                     $products_price = 0;
                 }
             }
             $this->_data .= '    <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . '      <td>' . osc_link_object(OSCOM::getLink(null, 'Products', 'id=' . (int) $data['products_id'] . '&action=save'), $products_icon . '&nbsp;' . osc_output_string_protected($data['products_name'])) . '</td>' . '      <td>' . (!empty($data['variants']) ? 'from ' : '') . $osC_Currencies->format($products_price) . '</td>' . '      <td>' . $Qproducts->value('date_last_modified') . '</td>' . '      <td align="center">' . osc_icon((int) $data['products_status'] === 1 ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif', null, null) . '</td>' . '    </tr>';
             $counter++;
         }
         $this->_data .= '  </tbody>' . '</table>';
     }
 }
コード例 #8
0
ファイル: Controller.php プロジェクト: haraldpdl/oscommerce
 public static function hasAccess($application) {
   return isset($_SESSION[OSCOM::getSite()]['id']) && Access::hasAccess(OSCOM::getSite(), $application);
 }
コード例 #9
0
ファイル: Products.php プロジェクト: haraldpdl/oscommerce
    public function __construct() {
      $OSCOM_Language = Registry::get('Language');

      $OSCOM_Language->loadIniFile('modules/Dashboard/Products.php');

      $this->_title = OSCOM::getDef('admin_indexmodules_products_title');
      $this->_title_link = OSCOM::getLink(null, 'Products');

      if ( Access::hasAccess(OSCOM::getSite(), 'Products') ) {
        if ( !Registry::exists('Currencies') ) {
          Registry::set('Currencies', new Currencies());
        }

        $OSCOM_Currencies = Registry::get('Currencies');

        $data = array('language_id' => $OSCOM_Language->getID(),
                      'batch_pageset' => 1,
                      'batch_max_results' => 6);

        $result = OSCOM::callDB('Admin\Products\GetAll', $data);

        foreach ( $result['entries'] as &$p ) {
          if ( $p['has_children'] === 1 ) {
            $p['products_price_formatted'] = $OSCOM_Currencies->format($p['products_price_min']);

            if ( $p['products_price_min'] != $p['products_price_max'] ) {
              $p['products_price_formatted'] .= ' - ' . $OSCOM_Currencies->format($p['products_price_max']);
            }

            $p['products_quantity'] = '(' . $p['products_quantity_variants'] . ')';
          } else {
            $p['products_price_formatted'] = $OSCOM_Currencies->format($p['products_price']);
          }
        }

        $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' .
                       '  <thead>' .
                       '    <tr>' .
                       '      <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_products') . '</th>' .
                       '      <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_price') . '</th>' .
                       '      <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_date') . '</th>' .
                       '      <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_status') . '</th>' .
                       '    </tr>' .
                       '  </thead>' .
                       '  <tbody>';

/*
        $Qproducts = Registry::get('PDO')->query('select products_id, greatest(products_date_added, products_last_modified) as date_last_modified from :table_products where parent_id is null order by date_last_modified desc limit 6');
        $Qproducts->execute();

        $counter = 0;

        while ( $Qproducts->fetch() ) {
          $data = osC_Products_Admin::get($Qproducts->valueInt('products_id'));

          $products_icon = osc_icon('products.png');
          $products_price = $data['products_price'];

          if ( !empty($data['variants']) ) {
            $products_icon = osc_icon('attach.png');
            $products_price = null;

            foreach ( $data['variants'] as $variant ) {
              if ( ($products_price === null) || ($variant['data']['price'] < $products_price) ) {
                $products_price = $variant['data']['price'];
              }
            }

            if ( $products_price === null ) {
              $products_price = 0;
            }
          }
*/

        $counter = 0;

        foreach ( $result['entries'] as $p ) {
          if ( $p['has_children'] === 1 ) {
            $products_icon = HTML::icon('products.png');
          } else {
            $products_icon = HTML::icon('attach.png');
          }

          $this->_data .= '    <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' .
                          '      <td>' . HTML::link(OSCOM::getLink(null, 'Products', 'Save&id=' . (int)$p['products_id']), $products_icon . '&nbsp;' . HTML::outputProtected($p['products_name'])) . '</td>' .
                          '      <td>' . $p['products_price_formatted'] . '</td>' .
                          '      <td>' . $p['products_last_modified'] . '</td>' .
                          '      <td align="center">' . HTML::icon(((int)$p['products_status'] === 1) ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif', null, null) . '</td>' .
                          '    </tr>';

          $counter++;
        }

        $this->_data .= '  </tbody>' .
                        '</table>';
      }
    }