Пример #1
0
 public static function toLong($raw_datetime, $strict = true)
 {
     $result = '';
     $date = new DateTime($raw_datetime, true, $strict);
     if ($date->isValid()) {
         $result = strftime(OSCOM::getDef('date_format_long'), $date->getTimestamp());
     }
     return $result;
 }
Пример #2
0
 function getOutput()
 {
     $OSCOM_Db = Registry::get('Db');
     $OSCOM_Language = Registry::get('Language');
     $output = '<table class="table table-hover">
                <thead>
                  <tr class="info">
                    <th>' . OSCOM::getDef('module_admin_dashboard_reviews_title') . '</th>
                    <th>' . OSCOM::getDef('module_admin_dashboard_reviews_date') . '</th>
                    <th>' . OSCOM::getDef('module_admin_dashboard_reviews_reviewer') . '</th>
                    <th class="text-right">' . OSCOM::getDef('module_admin_dashboard_reviews_rating') . '</th>
                    <th class="text-right">' . OSCOM::getDef('module_admin_dashboard_reviews_review_status') . '</th>
                  </tr>
                </thead>
                <tbody>';
     $Qreviews = $OSCOM_Db->get(['reviews r', 'products_description pd'], ['r.reviews_id', 'r.date_added', 'pd.products_name', 'r.customers_name', 'r.reviews_rating', 'r.reviews_status'], ['pd.products_id' => ['rel' => 'r.products_id'], 'pd.language_id' => $OSCOM_Language->getId()], 'r.date_added desc', 6);
     while ($Qreviews->fetch()) {
         $output .= '    <tr>
                       <td><a href="' . OSCOM::link(FILENAME_REVIEWS, 'rID=' . $Qreviews->valueInt('reviews_id') . '&action=edit') . '">' . $Qreviews->value('products_name') . '</a></td>
                       <td>' . DateTime::toShort($Qreviews->value('date_added')) . '</td>
                       <td>' . $Qreviews->valueProtected('customers_name') . '</td>
                       <td class="text-right">' . str_repeat('<i class="fa fa-star text-info"></i>', $Qreviews->valueInt('reviews_rating')) . str_repeat('<i class="fa fa-star-o"></i>', 5 - $Qreviews->valueInt('reviews_rating')) . '</td>
                       <td class="text-right"><i class="fa fa-circle ' . ($Qreviews->valueInt('reviews_status') === 1 ? 'text-success' : 'text-danger') . '"></i></td>
                     </tr>';
     }
     $output .= '  </tbody>
               </table>';
     return $output;
 }
Пример #3
0
 function getOutput()
 {
     $OSCOM_Db = Registry::get('Db');
     $OSCOM_Language = Registry::get('Language');
     $output = '<table class="table table-hover">
                <thead>
                  <tr class="info">
                    <th>' . OSCOM::getDef('module_admin_dashboard_orders_title') . '</th>
                    <th>' . OSCOM::getDef('module_admin_dashboard_orders_total') . '</th>
                    <th>' . OSCOM::getDef('module_admin_dashboard_orders_date') . '</th>
                    <th>' . OSCOM::getDef('module_admin_dashboard_orders_order_status') . '</th>
                  </tr>
                </thead>
                <tbody>';
     $Qorders = $OSCOM_Db->get(['orders o', 'orders_total ot', 'orders_status s'], ['o.orders_id', 'o.customers_name', 'greatest(o.date_purchased, ifnull(o.last_modified, 0)) as date_last_modified', 's.orders_status_name', 'ot.text as order_total'], ['o.orders_id' => ['rel' => 'ot.orders_id'], 'ot.class' => 'ot_total', 'o.orders_status' => ['rel' => 's.orders_status_id'], 's.language_id' => $OSCOM_Language->getId()], 'date_last_modified desc', 6);
     while ($Qorders->fetch()) {
         $output .= '    <tr>
                       <td><a href="' . OSCOM::link(FILENAME_ORDERS, 'oID=' . $Qorders->valueInt('orders_id') . '&action=edit') . '">' . $Qorders->valueProtected('customers_name') . '</a></td>
                       <td>' . strip_tags($Qorders->value('order_total')) . '</td>
                       <td>' . DateTime::toShort($Qorders->value('date_last_modified')) . '</td>
                       <td>' . $Qorders->value('orders_status_name') . '</td>
                     </tr>';
     }
     $output .= '  </tbody>
               </table>';
     return $output;
 }
Пример #4
0
 public static function initialize()
 {
     static::loadConfig();
     DateTime::setTimeZone();
     ErrorHandler::initialize();
     HTTP::setRequestType();
 }
