<?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"); 
?>
</head>
<body>

<?php
if(isset($_POST['submit1'])){
	$apie=$_POST['txt1'];					
	$sql = "INSERT INTO veikla (kalba, tipas, txt) VALUES ('1', 'festivalis', '$apie')";
	$rez = mysql_query($sql) or die(mysql_error());
	echo "<META HTTP-EQUIV=Refresh CONTENT='0; url=veikla.php'>";
	$ats = "<td rowspan='3>&#303;ra&#353;yta</td>";
}else if(isset($_POST['submit2'])){
	$apie2=$_POST['txt2'];					
	$sql = "INSERT INTO veikla (kalba, tipas, txt) VALUES ('1', 'tv', '$apie2')";
	$rez = mysql_query($sql) or die(mysql_error());
	echo "<META HTTP-EQUIV=Refresh CONTENT='0; url=veikla.php'>";
	$ats2 = "<td rowspan='3>&#303;ra&#353;yta</td>";
}

?>

<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 border="0" class="turinys2">
				<tr>
					<td class="t1">Koncertin&#279;s veiklos istorija<br/></td>
				</tr>
				<tr>
					<td class="t2" align="center">
						<form  action="<? echo $php_self ?>" method="post" enctype="multipart/form-data">
						<table class="lentele" border="0">
							<tr>
								<td>&#303;ra&#353;yti tarptautin&#303; festival&#303;, kuriame dalyvavo grup&#279;:</td>
								<?php echo $ats; ?>
							</tr>
							<tr valign="top">
								<td><textarea rows="2" cols="50" name="txt1"></textarea></td>
							</tr>
							<tr>
								<td align="right"><input type="submit" name="submit1" value="&#303;terpti"/></td>
							</tr>
						</table></form><br/>
						<form  action="<? echo $php_self ?>" method="post" enctype="multipart/form-data">
						<table class="lentele">
							<tr>
								<td>&#303;ra&#353;yti TV laid&#261;, kurioje dalyvavo grup&#279;:</td>
								<?php echo $ats2; ?>
							</tr>
							<tr>
								<td><textarea rows="2" cols="50" name="txt2"></textarea></td>
							</tr>
							<tr>
								<td align="right"><input type="submit" name="submit2" value="&#303;terpti"/></td>
							</tr>
						</form>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>

</body>
</html>