<?php
	if (!isset($_SESSION['nazwa'])) {
			header('Location: ../login.php');
			exit();
	}
	if ($_SESSION['status']<3) {
?>
<script type="text/javascript">
<?php
	echo "var s = 'http://".$_SERVER['HTTP_HOST']."/index.php?m=0';";
?>
	window.location.href = s;
</script>
<?php
		exit();
	}
?>

<link rel="stylesheet" href="adwasznet/css/admin.css" />
	
	<div id="adm_page">	
		<p id="formularz_tekst2" style="width: 400px">PANEL FORMULARZ - INFORMACJE</p>
			<div id="tlo_formularz1">
				<p id="formularz_tekst1">Wpisz tekst informacji</p>
				<form name="form_dane" action="adwasznet/add_info.php" method="post" id="formularz_info">
				
				<div id="div_linia">
					
					<div style="float: left; width: 720px; margin: 5px 5px; overflow-y: auto; background: #ABC">	
						<textarea rows="15" cols="150" id="info_text" name="info" style="width: 695px; margin: 5px 10px;"></textarea>
					</div>							
				</div>			
				<input type="submit" name="zinfo" value="Zapisz dane" id="but_wyslij">
				<input type="submit" class="zinfo" value="Podgląd" id="but_wyslij">
				</form>	
			</div>
			
			<?php
		if (isset($_SESSION['addu_kom'])) {
		echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Info: '.$_SESSION['addu_kom'];
			unset($_SESSION['addu_kom']);
		}
?>
		<div id="info_wyglad" style="width: 400px; background: #EEE; color: #005; overflow-y: auto; margin: 5px auto; padding: 15px 10px;">	
		
		</div>
	</div>

<script type="text/javascript">
	
	$(document).ready(function(){
		$('.zinfo').click(function() {
			$('#info_wyglad').html($('#info_text').val());
			return false;
		});
	});
	
</script>
