<?php
	session_start();
	if ($_SESSION['uid'] == null) header("Location: index.php");
	include "config.php";
	$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
	include "functions.php";	
	if ($user['id'] == "11263" or $user['login'] == "Dr Net"){} else {header("Location: main.php");	die(); }
	
	
?>
<HTML><HEAD>
<link rel=stylesheet type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
<META Http-Equiv=Cache-Control Content=no-cache>
<meta http-equiv=PRAGMA content=NO-CACHE>
<META Http-Equiv=Expires Content=0>
</HEAD>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#e0e0e0>
	<TABLE border=0 width=100% cellspacing="0" cellpadding="0">
	<td align=right>
	<FORM method=post>
		ФАЙЛ <input type="text" name="file">
		ТЕМА <input type="text" name="topic">
		КОММЕНТАРИЙ <input type="text" name="text" size=120>
		<INPUT TYPE="submit" value="Отметить" name="add">
	</table>
	</form>
	
	<h4>Правки файлов.</h4>
	<style>
	 td {
		border: 1px solid #c5c5c5; margin:0px;
	 }
	</style>
	<table width=100% style="border: 1px solid #c5c5c5; margin:0px;" cellspacing="0" cellpadding="0">
	<tr bgcolor=#c5c5c5><TD>#ID<TD>дата<TD>Измененный файл <TD>тема<TD>комментарий<TD>кто менял</tr>
	<?
		if($_POST['add']) {
			mysql_query("INSERT `work_edit` (`date`,`file`,`text`,`topic`,`who`) values ('".date("Y-m-d")."','{$_POST['file']}','{$_POST['text']}','{$_POST['topic']}','{$user['id']}') ;");
		}
	
		$data = mysql_query("SELECT * FROM `work_edit` ORDER by `id` DESC;");
		while($row = mysql_fetch_array($data)) {
			echo "<TR ><TD>",$row['id'],"<TD class=date>",$row['date'],"<TD style='color:red;'>",$row['file'],"<TD>",$row['topic'],"<TD>",$row['text'],"<TD>";
			nick2($row['who']);
			echo "</TR>";
		}
	?>
	</table>
</BODY>
</HTML>