Skip to content
Snippets Groups Projects
Commit ae6dd9ee authored by Никита Измайлов's avatar Никита Измайлов Committed by PavelBegunkov
Browse files

Добавлен интерфейс просмотра логов входа, без пейджинга

parent c744bf91
Branches
Tags
No related merge requests found
......@@ -28,7 +28,7 @@
{
"Title": "Управление системой",
"Items": [
{ "Title": "История авторизаций", "Anchor": "#", "Disabled": "true" },
{ "Title": "История авторизаций", "Anchor": "logs" },
{ "Title": "История выставления баллов", "Anchor": "#", "Disabled": "true" },
{ "Title": "Поддержка", "Anchor": "support" }
]
......
......@@ -26,7 +26,7 @@
{
"Title": "Управление системой",
"Items": [
{ "Title": "История авторизаций", "Anchor": "#", "Disabled": "true" },
{ "Title": "История авторизаций", "Anchor": "logs" },
{ "Title": "История выставления баллов", "Anchor": "#", "Disabled": "true" },
{ "Title": "Поддержка", "Anchor": "support" }
]
......
<?php
class Controller_Office_Logs extends Controller_Environment_Office
{
public function action_index() {
Cookie::set('fD', 'true');
$this->twig->set([
// 'Faculties' => $this->user->isAdmin() ? Model_Faculties::load() : [],
// 'GradesList' => Model_Grades::loadAll(),
'Logs' =>Model_Logs::LoadAll(),
])->set_filename(static::OFFICE . 'logs');
}
}
\ No newline at end of file
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Class Model_Semesters
*
* @property int ID
* @property int Num
* @property int Year
* @property string Season
*/
class Model_Logs extends Model
{
public static function loadAll() {
$res = DB::query(Database::SELECT, "
SELECT logs_signin.ID,
logs_signin.AccountID,
logs_signin.Date,
teachers.LastName,
teachers.FirstName,
teachers.SecondName
FROM `logs_signin` JOIN `teachers` ON logs_signin.AccountID = teachers.AccountID
ORDER BY logs_signin.Date DESC LIMIT 50")->execute()->as_array();
$list = [];
$i=0;
foreach ($res as $log)
{
// $list[$log['ID']] = new self($log);
$list[$i] = new self($log);
$i++;
}
return $res;
}
}
\ No newline at end of file
{% extends "office/base" %}
{% block title %}История авторизаций{% endblock %}
{% block office_content %}
{{ HTML.style('static/css/logs.css')|raw }}
<h2 class="Margin10 Bottom">История авторизаций</h2>
<table class="equal-width-cols">
<tbody>
<tr class="TableHead">
<td>Дата и время</td>
<td>Фамилия Имя Отчество</td>
<td>AccoundID</td>
</tr>
{% for Log in Logs %}
<tr>
<td>{{ Log.Date }}</td>
<td>{{ Log.LastName }} {{Log.FirstName}} {{Log.SecondName}}</td>
<td>{{ Log.AccountID}}</td>
</tr>
{% endfor %}
</table>
</tbody>
{% endblock %}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment