<?php require("check.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<title>Administratoriaus prisijungimas</title>
<link href="stilius.css" rel="stylesheet" type="text/css" />

<?php
require("configas.php");
global $dbhost, $dbuname, $dbpass, $dbname; 
mysql_connect($dbhost, $dbuname, $dbpass); 
@mysql_select_db($dbname) or die ("Unable to select database !"); 
mysql_query("SET NAMES utf8"); 
?>

<script language="JavaScript" type="text/javascript" src="wy/scripts/wysiwyg.js"></script>
<script language="JavaScript" type="text/javascript" src="wy/scripts/wysiwyg-settings.js"></script>	

<script language="javascript1.2">
   // attach the editor to all textareas of your page.
   WYSIWYG.attach('all');

</script>
</head>
<body>
<?
if(isset($_POST['redaguoti'])){
	$apie=$_POST['tekstas'];
	$id=$_GET["id"];								
	$sql = "UPDATE apie SET apie='$apie' WHERE id='1'";
	$rez = mysql_query($sql) or die(mysql_error());
	echo "<META HTTP-EQUIV=Refresh CONTENT='0; url=apie.php'>";
}
if(isset($_POST['reset'])){			
	$sql = "UPDATE apie SET apie='' WHERE id='1'";
	$rez = mysql_query($sql) or die(mysql_error());
	echo "<META HTTP-EQUIV=Refresh CONTENT='0; url=apie.php'>";
}
?>

<table id="pagr" align="center">
	<tr valign="top">
		<td class="meniu">
			<table class="meniu2" width="200px">
				<?php require("meniu.php"); ?>
			</table>			
		</td>
		<td class="turinys">
			<table class="turinys2">
				<tr>
					<td class="t1">"Apie mus" informacija</td>
				</tr>
				<tr>
					<td class="t2" align="center">
						<table width="555px" class="lentele">
						<?php
							$uzklausa = "SELECT * FROM apie where kalba='1'";
							$rezultatas = mysql_query($uzklausa) or die(mysql_error());
							$eilute = mysql_fetch_array($rezultatas);
							?>
							<form  action="<? echo $php_self ?>" method="post" enctype="multipart/form-data">
							<?php
							echo "<tr><td><textarea cols='70' rows='20' name='tekstas' id='text'>".$eilute['apie']."</textarea></td></tr>";
							echo "<tr><td align='right'><input type='submit' name='reset' value='I&#353;valyti'/><input type='submit' name='redaguoti' value='Siusti'/></td></tr></form>";
							
						?>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>

</body>
</html>