<div class="postui post-title">
	<h2><span>Ce se vorbeste pe server</span></h2>
</div>

<div class="postui post-con">
	<div class="con-wrap">
					
					
					 
						
<table width="100%" style="border-color:#b79647; border-style:solid; padding:10px; border-width:1px;">

			<tr>
				<td style="text-align:center; border-color:#b79647; border-style:solid; padding:10px; border-width:1px;"><a><b>Ora</b></a></td>
				<td style="text-align:center; border-color:#b79647; border-style:solid; padding:10px; border-width:1px;"><a><b>Regat</b></a></td>
				<td style="border-color:#b79647; border-style:solid; padding:10px; border-width:1px;"><a><b>Mesajul</b></a></td>
			</tr> 

<html> 

<?php
if (isset($_GET['id'])) {
$getID = replace($_GET['id']);
}
function generatePages($max, $page, $class)
	{
		if ($max>=10)
		{
			if (($page>4) && ($page<$max-3))
			{
				for ($i = 1; $i <= 3; $i++)
				{
					$data .= showPage($i,$page,$class);
				}
				$data .= '<span class="'. $class .'">...</span> ';
				for ($i = $page-1; $i <= $page+1; $i++)
				{
					$data .= showPage($i,$page,$class);
				}
				$data .= '<span class="'. $class .'">...</span> ';
				for ($i = $max-2; $i <= $max; $i++)
				{
					$data .= showPage($i,$page,$class);
				}
			}
			else
			{
				for ($i = 1; $i <= 5; $i++)
				{
					$data .= showPage($i,$page,$class);
				}
				$data .= '<span class="'. $class .'">...</span> ';
				for ($i = $max-5+1; $i <= $max; $i++)
				{
					$data .= showPage($i,$page,$class);
				}
			}
		}
		else
		{
		$max = (10 >= $max) ? $max : 10;
		for ($i = 1; $i <= $max; $i++)
		{
				$data .= showPage($i,$page,$class);
		}
		}
		return $data;
	}
		
	/**
	 * Page Style Generator .
	 * 
	 * @param int $i
	 * @param int $page
	 * @param string $class
	 * @param string $selected
	 */
	function showPage($i, $page, $class, $selected = 'pagination_selected')
	{
		if ($page==$i)
		{
			$data .= '<span class="'. $selected .'">'. $i .'</span> ';
		}
		else
		{
			global $name;
			$getPage = replace($_GET['page']);
			$data .= '<span  class="'. $class .'"><a href="?page='.$getPage.'&id='.$i.'" onclick="load()">'. $i .'</a></span> ';
		}
		return $data;
	}
	
if ((!isset($getID)) || (!is_numeric($getID)) || ($getID < 1)) { $pagenum = 1; }
	else { $pagenum = $getID; 
	
	}
	$page_rows = 10;
	if (($pagenum > $last) && ($last > 0)) { $pagenum = $last; }
	$max = $pagenum * $page_rows;
	$min = $max - $page_rows;

	
	$result = mysql_query("SELECT * FROM log.shout_log limit 0,10");
	

	$rows = mysql_num_rows($result);
	$last = ceil($rows/$page_rows);
$i = 0;
/////////////////////

$result2 = mysql_query("Select * from log.shout_log ORDER BY ora DESC limit ".($page_rows * ($pagenum - 1)).", ".$page_rows.""); 



//////////////////////////////////////////
if($getID == 1 || $getID == NULL)
{
	$nr=0;
}
else
{
	$nr = ((int)$getID-1)*(int)15+$nr;	
}
while($acs = mysql_fetch_object($result2))
{
	$nr++;
	$pid = $acs->id; 

	?>
 <tbody>
				  <td style='border-color:#b79647; border-style:solid; padding:10px; border-width:1px;'><b><?=$acs->ora?></b>
				  <td style='border-color:#b79647; border-style:solid; padding:10px; border-width:1px;'><b><img src="resurse/imagini/regate/<?=$acs->regat?>.png" width="34" alt="regat" title="regat"></b></td>
				  <td style='border-color:#b79647; border-style:solid; padding:10px; border-width:1px;'><b><?=$acs->mesajul?></b></td>	
		 <?php
		 
} 
echo "</table><Br>";

?>				
	
	

		</div>           
</div>
<div class="postui post-end"></div>