예제 #1
0
 public function __construct()
 {
     global $lC_Language, $lC_MessageStack;
     parent::__construct();
     $this->_page_contents = 'edit.php';
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         switch ($_GET['action']) {
             case 'save':
                 $data = array('oid' => $_POST['oid'], 'status' => $_POST['status'], 'comment' => $_POST['comment'], 'notify_customer' => isset($_POST['notify_customer']) && $_POST['notify_customer'] == 1 ? true : false, 'append_comment' => isset($_POST['append_comment']) && $_POST['append_comment'] == 1 ? true : false);
                 /*
                  * Update the order status
                  *
                  * @param integer $data['oid'] The orders id used on status update
                  * @param array $data The order status information
                  * @access public
                  * @return boolean
                  */
                 if (lC_Orders_Admin::updateStatus($data['oid'], $data)) {
                     lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $data['oid'] . '&action=save'));
                 } else {
                     $_SESSION['error'] = true;
                     $_SESSION['errmsg'] = $lC_Language->get('ms_error_action_not_performed');
                 }
                 break;
         }
     }
 }
예제 #2
0
 public function __construct()
 {
     global $lC_Database, $lC_Language, $lC_MessageStack;
     parent::__construct();
     if (isset($_SESSION['img_resize_flag'])) {
         unset($_SESSION['img_resize_flag']);
     }
     if (!empty($_POST['user_name']) && !empty($_POST['user_password'])) {
         $Qadmin = $lC_Database->query('select * from :table_administrators where user_name = :user_name');
         $Qadmin->bindTable(':table_administrators', TABLE_ADMINISTRATORS);
         $Qadmin->bindValue(':user_name', $_POST['user_name']);
         $Qadmin->execute();
         if ($Qadmin->numberOfRows() > 0) {
             if (lc_validate_password($_POST['user_password'], $Qadmin->value('user_password'))) {
                 $_SESSION['admin'] = array('id' => $Qadmin->valueInt('id'), 'firstname' => $Qadmin->value('first_name'), 'lastname' => $Qadmin->value('last_name'), 'username' => $Qadmin->value('user_name'), 'password' => $Qadmin->value('user_password'), 'access' => lC_Access::getUserLevels($Qadmin->valueInt('access_group_id')), 'language_id' => $Qadmin->value('language_id'));
                 $get_string = null;
                 if (isset($_SESSION['redirect_origin'])) {
                     $get_string = http_build_query($_SESSION['redirect_origin']['get']);
                     if (substr($get_string, -1) == '=') {
                         $get_string = substr($get_string, 0, -1);
                     }
                     unset($_SESSION['redirect_origin']);
                 }
                 if (defined('INSTALLATION_ID') && INSTALLATION_ID != NULL) {
                     lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $get_string));
                 } else {
                     // redirect to login=register
                     lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, 'login&action=register'));
                 }
             }
         }
     }
     $_SESSION['error'] = true;
     $_SESSION['errmsg'] = $lC_Language->get('ms_error_login_invalid');
 }
예제 #3
0
 function __construct()
 {
     global $lC_Language, $lC_MessageStack;
     $this->_page_title = $lC_Language->get('heading_title');
     if (!isset($_GET['action'])) {
         $_GET['action'] = '';
     }
     // check if the graphs directory exists
     $_SESSION['errArr'] = array();
     if (!empty($_GET['action']) && !$_SESSION['error']) {
         switch ($_GET['action']) {
             case 'save':
                 //echo '<pre>';print_r($_POST);exit;
                 $shipping_name = serialize($_POST['ups']);
                 $data = array('title' => $_POST['title'], 'shipping_name' => $shipping_name);
                 /*
                  * Save the banner information
                  *
                  * @param integer $_GET['bid'] The banner id
                  * @param array $data The banner information
                  * @access public
                  * @return boolean
                  */
                 if (lC_Restrict_shipping_Admin::save(isset($_GET['bid']) && is_numeric($_GET['bid']) ? $_GET['bid'] : null, $data)) {
                     lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module));
                 } else {
                     $_SESSION['error'] = true;
                     $_SESSION['errmsg'] = $lC_Language->get('ms_error_action_not_performed');
                 }
                 break;
         }
     }
 }
예제 #4
0
 public function __construct()
 {
     global $lC_Database, $lC_Language, $lC_MessageStack, $rInfo;
     parent::__construct();
     if (!isset($_SESSION['verify_key_valid']) || $_SESSION['verify_key_valid'] === false) {
         lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module));
     }
 }
