Example #1
0
 function _setData()
 {
     global $osC_Database, $osC_Language;
     $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . '  <thead>' . '    <tr>' . '      <th>' . $osC_Language->get('summary_customers_table_heading_customers') . '</th>' . '      <th>' . $osC_Language->get('summary_customers_table_heading_date') . '</th>' . '      <th>' . $osC_Language->get('summary_customers_table_heading_status') . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
     $Qcustomers = $osC_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->bindTable(':table_customers', TABLE_CUSTOMERS);
     $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(osc_href_link_admin(FILENAME_DEFAULT, '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>';
     $Qcustomers->freeResult();
 }
 function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     if (!isset($_GET['set'])) {
         $_GET['set'] = '';
     }
     if (!isset($_GET['action'])) {
         $_GET['action'] = '';
     }
     switch ($_GET['set']) {
         case 'content':
             $this->_page_title = $osC_Language->get('heading_title_content');
             break;
         case 'boxes':
         default:
             $_GET['set'] = 'boxes';
             $this->_page_title = $osC_Language->get('heading_title_boxes');
             break;
     }
     include '../includes/classes/modules.php';
     $osC_Language->load('modules-' . $_GET['set']);
     if (!empty($_GET['action'])) {
         switch ($_GET['action']) {
             case 'info':
                 $this->_page_contents = 'info.php';
                 break;
             case 'save':
                 $this->_page_contents = 'edit.php';
                 if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
                     $data = array('configuration' => $_POST['configuration']);
                     if ($this->_save($data)) {
                         $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
                     } else {
                         $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
                     }
                     osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '&set=' . $_GET['set']));
                 }
                 break;
             case 'install':
                 if ($this->_install($_GET['module'], $_GET['set'])) {
                     $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
                 } else {
                     $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
                 }
                 osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '&set=' . $_GET['set']));
                 break;
             case 'uninstall':
                 $this->_page_contents = 'uninstall.php';
                 if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
                     if ($this->_uninstall($_GET['module'], $_GET['set'])) {
                         $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
                     } else {
                         $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
                     }
                     osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '&set=' . $_GET['set']));
                 }
                 break;
         }
     }
 }
Example #3
0
 function _setData()
 {
     global $osC_Database, $osC_Language, $osC_Currencies;
     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>' . $osC_Language->get('summary_products_table_heading_products') . '</th>' . '      <th>' . $osC_Language->get('summary_products_table_heading_price') . '</th>' . '      <th>' . $osC_Language->get('summary_products_table_heading_date') . '</th>' . '      <th>' . $osC_Language->get('summary_products_table_heading_status') . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
     $Qproducts = $osC_Database->query('select products_id, greatest(products_date_added, products_last_modified) as date_last_modified from :table_products where parent_id = 0 order by date_last_modified desc limit 6');
     $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
     $Qproducts->execute();
     while ($Qproducts->next()) {
         $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="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' . '      <td>' . osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, 'products=' . (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>';
     }
     $this->_data .= '  </tbody>' . '</table>';
     $Qproducts->freeResult();
 }
Example #4
0
 public function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     parent::__construct();
     if (isset($_POST['batch']) && is_array($_POST['batch']) && !empty($_POST['batch'])) {
         $this->_page_contents = 'batch_edit.php';
         if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
             $error = false;
             foreach ($_POST['batch'] as $id) {
                 if (!osC_Administrators_Admin::setAccessLevels($id, $_POST['modules'], $_POST['mode'])) {
                     $error = true;
                     break;
                 }
             }
             if ($error === false) {
                 $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
                 if (in_array($_SESSION['admin']['id'], $_POST['batch'])) {
                     $_SESSION['admin']['access'] = osC_Access::getUserLevels($_SESSION['admin']['id']);
                 }
             } else {
                 $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
             }
             osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
         }
     }
 }