Пример #5
0
 function getOutput()
 {
     $entries = [];
     $newsCache = new Cache('oscommerce_website-news-latest5');
     if ($newsCache->exists(360)) {
         $entries = $newsCache->get();
     } else {
         $response = HTTP::getResponse(['url' => 'https://www.oscommerce.com/index.php?RPC&GetLatestNews']);
         if (!empty($response)) {
             $response = json_decode($response, true);
             if (is_array($response) && count($response) === 5) {
                 $entries = $response;
             }
         }
         $newsCache->save($entries);
     }
     $output = '<table class="table table-hover">
                <thead>
                  <tr class="info">
                    <th>' . OSCOM::getDef('module_admin_dashboard_latest_news_title') . '</th>
                    <th class="text-right">' . OSCOM::getDef('module_admin_dashboard_latest_news_date') . '</th>
                  </tr>
                </thead>
                <tbody>';
     if (is_array($entries) && count($entries) === 5) {
         foreach ($entries as $item) {
             $output .= '    <tr>
                         <td><a href="' . HTML::outputProtected($item['link']) . '" target="_blank">' . HTML::outputProtected($item['title']) . '</a></td>
                         <td class="text-right" style="white-space: nowrap;">' . HTML::outputProtected(DateTime::toShort($item['date'])) . '</td>
                       </tr>';
         }
     } else {
         $output .= '    <tr>
                       <td colspan="2">' . OSCOM::getDef('module_admin_dashboard_latest_news_feed_error') . '</td>
                     </tr>';
     }
     $output .= '    <tr>
                     <td class="text-right" colspan="2">
                       <a href="https://www.oscommerce.com/Us&News" target="_blank" title="' . HTML::outputProtected(OSCOM::getDef('module_admin_dashboard_latest_news_icon_news')) . '"><span class="fa fa-fw fa-home"></span></a>
                       <a href="https://www.oscommerce.com/newsletter/subscribe" target="_blank" title="' . HTML::outputProtected(OSCOM::getDef('module_admin_dashboard_latest_news_icon_newsletter')) . '"><span class="fa fa-fw fa-newspaper-o"></span></a>
                       <a href="https://plus.google.com/+osCommerce" target="_blank" title="' . HTML::outputProtected(OSCOM::getDef('module_admin_dashboard_latest_news_icon_google_plus')) . '"><span class="fa fa-fw fa-google-plus"></span></a>
                       <a href="https://www.facebook.com/pages/osCommerce/33387373079" target="_blank" title="' . HTML::outputProtected(OSCOM::getDef('module_admin_dashboard_latest_news_icon_facebook')) . '"><span class="fa fa-fw fa-facebook"></span></a>
                       <a href="https://twitter.com/osCommerce" target="_blank" title="' . HTML::outputProtected(OSCOM::getDef('module_admin_dashboard_latest_news_icon_twitter')) . '"><span class="fa fa-fw fa-twitter"></span></a>
                     </td>
                   </tr>
                 </tbody>
               </table>';
     return $output;
 }
Пример #6
0
 function getOutput()
 {
     $entries = [];
     $addonsCache = new Cache('oscommerce_website-addons-latest5');
     if ($addonsCache->exists(360)) {
         $entries = $addonsCache->get();
     } else {
         $response = HTTP::getResponse(['url' => 'https://www.oscommerce.com/index.php?RPC&GetLatestAddons']);
         if (!empty($response)) {
             $response = json_decode($response, true);
             if (is_array($response) && count($response) === 5) {
                 $entries = $response;
             }
         }
         $addonsCache->save($entries);
     }
     $output = '<table class="table table-hover">
                <thead>
                  <tr class="info">
                    <th>' . OSCOM::getDef('module_admin_dashboard_latest_addons_title') . '</th>
                    <th class="text-right">' . OSCOM::getDef('module_admin_dashboard_latest_addons_date') . '</th>
                  </tr>
                </thead>
                <tbody>';
     if (is_array($entries) && count($entries) === 5) {
         foreach ($entries as $item) {
             $output .= '    <tr>
                         <td><a href="' . HTML::outputProtected($item['link']) . '" target="_blank">' . HTML::outputProtected($item['title']) . '</a></td>
                         <td class="text-right" style="white-space: nowrap;">' . HTML::outputProtected(DateTime::toShort($item['date'])) . '</td>
                       </tr>';
         }
     } else {
         $output .= '    <tr>
                       <td colspan="2">' . OSCOM::getDef('module_admin_dashboard_latest_addons_feed_error') . '</td>
                     </tr>';
     }
     $output .= '    <tr>
                     <td class="text-right" colspan="2"><a href="http://addons.oscommerce.com" target="_blank" title="' . HTML::outputProtected(OSCOM::getDef('module_admin_dashboard_latest_addons_icon_site')) . '"><span class="fa fa-fw fa-home"></span></a></td>
                   </tr>
                 </tbody>
               </table>';
     return $output;
 }
Пример #7
0
 function getOutput()
 {
     $OSCOM_Db = Registry::get('Db');
     $output = '<table class="table table-hover">
                <thead>
                  <tr class="info">
                    <th>' . OSCOM::getDef('module_admin_dashboard_customers_title') . '</th>
                    <th class="text-right">' . OSCOM::getDef('module_admin_dashboard_customers_date') . '</th>
                  </tr>
                </thead>
                <tbody>';
     $Qcustomers = $OSCOM_Db->get(['customers c', 'customers_info ci'], ['c.customers_id', 'c.customers_lastname', 'c.customers_firstname', 'ci.customers_info_date_account_created'], ['c.customers_id' => ['rel' => 'ci.customers_info_id']], 'ci.customers_info_date_account_created desc', 6);
     while ($Qcustomers->fetch()) {
         $output .= '    <tr>
                       <td><a href="' . OSCOM::link(FILENAME_CUSTOMERS, 'cID=' . $Qcustomers->valueInt('customers_id') . '&action=edit') . '">' . HTML::outputProtected($Qcustomers->value('customers_firstname') . ' ' . $Qcustomers->value('customers_lastname')) . '</a></td>
                       <td class="text-right">' . DateTime::toShort($Qcustomers->value('customers_info_date_account_created')) . '</td>
                     </tr>';
     }
     $output .= '  </tbody>
               </table>';
     return $output;
 }
