<?
@session_start();
$base_path='../';
require_once('../connect/connect.php');
include_once('../lib/lib.php');
require('pdk.php');

$Action='statistic.php';

$titl="Статистика";
require ('top.php'); 



if ($_REQUEST['tabl'])
{
$tabl=$_REQUEST['tabl'];
$r = mysql_query ("SELECT COUNT(id) FROM ".$tabl." WHERE data = DATE_FORMAT(NOW(), '%Y-%m-%d')");
$rr=mysql_fetch_array($r);
$count_now=intval($rr[0]);
$r = mysql_query ("SELECT COUNT(id) FROM ".$tabl." ");
$rr=mysql_fetch_array($r);
$count=intval($rr[0]);

echo 'Всего: '.$count.'<br>';
echo 'За сегодня: '.$count_now.'<br>';
}


?>
<form action="<? echo $Action; ?>" method="post" name="form_stat" >
<select name="tabl">
	<option value="" >Выбрать таблицу</option>
<?
foreach($arr_plugin as $arr)
	{
	?>
	<option value="<?=$arr?>" <? if($arr==$tabl) echo 'selected';  ?> ><?=$arr?></option>
	<?
	}
?>

</select>
<br><input type="submit" class="submit" value="Выбрать">
</form>

<?
require ('bottom.php'); 
?>