Example #5
0
 public function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     parent::__construct();
     if (isset($_GET['aID']) && is_numeric($_GET['aID'])) {
         $this->_page_contents = 'edit.php';
     } else {
         $this->_page_contents = 'new.php';
     }
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         $data = array('username' => $_POST['user_name'], 'password' => $_POST['user_password']);
         switch (osC_Administrators_Admin::save(isset($_GET['aID']) && is_numeric($_GET['aID']) ? $_GET['aID'] : null, $data, isset($_POST['modules']) ? $_POST['modules'] : null)) {
             case 1:
                 if (isset($_GET['aID']) && is_numeric($_GET['aID']) && $_GET['aID'] == $_SESSION['admin']['id']) {
                     $_SESSION['admin']['access'] = osC_Access::getUserLevels($_GET['aID']);
                 }
                 $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
                 osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
                 break;
             case -1:
                 $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
                 osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
                 break;
             case -2:
                 $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_username_already_exists'), 'error');
                 break;
         }
     }
 }
Example #6
0
 public function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     parent::__construct();
     if (isset($_GET['cID']) && is_numeric($_GET['cID'])) {
         $this->_page_contents = 'edit.php';
     } else {
         $this->_page_contents = 'new.php';
     }
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         $data = array('name' => $_POST['categories_name'], 'image' => isset($_FILES['categories_image']) ? $_FILES['categories_image'] : null, 'sort_order' => $_POST['sort_order']);
         if (!isset($_GET['cID'])) {
             $data['parent_id'] = $_POST['parent_id'];
         }
         $error = false;
         foreach ($data['name'] as $key => $value) {
             if (empty($value)) {
                 $osC_MessageStack->add($this->_module, sprintf($osC_Language->get('ms_warning_category_name_empty'), $osC_Language->getData($key, 'name')), 'warning');
                 $error = true;
             }
         }
         if ($error === false) {
             if (osC_Categories_Admin::save(isset($_GET['cID']) && is_numeric($_GET['cID']) ? $_GET['cID'] : null, $data)) {
                 $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
             } else {
                 $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
             }
             osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $_GET[$this->_module]));
         }
     }
 }
Example #7
0
 public function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     parent::__construct();
     unset($_SESSION['admin']);
     $osC_MessageStack->add('header', $osC_Language->get('ms_success_logged_out'), 'success');
     osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT));
 }
Example #8
0
 function __construct()
 {
     global $osC_Language;
     $osC_Language->loadIniFile('modules/summary/error_log.php');
     $this->_title = $osC_Language->get('summary_error_log_title');
     $this->_title_link = osc_href_link_admin(FILENAME_DEFAULT, 'error_log');
     if (osC_Access::hasAccess('error_log')) {
         $this->_setData();
     }
 }
 function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     $this->_page_title = $osC_Language->get('heading_title');
     if (!isset($_GET['action'])) {
         $_GET['action'] = '';
     }
     if (!isset($_GET['page']) || isset($_GET['page']) && !is_numeric($_GET['page'])) {
         $_GET['page'] = 1;
     }
     if (!isset($_GET['fm'])) {
         $_GET['fm'] = '';
     }
     if (!isset($_GET['fu']) || !is_numeric($_GET['fu'])) {
         $_GET['fu'] = '';
     }
     if (!empty($_GET['action'])) {
         switch ($_GET['action']) {
             case 'info':
                 $this->_page_contents = 'info.php';
                 break;
             case 'delete':
                 $this->_page_contents = 'delete.php';
                 if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
                     if (osC_AdministratorsLog_Admin::delete($_GET['lID'])) {
                         $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
                     } else {
                         $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
                     }
                     osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '&page=' . $_GET['page'] . '&fm=' . $_GET['fm'] . '&fu=' . $_GET['fu']));
                 }
                 break;
             case 'batchDelete':
                 if (isset($_POST['batch']) && is_array($_POST['batch']) && !empty($_POST['batch'])) {
                     $this->_page_contents = 'batch_delete.php';
                     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
                         $error = false;
                         foreach ($_POST['batch'] as $id) {
                             if (!osC_AdministratorsLog_Admin::delete($id)) {
                                 $error = true;
                                 break;
                             }
                         }
                         if ($error === false) {
                             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
                         } else {
                             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
                         }
                         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '&page=' . $_GET['page'] . '&fm=' . $_GET['fm'] . '&fu=' . $_GET['fu']));
                     }
                 }
                 break;
         }
     }
 }
