Beispiel #1
0
	<link rel="stylesheet" href="fancybox/jquery.fancybox.css">
	<link rel="stylesheet" href="css/style.css">
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
	<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
	<script src="js/datepicker-ru.js"></script>
	<script src="ckeditor/ckeditor.js"></script>
	<script src="fancybox/jquery.fancybox.pack.js"></script>
	<script src="js/scripts.js"></script>
</head>
<body>
	<div class="body">
		<?php 
//В зависимости от полученных данных с POST и GET выполнить нужный скрипт (что то вроде From Controller)
?>
		<?php 
if ($user->checkUser() && (!empty($_POST['action']) || !empty($_GET['action']))) {
    //Доступ к функциям администратирования есть только у авторизированного пользователя
    include 'views/form.php';
} elseif (!empty($_POST['logout']) || !empty($_POST['login']) || !empty($_GET['login'])) {
    //Дейстия касательно авторизации
    include 'views/login.php';
} else {
    //Во всех остальных случаях просто выводяться отсортированные записи
    $result = $record->getAll(array(), $_GET['sort'], $_GET['order'], '', 'array');
    include 'views/index.php';
}
?>
	</div>
</body>
</html>
Beispiel #2
0
<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="css/style.css">
    <script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
    <script src="js/script.js"></script>
    <title>Гостевая книга</title>
</head>
<body>
<div class="admin">
    <a href="admin/index.php">Перейти в панель администратора</a>
</div>
<?php 
require_once 'php/autoload.php';
$arr = Record::getAll();
foreach ($arr as $row) {
    echo <<<lab
<div class="record">
    <span>{$row->name}</span>
    <span>({$row->email})</span>
    <div class="description">{$row->text}</div>
</div>
lab;
}
?>
<p class="title">Оставить отзыв</p>
<form action="php/form.php" method="post">
    <div class="name">
        <label for="name">Ваше имя</label>
        <input type="text" name="name" id="name">
Beispiel #3
0
 function testDeleteAll()
 {
     //Arrange
     $patron_id = 1;
     $checkout_date = null;
     $copy_id = 2;
     $test_record = new Record($patron_id, $copy_id, $checkout_date);
     $test_record->save();
     $patron_id2 = 1;
     $checkout_date2 = null;
     $copy_id2 = 2;
     $test_record2 = new Record($patron_id2, $copy_id2, $checkout_date2);
     $test_record2->save();
     //Act
     Record::deleteAll();
     $result = Record::getAll();
     //Assert
     $this->assertEquals([], $result);
 }