Пример #8
0
 function getOutput()
 {
     $current_version = OSCOM::getVersion();
     $new_version = false;
     $VersionCache = new Cache('core_version_check');
     if ($VersionCache->exists()) {
         $date_last_checked = DateTime::toShort(date('Y-m-d H:i:s', $VersionCache->getTime()), true);
         $releases = $VersionCache->get();
         foreach ($releases as $version) {
             $version_array = explode('|', $version);
             if (version_compare($current_version, $version_array[0], '<')) {
                 $new_version = true;
                 break;
             }
         }
     } else {
         $date_last_checked = OSCOM::getDef('module_admin_dashboard_version_check_never');
     }
     $output = '<table class="table table-hover">
                <thead>
                  <tr class="info">
                    <th>' . OSCOM::getDef('module_admin_dashboard_version_check_title') . '</th>
                    <th class="text-right">' . OSCOM::getDef('module_admin_dashboard_version_check_date') . '</th>
                  </tr>
                </thead>
                <tbody>';
     if ($new_version == true) {
         $output .= '    <tr class="success">
                       <td colspan="2">' . HTML::image(OSCOM::linkImage('icons/warning.gif'), OSCOM::getDef('icon_warning')) . '&nbsp;<strong>' . OSCOM::getDef('module_admin_dashboard_version_check_update_available') . '</strong></td>
                     </tr>';
     }
     $output .= '    <tr>
                     <td><a href="' . OSCOM::link('online_update.php') . '">' . OSCOM::getDef('module_admin_dashboard_version_check_check_now') . '</a></td>
                     <td class="text-right">' . $date_last_checked . '</td>
                   </tr>
                 </tbody>
               </table>';
     return $output;
 }
Пример #9
0
 function getOutput()
 {
     $OSCOM_Db = Registry::get('Db');
     $output = '<table class="table table-hover">
                <thead>
                  <tr class="info">
                    <th>' . OSCOM::getDef('module_admin_dashboard_admin_logins_title') . '</th>
                    <th class="text-right">' . OSCOM::getDef('module_admin_dashboard_admin_logins_date') . '</th>
                  </tr>
                </thead>
                <tbody>';
     $Qlogins = $OSCOM_Db->get('action_recorder', ['id', 'user_name', 'success', 'date_added'], ['module' => 'ar_admin_login'], 'date_added desc', 6);
     while ($Qlogins->fetch()) {
         $output .= '    <tr>
                       <td><i class="fa fa-' . ($Qlogins->valueInt('success') === 1 ? 'check text-success' : 'times text-danger') . '"></i>&nbsp;<a href="' . OSCOM::link(FILENAME_ACTION_RECORDER, 'module=ar_admin_login&aID=' . $Qlogins->valueInt('id')) . '">' . $Qlogins->valueProtected('user_name') . '</a></td>
                       <td class="text-right">' . DateTime::toShort($Qlogins->value('date_added')) . '</td>
                     </tr>';
     }
     $output .= '  </tbody>
               </table>';
     return $output;
 }