Example #10
0
/**
 * Redirect to a URL address
 *
 * @param string $url The URL address to redirect to
 * @access public
 */
function osc_redirect_admin($url)
{
    if (strpos($url, "\n") !== false || strpos($url, "\r") !== false) {
        $url = osc_href_link_admin(FILENAME_DEFAULT);
    }
    if (strpos($url, '&amp;') !== false) {
        $url = str_replace('&amp;', '&', $url);
    }
    header('Location: ' . $url);
    exit;
}
Example #11
0
 public function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     parent::__construct();
     $this->_page_contents = 'definitions_delete.php';
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         if (osC_Languages_Admin::deleteDefinitions($_GET[$this->_module], $_GET['group'], array($_GET['dID']))) {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
         } else {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
         }
         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $_GET[$this->_module]) . (isset($_GET['group']) ? '&group=' . $_GET['group'] : ''));
     }
 }
Example #12
0
 function _setData()
 {
     global $osC_Database, $osC_Currencies;
     $this->_data = array();
     $this->_resultset = $osC_Database->query('select o.orders_id, o.customers_name, ot.value from :table_orders o, :table_orders_total ot where o.orders_id = ot.orders_id and ot.class = :class order by value desc');
     $this->_resultset->bindTable(':table_orders', TABLE_ORDERS);
     $this->_resultset->bindTable(':table_orders_total', TABLE_ORDERS_TOTAL);
     $this->_resultset->bindValue(':class', 'total');
     $this->_resultset->setBatchLimit($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS);
     $this->_resultset->execute();
     while ($this->_resultset->next()) {
         $this->_data[] = array(osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, 'orders&oID=' . $this->_resultset->value('orders_id') . '&action=save'), $this->_icon . '&nbsp;' . $this->_resultset->value('customers_name')), $osC_Currencies->format($this->_resultset->valueInt('value')));
     }
 }
Example #13
0
 public function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     parent::__construct();
     $this->_page_contents = 'copy.php';
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         if (osC_Products_Admin::copy($_GET[$this->_module], $_POST['new_category_id'], $_POST['copy_as'])) {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
         } else {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
         }
         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '&cID=' . $_GET['cID']));
     }
 }
 public function __construct()
 {
     global $osC_MessageStack;
     parent::__construct();
     $this->_page_contents = 'entries_delete.php';
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         if (osC_ProductTypes_Admin::deleteAssignments($_GET[$this->_module], $_GET['aID'])) {
             $osC_MessageStack->add($this->_module, OSCOM::getDef('ms_success_action_performed'), 'success');
         } else {
             $osC_MessageStack->add($this->_module, OSCOM::getDef('ms_error_action_not_performed'), 'error');
         }
         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $_GET[$this->_module]));
     }
 }
Example #15
0
 public function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     parent::__construct();
     $this->_page_contents = 'delete.php';
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         if (osC_CreditCards_Admin::delete($_GET['ccID'])) {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
         } else {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
         }
         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
     }
 }
Example #16
0
 function _setData()
 {
     global $osC_Database, $osC_Language;
     $this->_data = array();
     $this->_resultset = $osC_Database->query('select p.products_id, pd.products_name, pd.products_viewed, l.name, l.code from :table_products p, :table_products_description pd, :table_languages l where p.products_id = pd.products_id and l.languages_id = pd.language_id order by pd.products_viewed desc');
     $this->_resultset->bindTable(':table_products', TABLE_PRODUCTS);
     $this->_resultset->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $this->_resultset->bindTable(':table_languages', TABLE_LANGUAGES);
     $this->_resultset->setBatchLimit($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS);
     $this->_resultset->execute();
     while ($this->_resultset->next()) {
         $this->_data[] = array(osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, 'products&pID=' . $this->_resultset->valueInt('products_id') . '&action=preview'), $this->_icon . '&nbsp;' . $this->_resultset->value('products_name')), $osC_Language->showImage($this->_resultset->value('code')), $this->_resultset->valueInt('products_viewed'));
     }
 }
