<?php
	
	require_once("mysqlconnect.php");
	require_once("global/functions.php");
	require_once("global/constants.php");
	session_start();
	
	$u=$_GET['u'];
	if($u<>$uhash || $_SESSION['mobile_admin_logged_in']==false)
	{
		header("location: index.php");
	}
	
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><title>4mobile - backoffice</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel="stylesheet" href="style.css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<script language="JavaScript" src="script.js" type="text/JavaScript"></script>
</head>
<body bgcolor="#000000">
	
<?php

	include('menu.php');
	$i = $_GET['i'];
	if(!$i) $i=1;
	$num=fnGetRowsNum('mobile_pozadia');
	$lim=fnGetLimit($i, IMAGES_NASTRANU);
	
	$query="
		SELECT mobile_pozadia.*, mobile_users.login as pridal_user 
		FROM mobile_pozadia, mobile_users 
		WHERE mobile_pozadia.pridal=mobile_users.id
		ORDER by ID asc limit $lim, ".IMAGES_NASTRANU;
	
	$result=mysql_query($query, $link) or die($query);
	if($result) 
	{
		$params['page']='images_admin';
		$params['i']=$i;
		$params['stranok']=fnGetPages($num, IMAGES_NASTRANU);
		fnWriteNav($params);
		fnWriteTableImages($result);
		fnWriteNav($params);
	}
	?>

</body>
</html>
<?php
	mysql_close($link);
?>