Пример #10
0
     }
 }
 if (strlen($customers_firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
     $error = true;
     $entry_firstname_error = true;
 } else {
     $entry_firstname_error = false;
 }
 if (strlen($customers_lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
     $error = true;
     $entry_lastname_error = true;
 } else {
     $entry_lastname_error = false;
 }
 if (ACCOUNT_DOB == 'true') {
     $dobDateTime = new DateTime($customers_dob);
     if (strlen($customers_dob) >= ENTRY_DOB_MIN_LENGTH && $dobDateTime->isValid()) {
         $entry_date_of_birth_error = false;
     } else {
         $error = true;
         $entry_date_of_birth_error = true;
     }
 }
 $entry_email_address_error = false;
 if (!Is::email($customers_email_address)) {
     $error = true;
     $entry_email_address_check_error = true;
 } else {
     $entry_email_address_check_error = false;
 }
 if (strlen($entry_street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
Пример #11
0
        } else {
            $order_type = OSCOM::getDef('text_order_billed_to');
            $order_name = $order['billing_name'];
        }
        ?>

  <div class="contentText">
    <div class="panel panel-info">
      <div class="panel-heading"><strong><?php 
        echo OSCOM::getDef('text_order_number') . ' ' . (int) $order['orders_id'] . ' <span class="contentText">(' . HTML::outputProtected($order['orders_status_name']) . ')</span>';
        ?>
</strong></div>
      <div class="panel-body">
        <div class="row">
          <div class="col-sm-6"><?php 
        echo '<strong>' . OSCOM::getDef('text_order_date') . '</strong> ' . DateTime::toLong($order['date_purchased']) . '<br /><strong>' . $order_type . '</strong> ' . HTML::outputProtected($order_name);
        ?>
</div>
          <br class="visible-xs" />
          <div class="col-sm-6"><?php 
        echo '<strong>' . OSCOM::getDef('text_order_products') . '</strong> ' . $Qproducts->valueInt('count') . '<br /><strong>' . OSCOM::getDef('text_order_cost') . '</strong> ' . strip_tags($order['order_total']);
        ?>
</div>
        </div>
      </div>
      <div class="panel-footer"><?php 
        echo HTML::button(OSCOM::getDef('small_image_button_view'), 'fa fa-file', OSCOM::link('account_history_info.php', (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'order_id=' . $order['orders_id']), null, 'btn-primary btn-xs');
        ?>
</div>
    </div>
  </div>
Пример #12
0
 * osCommerce Online Merchant
 *
 * @copyright (c) 2016 osCommerce; https://www.oscommerce.com
 * @license MIT; https://www.oscommerce.com/license/mit.txt
 */
use OSC\OM\DateTime;
use OSC\OM\ErrorHandler;
use OSC\OM\FileSystem;
use OSC\OM\HTML;
use OSC\OM\OSCOM;
require 'includes/application_top.php';
$files = [];
foreach (glob(ErrorHandler::getDirectory() . 'errors-*.txt') as $f) {
    $key = basename($f, '.txt');
    if (preg_match('/^errors-([0-9]{4})([0-9]{2})([0-9]{2})$/', $key, $matches)) {
        $files[$key] = ['path' => $f, 'key' => $key, 'date' => DateTime::toShort($matches[1] . '-' . $matches[2] . '-' . $matches[3]), 'size' => filesize($f)];
    }
}
$action = isset($_GET['action']) ? $_GET['action'] : '';
if (tep_not_null($action)) {
    switch ($action) {
        case 'delete':
            if (isset($_GET['log']) && array_key_exists($_GET['log'], $files)) {
                if (unlink($files[$_GET['log']]['path'])) {
                    $OSCOM_MessageStack->add(OSCOM::getDef('ms_success_delete', ['log' => $files[$_GET['log']]['key']]), 'success');
                } else {
                    $OSCOM_MessageStack->add(OSCOM::getDef('ms_error_delete', ['log' => $files[$_GET['log']]['key']]), 'error');
                }
            }
            OSCOM::redirect('error_log.php');
            break;
Пример #13
0
    echo $Qactions->valueInt('success') === 1 ? 'fa-check text-success' : 'fa-times text-danger';
    ?>
"></i> <?php 
    echo $module_title;
    ?>
</td>
      <td><?php 
    echo $Qactions->valueProtected('user_name') . ' [' . $Qactions->valueInt('user_id') . ']';
    ?>
</td>
      <td><?php 
    echo tep_not_null($Qactions->value('identifier')) ? '<a href="' . OSCOM::link('action_recorder.php', 'search=' . $Qactions->value('identifier')) . '"><u>' . $Qactions->valueProtected('identifier') . '</u></a>' : '(empty)';
    ?>
</td>
      <td class="text-right"><?php 
    echo DateTime::toShort($Qactions->value('date_added'), true);
    ?>
</td>
    </tr>

<?php 
}
?>

  </tbody>
</table>

<div>
  <span class="pull-right"><?php 
echo $Qactions->getPageSetLinks((isset($_GET['module']) && in_array($_GET['module'], $modules_array) && is_object($GLOBALS[$_GET['module']]) ? 'module=' . $_GET['module'] : null) . '&' . (isset($_GET['search']) && !empty($_GET['search']) ? 'search=' . $_GET['search'] : null));
?>
Пример #14
0
      <div class="form-group has-feedback">
        <label for="adminDir">Administration Directory Name</label>
        <?php 
    echo HTML::inputField('CFG_ADMIN_DIRECTORY', 'admin', 'required aria-required="true" id="adminDir"');
    ?>
        <span class="help-block">This is the directory where the administration section will be installed. You should change this for security reasons.</span>
      </div>

<?php 
}
?>

      <div class="form-group has-feedback">
        <label for="Zulu">Time Zone</label>
        <?php 
echo HTML::selectField('TIME_ZONE', DateTime::getTimeZones(), date_default_timezone_get(), 'id="Zulu"');
?>
        <span class="help-block">The time zone to base the date and time on.</span>
      </div>

      <p><?php 
echo HTML::button('Continue to Step 4', 'triangle-1-e', null, null, 'btn-success');
?>
</p>

<?php 
foreach ($_POST as $key => $value) {
    if ($key != 'x' && $key != 'y') {
        echo HTML::hiddenField($key, $value);
    }
}
Пример #15
0
  <div class="clearfix"></div>

  <div class="contentText">
    <ul class="timeline">
      <?php 
$Qstatuses = $OSCOM_Db->prepare('select os.orders_status_name, osh.date_added, osh.comments from :table_orders_status os, :table_orders_status_history osh where osh.orders_id = :orders_id and osh.orders_status_id = os.orders_status_id and os.language_id = :language_id and os.public_flag = "1" order by osh.date_added');
$Qstatuses->bindInt(':orders_id', $_GET['order_id']);
$Qstatuses->bindInt(':language_id', $OSCOM_Language->getId());
$Qstatuses->execute();
while ($Qstatuses->fetch()) {
    echo '<li>';
    echo '  <div class="timeline-badge"><i class="fa fa-check-square-o"></i></div>';
    echo '  <div class="timeline-panel">';
    echo '    <div class="timeline-heading">';
    echo '      <p class="pull-right"><small class="text-muted"><i class="fa fa-clock-o"></i> ' . DateTime::toShort($Qstatuses->value('date_added')) . '</small></p><h2 class="timeline-title">' . $Qstatuses->value('orders_status_name') . '</h2>';
    echo '    </div>';
    echo '    <div class="timeline-body">';
    echo '      <p>' . (tep_not_null($Qstatuses->value('comments')) ? '<blockquote>' . nl2br($Qstatuses->valueProtected('comments')) . '</blockquote>' : '&nbsp;') . '</p>';
    echo '    </div>';
    echo '  </div>';
    echo '</li>';
}
?>
    </ul>
  </div>

<?php 
if (DOWNLOAD_ENABLED == 'true') {
    include 'includes/content/downloads.php';
}
Пример #16
0
 public static function initialize()
 {
     DateTime::setTimeZone();
 }
Пример #17
0
                $aa = explode('|', $a);
                $ba = explode('|', $b);
                return version_compare($aa[0], $ba[0], '>');
            });
            $VersionCache->save($releases);
        } else {
            $releases = -1;
        }
    }
}
$versions = [];
if (is_array($releases) && !empty($releases)) {
    foreach ($releases as $version) {
        $version_array = explode('|', $version);
        if (version_compare($current_version, $version_array[0], '<')) {
            $versions[] = ['version' => $version_array[0], 'date' => DateTime::toLong(substr($version_array[1], 0, 4) . '-' . substr($version_array[1], 4, 2) . '-' . substr($version_array[1], 6, 2))];
        }
    }
}
$action = isset($_GET['action']) ? $_GET['action'] : '';
if (tep_not_null($action)) {
    switch ($action) {
        case 'getUpdateLog':
            $check = false;
            if (isset($_POST['version']) && preg_match('/^(\\d+\\.)?(\\d+\\.)?(\\d+)$/', $_POST['version'])) {
                foreach ($versions as $v) {
                    if ($v['version'] == $_POST['version']) {
                        $check = true;
                        break;
                    }
                }
Пример #18
0
    <tr>
      <td><?php 
        echo '<a href="' . OSCOM::link('orders.php', tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $Qorders->valueInt('orders_id') . '&action=edit') . '">' . $Qorders->value('customers_name') . '</a> <small class="text-muted">#' . $Qorders->valueInt('orders_id') . '</small>';
        ?>
</td>
      <td class="text-right"><?php 
        echo strip_tags($Qorders->value('order_total')) . ' <small class="text-muted">' . $Qorders->value('currency') . '</small>';
        ?>
</td>
      <td><div class="oscom-truncate" style="width: 150px;"><small class="text-muted"><?php 
        echo $Qorders->value('payment_method');
        ?>
</small></div></td>
      <td class="text-right"><?php 
        echo DateTime::toShort($Qorders->value('date_purchased'), true);
        ?>
</td>
      <td class="text-right"><?php 
        echo $Qorders->value('orders_status_name');
        ?>
</td>
      <td class="action"><?php 
        echo '<a href="' . OSCOM::link('orders.php', tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $Qorders->valueInt('orders_id') . '&action=edit') . '"><i class="fa fa-pencil" title="' . OSCOM::getDef('image_edit') . '"></i></a>
         <a href="' . OSCOM::link('orders.php', tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $Qorders->valueInt('orders_id') . '&action=delete') . '"><i class="fa fa-trash" title="' . OSCOM::getDef('image_delete') . '"></i></a>
         <a href="' . OSCOM::link('invoice.php', 'oID=' . $Qorders->valueInt('orders_id')) . '" target="_blank"><i class="fa fa-file-text-o" title="' . OSCOM::getDef('image_orders_invoice') . '"></i></a>
         <a href="' . OSCOM::link('packingslip.php', 'oID=' . $Qorders->valueInt('orders_id')) . '" target="_blank"><i class="fa fa-clipboard" title="' . OSCOM::getDef('image_orders_packingslip') . '"></i></a>';
        ?>
</td>
    </tr>
Пример #19
0
        <div class="col-xs-9">
          <?php 
    echo HTML::inputField('CFG_ADMIN_DIRECTORY', 'admin', 'required aria-required="true" id="adminDir"');
    ?>
          <span class="glyphicon glyphicon-asterisk form-control-feedback inputRequirement"></span>
          <span class="help-block">This is the directory where the administration section will be installed. You should change this for security reasons.</span>
        </div>
      </div>
<?php 
}
?>
      <div class="form-group has-feedback">
        <label for="Zulu" class="control-label col-xs-3">Time Zone</label>
        <div class="col-xs-9">
          <?php 
echo HTML::selectField('CFG_TIME_ZONE', DateTime::getTimeZones(), date_default_timezone_get());
?>
          <span class="glyphicon glyphicon-asterisk form-control-feedback inputRequirement"></span>
          <span class="help-block">The time zone to base the date and time on.</span>
        </div>
      </div>

      <p><?php 
echo HTML::button('Continue To Step 4', 'triangle-1-e', null, 'primary', null, 'btn-success btn-block');
?>
</p>

      <?php 
foreach ($_POST as $key => $value) {
    if ($key != 'x' && $key != 'y') {
        echo HTML::hiddenField($key, $value);
     $pto = $_GET['pto'];
 }
 if (isset($_GET['keywords'])) {
     $keywords = HTML::sanitize($_GET['keywords']);
 }
 $date_check_error = false;
 if (tep_not_null($dfrom)) {
     $dfromDateTime = new DateTime($dfrom);
     if ($dfromDateTime->isValid() === false) {
         $error = true;
         $date_check_error = true;
         $messageStack->add_session('search', OSCOM::getDef('error_invalid_from_date'));
     }
 }
 if (tep_not_null($dto)) {
     $dtoDateTime = new DateTime($dto);
     if ($dtoDateTime->isValid() === false) {
         $error = true;
         $date_check_error = true;
         $messageStack->add_session('search', OSCOM::getDef('error_invalid_to_date'));
     }
 }
 if ($date_check_error == false && isset($dfromDateTime) && $dfromDateTime->isValid() && isset($dtoDateTime) && $dtoDateTime->isValid()) {
     if ($dfromDateTime->get() > $dtoDateTime->get()) {
         $error = true;
         $messageStack->add_session('search', OSCOM::getDef('error_to_date_less_than_from_date'));
     }
 }
 $price_check_error = false;
 if (tep_not_null($pfrom)) {
     if (!settype($pfrom, 'double')) {
Пример #21
0
?>
<div class="col-sm-<?php 
echo $content_width;
?>
 upcoming-products">

  <table class="table table-striped table-condensed">
    <tbody>
      <tr>
        <th><?php 
echo OSCOM::getDef('module_content_upcoming_products_table_heading_products');
?>
</th>
        <th class="text-right"><?php 
echo OSCOM::getDef('module_content_upcoming_products_table_heading_date_expected');
?>
</th>
      </tr>
      <?php 
foreach ($products as $product) {
    echo '<tr>';
    echo '  <td><a href="' . OSCOM::link('product_info.php', 'products_id=' . (int) $product['products_id']) . '">' . $product['products_name'] . '</a></td>';
    echo '  <td class="text-right">' . DateTime::toShort($product['date_expected']) . '</td>';
    echo '</tr>';
}
?>
    </tbody>
  </table>

</div>
Пример #22
0
      </tr>
<?php 
            if ($pInfo->products_date_available > date('Y-m-d')) {
                ?>
      <tr>
        <td align="center" class="smallText"><?php 
                echo OSCOM::getDef('text_product_date_available', ['products_date_available' => DateTime::toLong($pInfo->products_date_available)]);
                ?>
</td>
      </tr>
<?php 
            } else {
                ?>
      <tr>
        <td align="center" class="smallText"><?php 
                echo OSCOM::getDef('text_product_date_added', ['products_date_added' => DateTime::toLong($pInfo->products_date_added)]);
                ?>
</td>
      </tr>
<?php 
            }
            ?>
      <tr>
        <td>&nbsp;</td>
      </tr>
<?php 
        }
        if (isset($_GET['origin'])) {
            $pos_params = strpos($_GET['origin'], '?', 0);
            if ($pos_params != false) {
                $back_url = substr($_GET['origin'], 0, $pos_params);
Пример #23
0
 if (ACCOUNT_GENDER == 'true') {
     if ($gender != 'm' && $gender != 'f') {
         $error = true;
         $messageStack->add('account_edit', OSCOM::getDef('entry_gender_error'));
     }
 }
 if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
     $error = true;
     $messageStack->add('account_edit', OSCOM::getDef('entry_first_name_error', ['min_length' => ENTRY_FIRST_NAME_MIN_LENGTH]));
 }
 if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
     $error = true;
     $messageStack->add('account_edit', OSCOM::getDef('entry_last_name_error', ['min_length' => ENTRY_LAST_NAME_MIN_LENGTH]));
 }
 if (ACCOUNT_DOB == 'true') {
     $dobDateTime = new DateTime($dob);
     if (strlen($dob) < ENTRY_DOB_MIN_LENGTH || $dobDateTime->isValid() === false) {
         $error = true;
         $messageStack->add('account_edit', OSCOM::getDef('entry_date_of_birth_error'));
     }
 }
 if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
     $error = true;
     $messageStack->add('account_edit', OSCOM::getDef('entry_email_address_error', ['min_length' => ENTRY_EMAIL_ADDRESS_MIN_LENGTH]));
 }
 if (!Is::email($email_address)) {
     $error = true;
     $messageStack->add('account_edit', OSCOM::getDef('entry_email_address_check_error'));
 }
 $Qcheck = $OSCOM_Db->prepare('select customers_id from :table_customers where customers_email_address = :customers_email_address and customers_id != :customers_id limit 1');
 $Qcheck->bindValue(':customers_email_address', $email_address);
Пример #24
0
 public static function initialize($site = null)
 {
     DateTime::setTimeZone();
     static::setSite($site);
 }
Пример #25
0
        } while ($Qpa->fetch());
        ?>
    </p>

<?php 
    }
    ?>

    <div class="clearfix"></div>

<?php 
    if ($Qproduct->value('products_date_available') > date('Y-m-d H:i:s')) {
        ?>

    <div class="alert alert-info"><?php 
        echo OSCOM::getDef('text_date_available', ['products_date_available' => DateTime::toLong($Qproduct->value('products_date_available'))]);
        ?>
</div>

<?php 
    }
    ?>

  </div>

<?php 
    $has_rating = false;
    $Qr = $OSCOM_Db->prepare('select count(*) as count, avg(reviews_rating) as avgrating from :table_reviews r, :table_reviews_description rd where r.products_id = :products_id and r.reviews_id = rd.reviews_id and rd.languages_id = :languages_id and reviews_status = 1');
    $Qr->bindInt(':products_id', $Qproduct->valueInt('products_id'));
    $Qr->bindInt(':languages_id', $OSCOM_Language->getId());
    $Qr->execute();
Пример #26
0
        // MySQL 3.22 does not have INTERVAL
        list($dt_year, $dt_month, $dt_day) = explode('-', $Qdownloads->value('date_purchased_day'));
        $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $Qdownloads->valueInt('download_maxdays'), $dt_year);
        $download_expiry = date('Y-m-d H:i:s', $download_timestamp);
        echo '      <tr>' . "\n";
        // The link will appear only if:
        // - Download remaining count is > 0, AND
        // - The file is present in the DOWNLOAD directory, AND EITHER
        // - No expiry date is enforced (maxdays == 0), OR
        // - The expiry date is not reached
        if ($Qdownloads->valueInt('download_count') > 0 && is_file(OSCOM::getConfig('dir_root', 'Shop') . 'download/' . $Qdownloads->value('orders_products_filename')) && ($Qdownloads->valueInt('download_maxdays') == 0 || $download_timestamp > time())) {
            echo '        <td><a href="' . OSCOM::link('download.php', 'order=' . $last_order . '&id=' . $Qdownloads->valueInt('orders_products_download_id')) . '">' . $Qdownloads->value('products_name') . '</a></td>' . "\n";
        } else {
            echo '        <td>' . $Qdownloads->value('products_name') . '</td>' . "\n";
        }
        echo '        <td>' . TABLE_HEADING_DOWNLOAD_DATE . DateTime::toLong($download_expiry) . '</td>' . "\n" . '        <td align="right">' . $Qdownloads->valueInt('download_count') . TABLE_HEADING_DOWNLOAD_COUNT . '</td>' . "\n" . '      </tr>' . "\n";
    } while ($Qdownloads->fetch());
    ?>

    </table>