Example #17
0
 function _setData()
 {
     global $osC_Database, $osC_Language;
     $this->_data = array();
     $this->_resultset = $osC_Database->query('select p.products_id, pd.products_name, products_quantity from :table_products p, :table_products_description pd where p.products_id = pd.products_id and pd.language_id = :language_id and p.products_quantity <= :stock_reorder_level order by p.products_quantity desc');
     $this->_resultset->bindTable(':table_products', TABLE_PRODUCTS);
     $this->_resultset->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $this->_resultset->bindInt(':language_id', $osC_Language->getID());
     $this->_resultset->bindInt(':stock_reorder_level', STOCK_REORDER_LEVEL);
     $this->_resultset->setBatchLimit($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS);
     $this->_resultset->execute();
     while ($this->_resultset->next()) {
         $this->_data[] = array(osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, 'products&pID=' . $this->_resultset->valueInt('products_id') . '&action=preview'), $this->_icon . '&nbsp;' . $this->_resultset->value('products_name')), $this->_resultset->valueInt('products_quantity'));
     }
 }
 function _setData()
 {
     global $osC_Database, $osC_Language;
     $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . '  <thead>' . '    <tr>' . '      <th>' . $osC_Language->get('summary_administrators_log_table_heading_users') . '</th>' . '      <th>' . $osC_Language->get('summary_administrators_log_table_heading_module') . '</th>' . '      <th>' . $osC_Language->get('summary_administrators_log_table_heading_date') . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
     $Qlog = $osC_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->bindTable(':table_administrators_log', TABLE_ADMINISTRATORS_LOG);
     $Qlog->bindTable(':table_administrators', TABLE_ADMINISTRATORS);
     $Qlog->bindRaw(':modules', implode('", "', $_SESSION['admin']['access']));
     $Qlog->execute();
     while ($Qlog->next()) {
         $this->_data .= '    <tr onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' . '      <td>' . osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, 'administrators_log&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>';
     }
     $this->_data .= '  </tbody>' . '</table>';
     $Qlog->freeResult();
 }
Example #19
0
 public function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     parent::__construct();
     $this->_page_contents = 'edit.php';
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         $data = array('name' => $_POST['name'], 'code' => $_POST['code'], 'locale' => $_POST['locale'], 'charset' => $_POST['charset'], 'date_format_short' => $_POST['date_format_short'], 'date_format_long' => $_POST['date_format_long'], 'time_format' => $_POST['time_format'], 'text_direction' => $_POST['text_direction'], 'currencies_id' => $_POST['currencies_id'], 'numeric_separator_decimal' => $_POST['numeric_separator_decimal'], 'numeric_separator_thousands' => $_POST['numeric_separator_thousands'], 'parent_id' => $_POST['parent_id'], 'sort_order' => $_POST['sort_order']);
         if (osC_Languages_Admin::update($_GET['lID'], $data, isset($_POST['default']) && $_POST['default'] == 'on')) {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
         } else {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
         }
         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
     }
 }
Example #20
0
 public function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     parent::__construct();
     $this->_page_contents = 'definitions_new.php';
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         $data = array('key' => $_POST['key'], 'value' => $_POST['value']);
         if (osC_Languages_Admin::insertDefinition(!empty($_POST['group_new']) ? $_POST['group_new'] : $_POST['group'], $data)) {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
         } else {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
         }
         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $_GET[$this->_module]) . (isset($_GET['group']) ? '&group=' . $_GET['group'] : ''));
     }
 }
Example #21
0
 function _setData()
 {
     global $osC_Database, $osC_Language;
     $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . '  <thead>' . '    <tr>' . '      <th>' . $osC_Language->get('summary_reviews_table_heading_products') . '</th>' . '      <th>' . $osC_Language->get('summary_reviews_table_heading_language') . '</th>' . '      <th>' . $osC_Language->get('summary_reviews_table_heading_rating') . '</th>' . '      <th>' . $osC_Language->get('summary_reviews_table_heading_date') . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
     $Qreviews = $osC_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->bindTable(':table_reviews', TABLE_REVIEWS);
     $Qreviews->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $Qreviews->bindTable(':table_languages', TABLE_LANGUAGES);
     $Qreviews->execute();
     while ($Qreviews->next()) {
         $this->_data .= '    <tr onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' . '      <td>' . osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, 'reviews&rID=' . $Qreviews->valueInt('reviews_id') . '&action=save'), osc_icon('reviews.png') . '&nbsp;' . $Qreviews->value('products_name')) . '</td>' . '      <td align="center">' . $osC_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>';
     }
     $this->_data .= '  </tbody>' . '</table>';
     $Qreviews->freeResult();
 }
