2022-12-11 13:55:49 +05:00
< ? php
2023-01-02 21:33:36 +05:00
ini_set ( 'display_errors' , 0 );
2022-12-24 21:12:23 +05:00
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' ] );
2022-12-17 18:15:09 +05:00
$smarty -> assign ( 'zametka' , $zametka );
2022-12-24 21:12:23 +05:00
/* ----------------------------------------------------------------------
14.12 . 2022
Получаем инфу о пользователе
---------------------------------------------------------------------- */
2022-12-17 18:15:09 +05:00
$smarty -> assign ( 'userInfo' , \core :: getUserInfo ( $_SESSION [ 'user_id' ] ) );
2022-12-24 21:12:23 +05:00
/* ----------------------------------------------------------------------
14.12 . 2022
Получаем список задач
---------------------------------------------------------------------- */
2022-12-11 13:55:49 +05:00
2022-12-24 21:12:23 +05:00
$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' ] ) );
2022-12-17 18:15:09 +05:00
$smarty -> assign ( 'tasks' , $tasks );
2022-12-24 21:12:23 +05:00
/* ----------------------------------------------------------------------
14.12 . 2022
Получаем список разработчиков
---------------------------------------------------------------------- */
$coders = \DB :: getAll ( " SELECT * FROM `users` WHERE `dostup`='a' OR `dostup`='c' ORDER BY `fio` " );
$smarty -> assign ( 'coders' , $coders );
2023-01-02 21:33:36 +05:00
/* ----------------------------------------------------------------------
26.12 . 2022
Товар без картинок
---------------------------------------------------------------------- */
$tovarBezImg = \DB :: getAll ( " SELECT count(*) FROM `tovar` WHERE (`countImg`=0 OR `countImg`='' OR `countImg` ISNULL) AND `status`=1 " );
$smarty -> assign ( 'tovarBezImg' , $tovarBezImg [ 0 ][ 'count(*)' ] );
/* ----------------------------------------------------------------------
26.12 . 2022
Товар без цен
---------------------------------------------------------------------- */
//$tovarBezCen = \DB::getAll( "SELECT count(*) FROM `tovar` WHERE `id` IN ( SELECT `tovar_id` FROM `tovar_price_history` ) ");
//$allTovar = \DB::getAll( "SELECT count(*) FROM `tovar`");
//$smarty -> assign( 'tovarBezCen', $allTovar[0]['count(*)']- $tovarBezCen[0]['count(*)'] );
2022-12-11 13:55:49 +05:00
?>