<?php 
    if (!strstr($PHP_SELF, 'account_history_info.php')) {
        ?>

    <p><?php 
        printf(FOOTER_DOWNLOAD, '<a href="' . OSCOM::link('account.php') . '">' . OSCOM::getDef('header_title_my_account') . '</a>');
        ?>
</p>

<?php 
Пример #27
0
</td>
                    <td class="smallText" align="right"><?php 
echo $Qproducts->getPageSetLinks();
?>
</td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
<?php 
$heading = array();
$contents = array();
if (isset($pInfo) && is_object($pInfo)) {
    $heading[] = array('text' => '<strong>' . $pInfo->products_name . '</strong>');
    $contents[] = array('align' => 'center', 'text' => HTML::button(OSCOM::getDef('image_edit'), 'fa fa-edit', OSCOM::link(FILENAME_CATEGORIES, 'pID=' . $pInfo->products_id . '&action=new_product')));
    $contents[] = array('text' => '<br />' . OSCOM::getDef('text_info_date_expected') . ' ' . DateTime::toShort($pInfo->products_date_available));
}
if (tep_not_null($heading) && tep_not_null($contents)) {
    echo '            <td width="25%" valign="top">' . "\n";
    $box = new box();
    echo $box->infoBox($heading, $contents);
    echo '            </td>' . "\n";
}
?>
          </tr>
        </table></td>
      </tr>
    </table>

<?php 
require $oscTemplate->getFile('template_bottom.php');
Пример #28
0
            if (is_object($sInfo)) {
                $heading[] = array('text' => '<strong>' . $sInfo->products_name . '</strong>');
                $contents[] = array('align' => 'center', 'text' => HTML::button(OSCOM::getDef('image_edit'), 'fa fa-edit', OSCOM::link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id . '&action=edit')) . HTML::button(OSCOM::getDef('image_delete'), 'fa fa-trash', OSCOM::link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id . '&action=delete')));
                $contents[] = array('text' => '<br />' . OSCOM::getDef('text_info_date_added') . ' ' . DateTime::toShort($sInfo->specials_date_added));
                if (isset($sInfo->specials_last_modified)) {
                    $contents[] = array('text' => '' . OSCOM::getDef('text_info_last_modified') . ' ' . DateTime::toShort($sInfo->specials_last_modified));
                }
                $contents[] = array('align' => 'center', 'text' => '<br />' . tep_info_image($sInfo->products_image, $sInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));
                $contents[] = array('text' => '<br />' . OSCOM::getDef('text_info_original_price') . ' ' . $currencies->format($sInfo->products_price));
                $contents[] = array('text' => '' . OSCOM::getDef('text_info_new_price') . ' ' . $currencies->format($sInfo->specials_new_products_price));
                $contents[] = array('text' => '' . OSCOM::getDef('text_info_percentage') . ' ' . number_format(100 - $sInfo->specials_new_products_price / $sInfo->products_price * 100) . '%');
                if (isset($sInfo->expires_date)) {
                    $contents[] = array('text' => '<br />' . OSCOM::getDef('text_info_expires_date') . ' <strong>' . DateTime::toShort($sInfo->expires_date) . '</strong>');
                }
                if (isset($sInfo->date_status_change)) {
                    $contents[] = array('text' => '' . OSCOM::getDef('text_info_status_change') . ' ' . DateTime::toShort($sInfo->date_status_change));
                }
            }
            break;
    }
    if (tep_not_null($heading) && tep_not_null($contents)) {
        echo '            <td width="25%" valign="top">' . "\n";
        $box = new box();
        echo $box->infoBox($heading, $contents);
        echo '            </td>' . "\n";
    }
}
?>
          </tr>
        </table></td>
      </tr>
