<% dim DIR_WS, DIR_WS_CATALOG, DIR_WS_HTTPS_CATALOG, DIR_WS_IMAGES, DIR_WS_INCLUDES dim DIR_WS_IMAGES_BUTTONS, DIR_WS_IMAGES_ICONS, DIR_WS_IMAGES_PRODUCTS dim DIR_WS_FUNCTIONS, DIR_WS_CLASSES, DIR_WS_MODULES, DIR_WS_TEMPLATES dim DIR_FS, DIR_FS_CATALOG, DIR_FS_IMAGES_PRODUCTS dim DB_NAME, DB_PATH, DB_DRIVER, DB_LOCALPATH ''' ' Define the webserver and path parameters ' HTTP_SERVER is your Main webserver: eg-http:'www.yourdomain.com ' HTTPS_SERVER is your Secure webserver: eg-https:'www.yourdomain.com const HTTP_SERVER = "http://mini-hangars.com" const HTTPS_SERVER = "https://mini-hangars.com" ' Use secure webserver for checkout procedure? const ENABLE_SSL = false ' NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes! ' * DIR_WS_* = Webserver directories (virtual/URL) ' these paths are relative to top of your webspace ... DIR_WS = "/" DIR_WS_CATALOG = DIR_WS & "cart/" DIR_WS_HTTPS_CATALOG = DIR_WS & "cart/" DIR_WS_IMAGES = DIR_WS & "images/" DIR_WS_INCLUDES = DIR_WS & "includes/" DIR_WS_IMAGES_PRODUCTS = DIR_WS_IMAGES & "catalog/" DIR_WS_FUNCTIONS = DIR_WS_INCLUDES & "functions/" DIR_WS_CLASSES = DIR_WS_INCLUDES & "classes/" DIR_WS_MODULES = DIR_WS_INCLUDES & "modules/" DIR_WS_TEMPLATES = DIR_WS_INCLUDES & "templates/" DIR_WS_IMAGES_BUTTONS = DIR_WS_TEMPLATES & "images/buttons/" DIR_WS_IMAGES_ICONS = DIR_WS_TEMPLATES & "images/icons/" ' * DIR_FS_* = Filesystem directories (local/physical) ' the following path is a COMPLETE path to your Cart files. DIR_FS = Server.MapPath(DIR_WS) DIR_FS_CATALOG = Server.MapPath(DIR_WS_CATALOG) DIR_FS_IMAGES_PRODUCTS = Server.MapPath(DIR_WS_IMAGES_PRODUCTS) ' define our database connection DB_NAME = "db_mini-hangars.mdb" DB_PATH = "/db/" DB_DRIVER = "Microsoft Access Driver (*.mdb)" DB_LOCALPATH = Server.MapPath(DB_PATH&DB_NAME) %> <% '///// '/ CLASS ADMINISTRATOR '///// class c_administrator private admin_id private admin_created_date private admin_modified_date private admin_last_login_date private admin_admintype_id private admin_name private admin_email private admin_username private admin_password private admin_is_active private admin_is_administrator '=========Objects=========' private obj_admin_type '=========public Inputs=========' private tmp_id '=========Internal Variables=========' private a_sql, a_rs '=========Initialize=========' private sub class_initialize() is_administrator = false id = 0 created_date = now() modified_date = now() last_login_date = now() admintype_id = 0 name = "" email = "" username = "" password = "" is_active = false set admintype = 0 end sub public property get set_administrator(a_id) tmp_id = ais_clean_numeric(a_id) a_sql = "select * from administrators where admin_id = "&tmp_id&";" set a_rs = conn.execute(a_sql) if not a_rs.eof then is_administrator = true id = a_rs("admin_id") created_date = a_rs("admin_created_date") modified_date = a_rs("admin_modified_date") last_login_date = a_rs("admin_last_login_date") admintype_id = a_rs("admin_admintype_id") name = a_rs("admin_name") email = a_rs("admin_email") username = a_rs("admin_username") password = a_rs("admin_password") is_active = a_rs("admin_is_active") set admintype = admintype_id else clear() end if a_rs.close end property public property get set_administrator_by_username(a_username) set a_rs = conn.execute("select admin_id from administrators where admin_username like '"&ais_db_input(a_username)&"';") if a_rs.eof then clear() else set_administrator a_rs("admin_id") end if end property public property get set_administrator_by_username_not_id(a_username, a_id) set a_rs = conn.execute("select admin_id from administrators where admin_username like '"&ais_db_input(a_username)&"' and admin_id <> "&ais_clean_numeric(a_id)&";") if a_rs.eof then clear() else set_administrator a_rs("admin_id") end if end property public property get set_administrator_by_email(a_email) set a_rs = conn.execute("select admin_id from administrators where admin_email like '"&ais_db_input(a_email)&"';") if a_rs.eof then clear() else set_administrator a_rs("admin_id") end if end property public property get is_administrator() is_administrator = admin_is_administrator end property private property let is_administrator(a_is_administrator) admin_is_administrator = a_is_administrator end property public property get id() id = admin_id end property private property let id(a_id) admin_id = a_id end property public property get created_date() created_date = admin_created_date end property private property let created_date(a_created_date) admin_created_date = a_created_date end property public property get modified_date() modified_date = admin_modified_date end property private property let modified_date(a_modified_date) admin_modified_date = a_modified_date end property public property get last_login_date() last_login_date = admin_last_login_date end property private property let last_login_date(a_last_login_date) admin_last_login_date = a_last_login_date end property public property get admintype_id() admintype_id = admin_admintype_id end property private property let admintype_id(a_admintype_id) admin_admintype_id = a_admintype_id end property public property get name() name = admin_name end property private property let name(a_name) admin_name = a_name end property public property get email() email = admin_email end property private property let email(a_email) admin_email = a_email end property public property get username() username = admin_username end property private property let username(a_username) admin_username = a_username end property public property get password() password = admin_password end property private property let password(a_password) admin_password = a_password end property public property get is_active() is_active = admin_is_active end property private property let is_active(a_is_active) admin_is_active = a_is_active end property '=========Objects=========' public property get admintype() set admintype = obj_admin_type end property private property set admintype(a_admintype_id) if not isobject(obj_admin_type) then set obj_admin_type = new c_administrator_type end if obj_admin_type.set_administrator_type a_admintype_id if is_administrator and not obj_admin_type.is_administrator_type then clear() end if end property '=========Functions=========' public function clear() is_administrator = false id = 0 created_date = now() modified_date = now() last_login_date = now() admintype_id = 0 name = "" email = "" username = "" password = "" is_active = false set admintype = 0 end function public function refresh() set_administrator id end function '=========Terminate=========' private sub class_terminate() set admin_id = nothing set admin_created_date = nothing set admin_modified_date = nothing set admin_last_login_date = nothing set admin_admintype_id = nothing set admin_name = nothing set admin_email = nothing set admin_username = nothing set admin_password = nothing set admin_is_active = nothing set admin_is_administrator = nothing '=========Objects=========' set obj_admin_type = nothing '=========public Inputs=========' set tmp_id = nothing '=========Internal Variables=========' set a_sql = nothing set a_rs = nothing end sub end class '///// '/ CLASS ADMINISTRATOR TYPE '///// class c_administrator_type private admintype_id private admintype_name private admintype_description private admintype_level private admintype_is_administrator_type '=========Objects=========' '=========public Inputs=========' private tmp_id '=========Internal Variables=========' private at_sql, at_rs '=========Initialize=========' private sub class_initialize() is_administrator_type = false id = 0 name = "" description = "" level = "" end sub public property get set_administrator_type(at_id) tmp_id = ais_clean_numeric(at_id) at_sql = "select * from administrators_types where admintype_id = "&tmp_id&";" set at_rs = conn.execute(at_sql) if not at_rs.eof then is_administrator_type = true id = at_rs("admintype_id") name = at_rs("admintype_name") description = at_rs("admintype_description") level = at_rs("admintype_level") else clear() end if at_rs.close end property public property get is_administrator_type() is_administrator_type = admintype_is_administrator_type end property private property let is_administrator_type(at_is_administrator_type) admintype_is_administrator_type = at_is_administrator_type end property public property get id() id = admintype_id end property private property let id(at_id) admintype_id = at_id end property public property get name() name = admintype_name end property private property let name(at_name) admintype_name = at_name end property public property get description() description = admintype_description end property private property let description(at_description) admintype_description = at_description end property public property get level() level = admintype_level end property private property let level(at_level) admintype_level = at_level end property '=========Objects=========' '=========Functions=========' public function reset() set_administrator id end function public function clear() is_administrator_type = false id = 0 name = "" description = "" level = "" end function '=========Terminate=========' private sub class_terminate() set admintype_id = nothing set admintype_name = nothing set admintype_description = nothing set admintype_level = nothing set admintype_is_administrator_type = nothing '=========Objects=========' '=========public Inputs=========' set tmp_id = nothing '=========Internal Variables=========' set at_sql = nothing set at_rs = nothing end sub end class %> <% '///// '/ CLASS CONFIGURATION '///// class c_configuration private config_session_timeout private config_script_timeout private config_store_mail private config_store_name private config_store_address private config_store_city private config_store_state private config_store_zip private config_store_phone private config_store_fax private config_mail_host private config_mail_user private config_mail_password private config_maint_in_progress private config_cust_max_address_book_entries private config_cart_show_empty_categories private config_cart_show_product_count private config_cart_add_to_cart_redirect private config_cart_cat_num_of_col private config_cart_prod_num_of_col private config_cart_prod_page_size private config_cart_prod_image_thumb_width private config_cart_prod_image_width private config_email_signature private config_meta_tags_title private config_meta_tags_keywords private config_meta_tags_description private config_is_configuration '=========Objects=========' '=========public inputs=========' '=========internal variables=========' private c_rs '=========Initialize=========' private sub class_initialize() set_configuration() end sub public property get set_configuration() set c_rs = conn.execute("select * from configurations;") if c_rs.eof then clear() else is_configuration = true session_timeout = c_rs("config_session_timeout") script_timeout = c_rs("config_script_timeout") store_mail = c_rs("config_store_mail") store_name = c_rs("config_store_name") store_address = c_rs("config_store_address") store_city = c_rs("config_store_city") store_state = c_rs("config_store_state") store_zip = c_rs("config_store_zip") store_phone = c_rs("config_store_phone") store_fax = c_rs("config_store_fax") mail_host = c_rs("config_mail_host") mail_user = c_rs("config_mail_user") mail_password = c_rs("config_mail_password") maint_in_progress = c_rs("config_maint_in_progress") cust_max_address_book_entries = c_rs("config_cust_max_address_book_entries") cart_show_empty_categories = c_rs("config_cart_show_empty_categories") cart_show_product_count = c_rs("config_cart_show_product_count") cart_add_to_cart_redirect = c_rs("config_cart_add_to_cart_redirect") cart_cat_num_of_col = c_rs("config_cart_cat_num_of_col") cart_prod_num_of_col = c_rs("config_cart_prod_num_of_col") cart_prod_page_size = c_rs("config_cart_prod_page_size") cart_prod_image_thumb_width = c_rs("config_cart_prod_image_thumb_width") cart_prod_image_width = c_rs("config_cart_prod_image_width") email_signature = c_rs("config_email_signature") meta_tags_title = c_rs("config_meta_tags_title") meta_tags_keywords = c_rs("config_meta_tags_keywords") meta_tags_description = c_rs("config_meta_tags_description") end if c_rs.close() end property public property get is_configuration() is_configuration = config_is_configuration end property private property let is_configuration(c_is_configuration) config_is_configuration = c_is_configuration end property public property get session_timeout() session_timeout = config_session_timeout end property private property let session_timeout(c_session_timeout) config_session_timeout = c_session_timeout end property public property get script_timeout() script_timeout = config_script_timeout end property private property let script_timeout(c_script_timeout) config_script_timeout = c_script_timeout end property public property get store_mail() store_mail = config_store_mail end property private property let store_mail(c_store_mail) config_store_mail = c_store_mail end property public property get store_name() store_name = config_store_name end property private property let store_name(c_store_name) config_store_name = c_store_name end property public property get store_address() store_address = config_store_address end property private property let store_address(c_store_address) config_store_address = c_store_address end property public property get store_city() store_city = config_store_city end property private property let store_city(c_store_city) config_store_city = c_store_city end property public property get store_state() store_state = config_store_state end property private property let store_state(c_store_state) config_store_state = c_store_state end property public property get store_zip() store_zip = config_store_zip end property private property let store_zip(c_store_zip) config_store_zip = c_store_zip end property public property get store_phone() store_phone = config_store_phone end property private property let store_phone(c_store_phone) config_store_phone = c_store_phone end property public property get store_fax() store_fax = config_store_fax end property private property let store_fax(c_store_fax) config_store_fax = c_store_fax end property public property get mail_host() mail_host = config_mail_host end property private property let mail_host(c_mail_host) config_mail_host = c_mail_host end property public property get mail_user() mail_user = config_mail_user end property private property let mail_user(c_mail_user) config_mail_user = c_mail_user end property public property get mail_password() mail_password = config_mail_password end property private property let mail_password(c_mail_password) config_mail_password = c_mail_password end property public property get maint_in_progress() maint_in_progress = config_maint_in_progress end property private property let maint_in_progress(c_maint_in_progress) config_maint_in_progress = c_maint_in_progress end property public property get cust_max_address_book_entries() cust_max_address_book_entries = config_cust_max_address_book_entries end property private property let cust_max_address_book_entries(c_cust_max_address_book_entries) config_cust_max_address_book_entries = c_cust_max_address_book_entries end property public property get cart_show_empty_categories() cart_show_empty_categories = config_cart_show_empty_categories end property private property let cart_show_empty_categories(c_cart_show_empty_categories) config_cart_show_empty_categories = c_cart_show_empty_categories end property public property get cart_show_product_count() cart_show_product_count = config_cart_show_product_count end property private property let cart_show_product_count(c_cart_show_product_count) config_cart_show_product_count = c_cart_show_product_count end property public property get cart_add_to_cart_redirect() cart_add_to_cart_redirect = config_cart_add_to_cart_redirect end property private property let cart_add_to_cart_redirect(c_cart_add_to_cart_redirect) config_cart_add_to_cart_redirect = c_cart_add_to_cart_redirect end property public property get cart_cat_num_of_col() cart_cat_num_of_col = config_cart_cat_num_of_col end property private property let cart_cat_num_of_col(c_cart_cat_num_of_col) config_cart_cat_num_of_col = c_cart_cat_num_of_col end property public property get cart_prod_num_of_col() cart_prod_num_of_col = config_cart_prod_num_of_col end property private property let cart_prod_num_of_col(c_cart_prod_num_of_col) config_cart_prod_num_of_col = c_cart_prod_num_of_col end property public property get cart_prod_page_size() cart_prod_page_size = config_cart_prod_page_size end property private property let cart_prod_page_size(c_cart_prod_page_size) config_cart_prod_page_size = c_cart_prod_page_size end property public property get cart_prod_image_thumb_width() cart_prod_image_thumb_width = config_cart_prod_image_thumb_width end property private property let cart_prod_image_thumb_width(c_cart_prod_image_thumb_width) config_cart_prod_image_thumb_width = c_cart_prod_image_thumb_width end property public property get cart_prod_image_width() cart_prod_image_width = config_cart_prod_image_width end property private property let cart_prod_image_width(c_cart_prod_image_width) config_cart_prod_image_width = c_cart_prod_image_width end property public property get email_signature() email_signature = config_email_signature end property private property let email_signature(c_email_signature) config_email_signature = c_email_signature end property public property get meta_tags_title() meta_tags_title = config_meta_tags_title end property private property let meta_tags_title(c_meta_tags_title) config_meta_tags_title = c_meta_tags_title end property public property get meta_tags_keywords() meta_tags_keywords = config_meta_tags_keywords end property private property let meta_tags_keywords(c_meta_tags_keywords) config_meta_tags_keywords = c_meta_tags_keywords end property public property get meta_tags_description() meta_tags_description = config_meta_tags_description end property private property let meta_tags_description(c_meta_tags_description) config_meta_tags_description = c_meta_tags_description end property '=========Objects=========' '=========Functions=========' public function refresh() set_configuration id end function public function clear() is_configuration = false session_timeout = "" script_timeout = "" store_mail = "" store_name = "" store_address = "" store_city = "" store_state = "" store_zip = "" store_phone = "" store_fax = "" mail_host = "" mail_user = "" mail_password = "" maint_in_progress = true cart_show_empty_categories = "" cart_show_product_count = "" cart_add_to_cart_redirect = "" cart_cat_num_of_col = "" cart_prod_num_of_col = "" cart_prod_page_size = "" cart_prod_image_thumb_width = "" cart_prod_image_width = "" email_signature = "" meta_tags_title = "" meta_tags_keywords = "" meta_tags_description = "" end function '=========Terminate=========' private sub class_terminate() set config_session_timeout = nothing set config_script_timeout = nothing set config_store_mail = nothing set config_store_name = nothing set config_store_address = nothing set config_store_city = nothing set config_store_state = nothing set config_store_zip = nothing set config_store_phone = nothing set config_store_fax = nothing set config_mail_host = nothing set config_mail_user = nothing set config_mail_password = nothing set config_maint_in_progress = nothing set config_cart_show_empty_categories = nothing set config_cart_show_product_count = nothing set config_cart_add_to_cart_redirect = nothing set config_cart_cat_num_of_col = nothing set config_cart_prod_num_of_col = nothing set config_cart_prod_image_thumb_width = nothing set config_cart_prod_image_width = nothing set config_email_signature = nothing set config_meta_tags_title = nothing set config_meta_tags_keywords = nothing set config_meta_tags_description = nothing set config_is_configuration = nothing '=========Objects=========' '=========internal variables=========' set c_rs = nothing end sub end class %> <% '///// '/ CLASS MESSAGE '///// class c_message private msg_id private msg_msgstat_id private msg_date_created private msg_subject private msg_name private msg_email private msg_phone private msg_comment private msg_is_set '=========Objects=========' private obj_msgstat '=========Internal Variables=========' private rs '=========Initialize=========' private sub class_initialize() clear() end sub public property get set_message(m_id) set rs = conn.execute("select * from messages where msg_id = "&ais_clean_numeric(trim(m_id))&";") if rs.eof then clear() else is_set = true id = rs("msg_id") msgstat_id = rs("msg_msgstat_id") date_created = rs("msg_date_created") subject = rs("msg_subject") name = rs("msg_name") email = rs("msg_email") phone = rs("msg_phone") comment = rs("msg_comment") set msgstat = msgstat_id end if rs.close end property public property get set_last() set rs = conn.execute("select top 1 msg_id from messages order by msg_id desc;") if rs.eof then clear() else set_message rs("msg_id") end if end property public property get is_set() is_set = msg_is_set end property private property let is_set(m_is_set) msg_is_set = m_is_set end property public property get id() id = msg_id end property private property let id(m_id) msg_id = m_id end property public property get msgstat_id() msgstat_id = msg_msgstat_id end property private property let msgstat_id(m_msgstat_id) msg_msgstat_id = m_msgstat_id end property public property get date_created() date_created = msg_date_created end property private property let date_created(m_date_created) msg_date_created = m_date_created end property public property get subject() subject = msg_subject end property private property let subject(m_subject) msg_subject = m_subject end property public property get name() name = msg_name end property private property let name(m_name) msg_name = m_name end property public property get email() email = msg_email end property private property let email(m_email) msg_email = m_email end property public property get phone() phone = msg_phone end property private property let phone(m_phone) msg_phone = m_phone end property public property get comment() comment = msg_comment end property private property let comment(m_comment) msg_comment = m_comment end property '=========Objects=========' public property get msgstat() set msgstat = obj_msgstat end property private property set msgstat(m_msgstat_id) if not isobject(obj_msgstat) then set obj_msgstat = new c_message_status end if obj_msgstat.set_message_status m_msgstat_id end property '=========Functions / Subs=========' public function refresh() set_message id end function public function clear() is_set = false id = "" msgstat_id = "" date_created = "" subject = "" name = "" email = "" phone = "" comment = "" set msgstat = msgstat_id end function '=========Terminate=========' private sub class_terminate() set msg_id = nothing set msg_msgstat_id = nothing set msg_date_created = nothing set msg_subject = nothing set msg_name = nothing set msg_email = nothing set msg_phone = nothing set msg_comment = nothing '=========Objects=========' set obj_msgstat = nothing '=========Internal Variables=========' set rs = nothing end sub end class '///// '/ CLASS MESSAGE_STATUS '///// class c_message_status private msgstat_id private msgstat_name private msgstat_sort_order private msgstat_is_set '=========Objects=========' '=========Internal Variables=========' private rs '=========Initialize=========' private sub class_initialize() clear() end sub public property get set_message_status(m_id) set rs = conn.execute("select * from message_status where msgstat_id = "&ais_clean_numeric(m_id)&";") if rs.eof then clear() else is_set = true id = rs("msgstat_id") name = rs("msgstat_name") sort_order = rs("msgstat_sort_order") end if rs.close end property public property get set_default() set rs = conn.execute("select top 1 msgstat_id from message_status order by msgstat_sort_order;") if rs.eof then clear() else set_message_status rs("msgstat_id") end if end property public property get is_set() is_set = msgstat_is_set end property private property let is_set(m_is_set) msgstat_is_set = m_is_set end property public property get id() id = msgstat_id end property private property let id(m_id) msgstat_id = m_id end property public property get name() name = msgstat_name end property private property let name(m_name) msgstat_name = m_name end property public property get sort_order() sort_order = msgstat_sort_order end property private property let sort_order(m_sort_order) msgstat_sort_order = m_sort_order end property '=========Objects=========' '=========Functions / Subs=========' public function refresh() set_message_status id end function public function clear() is_set = false id = "" name = "" sort_order = "" end function '=========Terminate=========' private sub class_terminate() set msgstat_id = nothing set msgstat_name = nothing set msgstat_sort_order = nothing '=========Objects=========' '=========Internal Variables=========' set rs = nothing end sub end class %> <% '///// '/ CLASS ZONES '///// class c_zone private zone_id private zone_country_id private zone_code private zone_name private zone_is_zone '=========Objects=========' private obj_country '=========Internal Variables=========' private z_rs '=========Initialize=========' private sub class_initialize() clear() end sub public property get set_zone(z_id) set z_rs = conn.execute("select * from zones where zone_id = "&ais_clean_numeric(z_id)&";") if z_rs.eof then clear() else is_zone = true id = z_rs("zone_id") country_id = z_rs("zone_country_id") code = z_rs("zone_code") name = z_rs("zone_name") set country = country_id end if z_rs.close end property public property get is_zone() is_zone = zone_is_zone end property private property let is_zone(z_is_zone) zone_is_zone = z_is_zone end property public property get id() id = zone_id end property private property let id(z_id) zone_id = z_id end property public property get country_id() country_id = zone_country_id end property private property let country_id(z_country_id) zone_country_id = z_country_id end property public property get code() code = zone_code end property private property let code(z_code) zone_code = z_code end property public property get name() name = zone_name end property private property let name(z_name) zone_name = z_name end property '=========Objects=========' public property get country() set country = obj_country end property private property set country(z_country_id) if not isobject(obj_country) then set obj_country = new c_country end if obj_country.set_country z_country_id if is_zone and not obj_country.is_country then clear() end if end property '=========Functions / Subs=========' public function refresh() set_zone id end function public function clear() is_zone = false id = "" country_id = "" code = "" name = "" set country = country_id end function public sub sandbox() response.write "ZONE
"&vbcrlf response.write "is_zone: "&me.is_zone&"
"&vbcrlf response.write "id: "&me.id&"
"&vbcrlf response.write "country_id: "&me.country_id&"
"&vbcrlf response.write "code: "&me.code&"
"&vbcrlf response.write "name: "&me.name&"
"&vbcrlf response.write "

"&vbcrlf me.country.sandbox() end sub '=========Terminate=========' private sub class_terminate() set zone_id = nothing set zone_country_id = nothing set zone_code = nothing set zone_name = nothing set zone_is_zone = nothing '=========Objects=========' set obj_country = nothing '=========Internal Variables=========' set z_rs = nothing end sub end class '///// '/ CLASS COUNTRIES '///// class c_country private country_id private country_addresstype_id private country_name private country_iso_code_2 private country_iso_code_3 private country_is_country '=========Objects=========' private obj_addresstype '=========Internal Variables=========' private c_rs '=========Initialize=========' private sub class_initialize() clear() end sub public property get set_country(c_id) if ais_is_numeric(c_id) then set c_rs = conn.execute("select * from countries where country_id = "&ais_clean_numeric(c_id)&";") else set c_rs = conn.execute("select * from countries where country_iso_code_2 like '"&c_id&"' or country_iso_code_3 like '"&c_id&"';") end if if c_rs.eof then clear() else is_country = true id = c_rs("country_id") addresstype_id = c_rs("country_addresstype_id") name = c_rs("country_name") iso_code_2 = c_rs("country_iso_code_2") iso_code_3 = c_rs("country_iso_code_3") set addresstype = addresstype_id end if c_rs.close end property public property get is_country() is_country = country_is_country end property private property let is_country(c_is_country) country_is_country = c_is_country end property public property get id() id = country_id end property private property let id(c_id) country_id = c_id end property public property get addresstype_id() addresstype_id = country_addresstype_id end property private property let addresstype_id(c_addresstype_id) country_addresstype_id = c_addresstype_id end property public property get name() name = country_name end property private property let name(c_name) country_name = c_name end property public property get iso_code_2() iso_code_2 = country_iso_code_2 end property private property let iso_code_2(c_iso_code_2) country_iso_code_2 = c_iso_code_2 end property public property get iso_code_3() iso_code_3 = country_iso_code_3 end property private property let iso_code_3(c_iso_code_3) country_iso_code_3 = c_iso_code_3 end property '=========Objects=========' public property get addresstype() set addresstype = obj_addresstype end property private property set addresstype(c_addresstype_id) if not isobject(obj_addresstype) then set obj_addresstype = new c_address_type end if obj_addresstype.set_address_type c_addresstype_id if is_country and not obj_addresstype.is_address_type then clear() end if end property '=========Functions Subs=========' public function refresh() set_country id end function public function clear() is_country = false id = "" addresstype_id = "" name = "" iso_code_2 = "" iso_code_3 = "" set addresstype = addresstype_id end function public sub sandbox() response.write "COUNTRY
"&vbcrlf response.write "is_country: "&me.is_country&"
"&vbcrlf response.write "id: "&me.id&"
"&vbcrlf response.write "addresstype_id: "&me.addresstype_id&"
"&vbcrlf response.write "name: "&me.name&"
"&vbcrlf response.write "iso_code_2: "&me.iso_code_2&"
"&vbcrlf response.write "iso_code_3: "&me.iso_code_3&"
"&vbcrlf response.write "

"&vbcrlf me.addresstype.sandbox() end sub '=========Terminate=========' private sub class_terminate() set country_id = nothing set country_addresstype_id = nothing set country_name = nothing set country_iso_code_2 = nothing set country_iso_code_3 = nothing set country_is_country = nothing '=========Objects=========' set obj_addresstype = nothing '=========Internal Variables=========' set c_rs = nothing end sub end class '///// '/ CLASS ADDRESS TYPES '///// class c_address_type private addresstype_id private addresstype_format private addresstype_summary private addresstype_is_address_type '=========Objects=========' '=========Internal Variables=========' private at_rs '=========Initialize=========' private sub class_initialize() clear() end sub public property get set_address_type(at_id) set at_rs = conn.execute("select * from address_types where addresstype_id = "&ais_clean_numeric(at_id)&";") if at_rs.eof then clear() else is_address_type = true id = at_rs("addresstype_id") format = at_rs("addresstype_format") summary = at_rs("addresstype_summary") end if at_rs.close end property public property get is_address_type() is_address_type = addresstype_is_address_type end property private property let is_address_type(at_is_address_type) addresstype_is_address_type = at_is_address_type end property public property get id() id = addresstype_id end property private property let id(at_id) addresstype_id = at_id end property public property get format() format = addresstype_format end property private property let format(at_format) addresstype_format = at_format end property public property get summary() summary = addresstype_summary end property private property let summary(at_summary) addresstype_summary = at_summary end property '=========Objects=========' '=========Functions / Subs=========' public function refresh() set_address_type id end function public function clear() is_address_type = false id = "" format = "" summary = "" end function public sub sandbox() response.write "ADDRESS TYPE
"&vbcrlf response.write "is_address_type: "&me.is_address_type&"
"&vbcrlf response.write "id: "&me.id&"
"&vbcrlf response.write "format: "&me.format&"
"&vbcrlf response.write "summary: "&me.summary&"
"&vbcrlf response.write "

"&vbcrlf end sub function build_address(ba_company, ba_firstname, ba_lastname, ba_address, ba_city, ba_state, ba_postcode, ba_country) dim tmp_address tmp_address = format if ais_not_null(tmp_address) then if ais_not_null(ba_company) then tmp_address = replace(tmp_address, "$company", ba_company) else tmp_address = replace(tmp_address, "$company$cr", "") end if tmp_address = replace(tmp_address, "$firstname", ba_firstname) tmp_address = replace(tmp_address, "$lastname", ba_lastname) tmp_address = replace(tmp_address, "$streets", ba_address) tmp_address = replace(tmp_address, "$city", ba_city) tmp_address = replace(tmp_address, "$postcode", ba_postcode) tmp_address = replace(tmp_address, "$statecomma", ba_state&", ") tmp_address = replace(tmp_address, "$state", ba_state) tmp_address = replace(tmp_address, "$country", ba_country) tmp_address = replace(tmp_address, "$cr", vbcrlf) build_address = tmp_address set tmp_address = nothing exit function else build_address = "" set tmp_address = nothing exit function end if end function function build_address_summary(ba_city, ba_state, ba_postcode, ba_country) dim tmp_address tmp_address = summary if ais_not_null(tmp_address) then tmp_address = replace(tmp_address, "$city", ba_city) tmp_address = replace(tmp_address, "$postcode", ba_postcode) tmp_address = replace(tmp_address, "$state", ba_state) tmp_address = replace(tmp_address, "$country", ba_country) build_address_summary = tmp_address set tmp_address = nothing exit function else build_address_summary = "" set tmp_address = nothing exit function end if end function '=========Terminate=========' private sub class_terminate() set addresstype_id = nothing set addresstype_format = nothing set addresstype_summary = nothing set addresstype_is_address_type = nothing '=========Objects=========' '=========Internal Variables=========' set at_rs = nothing end sub end class class c_tax_class private taxclass_id private taxclass_name private taxclass_description private taxclass_date_created private taxclass_date_modified private taxclass_is_set '=========Objects=========' '=========Internal Variables=========' private rs '=========Initialize=========' private sub class_initialize() clear() end sub public property get set_tax_class(tc_id) set rs = conn.execute("select * from tax_classes where taxclass_id = "&ais_clean_numeric(tc_id)&";") if rs.eof then clear() else is_set = true id = rs("taxclass_id") name = rs("taxclass_name") description = rs("taxclass_description") date_created = rs("taxclass_date_created") date_modified = rs("taxclass_date_modified") end if rs.close() end property public property get set_by_name(tc_name, tc_id) '//// '// If 'id' is passed, check if name exisits not including 'id' value '//// if ais_clean_numeric(tc_id) > 0 then set rs = conn.execute("select taxclass_id from tax_classes where taxclass_name like '"&tc_name&"' and taxclass_id <> "&ais_clean_numeric(tc_id)&";") else set rs = conn.execute("select taxclass_id from tax_classes where taxclass_name like '"&tc_name&"';") end if if rs.eof then clear() else set_tax_class rs("taxclass_id") end if end property public property get is_set() is_set = taxclass_is_set end property private property let is_set(tc_is_set) taxclass_is_set = tc_is_set end property public property get id() id = taxclass_id end property private property let id(tc_id) taxclass_id = tc_id end property public property get name() name = taxclass_name end property private property let name(tc_name) taxclass_name = tc_name end property public property get description() description = taxclass_description end property private property let description(tc_description) taxclass_description = tc_description end property public property get date_created() date_created = taxclass_date_created end property private property let date_created(tc_date_created) taxclass_date_created = tc_date_created end property public property get date_modified() date_modified = taxclass_date_modified end property private property let date_modified(tc_date_modified) taxclass_date_modified = tc_date_modified end property '=========Objects=========' '=========Functions Subs=========' public function refresh() set_tax_class id end function public function clear() is_set = false id = "" name = "" description = "" date_created = "" date_modified = "" end function public sub sandbox() response.write "TAX CLASS
"&vbcrlf response.write "is_set: "&me.is_set&"
"&vbcrlf response.write "id: "&me.id&"
"&vbcrlf response.write "name: "&me.name&"
"&vbcrlf response.write "description: "&me.description&"
"&vbcrlf response.write "date_created: "&me.date_created&"
"&vbcrlf response.write "date_modified: "&me.date_modified&"
"&vbcrlf response.write "

"&vbcrlf end sub '=========Terminate=========' private sub class_terminate() set taxclass_id = nothing set taxclass_name = nothing set taxclass_description = nothing set taxclass_date_created = nothing set taxclass_date_modified = nothing set taxclass_is_set = nothing '=========Objects=========' '=========Internal Variables=========' set rs = nothing end sub end class class c_tax_rate private taxrate_id private taxrate_zone_id private taxrate_taxclass_id private taxrate_rate private taxrate_description private taxrate_date_created private taxrate_date_modified private taxrate_is_set '=========Objects=========' private obj_zone private obj_taxclass '=========Internal Variables=========' private rs '=========Initialize=========' private sub class_initialize() clear() end sub public property get set_tax_rate(tr_id) set rs = conn.execute("select * from tax_rates where taxrate_id = "&ais_clean_numeric(tr_id)&";") if rs.eof then clear() else is_set = true id = rs("taxrate_id") zone_id = rs("taxrate_zone_id") taxclass_id = rs("taxrate_taxclass_id") rate = rs("taxrate_rate") description = rs("taxrate_description") date_created = rs("taxrate_date_created") date_modified = rs("taxrate_date_modified") set zone = zone_id set taxclass = taxclass_id end if rs.close() end property public property get set_by_zone_id_taxclass_id(tr_zone_id, tr_taxclass_id, tr_id) '//// '// If 'id' is passed, check if zone exisits not including 'id' value '//// if ais_clean_numeric(tr_id) > 0 then set rs = conn.execute("select taxrate_id from tax_rates where taxrate_zone_id = "&ais_clean_numeric(tr_zone_id)&" and taxrate_taxclass_id = "&ais_clean_numeric(tr_taxclass_id)&" and taxrate_id <> "&ais_clean_numeric(tr_id)&";") else set rs = conn.execute("select taxrate_id from tax_rates where taxrate_zone_id = "&ais_clean_numeric(tr_zone_id)&" and taxrate_taxclass_id = "&ais_clean_numeric(tr_taxclass_id)&";") end if if rs.eof then clear() else set_tax_rate rs("taxrate_id") end if end property public property get is_set() is_set = taxrate_is_set end property private property let is_set(tr_is_set) taxrate_is_set = tr_is_set end property public property get id() id = taxrate_id end property private property let id(tr_id) taxrate_id = tr_id end property public property get zone_id() zone_id = taxrate_zone_id end property private property let zone_id(tr_zone_id) taxrate_zone_id = tr_zone_id end property public property get taxclass_id() taxclass_id = taxrate_taxclass_id end property private property let taxclass_id(tr_taxclass_id) taxrate_taxclass_id = tr_taxclass_id end property public property get rate() rate = taxrate_rate end property private property let rate(tr_rate) taxrate_rate = tr_rate end property public property get description() description = taxrate_description end property private property let description(tr_description) taxrate_description = tr_description end property public property get date_created() date_created = taxrate_date_created end property private property let date_created(tr_date_created) taxrate_date_created = tr_date_created end property public property get date_modified() date_modified = taxrate_date_modified end property private property let date_modified(tr_date_modified) taxrate_date_modified = tr_date_modified end property '=========Objects=========' public property get zone() set zone = obj_zone end property private property set zone(tr_zone_id) if not isobject(obj_zone) then set obj_zone = new c_zone end if obj_zone.set_zone tr_zone_id if is_set and not obj_zone.is_zone then clear() end if end property public property get taxclass() set taxclass = obj_taxclass end property private property set taxclass(tr_taxclass_id) if not isobject(obj_taxclass) then set obj_taxclass = new c_tax_class end if obj_taxclass.set_tax_class tr_taxclass_id if is_set and not obj_taxclass.is_set then clear() end if end property '=========Functions / Subs=========' public function refresh() set_tax_rate id end function private function clear() is_set = false id = "" zone_id = "" taxclass_id = "" rate = "" description = "" date_created = "" date_modified = "" end function public sub sandbox() response.write "TAX RATE
"&vbcrlf response.write "is_set: "&me.is_set&"
"&vbcrlf response.write "id: "&me.id&"
"&vbcrlf response.write "zone_id: "&me.zone_id&"
"&vbcrlf response.write "taxclass_id: "&me.taxclass_id&"
"&vbcrlf response.write "rate: "&me.rate&"
"&vbcrlf response.write "description: "&me.description&"
"&vbcrlf response.write "date_created: "&me.date_created&"
"&vbcrlf response.write "date_modified: "&me.date_modified&"
"&vbcrlf response.write "

"&vbcrlf me.zone.sandbox() me.taxclass.sandbox() end sub '=========Terminate=========' private sub class_terminate() set taxrate_id = nothing set taxrate_zone_id = nothing set taxrate_taxclass_id = nothing set taxrate_rate = nothing set taxrate_description = nothing set taxrate_date_created = nothing set taxrate_date_modified = nothing set taxrate_is_set = nothing '=========Objects=========' set obj_zone = nothing set obj_taxclass = nothing '=========Internal Variables=========' set rs = nothing end sub end class %> <% ' ' ' ' ' %> <% '//// '// BUILD CATALOG NAVIGATION '//// function ais_catalog_nav(cp_array) dim level, cnav cnav = "" level = 0 cnav = cnav & "
"&vbcrlf cnav = cnav & "

Categories

"&vbcrlf cnav = cnav & "
"&vbcrlf call build_cat_tree(cnav, level, cp_array, 0, "") cnav = cnav & "
"&vbcrlf cnav = cnav & "
"&vbcrlf set level = nothing ais_catalog_nav = cnav end function sub build_cat_tree(cnav, level, cp_array, parent, path) dim rs, cat, lvlcount, spacer, cat_flag, prod_count set cat = new c_category spacer = "   " level = level + 1 set rs = conn.execute("select cat_id from categories where cat_parent_id = "&ais_clean_numeric(parent)&" and cat_is_active = true order by cat_sort_order, cat_name, cat_id;") if not rs.eof then cnav = cnav & ""&vbcrlf end if level = level - 1 set rs = nothing set cat = nothing set lvlcount = nothing set spacer = nothing end sub '//// '// CUSTOMER BASKET SIDE BOX '//// function ais_basket_side_box(obj_cart) dim basket, sci_rs basket = "" if obj_cart.is_set then set sci_rs = conn.execute("select p.prod_id, p.prod_name as item_name, sci.cartitem_quantity as item_qty from shopping_cart_items as sci inner join products as p on sci.cartitem_prod_id = p.prod_id where sci.cartitem_shopcart_id = "&obj_cart.id&";") if not sci_rs.eof then basket = basket & ""&vbcrlf basket = basket & "
"&vbcrlf basket = basket & "

Shopping Cart  [more]

"&vbcrlf basket = basket & "
"&vbcrlf basket = basket & "
    "&vbcrlf do until sci_rs.eof basket = basket & "
  • "&sci_rs("item_qty")&" - "&sci_rs("item_name")&"
  • "&vbcrlf sci_rs.movenext loop basket = basket & "
"&vbcrlf basket = basket & "
"&vbcrlf basket = basket & ""&vbcrlf end if sci_rs.close end if set sci_rs = nothing ais_basket_side_box = basket end function %> <% '//// '// DRAW BOXES '//// function ais_side_box(content, header, footer, box_template) dim tmp_box if not ais_not_null(box_template) then targetURL = ais_href_link("/includes/templates/common/boxes", "", "") Set xml = CreateObject("Microsoft.XMLHTTP") xml.Open "GET", targetURL, False xml.setRequestHeader "Pragma", "no-cache" xml.setRequestHeader "Cache-Control","no-cache" xml.Send box_template = xml.responseText end if tmp_box = box_template if ais_not_null(tmp_box) then tmp_box = replace(lcase(tmp_box),"[content]", content) tmp_box = replace(lcase(tmp_box),"[header]", header) tmp_box = replace(lcase(tmp_box),"[footer]", footer) end if ais_side_box = tmp_box end function %> <% '/////////////////////// ' DATA ALTERING '/////////////////////// ''' ' Preparing values for database entry ''' function ais_db_input(string) if len(string) > 0 then ais_db_input = replace(string, "'", "''") exit function else ais_db_input = "" exit function end if end function ''' ' Cleaning up SQL injections ''' private function ais_kill_chars(string) dim bad_chars, new_chars, kill_count bad_chars = array("select", "drop", ";", "--", "insert", "delete", "xp_") new_chars = string for kill_count = 0 to uBound(bad_chars) new_chars = replace(new_chars, bad_chars(kill_count), "") next ais_kill_chars = new_chars set bad_chars = nothing set new_chars = nothing set kill_count = nothing end function '//////////////////////////////////////////////////////////////////// '/////////////////////// ' ERROR REPORTING '/////////////////////// function ais_show_error(msg) if ais_not_null(msg) then response.write "
"&vbCRLF response.write " "&vbCRLF response.write " "&vbCRLF response.write " "&vbCRLF response.write " "&vbCRLF response.write "
"&msg&"
"&vbCRLF response.write "
"&vbCRLF end if end function '//////////////////////////////////////////////////////////////////// '/////////////////////// ' DATA VALIDATING '/////////////////////// ''' ' Regular expressions ''' const regex_email = "^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$" const regex_us_phone = "^\d{3}-\d{3}-\d{4}$" const regex_us_postal_code = "^\d{5}$" const regex_us_currency = "^\$?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(.[0-9][0-9])?$" const regex_url = "^((https?|ftp|news):\/\/)?([a-z]([a-z0-9\-]\.*)+([a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-z][a-z0-9_]*)?$" const regex_integer = "^\d*$" ''' ' Validate value is not null ''' function ais_not_null(value) if isarray(value) then if ubound(value) > 0 then ais_not_null = true exit function else ais_not_null = false exit function end if else if (value <> "") and (not isnull(value)) and ((len(trim(value)) > 0)) then ais_not_null = true exit function else ais_not_null = false exit function end if end if end function ''' ' Validate value is numeric ''' function ais_is_numeric(value) ais_is_numeric = (isnumeric(trim(value)) and ais_not_null(trim(value))) end function ''' ' Validate value is integer ''' function ais_is_integer(value) ais_is_integer = regex_check(value, regex_integer) end function ''' ' Validate value is a date ''' function ais_is_date(value) ais_is_date = isdate(value) end function ''' ' Validate value is an email ''' function ais_is_email(value) ais_is_email = regex_check(value, regex_email) end function ''' ' Validate value is a URL ''' function ais_is_url(value) ais_is_url = regex_check(value, regex_url) end function ''' ' Validate value is an us phone number ''' function ais_is_us_phone(value) ais_is_us_phone = regex_check(ais_clean_us_phone(value), regex_us_phone) end function ''' ' Validate value is an us postal code ''' function ais_is_us_postal_code(value) ais_is_us_postal_code = regex_check(value, regex_us_postal_code) end function ''' ' Validate value is an us currency ''' function ais_is_us_currency(value) ais_is_us_currency = regex_check(value, regex_us_currency) end function ''' ' Validate regular expressions ''' function regex_check(string,regex) dim obj_regex if ais_not_null(string) then set obj_regex = new regexp obj_regex.pattern = regex obj_regex.global = true obj_regex.ignorecase = true regex_check = obj_regex.test(string) else regex_check = false end if end function '//////////////////////////////////////////////////////////////////// '/////////////////////// ' WEBSITE FUNCTIONS '/////////////////////// ''' ' Redirect to URL ''' function ais_redirect(URL) if len(URL) < 1 then response.write ERROR_CUST_REDIRECT_EMPTY exit function else response.redirect URL end if end function '//////////////////////////////////////////////////////////////////// '/////////////////////// ' EMAILING FUNCTIONS '/////////////////////// function ais_send_email(e_host_name, e_sender_email, e_sender_name, e_recipient_emails, e_cc_emails, _ e_bcc_emails, e_reply_email, e_mail_subject, e_mail_body) dim mail, e_re, e_cc_e, e_bcc_e, tmp_send_email tmp_send_email = "" if not ais_not_null(e_host_name) then tmp_send_email = "Host name not present!" elseif not ais_not_null(e_sender_email) then tmp_send_email = "Sender email not present!" elseif not ais_not_null(e_sender_name) then e_sender_name = e_sender_email elseif not ais_not_null(e_recipient_emails) then tmp_send_email = "No recipient present" elseif not ais_not_null(e_mail_subject) then tmp_send_email = "Email subject not present!" elseif not ais_not_null(e_mail_body) then tmp_send_email = "Email body not present!" else set mail = server.createobject("Persits.MailSender") ' Specify a valid SMTP server mail.host = e_host_name ' Specify sender's address mail.from = e_sender_email ' Specify sender's name mail.fromname = e_sender_name ' Specify reciever's email address e_recipient_emails = SPLIT(e_recipient_emails,",") for each e_re in e_recipient_emails mail.addaddress e_re next ' Specify CC's email address if ais_not_null(e_cc_emails) then e_cc_emails = SPLIT(e_cc_emails,",") for each e_cc_e in e_cc_emails main.addcc e_cc_e next end if ' Specify BCC's email address if ais_not_null(e_bcc_emails) then e_bcc_emails = SPLIT(e_bcc_emails,",") for each e_bcc_e IN e_bcc_emails mail.addbcc e_bcc_e next end if ' Specify reply-to address if ais_not_null(e_reply_email) then mail.addreplyto e_reply_email else mail.addreplyto e_sender_email end if ' Specify email subject mail.subject = e_mail_subject ' Specify email body mail.body = e_mail_body ' Specify if email is HTML or Text mail.ishtml = true ' Authentication if ais_not_null(config.mail_user) then Mail.Username = config.mail_user Mail.Password = config.mail_password end if ' Send Mail mail.send end if ais_send_email = tmp_send_email end function '/////////////////////// ' ARRAY FUNCTIONS '/////////////////////// function ais_in_array(value, arr) if isarray(arr) then dim item for each item in arr if value = item then ais_in_array = true exit function end if next end if ais_in_array = false end function %> <% '/////////////////////// ' DATA CONVERSION / GENERATOR '/////////////////////// ''' ' Convert text to hash value ''' function ais_hashvalue(txt) dim cm, context, hash, hash_value ' Calculate Hash of Password + Salt hash_value = md5(txt) set cm = nothing set context = nothing set hash = nothing ais_hashvalue = hash_value end function ''' ' Random number generator ''' function ais_rand(dmin, dmax) if dmax = 0 then dmax = dmin + 1000 end if randomize ais_rand = Int(Rnd * (dmax-dmin))+dmin end function ''' ' Returns value as '0' if not numeric ''' function ais_clean_numeric(value) if not ais_is_numeric(value) then ais_clean_numeric = 0 exit function end if ais_clean_numeric = value end function function ais_string_to_int(value) ais_string_to_int = cint(value) end function ''' ' Returns text 'true' or 'false' to boolean values ''' function ais_clean_boolean(string) if ais_not_null(string) then if string = true then ais_clean_boolean = true exit function end if if lcase(string) = "true" then ais_clean_boolean = true exit function else ais_clean_boolean = false exit function end if else ais_clean_boolean = false exit function end if ais_clean_boolean = false end function ''' ' Returns US phone number (xxx-yyy-zzzz) ''' function ais_clean_us_phone(value) dim new_phone dim i new_phone = "" for i = 1 to len(value) if asc(mid(value,i,1)) >= asc("0") and asc(mid(value,i,1)) <= asc("9") then new_phone = new_phone & mid(value,i,1) end if next If Len(new_phone) = 10 Then new_phone = left(new_phone,3)&"-"&mid(new_phone, 4, 3)&"-"&right(new_phone,4) Else new_phone = value End If ais_clean_us_phone = new_phone END FUNCTION ''' ' Returns safe html output ''' function ais_output_string(string, protected) if ais_not_null(string) then if ais_clean_boolean(protected) then ais_output_string = Server.HTMLencode(string) else ais_output_string = replace(string, chr(34), """) exit function end if else ais_output_string = "" exit function end if ais_output_string = string end function ''' ' Returns status on/off image ''' function ais_output_status_image(string) if ais_clean_boolean(string) then ais_output_status_image = ais_link("includes/templates/images/icons/icon_is_active_on.png", "") exit function else ais_output_status_image = ais_link("includes/templates/images/icons/icon_is_active_off.png", "") exit function end if end function ''' ' Returns status on/off alt ''' function ais_output_status_alt(string) if ais_clean_boolean(string) then ais_output_status_alt = "Active" exit function else ais_output_status_alt = "Inactive" exit function end if end function function ais_output_currency(num) ais_output_currency = formatcurrency(ais_clean_numeric(num)) end function '//////////////////////////////////////////////////////////////////// '//// '// Check if payment method is configured '//// function ais_is_payment_configured(p_id) dim p set p = new c_payment_method p.set_payment_method p_id select case ais_clean_numeric(p.paymethodtype.id) case 1 '// Authorize.Net if not ais_not_null(p.value.login) or not ais_not_null(p.value.transaction_key) or not ais_not_null(p.value.transaction_type) then ais_is_payment_configured = false exit function end if case 2 '// Verisign if not ais_not_null(p.value.login) or not ais_not_null(p.value.partner) or not ais_not_null(p.value.transaction_type) then ais_is_payment_configured = false exit function end if case 3 '// PayPal if not ais_not_null(p.value.email) then ais_is_payment_configured = false exit function end if case 4 '// EProcessing Networks if not ais_not_null(p.value.login) then ais_is_payment_configured = false exit function end if case 5 '// Check or Money Orders if not ais_not_null(p.value.pay_to) or not ais_not_null(p.value.address) then ais_is_payment_configured = false exit function end if case else ais_is_payment_configured = false exit function end select ais_is_payment_configured = true end function '//////////////////////////////////////////////////////////////////// '/////////////////////// ' WEBSITE FUNCTIONS '/////////////////////// function ais_text_to_html(string) if ais_not_null(string) then ais_text_to_html = replace(string,vbcrlf,"
") exit function else ais_text_to_html = string exit function end if end function function ais_href_link(page, parameters, connection) dim link if left(page,1) = "/" then if UCASE(connection) = "SSL" then link = HTTPS_SERVER else link = HTTP_SERVER end if else if UCASE(connection) = "SSL" then link = HTTPS_SERVER & DIR_WS_HTTPS_CATALOG else link = HTTP_SERVER & DIR_WS_CATALOG end if end if if not ais_not_null(page) then page = "" elseif right(page,1) = "/" then page = page elseif instr(page, ".asp") < 1 then page = page & ".asp" end if if ais_not_null(parameters) then link = link & page & "?" & parameters else link = link & page end if do while Mid(link,len(link)) = "&" or Mid(link,len(link)) = "?" link = Mid(link,1,len(link)-1) loop ais_href_link = link end function function ais_html_safe_link(string) ais_html_safe_link = Server.URLEncode(string) end function function ais_link(page, connection) dim link if not ais_not_null(page) then ais_link = page exit function end if if UCASE(connection) = "SSL" then link = HTTPS_SERVER & DIR_WS_HTTPS_ADMIN else link = HTTP_SERVER & DIR_WS_ADMIN end if link = link & page ais_link = link end function function ais_file_exists(folder, file) dim fs set fs = server.createobject("scripting.filesystemobject") if ais_not_null(folder) and ais_not_null(file) then ais_file_exists = fs.fileexists(server.mappath(replace(folder,HTTP_SERVER,"")&file)) exit function else ais_file_exists = false exit function end if end function function ais_image_link(folder, file, size) if ais_file_exists(folder, file) then ais_image_link = folder&file exit function else select case size case 2 ' large image ais_image_link = DIR_WS_IMAGES&"no_picture.gif" case 3 ' full sized image ais_image_link = DIR_WS_IMAGES&"no_picture.gif" case else ' small image ais_image_link = DIR_WS_IMAGES&"no_picture.gif" end select exit function end if end function function ais_add_slash(string) if ais_not_null(string) then string = replace(string,vbcrlf,"\n") string = replace(string,"'","\'") string = replace(string,chr(34),""") ais_add_slash = string exit function else ais_add_slash = string exit function end if end function function ais_array_map(func, arr) dim new_array(), i, value i = 0 if isarray(arr) then redim new_array(ubound(arr)) for each value in arr if ais_is_numeric(value) then new_array(i) = func(value) i = i + 1 end if next else ais_array_map = null end if ais_array_map = new_array end function %> <% ' Init_Databae.asp ' This include file only has two function ' Open_Database() - opens the connection to the database ' Close_Database() - closes the connection to the database Dim Conn Dim connectstr ''''''''''''''''Opening The Access Database Connection'''''''''''''''' ' This will connect the database to the webpage that calls it ' ' db_path = folder that has the database ' db_name = Name of the database using ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function Open_Database() connectstr = "DRIVER="&DB_DRIVER&";DBQ="&DB_LOCALPATH Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open connectstr End Function ''''''''''''''''Closing The Access Database Connection'''''''''''''''' ' When called, this will close the connection ' of the database in the webpage that calls it '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function Close_Database() If UCase(TypeName(Conn)) = "CONNECTION" Then Conn.Close Set Conn = Nothing Set connectstr = Nothing End If End Function %> <% ' ' %> <% const HEADING_TITLE = "Customer Login" const ERROR_WRONG_LOGIN = "Error: Sorry, there is no match for that email address and/or password." const ERROR_WRONG_EMAIL = "Error: Sorry, there is no match for that email address." const ERROR_SECURITY_ERROR = "There was a security error when trying to login." const TEXT_PASSWORD_FORGOTTEN = "Resend Password" %> <% Const BUTTON_IMAGE_ADD_TO_CART = "button_add_to_cart.gif" Const BUTTON_IMAGE_ADD_ADDRESS = "button_add_address.gif" Const BUTTON_IMAGE_ADD_PRODUCTS_TO_CART = "button_add_selected.gif" Const BUTTON_IMAGE_BACK = "button_back.gif" Const BUTTON_IMAGE_BUY_NOW = "button_buy_now.gif" Const BUTTON_IMAGE_CANCEL = "button_cancel.gif" Const BUTTON_IMAGE_CHANGE_ADDRESS = "button_change_address.gif" Const BUTTON_IMAGE_CHECKOUT = "button_checkout.gif" Const BUTTON_IMAGE_CONFIRM_SEND = "button_confirm_send.gif" Const BUTTON_IMAGE_CONFIRM_ORDER = "button_confirm_order.gif" Const BUTTON_IMAGE_CONTINUE = "button_continue.gif" Const BUTTON_IMAGE_CONTINUE_CHECKOUT = "button_continue_checkout.gif" Const BUTTON_IMAGE_CONTINUE_SHOPPING = "button_continue_shopping.gif" Const BUTTON_IMAGE_CREATE_ACCOUNT = "button_create_account.gif" Const BUTTON_IMAGE_DELETE = "button_delete.gif" Const BUTTON_IMAGE_DELETE_SMALL = "button_delete_small.gif" Const BUTTON_IMAGE_DOWNLOAD = "button_download.gif" Const BUTTON_IMAGE_EDIT_SMALL = "button_small_edit.gif" Const BUTTON_IMAGE_GOTO_PROD_DETAILS = "button_goto_prod_details.gif" Const BUTTON_IMAGE_IN_CART = "button_in_cart.gif" Const BUTTON_IMAGE_LOG_OFF = "button_logoff.gif" Const BUTTON_IMAGE_LOGIN = "button_login.gif" Const BUTTON_IMAGE_MORE_REVIEWS = "button_more_reviews.gif" Const BUTTON_IMAGE_NEXT = "button_next.gif" Const BUTTON_IMAGE_PREVIOUS = "button_prev.gif" Const BUTTON_IMAGE_READ_REVIEWS = "button_read_reviews.gif" Const BUTTON_IMAGE_REDEEM = "button_redeem.gif" Const BUTTON_IMAGE_RETURN_TO_PROD_LIST = "button_return_to_product_list.gif" Const BUTTON_IMAGE_REVIEWS = "button_reviews.gif" Const BUTTON_IMAGE_SEARCH = "button_search.gif" Const BUTTON_IMAGE_SEND = "button_send.gif" Const BUTTON_IMAGE_SEND_A_GIFT_CERT = "button_send_a_gift_cert.gif" Const BUTTON_IMAGE_SEND_ANOTHER = "button_send_another.gif" Const BUTTON_IMAGE_SHIPPING_ESTIMATOR = "button_shipping_estimator.gif" Const BUTTON_IMAGE_SOLD_OUT = "button_sold_out.gif" Const BUTTON_IMAGE_SOLD_OUT_SMALL = "button_sold_out_sm.gif" Const BUTTON_IMAGE_SUBMIT = "button_submit.gif" Const BUTTON_IMAGE_TELL_A_FRIEND = "button_tell_a_friend.gif" Const BUTTON_IMAGE_TELLAFRIEND = "button_TellAFriend.gif" Const BUTTON_IMAGE_UNSUBSCRIBE = "button_unsubscribe.gif" Const BUTTON_IMAGE_UPDATE = "button_update.gif" Const BUTTON_IMAGE_VIEW_SMALL = "button_view.gif" Const BUTTON_IMAGE_WRITE_REVIEW = "button_write_review.gif" '//// ' ALT tags used for buttons '//// Const BUTTON_ADD_TO_CART_ALT = "Add This to My Cart" Const BUTTON_ADD_ADDRESS_ALT = "Add Address" Const BUTTON_ADD_PRODUCTS_TO_CART_ALT = "Add Selected Products to Cart" Const BUTTON_BACK_ALT = "Back" Const BUTTON_BUY_NOW_ALT = "Buy Now" Const BUTTON_CANCEL_ALT = "Cancel" Const BUTTON_CHANGE_ADDRESS_ALT = "Change Address" Const BUTTON_CHECKOUT_ALT = "Checkout" Const BUTTON_CONFIRM_SEND_ALT = "Send Gift Certificate" Const BUTTON_CONFIRM_ORDER_ALT = "Confirm Order" Const BUTTON_CONTINUE_ALT = "Continue" Const BUTTON_CONTINUE_CHECKOUT_ALT = "Go To Checkout" Const BUTTON_CONTINUE_SHOPPING_ALT = "Continue Shopping" Const BUTTON_CREATE_ACCOUNT_ALT = "Sign Up" Const BUTTON_DELETE_ALT = "Delete" Const BUTTON_DELETE_SMALL_ALT = "Delete" Const BUTTON_DOWNLOAD_ALT = "Download Now" Const BUTTON_EDIT_SMALL_ALT = "Edit" Const BUTTON_GOTO_PROD_DETAILS_ALT = "Go To This Product's Detailed Information" Const BUTTON_IN_CART_ALT = "Add to Cart" Const BUTTON_LOG_OFF_ALT = "Log Off" Const BUTTON_LOGIN_ALT = "Sign In" Const BUTTON_MORE_REVIEWS_ALT = "Read More Reviews" Const BUTTON_NEXT_ALT = "Next" Const BUTTON_PREVIOUS_ALT = "Previous" Const BUTTON_READ_REVIEWS_ALT = "Read the Review" Const BUTTON_REDEEM_ALT = "Redeem" Const BUTTON_RETURN_TO_PROD_LIST_ALT = "Return to the Product List" Const BUTTON_REVIEWS_ALT = "Go to the Reviews Page" Const BUTTON_SEARCH_ALT = "Search" Const BUTTON_SEND_ALT = "Send Now" Const BUTTON_SEND_A_GIFT_CERT_ALT = "Send Another Gift Certificate" Const BUTTON_SEND_ANOTHER_ALT = "Send A Gift Certificate" Const BUTTON_SHIPPING_ESTIMATOR_ALT = "Shipping Estimator" Const BUTTON_SOLD_OUT_ALT = "Sold Out" Const BUTTON_SOLD_OUT_SMALL_ALT = "Sold Out" Const BUTTON_SUBMIT_ALT = "Submit the Information" Const BUTTON_TELL_A_FRIEND_ALT = "Tell a Friend" Const BUTTON_TELLAFRIEND_ALT = "Tell a Friend" Const BUTTON_UNSUBSCRIBE_ALT = "Unsubscribe" Const BUTTON_UPDATE_ALT = "Update" Const BUTTON_VIEW_SMALL_ALT = "View" Const BUTTON_WRITE_REVIEW_ALT = "Write Review" %> <% '' define the icon images used in the project Const ICON_IMAGE_ERROR = "error.png" Const ICON_IMAGE_WARNING = "warning.gif" Const ICON_IMAGE_SUCCESS = "success.gif" Const ICON_IMAGE_TRASH = "small_delete.gif" Const ICON_IMAGE_UPDATE = "button_update_cart.gif" Const ICON_IMAGE_TINYCART = "cart.gif" '' alt tags for buttons Const ICON_ERROR_ALT = "Error" Const ICON_SUCCESS_ALT = "Success" Const ICON_WARNING_ALT = "Warning" Const ICON_TRASH_ALT = "Delete this item from the cart by clicking this icon." Const ICON_UPDATE_ALT = "Change your quantity by highlighting the number in the box, correcting the quantity and clicking this button." Const ICON_TINYCART_ALT = "Add this product to your cart by clicking here." %> <% '///// ' Site-wide Variables '///// dim err_message dim app_flag, app_err_msg dim WS_PAGE_TITLE, WS_PAGE_KEYWORDS, WS_PAGE_DESCRIPTION dim box_template, xml, targetURL dim current_page, prev_page app_flag = true app_err_msg = "" err_message = request("err_message") current_page = ais_href_link(request.servervariables("path_info"),request.servervariables("query_string"),"") prev_page = request.servervariables("http_referer") '///// ' Initialize Database Connection '///// open_database() '///// ' Initialize Default Configurations '///// dim config set config = new c_configuration '///// ' Site-wide Settings '///// Session.Timeout = config.session_timeout Server.ScriptTimeout = config.script_timeout WS_PAGE_TITLE = config.meta_tags_title WS_PAGE_KEYWORDS = config.meta_tags_keywords WS_PAGE_DESCRIPTION = config.meta_tags_description %> <%=WS_PAGE_TITLE%>