예제 #5
0
 public function __construct()
 {
     global $lC_Language, $lC_MessageStack;
     parent::__construct();
     unset($_SESSION['admin']);
     if (isset($_SESSION['img_resize_flag'])) {
         unset($_SESSION['img_resize_flag']);
     }
     lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT));
 }
예제 #6
0
 public function __construct()
 {
     global $lC_Language, $lC_MessageStack, $lC_Currencies, $lC_DateTime;
     parent::__construct();
     $this->_page_contents = 'edit.php';
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         // validate the input
         $type = isset($_POST['type']) && $_POST['type'] != NULL ? preg_replace('/[^A-Z\\s]/', '', $_POST['type']) : 'R';
         $name = isset($_POST['name']) && $_POST['name'] != NULL ? preg_replace('/[^A-Za-z0-9\\s]/', '', $_POST['name']) : NULL;
         $reward = isset($_POST['reward']) && $_POST['reward'] != NULL ? preg_replace('/[^0-9\\s\\.\\%]/', '', $_POST['reward']) : 0.0;
         $mode = isset($_POST['mode']) && $_POST['mode'] != NULL ? preg_replace('/[^a-z\\s]/', '', $_POST['mode']) : 'coupon';
         $code = isset($_POST['code']) && $_POST['code'] != NULL ? preg_replace('/[^A-Za-z0-9\\s]/', '', $_POST['code']) : substr(str_shuffle(str_repeat('ABCEFGHJKLMNPRSTUVWXYZabcdefghjklmnpqrstuvwxyz23456789', 7)), 0, 7);
         $purchase_over = isset($_POST['purchase_over']) && $_POST['purchase_over'] != NULL ? preg_replace('/[^0-9\\s\\.\\%]/', '', $_POST['purchase_over']) : 0.0;
         $start_date = isset($_POST['start_date']) && $_POST['start_date'] != NULL ? preg_replace('/[^0-9\\s\\/]/', '', $_POST['start_date']) : NULL;
         $expires_date = isset($_POST['expires_date']) && $_POST['expires_date'] != NULL ? preg_replace('/[^0-9\\s\\/]/', '', $_POST['expires_date']) : NULL;
         $uses_per_coupon = isset($_POST['uses_per_coupon']) && $_POST['uses_per_coupon'] != NULL ? preg_replace('/[^0-9\\s]/', '', $_POST['uses_per_coupon']) : 1;
         $uses_per_customer = isset($_POST['uses_per_customer']) && $_POST['uses_per_customer'] != NULL ? preg_replace('/[^0-9\\s]/', '', $_POST['uses_per_customer']) : 1;
         $restrict_to_products = isset($_POST['restrict_to_products']) && $_POST['restrict_to_products'] != NULL ? preg_replace('/[^0-9\\s]/', '', $_POST['restrict_to_products']) : -1;
         $restrict_to_categories = isset($_POST['restrict_to_categories']) && $_POST['restrict_to_categories'] != NULL ? preg_replace('/[^0-9\\s]/', '', $_POST['restrict_to_categories']) : -1;
         $restrict_to_customers = isset($_POST['restrict_to_customers']) && $_POST['restrict_to_customers'] != NULL ? preg_replace('/[^0-9\\s]/', '', $_POST['restrict_to_customers']) : -1;
         $status = isset($_POST['status']) && $_POST['status'] == 'on' ? 1 : -1;
         $sale_exclude = isset($_POST['sale_exclude']) && $_POST['sale_exclude'] == 'on' ? 1 : -1;
         $notes = isset($_POST['notes']) && $_POST['notes'] != NULL ? preg_replace('/[^a-zA-Z0-9\\s\\.\\%\\,]/', '', $_POST['notes']) : NULL;
         switch ($type) {
             case 'R':
                 // regular
             // regular
             case 'T':
                 // percent
                 if (strstr($reward, '%')) {
                     $type = 'T';
                 }
                 break;
             case 'S':
                 // free shipping
                 break;
             case 'P':
                 // free product
                 break;
         }
         $data = array('name' => $name, 'type' => $type, 'mode' => $mode, 'code' => $code, 'reward' => str_replace("%", "", $reward), 'purchase_over' => $purchase_over, 'start_date' => $start_date, 'expires_date' => $expires_date, 'uses_per_coupon' => $uses_per_coupon, 'uses_per_customer' => $uses_per_customer, 'restrict_to_products' => $restrict_to_products, 'restrict_to_categories' => $restrict_to_categories, 'restrict_to_customers' => $restrict_to_customers, 'status' => $status, 'sale_exclude' => $sale_exclude, 'notes' => $notes);
         $id = lC_Coupons_Admin::save(isset($_GET[$this->_module]) && is_numeric($_GET[$this->_module]) ? $_GET[$this->_module] : null, $data);
         if (is_numeric($id) && isset($id)) {
             if (!empty($_POST['save_close'])) {
                 lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module));
             } else {
                 lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $id . '&action=save'));
             }
         } else {
             $lC_MessageStack->add($this->_module, $lC_Language->get('ms_error_action_not_performed'), 'error');
             lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module));
         }
     }
 }