Пример #29
0
        $contents[] = array('text' => '<br />' . OSCOM::getDef('text_info_tax_rate_priority') . '<br />' . HTML::inputField('tax_priority', $trInfo->tax_priority));
        $contents[] = array('align' => 'center', 'text' => '<br />' . HTML::button(OSCOM::getDef('image_save'), 'fa fa-save') . HTML::button(OSCOM::getDef('image_cancel'), 'fa fa-close', OSCOM::link(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $trInfo->tax_rates_id)));
        break;
    case 'delete':
        $heading[] = array('text' => '<strong>' . OSCOM::getDef('text_info_heading_delete_tax_rate') . '</strong>');
        $contents = array('form' => HTML::form('rates', OSCOM::link(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $trInfo->tax_rates_id . '&action=deleteconfirm')));
        $contents[] = array('text' => OSCOM::getDef('text_info_delete_intro'));
        $contents[] = array('text' => '<br /><strong>' . $trInfo->tax_class_title . ' ' . number_format($trInfo->tax_rate, TAX_DECIMAL_PLACES) . '%</strong>');
        $contents[] = array('align' => 'center', 'text' => '<br />' . HTML::button(OSCOM::getDef('image_delete'), 'fa fa-trash') . HTML::button(OSCOM::getDef('image_cancel'), 'fa fa-close', OSCOM::link(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $trInfo->tax_rates_id)));
        break;
    default:
        if (is_object($trInfo)) {
            $heading[] = array('text' => '<strong>' . $trInfo->tax_class_title . '</strong>');
            $contents[] = array('align' => 'center', 'text' => HTML::button(OSCOM::getDef('image_edit'), 'fa fa-edit', OSCOM::link(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $trInfo->tax_rates_id . '&action=edit')) . HTML::button(OSCOM::getDef('image_delete'), 'fa fa-trash', OSCOM::link(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $trInfo->tax_rates_id . '&action=delete')));
            $contents[] = array('text' => '<br />' . OSCOM::getDef('text_info_date_added') . ' ' . DateTime::toShort($trInfo->date_added));
            $contents[] = array('text' => '' . OSCOM::getDef('text_info_last_modified') . ' ' . DateTime::toShort($trInfo->last_modified));
            $contents[] = array('text' => '<br />' . OSCOM::getDef('text_info_rate_description') . '<br />' . $trInfo->tax_description);
        }
        break;
}
if (tep_not_null($heading) && tep_not_null($contents)) {
    echo '            <td width="25%" valign="top">' . "\n";
    $box = new box();
    echo $box->infoBox($heading, $contents);
    echo '            </td>' . "\n";
}
?>
          </tr>
        </table></td>
      </tr>
    </table>
