<?php if (!isset($_SESSION['FirstName'])) {
	session_start();
}
    include ('includes/db1config.php');
    include ('../includes/mysql_connect.php');
	include ('includes/admin-config.php');	//get site options
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<?php 
include('title.php'); 
echo'<link href="css/'.$stylesheet.'" rel="stylesheet" type="text/css" media="screen" />';	
echo'<link href="css/print_style.css" rel="stylesheet" type="text/css" media="print" />';
?>

<!--<link rel="stylesheet" type="text/css" href="css/cssverticalmenu.css" />-->
<link rel="stylesheet" href="includes/tinyaccordion/style.css" type="text/css" />

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"> </script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.9.1.js"></script>
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>


<script type="text/javascript" src="../js/ddaccordion.js"></script>

<!-- for popup windows -->
<link href="css/popup-style.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="js/script.js"></script>
 <!-- end popup script-->

<style type="text/css">

.leftForm {
    float: left;
    left: -54px;
    position: relative;
    width: 371px;
}

.rightForm{
	float: left;
	width: 300px;
}
.saveButton{
	margin: auto;
}
#save-button{
	margin-right: 115px;
	width: 150px;
}

.AddMOreEdit:hover {
	cursor: pointer;
}

.arrowlistmenu{
	width: 100%; /*width of accordion menu*/
	}

	.arrowlistmenu .menuheader{ /*CSS class for menu headers in general (expanding or not!)*/
	font:12px Verdana,Arial;width:95%; border:1px solid #467182; padding:7px; 
		font-weight:bold; margin-top:5px; cursor:pointer; 
	    -webkit-border-radius: 7px;
	    -moz-border-radius: 7px;
	    border-radius: 7px;
	    border: solid 1px #e8e8e8;
	    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
	    -webkit-transition-duration: 0.2s;
	    -moz-transition-duration: 0.2s;
	    transition-duration: 0.2s;
	    -webkit-user-select:none;
	    -moz-user-select:none;
	    -ms-user-select:none;
	    user-select:none;
		color:#fff;
		background-color:#2077a1;
		padding-left:.5em;padding-right:.5em;
	}

	.arrowlistmenu .openheader{ /*CSS class to apply to expandable header when it's expanded*/
	background-image: url(titlebar-active.png);
	}

	.arrowlistmenu ul{ /*CSS for UL of each sub menu*/
	list-style-type: none;
	margin: 0;
	padding: 0;
	margin-bottom: 0px; /*bottom spacing between each UL and rest of content*/
	background: none;
	}

	.arrowlistmenu ul li{
	padding-bottom: 0px; /*bottom spacing between menu items*/
	}

	.arrowlistmenu ul li .opensubheader{ /*Open state CSS for sub menu header*/
	background: lightblue !important;
	}

	.arrowlistmenu ul li .closedsubheader{ /*Closed state CSS for sub menu header*/
	background: lightgreen !important;
	}

	.arrowlistmenu ul li a{
	color: #81BEF7;
	background: url(arrowbullet.png) no-repeat center left; /*custom bullet list image*/
	display: block;
	padding: 0px 0;
	padding-left: 19px; /*link text is indented 19px*/
	text-decoration: none;
	font-weight: bold;
	border-bottom: 1px solid #dadada;
	font-size: 90%;
	}

	.arrowlistmenu ul li a:visited{
	color: #81BEF7;
	}

	.arrowlistmenu ul li a:hover{ /*hover state CSS*/
	color: #FA5858;
	background-color: #FA5858;
	}

	.arrowlistmenu ul li a.subexpandable:hover{ /*hover state CSS for sub menu header*/
	background: lightblue;
	}
	html {
	    overflow-y: scroll;
	}
	#save-button {
	    margin-right: 0px !important;
	    width: 100px !important;
	}

</style>

<style type="text/css">
	body#pop-up-window {
		background:none;
		margin-top:5px;
	}
	
	body#pop-up-window #content,
	body#pop-up-window #main-content {
		margin:0px;
		padding:0px;
		width:100%;
		background:none;
	}
	
	#main-content .entry h1 {
	    margin     : 0 0 0 25%;
	    padding    : 0 0 10px;
	    text-align : center;
	}

	body#pop-up-window #content {
	}
	
	#wrapper.custom {
		-webkit-border-radius: none;
		-moz-border-radius: none;
	    border-radius: 0;
		border: none;
		background: none;
		width: 500px;
		padding:0px;
		margin:0px;
		margin:16px;
	}

	.disabled {
		background: #48a3db none repeat scroll 0 0;
	    border: 1px solid #777777;
	    border-radius: 4px;
	    color: #fff;
	    opacity: 0.34;
	    padding: 3px 6px;
	}

	.disabled:hover {
		background: #48a3db none repeat scroll 0 0 !important;
	    border: 1px solid #777777 !important;
	    border-radius: 4px !important;
	    color: #fff !important;
	    opacity: 0.34 !important;
	    padding: 3px 6px !important;
	}

	tr td {
	    padding: 3px 20px !important;
	}
	.mainForm{
		margin: auto !important;
    	width: 250px !important;
	}
