Example #1
0
 function mall_setup($store_id = 1)
 {
     $this->set_store_id((int) $store_id);
     require DIR_WS_INCLUDES . 'database_tables.php';
     smn_set_database_tables();
     $store_query = smn_db_query("select sm.*, sd.store_description, sd.store_name, a.admin_groups_id from " . TABLE_STORE_MAIN . " sm, " . TABLE_STORE_DESCRIPTION . " sd, " . TABLE_ADMIN . " a WHERE sm.store_id = '" . $this->store_id . "' and sd.store_id = '" . $this->store_id . "' and a.store_id = '" . $this->store_id . "'");
     if (smn_db_num_rows($store_query) == 0) {
         $this->store_id = 1;
         $store_query = smn_db_query("select sm.*, sd.store_description, sd.store_name, a.admin_groups_id from " . TABLE_STORE_MAIN . " sm, " . TABLE_STORE_DESCRIPTION . " sd, " . TABLE_ADMIN . " a WHERE sm.store_id = '1' and sd.store_id = '1' and a.store_id = '1'");
     }
     $store_array = smn_db_fetch_array($store_query);
     $store_info_query = smn_db_query("select c.*, ab.* from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab WHERE c.customers_id = '" . $store_array['customer_id'] . "' and c.customers_id = ab.customers_id and c.customers_default_address_id = ab.address_book_id");
     $store_info_array = smn_db_fetch_array($store_info_query);
     $this->set_store_customer_id($store_array['customer_id']);
     $this->set_store_group_id($store_array['admin_groups_id']);
     $this->set_store_company($store_info_array['entry_company']);
     $this->set_store_dob($store_info_array['customers_dob']);
     $this->set_store_telephone($store_info_array['customers_telephone']);
     $this->set_store_fax($store_info_array['customers_fax']);
     $this->set_store_name(stripslashes($store_array['store_name']));
     $this->set_store_logo($store_array['store_image']);
     $this->set_store_zone($store_info_array['entry_zone_id']);
     $this->set_store_owner_email_address($store_info_array['customers_email_address']);
     $this->set_email_from($this->get_store_name() . '<' . $this->get_store_owner_email_address() . '>');
     $this->set_store_country($store_info_array['entry_country_id']);
     $this->set_store_name_address($this->get_store_name() . "\n" . $store_info_array['entry_street_address'] . "\n" . $store_info_array['entry_city'] . "\n" . $store_info_array['entry_state'] . "\n" . 'USA' . "\n" . $store_info_array['entry_postcode'] . "\n");
     $this->set_shipping_origin_country($store_info_array['entry_country_id']);
     $this->set_shipping_origin_zip($store_info_array['entry_postcode']);
     $this->set_store_type((int) $store_array['store_type']);
     $this->set_store_description($store_array['store_description']);
     $this->set_store_status((int) $store_array['store_status']);
     $this->set_store_image($store_array['store_image']);
     $this->set_db_tables();
 }
Example #2
0
function smn_set_db_tables($store_id = 1, $store_type = 'mall')
{
    define('DIR_WS_BODY', DIR_WS_INCLUDES . 'body/' . $store_type . '/');
    define('DIR_WS_JAVA', DIR_WS_INCLUDES . 'java/');
    require DIR_WS_INCLUDES . $store_type . '_filenames.php';
    define('DIR_WS_ADMIN', DIR_WS_HTTP_CATALOG . 'mall_admin/');
    require DIR_WS_INCLUDES . 'database_tables.php';
    smn_set_database_tables();
    define('DIR_WS_IMAGES', 'images/' . $store_id . '_images/');
    define('DIR_WS_STORE_CATALOG', $store_type . '/');
    define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/' . $store_id . '_images/');
    define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
    define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/' . $store_id . '_images/');
}