예제 #7
0
 function __construct()
 {
     global $lC_Language;
     $this->_page_title = $lC_Language->get('heading_title');
     if (!isset($_GET['action'])) {
         $_GET['action'] = '';
     }
     if (!empty($_GET['action']) && !$_SESSION['error']) {
         switch ($_GET['action']) {
             case 'save':
                 $branding_image = $_POST['branding_manager_logo'];
                 $branding_name = $_POST['branding_name'];
                 $branding_slogan = $_POST['branding_slogan'];
                 $branding_chat_code = $_POST['branding_chat_code'];
                 $branding_address = $_POST['branding_address'];
                 $branding_support_phone = $_POST['branding_support_phone'];
                 $branding_support_email = $_POST['branding_support_email'];
                 $branding_sales_phone = $_POST['branding_sales_phone'];
                 $branding_sales_email = $_POST['branding_sales_email'];
                 $branding_meta_description = $_POST['branding_meta_description'];
                 $branding_meta_keywords = $_POST['branding_meta_keywords'];
                 $branding_graph_site_thumbnail = $_POST['branding_graph_site_thumbnail'];
                 $branding_meta_title = $_POST['branding_meta_title'];
                 $branding_meta_title_prefix = $_POST['branding_meta_title_prefix'];
                 $branding_meta_title_suffix = $_POST['branding_meta_title_suffix'];
                 $branding_meta_title_delimeter = $_POST['branding_meta_title_delimeter'];
                 $branding_social_fb_page = $_POST['branding_social_fb_page'];
                 $branding_social_twitter = $_POST['branding_social_twitter'];
                 $branding_social_pinterest = $_POST['branding_social_pinterest'];
                 $branding_social_google_plus = $_POST['branding_social_google_plus'];
                 $branding_social_youtube = $_POST['branding_social_youtube'];
                 $branding_social_linkedin = $_POST['branding_social_linkedin'];
                 $branding_footer_text = $_POST['branding_footer_text'];
                 $branding_home_page_text = $_POST['branding_home_page_text'];
                 $branding_customcss = $_POST['branding_customcss'];
                 $data = array('site_image' => $branding_image, 'name' => $branding_name, 'slogan' => $branding_slogan, 'chat_code' => $branding_chat_code, 'address' => $branding_address, 'support_phone' => $branding_support_phone, 'support_email' => $branding_support_email, 'sales_phone' => $branding_sales_phone, 'sales_email' => $branding_sales_email, 'meta_description' => $branding_meta_description, 'meta_keywords' => $branding_meta_keywords, 'og_image' => $branding_graph_site_thumbnail, 'meta_title' => $branding_meta_title, 'meta_title_prefix' => $branding_meta_title_prefix, 'meta_title_suffix' => $branding_meta_title_suffix, 'meta_delimeter' => $branding_meta_title_delimeter, 'social_facebook_page' => $branding_social_fb_page, 'social_twitter' => $branding_social_twitter, 'social_pinterest' => $branding_social_pinterest, 'social_google_plus' => $branding_social_google_plus, 'social_youtube' => $branding_social_youtube, 'social_linkedin' => $branding_social_linkedin, 'footer_text' => $branding_footer_text, 'home_page_text' => $branding_home_page_text, 'custom_css' => $branding_customcss);
                 /*
                  * Save the Branding information
                  *
                  * @param array $data The Branding information
                  * @access public
                  * @return boolean
                  */
                 if (lC_Branding_manager_Admin::save($data)) {
                     lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module));
                 } else {
                     $_SESSION['error'] = true;
                     $_SESSION['errmsg'] = $lC_Language->get('ms_error_action_not_performed');
                 }
                 break;
         }
     }
 }
