Exemplo n.º 1
0
 function start()
 {
     global $lC_Language, $lC_Currencies, $lC_Vqmod;
     include $lC_Vqmod->modCheck('includes/classes/currencies.php');
     $lC_Currencies = new lC_Currencies();
     if (isset($_SESSION['currency']) == false || isset($_GET['currency']) || USE_DEFAULT_LANGUAGE_CURRENCY == '1' && $lC_Currencies->getCode($lC_Language->getCurrencyID()) != $_SESSION['currency']) {
         if (isset($_GET['currency']) && $lC_Currencies->exists($_GET['currency'])) {
             $_SESSION['currency'] = $_GET['currency'];
         } else {
             $_SESSION['currency'] = USE_DEFAULT_LANGUAGE_CURRENCY == '1' ? $lC_Currencies->getCode($lC_Language->getCurrencyID()) : DEFAULT_CURRENCY;
         }
         if (isset($_SESSION['cartID'])) {
             unset($_SESSION['cartID']);
         }
     }
     return true;
 }
Exemplo n.º 2
0
 protected function _setData()
 {
     global $lC_Database, $lC_Language, $lC_Vqmod;
     if (!$this->enabled) {
         $this->_data = '';
     } else {
         require_once $lC_Vqmod->modCheck('../includes/classes/currencies.php');
         $lC_Currencies = new lC_Currencies();
         $lastMonth = @date("m", @strtotime("-1 month"));
         $currentDay = @date("d");
         $currentMonth = @date("m");
         $currentYear = @date("Y");
         $Qorders = $lC_Database->query('select o.orders_id, ot.value as order_total, greatest(o.date_purchased, ifnull(o.last_modified, "1970-01-01")) as date_last_modified from :table_orders o, :table_orders_total ot where o.orders_id = ot.orders_id and ot.class = "total" order by date_last_modified desc limit 6');
         $Qorders->bindTable(':table_orders', TABLE_ORDERS);
         $Qorders->bindTable(':table_orders_total', TABLE_ORDERS_TOTAL);
         $Qorders->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
         $Qorders->bindInt(':language_id', $lC_Language->getID());
         $Qorders->execute();
         $last = 0;
         $today = 0;
         $current = 0;
         $annual = 0;
         while ($Qorders->next()) {
             $year = substr($Qorders->value('date_last_modified'), 0, 4);
             $month = substr($Qorders->value('date_last_modified'), 5, 2);
             $day = substr($Qorders->value('date_last_modified'), 8, 2);
             if ($currentYear == $year) {
                 $annual += $Qorders->valueDecimal('order_total');
                 if ($month == $currentMonth) {
                     $current += $Qorders->valueDecimal('order_total');
                     if ($day == $currentDay) {
                         $today += $Qorders->valueDecimal('order_total');
                     }
                 }
                 if ($month == $lastMonth) {
                     $last += $Qorders->valueDecimal('order_total');
                 }
             }
         }
         $llast = $last > 0 ? $last : 0.01;
         $growth = ($current - $last) / $llast;
         $ribbonText = $growth > 0 ? '<span class="ribbon-inner green-gradient glossy"><span class="fact-progress">+' . number_format($growth, 1) . '% ▲</span></span>' : '<span class="ribbon-inner red-gradient glossy"><span class="fact-progress">-' . number_format($growth, 1) . '% ▼</span></span>';
         $this->_data = '<div class="four-columns six-columns-tablet twelve-columns-mobile">' . '  <style>#revenueTable h3, h4 { margin:0; }</style>' . '  <div class="block large-margin-bottom">' . '    <h3 class="block-title">' . $this->_title . '</h3>' . '    <span class="ribbon">' . $ribbonText . '</span>' . '    <div class="with-padding">' . '      <table width="100%" id="revenueTable" class="responsive-table">' . '        <tr>' . '          <td height="24px;" width="99px" class="orange" style="border-right:1px solid #ccc; padding:8px 0 0 10px;"><h3>' . $lC_Currencies->format($today) . '</h3></td>' . '          <td height="24px;" style="padding:12px 0 0 10px;"><h4>' . $lC_Language->get('summary_revenue_text_todays') . ' ' . $lC_Language->get('summary_revenue_text_totals') . '</h4></td>' . '        </tr>' . '        <tr><td colspan="2"><hr></td></tr>' . '        <tr>' . '          <td height="24px;" width="99px" style="border-right:1px solid #ccc; padding:8px 0 0 10px;"><h3>' . $lC_Currencies->format($current) . '</h3></td>' . '          <td height="24px;" style="padding:12px 0 0 10px;"><h4>' . $lC_Language->get('month_' . $currentMonth) . ' ' . $lC_Language->get('summary_revenue_text_totals') . '</h4></td>' . '        </tr>' . '        <tr><td colspan="2"><hr></td></tr>' . '        <tr>' . '          <td height="24px;" width="99px" style="border-right:1px solid #ccc; padding:8px 0 0 10px;"><h3>' . $lC_Currencies->format($last) . '</h3></td>' . '          <td height="24px;" style="padding:12px 0 0 10px;"><h4>' . $lC_Language->get('month_' . $lastMonth) . ' ' . $lC_Language->get('summary_revenue_text_totals') . '</h4></td>' . '        </tr>' . '        <tr><td colspan="2"><hr></td></tr>' . '        <tr>' . '          <td height="24px;" width="99px" style="border-right:1px solid #ccc; padding:8px 0 0 10px;"><h3>' . $lC_Currencies->format($annual) . '</h3></td>' . '          <td height="24px;" style="padding:12px 0 0 10px;"><h4>' . $currentYear . ' ' . $lC_Language->get('summary_revenue_heading_yearly') . ' ' . $lC_Language->get('summary_revenue_text_totals') . '</h4></td>' . '        </tr>' . '      </table>' . '    </div>' . '  </div>' . '</div>';
         $Qorders->freeResult();
     }
 }
