<?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="tile"><div class="t-header th-alt bg-teal"><div class="th-title"><i class="zmdi zmdi-widgets"></i><a href="/"style="text-decoration:none; color:white;"> Главная</a> :: <a href="/office"style="text-decoration:none; color:white;"> Кабинет</a> :: <a href="/notebook" style="text-decoration:none; color:white;">Блокнот</a> :: '.$notebook['name'].'</div></div>';
$ank = Nick($notebook['id_user']);
echo '<div class="list-group-item media">';
echo text($notebook['msg']) . '<br/>';
if ($b['id'] == $notebook['id_user']){
echo '<i class="zmdi zmdi-shuffle"></i> <a href="create.php?edit=' . $notebook['id'] . '">[Ред]</a> <a href="index.php?delete=' . $notebook['id'] . '">[Удал]</a><br/>';
}
echo '</div>';
echo '<div class="list-group-item media">Ссылка на запись:<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();
?>