<?php
include ('includes/db1config.php');
include ('includes/mysql_connect.php');
$mysql = "select * from admin_options";
$rs = mysql_query($mysql);          // query executed
while($nt=mysql_fetch_array($rs)){
	$fantools_subscribed=$nt[use_fantools];		//this enables fantools options in admin area
	$fantools_org_id=$nt[fantools_org_id];		//this assigns fantools users to the Paperin/PostedCard account at Four51
	$ordering_subscribed=$nt[online_ordering];		//this enables online ordering
	$fax_subscribed=$nt[fax_service];			//this enables the order-to-fax service
	$mobile_only=$nt[mobile_only];			//this makes the site mobile only (social connect) for stores that already have a PC based site and want a mobile version
	$white_label_admin=$nt[white_label];		//this option removes the styling from the admin pages, so it can be embedded into another website
	$brand=$nt[brand];				//this includes options and branding based on who sold the site (Paperin, Taste Systems, etc)
	$coupon_club_option=$nt[coupon_club_option]; //default = 0 if not changed by developers
	$footer_option=$nt[footer_option];	//default = 0 if not changed by developers
	$sidebar_option=$nt[sidebar_option];	//default = 0 if not changed by developers
	$social_button_option=$nt[social_button_option];	//default = 0 if not changed by developers
	$show_home_sidebar=$nt[show_home_sidebar];	//default = 1 (on) if not changed by developers
	$right_sidebar=$nt[right_sidebar];	//default = 0 (off) if not changed by developers
	$sms_enabled=$nt[sms_enabled];	//default = 0 (off) if not changed by developers
	$linkpos_enabled=$nt[use_linkpos];	//default = 0 (off) if not changed by developers
	if($linkpos_enabled=='1'){$_SESSION['linkpos']=true;}else{$_SESSION['linkpos']=false;}
	$ecommerce_pkg=$nt[ecommerce_pkg];	//default = 0 (off) if not changed by developers
	$_SESSION['ecommerce_pkg']=$nt[ecommerce_pkg]; //same as above, save in session
	$auto_pkg=$nt[auto_pkg];	//default = 0 (off) if not changed by developers
	$real_estate_pkg=$nt[real_estate_pkg];	//default = 0 (off) if not changed by developers
	$coupon_pkg=$nt[coupon_pkg];	//default = 0 (off) if not changed by developers
	$deal_site_pkg=$nt[deal_site_pkg];	//default = 0 (off) if not changed by developers
	$restaurant_pkg=$nt[restaurant_pkg];	//default = 0 (off) if not changed by developers
	$_SESSION['restaurant_pkg']=$nt[restaurant_pkg];
	$hvac_pkg=$nt[hvac_pkg];	//default = 0 (off) if not changed by developers
	$_SESSION['admin_brand']=$nt[brand];
	$_SESSION['enable_mobile']=$nt[enable_mobile];
	$allow_order_edits = $nt[allow_order_edits]; //default = 0 (off)  - this is a rare option since orders shouldn't change after paid for.
	$bottom_widgets=$nt[bottom_widgets];	//default = 0 
	$top_widgets=$nt[top_widgets];	//default = 0 
	$parent_pages_clickable=$nt[parent_pages_clickable];	//default = 0
	$menu_only=$nt[menu_only];	//default = 0 ***This allows hiding of most admin features for menu-only sites.
	$full_width_order_page=$nt[full_width_order_page];	//default = 0 ***This allows setting the order page to full width by changing value to 1
	$_SESSION['parent_site_url']=$nt[parent_site_url];	//this means that this site is in a subfolder and needs to use the root_folder variable
	$_SESSION['enable_menu_reviews']=$nt[enable_menu_reviews];
	$_SESSION['menu_boards']=$nt[menu_boards];
	$_SESSION['template']=$nt[template_id];
	$_SESSION['small_admin']=$nt[small_admin];
	$_SESSION['menu_board_only']=$nt[menu_board_only];
	$_SESSION['chow_now_id']=$nt[chow_now_id];
	$_SESSION['cloud_print']=$nt[cloud_print];
	$_SESSION['text_only']=$nt[text_only];
	
}


$query = "Select timezone, root_folder, title, gtm_id, use_multiple_sauces, use_multiple_crusts, cc_processor from storePrefs";
	$rt=mysql_query($query);          // query executed 
	while($nt=mysql_fetch_array($rt)){
		$_SESSION[timezone] = $nt[timezone];
		date_default_timezone_set($_SESSION[timezone]);
		$_SESSION[root_folder] = $nt[root_folder];
		$_SESSION[site_name] = $nt[title];
		$_SESSION[gtm_id] = $nt[gtm_id];
		$_SESSION[use_multiple_sauces] = $nt[use_multiple_sauces];
		$_SESSION[use_multiple_crusts] = $nt[use_multiple_crusts];
		$_SESSION[cc_processor] = $nt[cc_processor];
	}
	

	

//now using only one stylesheet for all brands
$stylesheet="main_style.css";
$admin_folder="cmsadmin";	


//print_r($_SESSION);
//die();



?>