Exemplo n.º 3
0
 protected function _setData()
 {
     global $lC_Database, $lC_Language, $lC_Currencies, $lC_Vqmod;
     if (!$this->enabled) {
         $this->_data = '';
     } else {
         $this->_data = '<div class="four-columns six-columns-tablet twelve-columns-mobile clear-both">' . '  <h2 class="relative thin">' . $this->_title . '</h2>' . '  <ul class="list spaced">';
         if (!isset($lC_Currencies)) {
             if (!class_exists('lC_Currencies')) {
                 include $lC_Vqmod->modCheck('../includes/classes/currencies.php');
             }
             $lC_Currencies = new lC_Currencies();
         }
         $Qproducts = $lC_Database->query('select p.products_id, greatest(p.products_date_added, p.products_last_modified) as date_last_modified, pd.products_name from :table_products p, :table_products_description pd where parent_id = 0 and p.products_id = pd.products_id and pd.language_id = :language_id order by date_last_modified desc limit 6');
         $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
         $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
         $Qproducts->bindInt(':language_id', $lC_Language->getID());
         $Qproducts->execute();
         while ($Qproducts->next()) {
             $data = lC_Products_Admin::get($Qproducts->valueInt('products_id'));
             $products_icon = lc_icon_admin('products.png');
             $products_price = $data['products_price'];
             if (!empty($data['variants'])) {
                 $products_icon = lc_icon_admin('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 .= '    <li>' . '      <span class="list-link icon-bag icon-blue" title="' . $lC_Language->get('edit') . '">' . '        <strong>' . (!empty($data['variants']) ? $lC_Language->get('text_from') . ' ' : '') . $lC_Currencies->format($products_price) . '</strong> <span class="anthracite">' . lc_output_string_protected($data['products_name']) . '</span>' . '      </span>' . '      <div class="absolute-right compact show-on-parent-hover">' . '        <a href="' . ((int) ($_SESSION['admin']['access']['products'] < 3) ? '#' : lc_href_link_admin(FILENAME_DEFAULT, 'products=' . $Qproducts->valueInt('products_id') . '&cID=' . $category_id . '&action=save')) . '" class="button icon-pencil' . ((int) ($_SESSION['admin']['access']['products'] < 3) ? ' disabled' : NULL) . '">' . $lC_Language->get('icon_edit') . '</a>' . '        <a href="' . ((int) ($_SESSION['admin']['access']['products'] < 3) ? '#' : 'javascript://" onclick="copyProduct(\'' . $Qproducts->valueInt('products_id') . '\', \'' . urlencode($Qproducts->value('products_name')) . '\')') . '" class="button icon-pages with-tooltip' . ((int) ($_SESSION['admin']['access']['products'] < 3) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_copy') . '"></a>' . '        <a href="' . ((int) ($_SESSION['admin']['access']['products'] < 4) ? '#' : 'javascript://" onclick="deleteProduct(\'' . $Qproducts->valueInt('products_id') . '\', \'' . urlencode($Qproducts->value('products_name')) . '\')') . '" class="button icon-trash with-tooltip' . ((int) ($_SESSION['admin']['access']['products'] < 4) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_delete') . '"></a>' . '      </div>' . '    </li>';
         }
         $this->_data .= '  </ul>' . '</div>';
         $Qproducts->freeResult();
         $this->_data .= $this->loadModal();
     }
 }
Exemplo n.º 4
0
 public static function getData($id)
 {
     global $lC_Database;
     $lC_Currencies = new lC_Currencies();
     $lC_Tax = new lC_Tax_Admin();
     $lC_GeoIP = lC_GeoIP_Admin::load();
     if ($lC_GeoIP->isInstalled()) {
         $lC_GeoIP->activate();
     }
     $Qwho = $lC_Database->query('select * from :table_whos_online where session_id = :session_id');
     $Qwho->bindTable(':table_whos_online', TABLE_WHOS_ONLINE);
     $Qwho->bindValue(':session_id', $id);
     $Qwho->execute();
     $data = $Qwho->toArray();
     $data['timeOnline'] = gmdate('H:i:s', time() - $Qwho->value('time_entry'));
     $data['ipAddress'] = $Qwho->value('ip_address');
     if ($lC_GeoIP->isActive() && $lC_GeoIP->isValid($Qwho->value('ip_address'))) {
         $data['ipAddress'] .= '<p>' . implode('<br />', $lC_GeoIP->getData($Qwho->value('ip_address'))) . '</p>';
     }
     $data['entryTime'] = @date('H:i:s', $Qwho->value('time_entry'));
     $data['lastClick'] = @date('H:i:s', $Qwho->value('time_last_click'));
     $Qwho->freeResult();
     // get cart contents
     if (STORE_SESSIONS == 'database') {
         $Qsession = $lC_Database->query('select value from :table_sessions where id = :id');
         $Qsession->bindTable(':table_sessions', TABLE_SESSIONS);
         $Qsession->bindValue(':id', $id);
         $Qsession->execute();
         $session_data = trim($Qsession->value('value'));
     } else {
         if (file_exists($lC_Session->getSavePath() . '/sess_' . $id) && filesize($lC_Session->getSavePath() . '/sess_' . $id) > 0) {
             $session_data = trim(file_get_contents($lC_Session->getSavePath() . '/sess_' . $id));
         }
     }
     $navigation = unserialize(lc_get_serialized_variable($session_data, 'lC_NavigationHistory_data', 'array'));
     $last_page = end($navigation);
     $last_page_url = $last_page['page'];
     if (isset($last_page['get']['osCsid'])) {
         unset($last_page['get']['osCsid']);
     }
     if (sizeof($last_page['get']) > 0) {
         $last_page_url .= '?' . lc_array_to_string($last_page['get']);
     }
     $currency = unserialize(lc_get_serialized_variable($session_data, 'currency', 'string'));
     $cart = unserialize(lc_get_serialized_variable($session_data, 'lC_ShoppingCart_data', 'array'));
     $data['cartContents'] = '';
     if (!empty($cart['contents'])) {
         $data['cartContents'] .= '<tr>' . "\n" . '  <td colspan="2">&nbsp;</td>' . "\n" . '</tr>' . "\n" . '<tr>' . "\n" . '  <td width="200px" valign="top"><b>' . $lC_Language->get('field_shopping_cart_contents') . '</b></td>' . "\n" . '  <td><table border="0" cellspacing="0" cellpadding="2">' . "\n";
         foreach ($cart['contents'] as $product) {
             $data['cartContents'] .= '<tr>' . "\n" . '  <td align="right">' . $product['quantity'] . ' x</td>' . "\n" . '  <td>' . $product['name'] . '</td>' . "\n" . '</tr>' . "\n";
         }
         $data['cartContents'] .= '  </table></td>' . "\n" . '</tr>' . "\n" . '<tr>' . "\n" . '  <td width="200px"><b>' . $lC_Language->get('field_shopping_cart_total') . '</b></td>' . "\n" . '  <td>' . $lC_Currencies->format($cart['total_cost'], true, $currency) . '</td>' . "\n" . '</tr>' . "\n";
     }
     return $data;
 }
Exemplo n.º 5
0
<?php

/**
  @package    catalog::admin::applications
  @author     Loaded Commerce
  @copyright  Copyright 2003-2014 Loaded Commerce, LLC
  @copyright  Portions Copyright 2003 osCommerce
  @copyright  Template built on Developr theme by DisplayInline http://themeforest.net/user/displayinline under Extended license 
  @license    https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt
  @version    $Id: invoice.php v1.0 2013-08-08 datazen $
*/
global $lC_Vqmod;
require_once $lC_Vqmod->modCheck('../includes/classes/currencies.php');
$lC_Currencies = new lC_Currencies();
require_once $lC_Vqmod->modCheck('includes/classes/tax.php');
$lC_Tax = new lC_Tax_Admin();
$lC_Order = new lC_Order($_GET['oid']);
?>
<!-- Main content -->
<section role="main" id="main">
  <noscript class="message black-gradient simpler"><?php 
echo $lC_Language->get('ms_error_javascript_not_enabled_warning');
?>
</noscript>
  <hgroup id="main-title" class="thin">
    <h1><?php 
echo $lC_Template->getPageTitle();
?>
</h1>
  </hgroup>
  <div class="with-padding-no-top">