<?php
require_once('../classes/body.class.php');
require_once('../classes/db.class.php');
require_once('../classes/system.class.php');
$title= new Body;
$title->SetTitle(''.homeurl.' - Личный блокнот');

///Подключаем шапку
$title->GetHeader();
if ($b == false) {
header('location: /');
die();
}
// Ключ записи
$key = check($_GET['key']);

// Определение записи
$notebook = DB::$dbs->queryFetch("SELECT * FROM `notebook` WHERE `key` = ? LIMIT 1", [$key]);

if (!$notebook['id'])
{
header('location: /');
	exit;
}
echo '<div class="container-fluid page_header"><div class="container"><div class="row"><div class="col-xs-12 col-sm-8 col-md-9 col-lg-9"><h1>Личный блокнот</h1><ol class="breadcrumb" xmlns:v="http://'.homeurl.'/#"><li typeof="v:Breadcrumb"><a href="/" rel="v:url" property="v:title">'.homeurl.'</a></li><li typeof="v:Breadcrumb"><a href="/office" rel="v:url" property="v:title">Кабинет</a></li><li typeof="v:Breadcrumb"><a href="/notebook" rel="v:url" property="v:title">Блокнот</a></li><li class="active" typeof="v:Breadcrumb"><span property="v:title">'.$notebook['name'].'</span></li></ol></div></div></div></div>';
echo'<div class="container page_body"><div class="row"><div class="col-xs-12 page_content col-lg-9"><div class="navbar page_content_navbar collapse hidden-lg"><div class="container-fluid"><div class="navbar-collapse"></div></div></div><div class="text_box hidden-lg pr_block_small hidden"></div><div class="container-fluid cols_table">';
echo '<div class="catSides"><a href="/"><i class="md-format-list-bulleted"></i> Главная </a> -<a href="/office"> Кабинет</a> - <a href="/notebook">Личный блокнот</a> - '.$notebook['name'].'</div>';

// Автор 
$ank = Nick($notebook['id_user']);

echo '<div class="row text_box">';
echo text($notebook['msg']) . '<br/>';

if ($b['id'] == $notebook['id_user'])
{
echo '<i class="md-shuffle"></i> <a href="create.php?edit=' . $notebook['id'] . '">[Ред]</a>  <a href="index.php?delete=' . $notebook['id'] . '">[Удал]</a><br/>';
}
echo '</div>';

echo '<div class="row text_box">Ссылка на запись:<br /><input class="form-control" value="http://' . $_SERVER['HTTP_HOST'] . '/notebook/note.php?key=' . $notebook['key'] . '"><br />Копировать:<br /><textarea class="form-control" rows="3">' .$notebook['msg']. '</textarea></div>';

///Подключаем меню
$title->GetMenu();

///Подключаем футер
$title->GetFooter();
?>