예제 #8
0
 public function __construct()
 {
     global $lC_Database, $lC_Language, $lC_MessageStack, $rInfo;
     parent::__construct();
     if (isset($_POST['key']) && $_POST['key'] != NULL && isset($_POST['email']) && $_POST['email'] != NULL) {
         if (lC_Login_Admin::lostPasswordConfirmKey($_POST['key'], $_POST['email'])) {
             $rInfo = new lC_ObjectInfo($_POST);
         } else {
             // if key is invalid redirect back to login
             lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module));
         }
     }
 }
예제 #9
0
 public function __construct()
 {
     global $lC_Language, $lC_Database, $lC_MessageStack;
     if (!isset($_GET['set'])) {
         $_GET['set'] = 'members';
     }
     $action = isset($_GET['gid']) && !empty($_GET['gid']) ? 'edit' : 'insert';
     switch ($_GET['set']) {
         case 'groups':
             $this->_page_title = $lC_Language->get('heading_title_groups');
             $this->_page_name = 'groups';
             $this->_page_contents = 'groups.php';
             if (isset($_GET['process'])) {
                 $result = array();
                 switch (strtolower($_GET['process'])) {
                     case 'edit':
                         $result = lC_Administrators_Admin::saveGroup($_GET['gid'], $_POST);
                         break;
                     default:
                         $result = lC_Administrators_Admin::saveGroup(NULL, $_POST);
                 }
                 if ($result['rpcStatus'] != 1 || $lC_Database->isError()) {
                     if ($lC_Database->isError()) {
                         $lC_MessageStack->add($this->_module, $lC_Database->getError(), 'error');
                     } else {
                         $lC_MessageStack->add($this->_module, $lC_Language->get('ms_error_action_not_performed'), 'error');
                     }
                 }
                 $_SESSION['messageToStack'] = $lC_MessageStack->getAll();
                 lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '&set=groups'));
             }
             break;
         case 'access':
             if ($action == 'insert' && (int) $_SESSION['admin']['access'][$this->_module] < 2) {
                 lc_redirect(lc_href_link_admin(FILENAME_DEFAULT, 'error_pages&set=no_access'));
             }
             if ($action != 'insert' && (int) $_SESSION['admin']['access'][$this->_module] < 3) {
                 lc_redirect(lc_href_link_admin(FILENAME_DEFAULT, 'error_pages&set=no_access'));
             }
             $this->_page_title = $action == 'insert' ? $lC_Language->get('heading_title_new_group') : $lC_Language->get('heading_title_edit_group');
             $this->_page_name = 'access';
             $this->_page_contents = 'access.php';
             break;
         case 'members':
         default:
             $this->_page_title = $lC_Language->get('heading_title');
             $this->_page_name = 'members';
             $this->_page_contents = 'main.php';
             break;
     }
 }
예제 #10
0
 public function __construct()
 {
     global $lC_Database, $lC_Language, $lC_MessageStack;
     parent::__construct();
     if (!isset($_SESSION['verify_key_valid']) || $_SESSION['verify_key_valid'] === false) {
         lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module));
     }
     if (isset($_POST['password']) && $_POST['password'] != NULL && isset($_POST['email']) && $_POST['email'] != NULL) {
         if (lC_Login_Admin::passwordChange($_POST['password'], $_POST['email'])) {
             $rInfo = new lC_ObjectInfo($_POST);
         } else {
             // if error, redirect back to login
             lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module));
         }
     }
 }
예제 #11
0
 public function __construct()
 {
     global $lC_Database, $lC_Language, $lC_Template, $lC_Currencies;
     $lC_Currencies = new lC_Currencies();
     $this->_page_title = $lC_Language->get('heading_title');
     if (!isset($_GET['action'])) {
         $_GET['action'] = '';
     }
     if (isset($_GET['cID']) && $_GET['cID'] != null) {
         $_SESSION['cIDFilter'] = $_GET['cID'];
     } else {
         if (isset($_SESSION['cIDFilter'])) {
             unset($_SESSION['cIDFilter']);
         }
     }
     if (isset($_GET['action']) && $_GET['action'] == "quick_add") {
         if ($order_insert_id = lC_Orders_Admin::createOrder($_GET['cID'])) {
             lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $order_insert_id . '&action=save&tabProducts=1'));
         }
     } else {
         if (isset($_GET['action']) && $_GET['action'] == "add_product") {
             lC_Orders_Admin::addOrderProductData();
             lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $_GET['oID'] . '&action=save&tabProducts=1'));
         }
     }
     // for temporary use
     if (isset($_POST['action_order_total']) && $_POST['action_order_total'] == 'save_order_total') {
         lC_Orders_Admin::saveOrderTotal();
         lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $_POST['oid'] . '&action=save&tabTotals=1'));
     }
     if (!empty($_GET['action'])) {
         switch ($_GET['action']) {
             case 'invoice':
                 $this->_page_contents = 'invoice.php';
                 $this->_has_header = false;
                 $this->_has_footer = false;
                 $this->_has_wrapper = false;
                 break;
             case 'packaging_slip':
                 $this->_page_contents = 'packaging_slip.php';
                 $this->_has_header = false;
                 $this->_has_footer = false;
                 $this->_has_wrapper = false;
                 break;
         }
     }
 }