Example #22
0
 function _setData()
 {
     global $osC_Database, $osC_Language;
     $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . '  <thead>' . '    <tr>' . '      <th>' . $osC_Language->get('summary_orders_table_heading_orders') . '</th>' . '      <th>' . $osC_Language->get('summary_orders_table_heading_total') . '</th>' . '      <th>' . $osC_Language->get('summary_orders_table_heading_date') . '</th>' . '      <th>' . $osC_Language->get('summary_orders_table_heading_status') . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
     $Qorders = $osC_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->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', $osC_Language->getID());
     $Qorders->execute();
     while ($Qorders->next()) {
         $this->_data .= '    <tr onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' . '      <td>' . osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, '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>';
     }
     $this->_data .= '  </tbody>' . '</table>';
     $Qorders->freeResult();
 }
 function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     $this->_page_title = $osC_Language->get('heading_title');
     if (!isset($_GET['action'])) {
         $_GET['action'] = '';
     }
     if (!empty($_GET['action'])) {
         switch ($_GET['action']) {
             case 'install':
                 $module = basename($_GET['module']);
                 if (file_exists('includes/modules/product_attributes/' . $module . '.php')) {
                     include 'includes/modules/product_attributes/' . $module . '.php';
                     if (class_exists('osC_ProductAttributes_' . $module)) {
                         $module = 'osC_ProductAttributes_' . $module;
                         $module = new $module();
                         if ($module->install()) {
                             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
                         } else {
                             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
                         }
                         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
                     }
                 }
                 break;
             case 'uninstall':
                 $this->_page_contents = 'uninstall.php';
                 if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
                     $module = basename($_GET['module']);
                     if (file_exists('includes/modules/product_attributes/' . $module . '.php')) {
                         include 'includes/modules/product_attributes/' . $module . '.php';
                         if (class_exists('osC_ProductAttributes_' . $module)) {
                             $module = 'osC_ProductAttributes_' . $module;
                             $module = new $module();
                             if ($module->uninstall()) {
                                 $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
                             } else {
                                 $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
                             }
                             osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
                         }
                     }
                 }
                 break;
         }
     }
 }
 function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     $this->_page_title = $osC_Language->get('heading_title');
     if (!isset($_GET['action'])) {
         $_GET['action'] = '';
     }
     if (!empty($_GET['action'])) {
         switch ($_GET['action']) {
             case 'info':
                 $this->_page_contents = 'info.php';
                 break;
             case 'save':
                 $this->_page_contents = 'edit.php';
                 if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
                     $data = array('configuration' => $_POST['configuration']);
                     if ($this->_save($_GET['template'], $data, isset($_POST['default']) && $_POST['default'] == 'on' ? true : false)) {
                         $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
                     } else {
                         $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
                     }
                     osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
                 }
                 break;
             case 'install':
                 if ($this->_install($_GET['template'])) {
                     $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
                 } else {
                     $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
                 }
                 osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
                 break;
             case 'uninstall':
                 $this->_page_contents = 'uninstall.php';
                 if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
                     if ($this->_uninstall($_GET['template'])) {
                         $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
                     } else {
                         $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
                     }
                     osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
                 }
                 break;
         }
     }
 }
Example #25
0
 public function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     parent::__construct();
     $this->_page_contents = 'update_rates.php';
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         if (isset($_POST['service']) && ($_POST['service'] == 'oanda' || $_POST['service'] == 'xe')) {
             $results = osC_Currencies_Admin::updateRates($_POST['service']);
             foreach ($results[0] as $result) {
                 $osC_MessageStack->add($this->_module, sprintf($osC_Language->get('ms_error_invalid_currency'), $result['title'], $result['code']), 'error');
             }
             foreach ($results[1] as $result) {
                 $osC_MessageStack->add($this->_module, sprintf($osC_Language->get('ms_success_currency_updated'), $result['title'], $result['code']), 'success');
             }
         }
         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
     }
 }