Пример #30
0
        $contents[] = array('text' => '<br /><strong>' . $cInfo->title . '</strong>');
        $contents[] = array('align' => 'center', 'text' => '<br />' . ($remove_currency ? HTML::button(OSCOM::getDef('image_delete'), 'fa fa-trash', OSCOM::link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=deleteconfirm')) : '') . HTML::button(OSCOM::getDef('image_cancel'), 'fa fa-close', OSCOM::link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id)));
        break;
    default:
        if (is_object($cInfo)) {
            $heading[] = array('text' => '<strong>' . $cInfo->title . '</strong>');
            $contents[] = array('align' => 'center', 'text' => HTML::button(OSCOM::getDef('image_edit'), 'fa fa-edit', OSCOM::link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=edit')) . HTML::button(OSCOM::getDef('image_delete'), 'fa fa-trash', OSCOM::link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=delete')));
            $contents[] = array('text' => '<br />' . OSCOM::getDef('text_info_currency_title') . ' ' . $cInfo->title);
            $contents[] = array('text' => OSCOM::getDef('text_info_currency_code') . ' ' . $cInfo->code);
            $contents[] = array('text' => '<br />' . OSCOM::getDef('text_info_currency_symbol_left') . ' ' . $cInfo->symbol_left);
            $contents[] = array('text' => OSCOM::getDef('text_info_currency_symbol_right') . ' ' . $cInfo->symbol_right);
            $contents[] = array('text' => '<br />' . OSCOM::getDef('text_info_currency_decimal_point') . ' ' . $cInfo->decimal_point);
            $contents[] = array('text' => OSCOM::getDef('text_info_currency_thousands_point') . ' ' . $cInfo->thousands_point);
            $contents[] = array('text' => OSCOM::getDef('text_info_currency_decimal_places') . ' ' . $cInfo->decimal_places);
            if (isset($cInfo->last_updated)) {
                $contents[] = array('text' => '<br />' . OSCOM::getDef('text_info_currency_last_updated') . ' ' . DateTime::toShort($cInfo->last_updated));
            }
            $contents[] = array('text' => OSCOM::getDef('text_info_currency_value') . ' ' . number_format($cInfo->value, 8));
            $contents[] = array('text' => '<br />' . OSCOM::getDef('text_info_currency_example') . '<br />' . $currencies->format('30', false, DEFAULT_CURRENCY) . ' = ' . $currencies->format('30', true, $cInfo->code));
        }
        break;
}
if (tep_not_null($heading) && tep_not_null($contents)) {
    echo '            <td width="25%" valign="top">' . "\n";
    $box = new box();
    echo $box->infoBox($heading, $contents);
    echo '            </td>' . "\n";
}
?>
          </tr>
        </table></td>