예제 #12
0
 function __construct()
 {
     global $lC_Language, $lC_MessageStack;
     $this->_page_title = $lC_Language->get('heading_title');
     if (!isset($_GET['action'])) {
         $_GET['action'] = '';
     }
     $this->image_extension = lc_dynamic_image_extension();
     // check if the graphs directory exists
     $_SESSION['errArr'] = array();
     if (!empty($this->image_extension)) {
         if (is_dir('images/graphs')) {
             if (!is_writeable('images/graphs')) {
                 $_SESSION['errArr']['error'] = true;
                 $_SESSION['errArr']['errmsg'] = sprintf($lC_Language->get('ms_error_graphs_directory_not_writable'), realpath('images'));
             }
         } else {
             $_SESSION['errArr']['error'] = true;
             $_SESSION['errArr']['errmsg'] = sprintf($lC_Language->get('ms_error_graphs_directory_non_existant'), realpath('images'));
         }
     }
     if (!empty($_GET['action']) && !$_SESSION['error']) {
         switch ($_GET['action']) {
             case 'save':
                 $data = array('title' => $_POST['title'], 'url' => $_POST['url'], 'target' => isset($_POST['target']) && $_POST['target'] == 'on' ? true : false, 'group' => isset($_POST['group']) ? $_POST['group'] : null, 'group_new' => $_POST['group_new'], 'image' => isset($_FILES['image']) ? $_FILES['image'] : null, 'image_local' => $_POST['image_local'], 'image_target' => $_POST['image_target'], 'html_text' => $_POST['html_text'], 'date_scheduled' => $_POST['date_scheduled'], 'date_expires' => $_POST['date_expires'], 'expires_impressions' => $_POST['expires_impressions'], 'status' => isset($_POST['status']) && $_POST['status'] == 'on' ? true : false);
                 /*
                  * Save the banner information
                  *
                  * @param integer $_GET['bid'] The banner id
                  * @param array $data The banner information
                  * @access public
                  * @return boolean
                  */
                 if (lC_Banner_manager_Admin::save(isset($_GET['bid']) && is_numeric($_GET['bid']) ? $_GET['bid'] : null, $data)) {
                     lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module));
                 } else {
                     $_SESSION['error'] = true;
                     $_SESSION['errmsg'] = $lC_Language->get('ms_error_action_not_performed');
                 }
                 break;
         }
     }
 }
예제 #13
0
 public function __construct()
 {
     global $lC_Language, $lC_MessageStack;
     parent::__construct();
     $this->_page_contents = 'edit.php';
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         switch ($_GET['action']) {
             case 'save':
                 $data = array('image' => isset($_POST['categories_image']) ? $_POST['categories_image'] : null, 'parent_id' => $_POST['parent_id'], 'sort_order' => $_POST['sort_order'], 'mode' => $_POST['categories_mode'], 'link_target' => $_POST['categories_link_target'] == 'on' ? 1 : 0, 'custom_url' => $_POST['categories_custom_url'], 'status' => $_POST['categories_status'] == 'on' ? 1 : 0, 'nav' => $_POST['categories_visibility_nav'] == 'on' ? 1 : 0, 'box' => $_POST['categories_visibility_box'] == 'on' ? 1 : 0, 'name' => $_POST['categories_name'], 'menu_name' => $_POST['categories_menu_name'], 'blurb' => $_POST['categories_blurb'], 'description' => $_POST['categories_description'], 'permalink' => $_POST['categories_permalink'], 'tags' => $_POST['categories_tags']);
                 // access levels
                 if (isset($_POST['access_levels'])) {
                     $data['access_levels'] = $_POST['access_levels'];
                 }
                 if (isset($_POST['sync_all_products'])) {
                     $data['sync_all_products'] = $_POST['sync_all_products'];
                 }
                 if (isset($_POST['sync_all_children'])) {
                     $data['sync_all_children'] = $_POST['sync_all_children'];
                 }
                 /*
                  * Save the category information
                  *
                  * @param integer $_GET['cid'] The categories id used on update, null on insert
                  * @param array $data The categories information
                  * @access public
                  * @return boolean
                  */
                 $id = lC_Categories_Admin::save(isset($_GET['categories']) && is_numeric($_GET['categories']) ? $_GET['categories'] : null, $data);
                 if (is_numeric($id)) {
                     if (empty($_POST['save_close'])) {
                         lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $id . '&cid=' . $_GET['cid'] . '&action=save'));
                     } else {
                         lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $data['parent_id']));
                     }
                 } else {
                     $_SESSION['error'] = true;
                     $_SESSION['errmsg'] = $lC_Language->get('ms_error_action_not_performed');
                 }
                 break;
         }
     }
 }