<%if ais_not_null(err_message) then%>
<%=err_message%>
<%end if%>



Ordering a Mini Hangar
Requires the Following:

Dimensions in Inches (see diagram):
High Wing, Low Wing, Other

We'll also need to know how you want your cover designed for you:
Airplane to be inserted Frontward or Backward

Year, Make, Style of plane
You can email us a picture of your plane. Click here.


Click Images to enlarge
mini hangars small airplane hangarssmall airplane hangars

- Prices Starting At -

  Mini Hangars ......................... only $995.00 ea.
  45yr. Sheeting ................................... $4.05 ft.
  Trim ................................................ $20.00 ea.
  Low Wing Sides ................................. $199.00 pr.

Wheel Lock-Down Assembly
  W/Guidance Rail .............................. $125.00 ea.
  J-bolts ........................................... $4.50 ea.

Gables
  3ft. Gable .................................. $149.95 ea.
  6ft. Gable .................................. $195.95 ea.

Back Kits
  6ft. Legs .................................... $235.95 ea.
  7-9ft. Legs ................................... $285.95 ea.

Buildings & T-Hangars up to 50ft. wide available!
-Plus tax & shipping

Use this form to gather your measurements.  Then call us with the information.
mini hangar measuring for airplane hangar

Coverall Protective Structures
916-992-0555
Fax 916-992-0333
info@coverall-carports.com
1-800-490-LOOK
Protective hangars by Coverall-Carports.com
2577 Elkhorn Blvd.
Rio Linda, CA 95673

<%=Year(Date())%> All Rights Reserved - Mini-Hangars.com
site by
AnInternetStore.com

<% '///// ' Site-wide Variables '///// set err_message = nothing set app_flag = nothing set app_err_msg = nothing '///// ' Initialize Default Configurations '///// set config = nothing '///// ' Initialize Database Connection '///// close_database() %>