<?php

/*
* @package BANANA WARS
* @copyright: (c) 2017 G.P. aka Mvcshka (mvcshka@yandex.ru)
* @license: GNU General Public License version 2; see LICENSE.txt
* @files: /page/news.php
*
*/

if(!isset($_SESSION['id']))
{
	Header("Location: /");
	exit;
}

$q = $mysql->query("SELECT * FROM db_news ORDER BY Uid DESC");
while($row = $q->fetch()) {
	
?>
<!-- OPEN CENTER -->
<tr>
	<td align="left" valign="top">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tbody>
				<tr>
					<td width="284" align="left" valign="top">
					<?php require('theme/users_block.php');?>
					</td><!-- MENU USER -->
					<td align="left" valign="top">
						<?php require('theme/menu.php'); ?>
						<div style="height:15px"></div>
						<!-- OPEN NEWS -->
						<table width="100%" border="0" cellspacing="2" cellpadding="0">
							<tbody>
								<tr>
									<td><div style="background:url('/images/title.jpg') no-repeat center;text-align:center"><span style="background-color:#F0E8D5;padding-right:15px;padding-left:15px;font-size:18px">Новости </span></div><br>								</td>
								</tr>
								<tr>
									<td align="left" valign="middle"><font class="blue-b"><?=date("d.m.Y", $row['DateAdd']); ?></font></td>
								</tr>
								<tr>
									<td>
										<div class="news"><?=$row['Title']; ?></div>
										<p><?=$row['Text']; ?></p>
									</td>
								</tr>
								<tr>
									<td><div style="background: transparent url(/images/dots.gif) repeat-x scroll 0px 5px; height: 10px; width: 670px;"></div></td>
								</tr>	
								<tr>
									<td></td>
									<td></td>
								</tr>
							</tbody>
						</table>
						<!-- CLOSE NESW -->
					</td><!-- CONTENT USER -->
				</tr>
			</tbody>
		</table>
	</td>
</tr>
<!-- CLOSE CENTER -->

<?php } ?>