$customer_id = $profile_edit->create($customer_id); if ($store->is_store_owner($customer_id)) { // file uploading class require DIR_WS_CLASSES . 'upload.php'; if (function_exists('ini_get') && (bool) ini_get('file_uploads') == false) { $messageStack->add(WARNING_FILE_UPLOADS_DISABLED, 'warning'); } $store_query = smn_db_query("select store_name from " . TABLE_STORE_DESCRIPTION . " WHERE store_name like '" . $_POST['store_edit_name'] . "'"); if (smn_db_num_rows($store_query)) { $error = true; $messageStack->add('account_edit', ENTRY_STORE_NAME_ERROR); } else { $store_edit->set_store_name($_POST['store_edit_name']); } $store_edit->set_store_description($_POST['store_description']); $store_edit->update_store_info(); $store_edit->set_store_logo('store_image'); $error_text = $store_edit->put_logo_image('update'); if ($error_text != '') { smn_session_register('error_text'); } } $customer_first_name = $firstname; $messageStack->add_session('account_edit', SUCCESS_ACCOUNT_UPDATED, 'success'); smn_redirect(smn_href_link(FILENAME_ACCOUNT_EDIT, 'ID=' . $store_id, 'NONSSL')); } } $account_query = smn_db_query("select c.*, ab.* from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab where ab.customers_id = '" . (int) $customer_id . "' and c.customers_id = '" . (int) $customer_id . "' and ab.address_book_id = c.customers_default_address_id"); $account = smn_db_fetch_array($account_query); $breadcrumb->add(NAVBAR_TITLE_1, smn_href_link(FILENAME_ACCOUNT, 'ID=' . $store_id, 'NONSSL')); $breadcrumb->add(NAVBAR_TITLE_2, smn_href_link(FILENAME_ACCOUNT_EDIT, 'ID=' . $store_id, 'NONSSL'));
$customerInfo->set_zone_id($customer_zone_id); $customerInfo->set_state($state); $customerInfo->set_telephone($telephone); $customerInfo->set_tollfree($tollfree); $customerInfo->set_fax($fax); $customerInfo->set_newsletter($newsletter); if (isset($_POST['affiliate_id'])) { $customerInfo->set_affiliate_id($_POST['affiliate_id']); } $customerInfo->create($customer_id); if (smn_session_is_registered('customer_store_id')) { $customerInfo->update_store_admin(); $customersStore->set_store_name($new_store_name); $customersStore->set_store_category($_POST['store_catagory']); $customersStore->set_store_description($_POST['store_description']); $customersStore->update_store_info(); $customersStore->put_store_category(); } echo '{success:true}'; } else { echo '{ success: false, errors: { message: "' . addslashes(str_replace("\n", '', nl2br($messageStack->outputPlain('account_edit')))) . '" } }'; } exit; } $account_query = smn_db_query("select c.*, ab.* from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab where ab.customers_id = '" . (int) $customer_id . "' and c.customers_id = '" . (int) $customer_id . "' and ab.address_book_id = c.customers_default_address_id"); $account = smn_db_fetch_array($account_query);
$customer_store_id = $store_info->create_store(); $store_info->put_store_description(); $store_info->put_store_category(); $store_info->put_store_admin(); $store_info->put_store_data(); $store_info->put_store_cost(); $store_info->put_store_products(); if (ALLOW_STORE_SITE_TEXT == 'true') { $store_info->put_store_language('english'); } $store_info->send_store_email($gender); $error_text = $store_info->put_logo_image('update'); } else { $customer_store_id = (int) $_GET['sID']; //update existing store here.... $store_info->update_store_info(); $error_text = $store_info->put_logo_image('update'); $sql_store_array = array('store_status' => $store_status); smn_db_perform(TABLE_STORE_MAIN, $sql_store_array, 'update', "store_id = '" . (int) $_GET['sID'] . "'"); $sql_member_array = array('products_id' => (int) $store_products_id); smn_db_perform(TABLE_MEMBER_ORDERS, $sql_member_array, 'update', "store_id = '" . (int) $_GET['sID'] . "'"); if ((int) $_GET['sID'] != 1) { $sql_data_array = array('admin_groups_id' => (int) $new_store_type); } smn_db_perform(TABLE_ADMIN, $sql_data_array, 'update', "store_id = '" . (int) $_GET['sID'] . "'"); } smn_redirect(smn_href_link(FILENAME_MANAGEMENT, 'sPath=' . $sPath . '&sID=' . (int) $customer_store_id)); } } // check if the catalog image directory exists if (is_dir(DIR_FS_CATALOG_IMAGES)) {