예제 #14
0
 function __construct()
 {
     global $lC_Language, $lC_Image;
     $this->_page_title = $lC_Language->get('heading_title');
     if (!isset($_GET['action'])) {
         $_GET['action'] = '';
     }
     // check if the manufacturers image directory exists
     if (is_dir('../images/manufacturers')) {
         if (!is_writeable('../images/manufacturers')) {
             $_SESSION['error'] = true;
             $_SESSION['errmsg'] = sprintf($lC_Language->get('ms_error_image_directory_not_writable'), realpath('../images/manufacturers'));
         }
     } else {
         $_SESSION['error'] = true;
         $_SESSION['errmsg'] = sprintf($lC_Language->get('ms_error_image_directory_non_existant'), realpath('../images/manufacturers'));
     }
     $lC_Image = new lC_Image_Admin();
     if (!empty($_GET['action'])) {
         switch ($_GET['action']) {
             case 'save':
                 /*
                  * Save the manufacturer information
                  *
                  * @param integer $_GET['mID'] The manufacturer id
                  * @param array $data The manufacturer information
                  * @access public
                  * @return boolean
                  */
                 $data = array('name' => $_POST['manufacturers_name'], 'image' => isset($_FILES['image']) ? $_FILES['image'] : null, 'url' => $_POST['manufacturers_url']);
                 if (lC_Manufacturers_Admin::save(isset($_GET['mID']) && is_numeric($_GET['mID']) ? $_GET['mID'] : null, $data)) {
                     lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module));
                 } else {
                     $_SESSION['error'] = true;
                     $_SESSION['errmsg'] = $lC_Language->get('ms_error_action_not_performed');
                 }
                 break;
         }
     }
 }
예제 #15
0
 public function __construct()
 {
     global $lC_Language, $lC_MessageStack, $lC_Currencies, $lC_DateTime;
     parent::__construct();
     $this->_page_contents = 'edit.php';
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         // validate the input
         $status = isset($_POST['status']) && $_POST['status'] == 'on' ? 1 : 0;
         $expires_date = isset($_POST['expires_date']) && $_POST['expires_date'] != NULL ? preg_replace('/[^0-9\\s\\/]/', '', $_POST['expires_date']) : '0000-00-00 00:00:00';
         $data = array('products_id' => $_POST['products_id'], 'status' => $status, 'expires_date' => $expires_date);
         $id = lC_Featured_products_Admin::save(isset($_GET[$this->_module]) && is_numeric($_GET[$this->_module]) ? $_GET[$this->_module] : null, $data);
         if (is_numeric($id)) {
             if (empty($_POST['save_close'])) {
                 lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $id . '&action=save'));
             } else {
                 lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module));
             }
         } else {
             $lC_MessageStack->add($this->_module, $lC_Language->get('ms_error_action_not_performed'), 'error');
         }
         lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module));
     }
 }
