include("dbinfo.inc.php");
mysql_connect($g_db_server,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$appname= $_GET['App'];
$lang= $_GET['Lang'];
$appnamequery="SELECT * FROM `Apps` WHERE App = '".$appname."'";
$resultAppName = $conn->query($appnamequery);
$theApp=utf8_encode(mysql_result($resultAppName,0,$lang));
$queryDivs="SELECT * FROM `Links` WHERE Lang = \"".$lang."\"";
$resultDivs=$conn->query($queryDivs);
$numDivs=mysql_numrows($resultDivs);
$queryLinksText="SELECT * FROM `LinkTexts` WHERE Lang = \"".$lang."\"";
$resultDivsLinkTexts=$conn->query($queryLinksText);
$mainText = utf8_encode( mysql_result($resultDivsLinkTexts,0,"MainText") );
$headerTextQuery="SELECT * FROM `Header` WHERE App = \"".$appname."\"";
$resultHeader=$conn->query($headerTextQuery);
$headerText=mysql_result($resultHeader,0,$lang);
$menuQuery="SELECT * FROM `NavMenu` WHERE AppId = \"".$appname."\" AND Lang = \"".$lang."\"";
$resultMenu=$conn->query($menuQuery);
$numMenus=mysql_numrows($resultMenu);
$footerTextQuery="SELECT * FROM `Footer` WHERE AppId = \"".$appname."\" AND Lang = \"".$lang."\"";
$resultFooter=$conn->query($footerTextQuery);
$footerText= utf8_encode( mysql_result($resultFooter,0,"Text") );
mysql_close();
?>