core/api/modules/admin/index.php

27 lines
1.6 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
if ( $_SESSION['dostup'] != 'a' && $_SESSION['dostup'] != 'e' && $_SESSION['dostup'] != 'c' ) header( 'Location: /login/' );// && $dostup!='m'
/* ----------------------------------------------------------------------
14.12.2022
Читаем заметки
---------------------------------------------------------------------- */
$zametka = \DB::getValue( 'SELECT `txt` FROM `zametka` WHERE `user_id`=' . $_SESSION['user_id'] );
$smarty -> assign( 'zametka', $zametka );
/* ----------------------------------------------------------------------
14.12.2022
Получаем инфу о пользователе
---------------------------------------------------------------------- */
$smarty -> assign( 'userInfo', \core::getUserInfo( $_SESSION['user_id'] ) );
/* ----------------------------------------------------------------------
14.12.2022
Получаем список задач
---------------------------------------------------------------------- */
$tasks = \DB::getAll( "SELECT * FROM `tasks` WHERE `user_id`=? OR `isp_id`=? ORDER BY `id` DESC LIMIT 10", array($_SESSION['user_id'], $_SESSION['user_id'] ) );
$smarty -> assign( 'tasks', $tasks );
/* ----------------------------------------------------------------------
14.12.2022
Получаем список разработчиков
---------------------------------------------------------------------- */
$coders = \DB::getAll( "SELECT * FROM `users` WHERE `dostup`='a' OR `dostup`='c' ORDER BY `fio`" );
$smarty -> assign( 'coders', $coders );
?>