예제 #16
0
 public function __construct()
 {
     global $lC_Language, $lC_MessageStack;
     parent::__construct();
     $this->_page_contents = 'edit.php';
     if ((lc_empty(CFG_APP_IMAGEMAGICK_CONVERT) || !@file_exists(CFG_APP_IMAGEMAGICK_CONVERT)) && !lC_Image_Admin::hasGDSupport()) {
         $_SESSION['error'] = true;
         $_SESSION['errmsg'] = $lC_Language->get('ms_warning_image_processor_not_available');
     }
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         $error = false;
         $has_variants = isset($_POST['variants']) ? true : false;
         $data = array('id' => isset($_POST['products_id']) ? $_POST['products_id'] : 0, 'quantity' => isset($_POST['products_quantity']) && $has_variants === false ? $_POST['products_quantity'] : 0, 'cost' => number_format(is_numeric($_POST['products_cost']) ? $_POST['products_cost'] : 0, DECIMAL_PLACES, '.', ''), 'price' => number_format(is_numeric($_POST['products_price']) ? $_POST['products_price'] : 0, DECIMAL_PLACES, '.', ''), 'msrp' => number_format(is_numeric($_POST['products_msrp']) ? $_POST['products_msrp'] : 0, DECIMAL_PLACES, '.', ''), 'weight' => $_POST['products_weight'], 'weight_class' => isset($_POST['products_weight_class']) ? $_POST['products_weight_class'] : '', 'status' => isset($_POST['products_status']) && $_POST['products_status'] == 'on' ? true : false, 'model' => isset($_POST['products_model']) ? $_POST['products_model'] : '', 'sku' => isset($_POST['products_sku']) ? $_POST['products_sku'] : '', 'tax_class_id' => isset($_POST['products_tax_class_id']) ? $_POST['products_tax_class_id'] : 0, 'shipping_rule_id' => isset($_POST['shipping_rule_id']) ? $_POST['shipping_rule_id'] : 0, 'products_name' => $_POST['products_name'], 'products_blurb' => $_POST['products_blurb'], 'products_description' => $_POST['products_description'], 'products_keyword' => $_POST['products_keyword'], 'products_tags' => $_POST['products_tags'], 'products_url' => $_POST['products_url'], 'has_children' => $has_variants, 'products_sort_order' => $_POST['products_sort_order']);
         if (isset($_POST['attributes'])) {
             $data['attributes'] = $_POST['attributes'];
         }
         if (isset($_POST['attributes2'])) {
             $data['attributes2'] = $_POST['attributes2'];
         }
         if (isset($_POST['categories'])) {
             $data['categories'] = $_POST['categories'];
         }
         if (isset($_POST['localimages'])) {
             $data['localimages'] = $_POST['localimages'];
         }
         // simple options
         if (isset($_POST['simple_options_group_name'])) {
             $data['simple_options_group_name'] = $_POST['simple_options_group_name'];
         }
         if (isset($_POST['simple_options_group_type'])) {
             $data['simple_options_group_type'] = $_POST['simple_options_group_type'];
         }
         if (isset($_POST['simple_options_group_sort_order'])) {
             $data['simple_options_group_sort_order'] = $_POST['simple_options_group_sort_order'];
         }
         if (isset($_POST['simple_options_group_status'])) {
             $data['simple_options_group_status'] = $_POST['simple_options_group_status'];
         }
         if (isset($_POST['simple_options_entry'])) {
             $data['simple_options_entry'] = $_POST['simple_options_entry'];
         }
         if (isset($_POST['simple_options_entry_price_modifier'])) {
             $data['simple_options_entry_price_modifier'] = $_POST['simple_options_entry_price_modifier'];
         }
         // specials
         if (isset($_POST['specials_pricing_switch']) && $_POST['specials_pricing_switch'] == 'on') {
             if (is_array($_POST['products_special_pricing'])) {
                 $data['products_special_pricing'] = $_POST['products_special_pricing'];
             }
             $data['specials_pricing_switch'] = 1;
             if (isset($_POST['products_special_pricing_enable1'])) {
                 $data['products_special_pricing_enable1'] = $_POST['products_special_pricing_enable1'] == 'on' ? 1 : 0;
             }
             if (isset($_POST['products_special_price'][1])) {
                 $data['products_special_price1'] = $_POST['products_special_price'][1];
             }
             if (isset($_POST['products_special_start_date'][1])) {
                 $data['products_special_start_date1'] = $_POST['products_special_start_date'][1];
             }
             if (isset($_POST['products_special_expires_date'][1])) {
                 $data['products_special_expires_date1'] = $_POST['products_special_expires_date'][1];
             }
         }
         // sub-products
         if (is_array($_POST['sub_products_name']) && count($_POST['sub_products_name']) > 1) {
             $data['has_subproducts'] = '1';
             $data['sub_products_name'] = $_POST['sub_products_name'];
             if (isset($_POST['sub_products_default']) && $_POST['sub_products_default'] != NULL) {
                 $data['sub_products_default'] = $_POST['sub_products_default'];
             }
             if (isset($_POST['sub_products_status']) && $_POST['sub_products_status'] != NULL) {
                 $data['sub_products_status'] = $_POST['sub_products_status'];
             }
             if (isset($_POST['sub_products_weight']) && $_POST['sub_products_weight'] != NULL) {
                 $data['sub_products_weight'] = $_POST['sub_products_weight'];
             }
             if (isset($_POST['sub_products_sku']) && $_POST['sub_products_sku'] != NULL) {
                 $data['sub_products_sku'] = $_POST['sub_products_sku'];
             }
             if (isset($_POST['sub_products_qoh']) && $_POST['sub_products_qoh'] != NULL) {
                 $data['sub_products_qoh'] = $_POST['sub_products_qoh'];
             }
             if (isset($_POST['sub_products_id']) && $_POST['sub_products_id'] != NULL) {
                 $data['sub_products_id'] = $_POST['sub_products_id'];
             }
             if (isset($_POST['sub_products_cost']) && $_POST['sub_products_cost'] != NULL) {
                 $data['sub_products_cost'] = $_POST['sub_products_cost'];
             }
             if (isset($_POST['sub_products_price']) && $_POST['sub_products_price'] != NULL) {
                 $data['sub_products_price'] = $_POST['sub_products_price'];
             }
         }
         // qpb
         $data['qpb_pricing_switch'] = isset($_POST['qpb_pricing_switch']) && $_POST['qpb_pricing_switch'] == 'on' ? true : false;
         if (is_array($_POST['products_qty_break_point']) && $_POST['products_qty_break_point'][1] != NULL) {
             $data['products_qty_break_point'] = $_POST['products_qty_break_point'];
         }
         if (is_array($_POST['products_qty_break_price']) && $_POST['products_qty_break_price'][1] != NULL) {
             $data['products_qty_break_price'] = $_POST['products_qty_break_price'];
         }
         // multi SKU options
         if (isset($_POST['variants'])) {
             $data['variants'] = $_POST['variants'];
         }
         // access levels
         if (isset($_POST['access_levels'])) {
             $data['access_levels'] = $_POST['access_levels'];
         }
         // options pricing
         if (isset($_POST['options_pricing'])) {
             $data['options_pricing'] = $_POST['options_pricing'];
         }
         // specials pricing
         if (isset($_POST['specials_pricing'])) {
             $data['specials_pricing'] = $_POST['specials_pricing'];
         }
         // group pricing
         $data['groups_pricing_switch'] = isset($_POST['groups_pricing_switch']) && $_POST['groups_pricing_switch'] == 'on' ? true : false;
         if (isset($_POST['group_pricing'])) {
             $data['group_pricing'] = $_POST['group_pricing'];
         }
         if ($error === false) {
             // the line below is used as a hook match point - do not not modify or remove
             $id = (int) lC_Products_Admin::save(isset($_GET[$this->_module]) && is_numeric($_GET[$this->_module]) ? $_GET[$this->_module] : null, $data);
             if (is_numeric($id)) {
                 if (empty($_POST['save_close'])) {
                     lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $id . '&action=save&cID=' . $_GET['cID']));
                 } else {
                     lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '&cID=' . $_GET['cID']));
                 }
             } else {
                 $_SESSION['error'] = true;
                 $_SESSION['errmsg'] = $lC_Language->get('ms_error_action_not_performed');
             }
             lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '&cID=' . $_GET['cID']));
         }
     }
 }
