<?
if (isset($_REQUEST[session_name()])) 
@session_start();

$title="Блокнот";
$name_stranica='bloknot';

$bp="../";
$base_path="../";

require_once($base_path.'connect/connect.php');
include_once($base_path.'lib/lib.php');
include_once($base_path.'connect/_svod_rec.php');

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="nofollow" />
<title><?=$title?></title>
<link rel="shortcut icon" href="<?=$bp?>icon/favicon.ico" type="image/x-icon">
<meta name="Author" content="aikuvshinov@mail.ru, http://script-ks.narod.ru" />
<link rel="stylesheet" type="text/css" href="<?=$base_path?>style/style.css" />
<link rel="stylesheet" type="text/css" href="<?=$bp?>style/jquery.fancybox.css" media="screen" />

<script type="text/javascript" charset="utf-8" src="<?=$base_path.'js/'?>jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="<?=$bp.'js/'?>jquery.easing.1.3.js"></script>
<script type="text/javascript" src="<?=$bp.'js/'?>jquery.fancybox-1.2.1.pack.js"></script>
<script type="text/javascript" src="<?=$bp.'js/'?>fancy.js"></script>

<![if !IE]>
<?
if($rru['round'])
{
?>
<script type="text/javascript" src="<?=$base_path.'js/'?>jquery.corner.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".imground").corner("round");
$(".submit").corner("round");
$(".str").corner("round");
});
</script>
<?
}
?>
<![endif]>


</head>
<BODY 
style="MARGIN: 0px auto; POSITION: inherit; width: 1000px">

<?
include_once($base_path."blok/top_form.php"); 
?>


<table class="table" width="100%">
	
	<tr>
		<td valign="top" class="td" >
		<?
		if($_POST['ch'] && $_SESSION['cart'])
			{
			foreach ($_SESSION['cart'] as $index=>$crt)
				{
				if(in_array($crt, $_POST['ch']))
				unset($_SESSION['cart'][$index]);
				}
				
			if($_SESSION['cart'])
				{
				?>
				<script language="javascript">
				document.getElementById('blok_col').innerHTML = '(<?=count($_SESSION['cart'])?>)'; 
				</script>				
				<?
				}
			else
				{
				?>
				<script language="javascript">
				document.getElementById('blok_col').innerHTML = ''; 
				</script>				
				<?
				}
			}
			
		if($_SESSION['cart'])
			{
			$qr=implode(",", $_SESSION['cart']);
			$query = "SELECT * FROM board WHERE id IN (".$qr.") ORDER BY vip DESC, data DESC, id DESC";	
			$query_count = "SELECT count(id) FROM board WHERE id IN (".$qr.") ";
			include_once($base_path."blok/tab_bloknot.php"); 
			}
		else echo '<p>Блокнот пустой';
		?>
		</td>
	</tr>
	
	
	<tr>
		<td>
			<table width="100%" cellpadding="5" cellspacing="5">
				<tr>
					<td>
					<?
					include_once($base_path."blok/bottom_form.php"); 
					?>
					</td>
					<td>

					</td>
				</tr>
			</table>
		</td>
	</tr>
	
</table>

</body>
</html>