2022-12-11 13:55:49 +05:00
< ? php
ini_set ( 'display_errors' , 0 );
2023-02-08 16:59:59 +05:00
/* ----------------------------------------------------------------------
07.12 . 2023
Получаем список своих организаций
---------------------------------------------------------------------- */
$listMyOrgs = \DB :: getAll ( " SELECT * FROM `multiOrg` WHERE `user_id`=? AND `status`=1 " , $_SESSION [ 'user_id' ]);
for ( $i = 0 ; $i < count ( $listMyOrgs ); $i ++ ) $listMyOrgs [ $i ][ 'txt' ] = \DB :: getValue ( " SELECT `txt` FROM `org` WHERE `id`=? " , $listMyOrgs [ $i ][ 'org_id' ]);
$smarty -> assign ( 'listMyOrgs' , $listMyOrgs );
2022-12-11 13:55:49 +05:00
2023-02-08 16:59:59 +05:00
/* ----------------------------------------------------------------------
07.12 . 2023
Получаем список своих организаций на проверке
---------------------------------------------------------------------- */
$listMyOrgsCheck = \DB :: getAll ( " SELECT * FROM `multiOrg` WHERE `user_id`=? AND `status`=0 " , $_SESSION [ 'user_id' ]);
for ( $i = 0 ; $i < count ( $listMyOrgsCheck ); $i ++ ) $listMyOrgsCheck [ $i ][ 'txt' ] = \DB :: getValue ( " SELECT `txt` FROM `org` WHERE `id`=? " , $listMyOrgsCheck [ $i ][ 'org_id' ]);
$smarty -> assign ( 'listMyOrgsCheck' , $listMyOrgsCheck );
2022-12-11 13:55:49 +05:00
/* ----------------------------------------------------------------------
14.10 . 2022
Меню личного кабинета
---------------------------------------------------------------------- */
2023-02-08 16:59:59 +05:00
//$smarty -> assign ( 'mnulk', MYDIR . '/skin/inc/mnulk.html');
2022-12-11 13:55:49 +05:00
/* ----------------------------------------------------------------------
01.05 . 2021
Выгонялка
---------------------------------------------------------------------- */
if ( ! $_SESSION [ 'user_id' ] && ! ID ) header ( 'Location: /login/' );
/* ----------------------------------------------------------------------
06.11 . 2022
Получаем опции пользователя для меню
---------------------------------------------------------------------- */
2023-02-08 16:59:59 +05:00
//$userOption = DB::getAll('SELECT * FROM `userOption` WHERE `user_id` = ' . Clean::str($_SESSION['user_id']) . ' LIMIT 1');
//$smarty -> assign( 'userOption', $userOption );
2022-12-11 13:55:49 +05:00
/* ----------------------------------------------------------------------
06.11 . 2022
Получаем список своих организаций
---------------------------------------------------------------------- */
2023-02-08 16:59:59 +05:00
/*
$myOrgsOnCheck = \DB :: getAll ( 'SELECT * FROM `org` WHERE `id` IN (SELECT `org_id` FROM `multiOrg` WHERE `user_id`=' . $_SESSION [ 'user_id' ] . ' AND `status`<>1 )' );
2022-12-11 13:55:49 +05:00
for ( $i = 0 ; $i < count ( $myOrgsOnCheck ); $i ++ ){
2023-02-08 16:59:59 +05:00
$myOrgsOnCheck [ $i ][ 'status' ] = \DB :: getValue ( " SELECT `status` FROM `multiOrg` WHERE `org_id` = " . $myOrgsOnCheck [ $i ][ 'id' ]);
2022-12-11 13:55:49 +05:00
}
$smarty -> assign ( 'myOrgsOnCheck' , $myOrgsOnCheck );
2023-02-08 16:59:59 +05:00
$myOrgs = \DB :: getAll ( 'SELECT * FROM `org` WHERE `id` IN (SELECT `org_id` FROM `multiOrg` WHERE `user_id`=' . $_SESSION [ 'user_id' ] . ' AND `status`=1 )' );
2022-12-11 13:55:49 +05:00
$smarty -> assign ( 'myOrgs' , $myOrgs );
2023-02-08 16:59:59 +05:00
*/
2022-12-11 13:55:49 +05:00
?>