예제 #17
0
if (!isset($_SESSION['admin']) && basename($_SERVER['PHP_SELF']) != FILENAME_RPC) {
    $redirect = false;
    if (empty($_GET)) {
        $redirect = true;
    } else {
        $first_array = array_slice($_GET, 0, 1);
        $_module = lc_sanitize_string(basename(key($first_array)));
        if ($_module != 'login') {
            if (!isset($_SESSION['redirect_origin'])) {
                $_SESSION['redirect_origin'] = array('module' => $_module, 'get' => $_GET);
            }
            $redirect = true;
        }
    }
    if ($redirect === true) {
        lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, 'login'));
    }
    unset($redirect);
}
require $lC_Vqmod->modCheck('includes/classes/access.php');
require $lC_Vqmod->modCheck('../includes/classes/directory_listing.php');
require $lC_Vqmod->modCheck('../includes/classes/address.php');
require $lC_Vqmod->modCheck('../includes/classes/weight.php');
require $lC_Vqmod->modCheck('../includes/classes/xml.php');
require $lC_Vqmod->modCheck('../includes/classes/datetime.php');
// set the language
require $lC_Vqmod->modCheck('includes/classes/language.php');
$lC_Language = new lC_Language_Admin();
// admin specific language
if ($lC_Language->getAdminLanguage($_SESSION['admin']['id']) != 'en_US' || $lC_Language->getAdminLanguage($_SESSION['admin']['id']) != $_SESSION['admin']['language_id']) {
    $lC_Language->set($lC_Language->getAdminLanguage($_SESSION['admin']['id']));