public static function execute()
 {
     $OSCOM_Cache = Registry::get('Cache');
     $result = array('entries' => array());
     if ($OSCOM_Cache->read('coreupdate-availablepackages', 360)) {
         $versions = $OSCOM_Cache->getCache();
     } else {
         $versions = HttpRequest::getResponse(array('url' => 'http://www.oscommerce.com/version/online_merchant/3', 'method' => 'get'));
         $OSCOM_Cache->write($versions);
     }
     $versions_array = explode("\n", $versions);
     $counter = 0;
     foreach ($versions_array as $v) {
         $v_info = explode('|', $v);
         if (version_compare(OSCOM::getVersion(), $v_info[0], '<')) {
             $result['entries'][] = array('key' => $counter, 'version' => $v_info[0], 'date' => DateTime::getShort(DateTime::fromUnixTimestamp(DateTime::getTimestamp($v_info[1], 'Ymd'))), 'announcement' => $v_info[2], 'update_package' => isset($v_info[3]) ? $v_info[3] : null);
             $counter++;
         }
     }
     usort($result['entries'], function ($a, $b) {
         return version_compare($a['version'], $b['version'], '>');
     });
     $result['total'] = count($result['entries']);
     return $result;
 }
Example #2
0
 public static function execute($search, $pageset = 1)
 {
     if (!is_numeric($pageset) || floor($pageset) != $pageset) {
         $pageset = 1;
     }
     $result = array('entries' => array(), 'total' => ErrorHandler::getTotalFindEntries($search));
     foreach (ErrorHandler::find($search, MAX_DISPLAY_SEARCH_RESULTS, $pageset) as $row) {
         $result['entries'][] = array('date' => DateTime::getShort(DateTime::fromUnixTimestamp($row['timestamp']), true), 'message' => $row['message']);
     }
     return $result;
 }
Example #3
0
 public static function execute($log)
 {
     $log = basename($log);
     if (substr($log, 0, -4) != '.txt') {
         $log .= '.txt';
     }
     $result = array('entries' => array());
     foreach (file(OSCOM::BASE_DIRECTORY . 'Work/Logs/' . $log) as $l) {
         if (preg_match('/^\\[([0-9]{2})-([A-Za-z]{3})-([0-9]{4}) ([0-9]{2}):([0-5][0-9]):([0-5][0-9])\\] (.*)$/', $l)) {
             $result['entries'][] = array('date' => DateTime::getShort(DateTime::fromUnixTimestamp(DateTime::getTimestamp(substr($l, 1, 20), 'd-M-Y H:i:s')), true), 'message' => substr($l, 23));
         }
     }
     $result['total'] = count($result['entries']);
     return $result;
 }
Example #4
0
 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>';
     }
 }
echo OSCOM::getDef('field_last_name');
?>
</label><?php 
echo HTML::inputField('lastname', $new_customer ? null : $OSCOM_ObjectInfo->get('customers_lastname'));
?>
</p>

<?php 
if (ACCOUNT_DATE_OF_BIRTH == '1') {
    ?>

      <p><label for="dob"><?php 
    echo OSCOM::getDef('field_date_of_birth');
    ?>
</label><?php 
    echo HTML::inputField('dob', $new_customer ? null : DateTime::fromUnixTimestamp(DateTime::getTimestamp($OSCOM_ObjectInfo->get('customers_dob')), 'Y-m-d'));
    ?>
</p>

      <script>$('#dob').datepicker({dateFormat: 'yy-mm-dd', changeMonth: true, changeYear: true, yearRange: '-100:+0'});</script>

<?php 
}
?>

      <p><label for="email_address"><?php 
echo OSCOM::getDef('field_email_address');
?>
</label><?php 
echo HTML::inputField('email_address', $new_customer ? null : $OSCOM_ObjectInfo->get('customers_email_address'));
?>