<?php if (!isset($_SESSION['FirstName'])) {
	session_start();
}
    include ('includes/db1config.php');
    include ('includes/mysql_connect.php');
?>
<!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 NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<?php include('title.php'); ?>
<meta name="description" content="Restaurant Online" />
<meta name="keywords" content="Restaurant Online" />

<link href="css/main_style.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/print_style.css" rel="stylesheet" type="text/css" media="print" />

<link rel="stylesheet" type="text/css" href="css/cssverticalmenu.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>

</head>
<body>

<div id="wrapper">

<!-- start header -->
<?php include('includes/header.inc.php'); ?>
<!-- end header-->


<!-- start page -->
<div id="page-container">
<div id="page-bg-top">


<!-- start content -->
<div id="content">
<div id="main-content">
   
		<div class="post">
		  <div class="entry">
          
    <br />
<p><strong>Site Admin Page</strong> &bull; 
FanTools login
</p>
<br />

<h1>FanTools Login</h1>
 <?php
if ($_SESSION['FirstName'] == "") {
	echo 'You are not authorized to view this page. <br><br>You may <a href="index.php">log in here.</a>';
	exit;
	}
?>	
<style type="text/css">
body, input {
	font-size: 11px; 
}
input[type=text] {
	margin-bottom: 5px;
	width: 200px;
}
.label {
	float: left;
	width: 120px;
}
.header {
	font-weight: bolder;
	font-size: 14px;
	width: 140px;
}
.hint {
	font-size: 9px;
}
</style>

	


<body>

<!--<span class="label">Api Key:</span>--><input type="hidden" id="api_key" value="6fd1b6ecee2f4aa198fd05ca239f6ebc"/>&nbsp;&nbsp;<br />
<!--<span class="label">Access Token:</span><input type="text" id="access_token" value="68b8bba9749e42959d6a4a22ff8fdea1" />&nbsp;&nbsp;<span class="hint">Identifies the user performing the action. Permissions checks on actions are performed against this user.</span><br />-->
<!--<span class="label">Base URL:</span>--><input type="hidden" id="base_url" value="http://www.fantools.net" />&nbsp;&nbsp;<br />
<!--<span class="label">Facebook Page ID:</span><input type="text" id="fb_id" />&nbsp;&nbsp;<span class="hint">Only used to retrive a deal list by facebook page.  No other variable are needed if this is used.</span><br />-->
<!--<span class="label">Organization ID:</span>--><input type="hidden" id="org_id" value="431"/>&nbsp;&nbsp;<br />
<hr />

<div style="float: left; width: 20%;">
	<!--<span class="label">Email:</span>--><input type="hidden" id="user_email" value="apicton@apnetworking.com"/><br />
	
</div>


<!--
<div style="clear: both;"></div>
<span class="label">Api Methods:</span><select id="methods" />&nbsp;&nbsp;<input type="button" id="btn_run" value="Run" /><br />
<div style="clear: both;"></div>
<span class="header">API Result:</span><br />
<div id="output" style="padding-left: 5px; float: left; width: 100%; background-color: lightblue;"></div>
-->
<script>
$(document).ready(function() {
$.ajax({
type: 'GET',
data: { Email: 'apicton@apnetworking.com' }, url:'http://www.fantools.net/token/access_token?api_key=6fd1b6ecee2f4aa198fd05ca239f6ebc',
dataType: 'jsonp',
success: function(response) {
$('#output').html(response.data);
}
$('#output').html('TEST').append(response.message);
});

}
var ajax_call = function(url) {
	$.ajax({
		type: 'POST',
		url: $('#base_url').val() + url
	});
}






var methods = {
	access_token:  {
		url: function() { return '/token/access_token?api_key={key}'.replace('{key}', $('#api_key').val()) },
		data: function() { return new user_data(); },
		fn: function(response) {
			if (response.success)
				$('#output').html('').append(JSON.stringify(response.data));
			else
				$('#output').html('').append(response.message);
		}
	},


}

var ajax = function(method) {
	$.ajax({
		type: 'POST',
		url: $('#base_url').val() + method.url(),
		dataType: 'jsonp',
		data: method.data(),
		success: method.fn
	});
}

$('#btn_run').ready(function() {
	ajax(methods[$('#methods').val()]);
});
// bind methods to dropdown
for(var m in methods) {
	$('#methods').append('<option>{val}</option>'.replace('{val}', m));
}
</script>
 <center>Please note: By continuing login, you will be leaving the ROO system and logged into the FanTools system.<br><br>
<a href="http://www.fantools.net/Admin/Login/Auto?email=apicton@apnetworking.com&password=2daughters&token=" target="blank"><font color="blue" size=4>Continue Login</font></a>
</center>
 
</div><!-- end entry-->

<br />

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

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

</div><!-- end content -->
    
<!-- start sidebar -->
<?php include('includes/admin-sidebar.inc.php'); ?>
<!--sidebar-->


<div style="clear: both;">&nbsp;</div>
<div id="page-bg-btm">
</div><!-- end page-bg-btm div -->
</div><!-- end page-bg-top div -->
</div><!-- end page-container -->



</div><!-- end wrapper div-->

<!-- end page -->


<!--footer-->



</body>
</html>
