Exemplo n.º 1
0
<?php

$data = $_GET;
if (isset($data['text']) && !empty($data['text']) && strlen($data['text']) > 3) {
    $text = $data['text'];
    $text = trim($text);
    $text = htmlspecialchars($text);
} else {
    errorWithMessage('Поисковый запрос не введен, либо он меньше 4 символов!');
}
include_once '../models/Book.php';
$book = new Book();
$books = $book->poiskBooks($text);
$view = 'poisk.php';
if (!isset($view)) {
    errorView();
}
include_once '../views/shablon.php';
Exemplo n.º 2
0
<?php

$data = $_GET;
if (isset($data['komm_text']) && !empty($data['komm_text']) && strlen($data['komm_text']) > 3 && isset($data['id']) && !empty($data['id'])) {
    $text = $data['komm_text'];
    $text = trim($text);
    $text = htmlspecialchars($text);
} else {
    errorWithMessage('Комментарий не введен, либо он меньше 4 символов!');
}
//include_once('../models/Resept.php');
//$resept = new Resept();
//
//if ($resept->has)
include_once '../models/Comment.php';
$comm = new Comment();
$comm->komm_text = $data['komm_text'];
$comm->id_book = $data['id'];
$comm->save();
header('Location: http://localhost/test/book-mvc/public/?pagetype=book&id=' . $data['id']);
//header('Location: http://www.tigir.com/php.htm');
exit;
if (!isset($view)) {
    errorView();
}
include_once '../views/shablon.php';