<?php
require_once "../../maincore.php";
require_once "infusion_db.php";

// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS."studiobox_panel/locale/".$settings['locale'].".php")) {
	// Load the locale file matching the current site locale setting.
	include INFUSIONS."studiobox_panel/locale/".$settings['locale'].".php";
} else {
	// Load the infusion's default locale file.
	include INFUSIONS."studiobox_panel/locale/English.php";
}

echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'>
<head>
<title>Studiobox Posteingang</title>
<link rel='stylesheet' href='".THEME."styles.css' type='text/css' media='screen' />
<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."' />
<script language='JavaScript' type='text/javascript'>
        function setFocus() {
            self.focus();
            window.setTimeout(\"setFocus()\",10);
        }
		
</script>
</head>
<body onBlur=\"self.focus()\" onload=\"setFocus()\">

<div class='tbl-border' style='padding: 5px;'>
<div class='tbl2'>
<h3 align='center'>".$sb_locale['studiobox_inbox']."</h3>
";

$sp_id = '0';

echo "<div id='sbentries'>Pr&uuml;fe Studiobox-Eingang...</div>\n";

echo "
<script type='text/javascript'>
function get_sbentries()
{
var xmlHttp = false;
try {
    xmlHttp  = new ActiveXObject(\"Msxml2.XMLHTTP\");
} catch(e) {
    try {
        xmlHttp  = new ActiveXObject(\"Microsoft.XMLHTTP\");
    } catch(e) {
        xmlHttp  = false;
    }
}
if (!xmlHttp  && typeof XMLHttpRequest != 'undefined') {
    xmlHttp = new XMLHttpRequest();
}

 if (xmlHttp) {
     xmlHttp.open('GET', '".INFUSIONS."studiobox_panel/get_entries.php', true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById(\"sbentries\").innerHTML = xmlHttp.responseText;
         }
     };
     xmlHttp.send(null);
 }
}
get_sbentries();
setInterval('get_sbentries()',30000);

function get_sbcount()
{
var xmlHttp = false;
try {
    xmlHttp  = new ActiveXObject(\"Msxml2.XMLHTTP\");
} catch(e) {
    try {
        xmlHttp  = new ActiveXObject(\"Microsoft.XMLHTTP\");
    } catch(e) {
        xmlHttp  = false;
    }
}
if (!xmlHttp  && typeof XMLHttpRequest != 'undefined') {
    xmlHttp = new XMLHttpRequest();
}

 if (xmlHttp) {
     xmlHttp.open('GET', '".INFUSIONS."studiobox_panel/get_entriescount.php', true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {

			 window.document.title = xmlHttp.responseText;
         }
     };
     xmlHttp.send(null);
 }
}

get_sbcount();
setInterval('get_sbcount()',30000);
</script>\n";

echo "
</body>
</html>
";