</style>

</head>
<body id="pop-up-window">

<div id="wrapper" class="custom">

<!-- start content -->
<div id="content">
<div id="main-content">
   
		<div class="post">
		  <div class="entry">

<h1>Update Master Options</h1>
                
<?php 
if($_SESSION['masterAdmin']==1){ 
	include ('includes/db1config.php');
	include ('../includes/mysql_connect.php');

    $query = "SELECT * from admin_options where recordkey = 1";
	$rt    = mysql_query($query); // query executed
	echo mysql_error(); // if any error is there that will be printed to the screen
	$row   = mysql_fetch_array($rt);

	$ssl_domain              = ( isset($row['ssl_domain'])      ? $row['ssl_domain']         : '' );
	$parent_site_url         = ( isset($row['parent_site_url']) ? $row['parent_site_url']    : '' );
	$sms_plan                = ( isset($row['sms_plan'])        ? $row['sms_plan']           : '' );
	$email_plan              = ( isset($row['email_plan'])      ? $row['email_plan']         : '' );
	$rocketblaster_id        = ( isset($row['rocketblaster_id'])? $row['rocketblaster_id']   : '' );
	$chow_now_id             = ( isset($row['chow_now_id'])     ? $row['chow_now_id'] 		 : '' );
	$sms_enabled             = ( isset($row['sms_enabled'])     ? $row['sms_enabled'] 		 : 0  );
	$use_linkpos             = ( isset($row['use_linkpos'])     ? $row['use_linkpos'] 		 : 0  );
	$auto_pkg                = ( isset($row['auto_pkg'])        ? $row['auto_pkg'] 			 : 0  );
	$ecommerce_pkg           = ( isset($row['ecommerce_pkg'])   ? $row['ecommerce_pkg'] 	 : 0  );
	$real_estate_pkg         = ( isset($row['real_estate_pkg']) ? $row['real_estate_pkg'] 	 : 0  );
	$coupon_pkg              = ( isset($row['coupon_pkg'])      ? $row['coupon_pkg'] 		 : 0  );
	$deal_site_pkg           = ( isset($row['deal_site_pkg'])   ? $row['deal_site_pkg'] 	 : 0  );
	$restaurant_pkg          = ( isset($row['restaurant_pkg'])  ? $row['restaurant_pkg']     : 0  );
	$hvac_pkg                = ( isset($row['hvac_pkg'])        ? $row['hvac_pkg']           : 0  );
	$enable_mobile           = ( isset($row['enable_mobile'])   ? $row['enable_mobile']      : 0  );
	$parent_pages_clickable  = ( isset($row['parent_pages_clickable']) ? $row['parent_pages_clickable'] : 0  );
	$horizontal_nav_enabled  = ( isset($row['horizontal_nav_enabled']) ? $row['horizontal_nav_enabled'] : 0  );
	$vertical_nav_enabled    = ( isset($row['vertical_nav_enabled'])   ? $row['vertical_nav_enabled']   : 0  );
	$enable_product_reviews  = ( isset($row['enable_product_reviews']) ? $row['enable_product_reviews'] : 0  );
	$enable_menu_reviews     = ( isset($row['enable_menu_reviews'])    ? $row['enable_menu_reviews']    : 0  );
	$online_ordering         = ( isset($row['online_ordering'])        ? $row['online_ordering']        : 0  );
	$fax_service             = ( isset($row['fax_service'])            ? $row['fax_service']            : 0  );
	$top_widgets             = ( isset($row['top_widgets'])            ? $row['top_widgets']            : '' );
	$bottom_widgets          = ( isset($row['bottom_widgets'])         ? $row['bottom_widgets']         : '' );
	$menu_boards             = ( isset($row['menu_boards'])            ? $row['menu_boards']            : '' );
	$admin_record_key        = ( isset($row['recordkey'])              ? $row['recordkey']              : '' );


	$query1 = "SELECT * from storePrefs where recordkey = 2";
	$rt     = mysql_query($query1); // query executed
	echo mysql_error(); // if any error is there that will be printed to the screen
	$row1   = mysql_fetch_array($rt);
	
	$number_of_menus             = ( isset($row1['number_of_menus'])      ? $row1['number_of_menus']      : '' );
	$text_notice_phone           = ( isset($row1['text_notice_phone'])    ? $row1['text_notice_phone']    : '' );
	$text_notice_enabled         = ( isset($row1['text_notice_enabled'])  ? $row1['text_notice_enabled']  : 0  );
	$tastepos_subscribed         = ( isset($row1['tastepos_subscribed'])  ? $row1['tastepos_subscribed']  : 0  );
	$orderOnline                 = ( isset($row1['orderOnline'])          ? $row1['orderOnline']          : 0  );
	$store_record_key            = ( isset($row1['recordKey'])            ? $row1['recordKey']            : '' );

?>
	
		<div class="mainForm">
            <form action="updateAdminOptions.php" method="post">
                <input type="hidden" name="admin_record_key" value="<?php echo $admin_record_key; ?>">
                <input type="hidden" name="store_record_key" value="<?php echo $store_record_key; ?>">
                <div class="leftForm">
                    <table>    
                        <!-- Text Fields -->
                        <tr><td style="width:20%;">SSl Domain :</td><td><input type="text" name="ssl_domain" value="<?php echo $ssl_domain; ?>" id="Item" size="20"></td></tr>

                        <tr><td>Parent Site Url :</td><td><input type="text" name="parent_site_url" class="" id="" size="20" value="<?php echo $parent_site_url;$row['invoice_date']; ?>" ></td></tr>

                        <tr><td>SMS Plan :</td><td><input value="<?php echo $sms_plan; ?>"  type="text" name="sms_plan" class="" id="" ></td></tr>

                        <tr><td>Email Plan :</td><td><input value="<?php echo $email_plan; ?>"  type="text" name="email_plan" class="" id="" ></td></tr>

                        <tr><td>RocketBlaster Id :</td><td><input value="<?php echo $rocketblaster_id; ?>"  type="text" name="rocketblaster_id" class="" id="" ></td></tr>

                        <tr><td>Chow Now Id :</td><td><input value="<?php echo $chow_now_id; ?>"  type="text" name="chow_now_id" class="" id="" ></td></tr>

                        <!-- CheckBOxes -->
                        <tr><td>SMS Enabled :</td><td><input value="1"  type="checkbox" <?php if($sms_enabled == 1 ) { echo "checked"; }?> name="sms_enabled" class="" id="" ></td></tr>

                        <tr><td>Use Linkpos :</td><td><input value="1"  type="checkbox" <?php if($use_linkpos == 1 ) { echo "checked"; }?> name="use_linkpos" class="" id="" ></td></tr>

                        <tr><td>Auto Pkg :</td><td><input value="1"  type="checkbox" <?php if($auto_pkg == 1 ) { echo "checked"; }?> name="auto_pkg" class="" id="" ></td></tr>

                        <tr><td>Ecommerce Pkg :</td><td><input value="1"  type="checkbox" <?php if($ecommerce_pkg == 1 ) { echo "checked"; }?> name="ecommerce_pkg" class="" id="" ></td></tr>

                        <tr><td>Realestate Pkg :</td><td><input value="1"  type="checkbox" <?php if($real_estate_pkg == 1 ) { echo "checked"; }?> name="real_estate_pkg" class="" id="" ></td></tr>

                        <tr><td>Coupon Pkg :</td><td><input value="1"  type="checkbox" <?php if($coupon_pkg == 1 ) { echo "checked"; }?> name="coupon_pkg" class="" id="" ></td></tr>

                        <tr><td>DealSite Pkg :</td><td><input value="1"  type="checkbox" <?php if($deal_site_pkg == 1 ) { echo "checked"; }?> name="deal_site_pkg" class="" id="" ></td></tr>

                        <tr><td>Restaurent Pkg :</td><td><input value="1"  type="checkbox" <?php if($restaurant_pkg == 1 ) { echo "checked"; }?> name="restaurant_pkg" class="" id="" ></td></tr>

                        <tr><td>Hvac Pkg :</td><td><input value="1"  type="checkbox" <?php if($hvac_pkg == 1 ) { echo "checked"; }?> name="hvac_pkg" class="" id="" ></td></tr>

                        <tr><td>Enable Mobile :</td><td><input value="1"  type="checkbox" <?php if($enable_mobile == 1 ) { echo "checked"; }?> name="enable_mobile" class="" id="" ></td></tr>

                        <tr><td>Parent Pages Clickable :</td><td><input value="1"  type="checkbox" <?php if($parent_pages_clickable == 1 ) { echo "checked"; }?> name="parent_pages_clickable" class="" id="" ></td></tr>

                        <tr><td>Horizontal Nav Enabled :</td><td><input value="1"  type="checkbox" <?php if($horizontal_nav_enabled == 1 ) { echo "checked"; }?> name="horizontal_nav_enabled" class="" id="" ></td></tr>

                        <tr><td>Vertical Nav Enabled :</td><td><input value="1"  type="checkbox" <?php if($vertical_nav_enabled == 1 ) { echo "checked"; }?> name="vertical_nav_enabled" class="" id="" ></td></tr>

                        <tr><td>Enable Product Reviews :</td><td><input value="1"  type="checkbox" <?php if($enable_product_reviews == 1 ) { echo "checked"; }?> name="enable_product_reviews" class="" id="" ></td></tr>

                        <tr><td>Enable Menu Reviews :</td><td><input value="1"  type="checkbox" <?php if($enable_menu_reviews == 1 ) { echo "checked"; }?> name="enable_menu_reviews" class="" id="" ></td></tr>

                        <tr><td>Online Ordering :</td><td><input value="1"  type="checkbox" <?php if($online_ordering == 1 && $orderOnline == 1 ) { echo "checked"; }?> name="online_ordering" class="" id="" ></td></tr> 

                        <!-- Saved In Two Tables -->

                        <tr><td>Fax Service :</td><td><input value="1" type="checkbox" <?php if($fax_service == 1 ) { echo "checked"; }?> name="fax_service" class="" id="" ></td></tr>

                        <!-- Dropdown fields -->
                        <tr>
                        	<td>Top widgets:</td>
                        	<td>
                        		<select  name="top_widgets">
	                        		<option <?php if($top_widgets == 1 ){ echo "selected"; } ?> value="1">1</option>
	                        		<option <?php if($top_widgets == 2 ){ echo "selected"; } ?> value="2">2</option>
	                        		<option <?php if($top_widgets == 3 ){ echo "selected"; } ?> value="3">3</option>
                        		</select>
                        	</td>
                        </tr>

                        <tr>
                        	<td>Bottom widgets:</td>
                        	<td>
                        		<select  name="bottom_widgets">
                            		<option <?php if($bottom_widgets == 1 ){ echo "selected"; } ?> value="1">1</option>
	                        		<option <?php if($bottom_widgets == 2 ){ echo "selected"; } ?> value="2">2</option>
	                        		<option <?php if($bottom_widgets == 3 ){ echo "selected"; } ?> value="3">3</option>
                        		</select>
                        	</td>
                        </tr>

                        <tr>
                        	<td>Menu boards:</td>
                        	<td>
                        		<select name="menu_boards">
                            		<option <?php if($menu_boards == 1 ) { echo "selected"; }?> value="1">1</option>
	                        		<option <?php if($menu_boards == 2 ) { echo "selected"; }?> value="2">2</option>
	                        		<option <?php if($menu_boards == 3 ) { echo "selected"; }?> value="3">3</option>
	                        		<option <?php if($menu_boards == 4 ) { echo "selected"; }?> value="4">4</option>
	                        		<option <?php if($menu_boards == 5 ) { echo "selected"; }?> value="5">5</option>
	                        		<option <?php if($menu_boards == 6 ) { echo "selected"; }?> value="6">6</option>
	                        		<option <?php if($menu_boards == 7 ) { echo "selected"; }?> value="7">7</option>
	                        		<option <?php if($menu_boards == 8 ) { echo "selected"; }?> value="8">8</option>
	                        		<option <?php if($menu_boards == 9 ) { echo "selected"; }?> value="9">9</option>
	                        		<option <?php if($menu_boards == 10 ) { echo "selected"; }?> value="10">10</option>
                        		</select>
                        	</td>
                        </tr>
                        <!-- Store Pref fields Text and Checkboxes -->
                        <tr><td>Number of menus :</td><td><input type="text" name="number_of_menus" value="<?php echo $number_of_menus; ?>" id="Item" size="20"></td></tr>

                        <tr><td>Text notice phone :</td><td><input type="text" name="text_notice_phone" value="<?php echo $text_notice_phone; ?>" id="Item" size="20"></td></tr>

                        <tr><td>Text notice enabled :</td><td><input type="checkbox" <?php if($text_notice_enabled == 1 ) { echo "checked";} ?> name="text_notice_enabled" value="1" id="Item" size="20"></td></tr>

                        <tr><td>Tastepos subscribed :</td><td><input type="checkbox" <?php if($tastepos_subscribed == 1 ) { echo "checked";} ?> name="tastepos_subscribed" value="1" id="Item" size="20"></td></tr>

                        <tr>
                        	<td></td>
                        	<td><input type="submit" name="Update" value="Update" id="save-button" ></td>
                    	</tr>
                    </table>
            	</div>
            </form>
        </div>

<?php } else {
	echo '<font color="red"><div align="center">You are not authorized to view this page.<br></div></font>';
}
?>
<br/>
</div><!-- end entry-->

<br/>

</div><!-- end post-->

</div><!-- end main-content-->

</div><!-- end content -->


<div style="clear: both;">&nbsp;</div>
<div id="page-bg-btm">
</div><!-- end page-bg-btm div -->
</div><!-- end wrapper div-->
<!-- end page -->
<!--footer-->
</body>
</html>