Example #26
0
 public function __construct()
 {
     global $osC_MessageStack;
     parent::__construct();
     if (isset($_GET['tID']) && is_numeric($_GET['tID'])) {
         $this->_page_contents = 'edit.php';
     } else {
         $this->_page_contents = 'new.php';
     }
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         $data = array('title' => $_POST['title']);
         if (osC_ProductTypes_Admin::save(isset($_GET['tID']) && is_numeric($_GET['tID']) ? $_GET['tID'] : null, $data)) {
             $osC_MessageStack->add($this->_module, OSCOM::getDef('ms_success_action_performed'), 'success');
         } else {
             $osC_MessageStack->add($this->_module, OSCOM::getDef('ms_error_action_not_performed'), 'error');
         }
         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
     }
 }
Example #27
0
 public function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     parent::__construct();
     if (isset($_GET['zID']) && is_numeric($_GET['zID'])) {
         $this->_page_contents = 'zones_edit.php';
     } else {
         $this->_page_contents = 'zones_new.php';
     }
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         $data = array('name' => $_POST['zone_name'], 'code' => $_POST['zone_code'], 'country_id' => $_GET[$this->_module]);
         if (osC_Countries_Admin::saveZone(isset($_GET['zID']) && is_numeric($_GET['zID']) ? $_GET['zID'] : null, $data)) {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
         } else {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
         }
         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $_GET[$this->_module]));
     }
 }
Example #28
0
 public function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     parent::__construct();
     if (isset($_GET['ccID']) && is_numeric($_GET['ccID'])) {
         $this->_page_contents = 'edit.php';
     } else {
         $this->_page_contents = 'new.php';
     }
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         $data = array('name' => $_POST['credit_card_name'], 'pattern' => $_POST['pattern'], 'status' => isset($_POST['credit_card_status']) && $_POST['credit_card_status'] == '1' ? 1 : 0, 'sort_order' => $_POST['sort_order']);
         if (osC_CreditCards_Admin::save(isset($_GET['ccID']) && is_numeric($_GET['ccID']) ? $_GET['ccID'] : null, $data)) {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
         } else {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
         }
         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
     }
 }
Example #29
0
 public function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     parent::__construct();
     if (isset($_GET['cID']) && is_numeric($_GET['cID'])) {
         $this->_page_contents = 'edit.php';
     } else {
         $this->_page_contents = 'new.php';
     }
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         $data = array('title' => $_POST['title'], 'code' => $_POST['code'], 'symbol_left' => $_POST['symbol_left'], 'symbol_right' => $_POST['symbol_right'], 'decimal_places' => $_POST['decimal_places'], 'value' => $_POST['value']);
         if (osC_Currencies_Admin::save(isset($_GET['cID']) && is_numeric($_GET['cID']) ? $_GET['cID'] : null, $data, isset($_POST['default']) && $_POST['default'] == 'on' || isset($_POST['is_default']) && $_POST['is_default'] == 'true' && $_POST['code'] != DEFAULT_CURRENCY)) {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
         } else {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
         }
         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
     }
 }
Example #30
0
 public function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     parent::__construct();
     if (isset($_GET['trID']) && is_numeric($_GET['trID'])) {
         $this->_page_contents = 'entries_edit.php';
     } else {
         $this->_page_contents = 'entries_new.php';
     }
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         $data = array('zone_id' => $_POST['tax_zone_id'], 'rate' => $_POST['tax_rate'], 'description' => $_POST['tax_description'], 'priority' => $_POST['tax_priority'], 'rate' => $_POST['tax_rate'], 'tax_class_id' => $_GET[$this->_module]);
         if (osC_TaxClasses_Admin::saveEntry(isset($_GET['trID']) && is_numeric($_GET['trID']) ? $_GET['trID'] : null, $data)) {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
         } else {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
         }
         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $_GET[$this->_module]));
     }
 }