core/api/modules/lk-my-orgs/index.php

58 lines
2.9 KiB
PHP

<?php
ini_set('display_errors', 0);
/* ----------------------------------------------------------------------
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 );
/* ----------------------------------------------------------------------
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 );
/* ----------------------------------------------------------------------
14.10.2022
Меню личного кабинета
---------------------------------------------------------------------- */
//$smarty -> assign ( 'mnulk', MYDIR . '/skin/inc/mnulk.html');
/* ----------------------------------------------------------------------
01.05.2021
Выгонялка
---------------------------------------------------------------------- */
if ( !$_SESSION['user_id'] && !ID ) header ( 'Location: /login/' );
/* ----------------------------------------------------------------------
06.11.2022
Получаем опции пользователя для меню
---------------------------------------------------------------------- */
//$userOption = DB::getAll('SELECT * FROM `userOption` WHERE `user_id` = ' . Clean::str($_SESSION['user_id']) . ' LIMIT 1');
//$smarty -> assign( 'userOption', $userOption );
/* ----------------------------------------------------------------------
06.11.2022
Получаем список своих организаций
---------------------------------------------------------------------- */
/*
$myOrgsOnCheck = \DB::getAll('SELECT * FROM `org` WHERE `id` IN (SELECT `org_id` FROM `multiOrg` WHERE `user_id`=' . $_SESSION['user_id'] . ' AND `status`<>1 )');
for ($i=0; $i<count($myOrgsOnCheck); $i++){
$myOrgsOnCheck[$i]['status'] = \DB::getValue("SELECT `status` FROM `multiOrg` WHERE `org_id` = " . $myOrgsOnCheck[$i]['id']);
}
$smarty -> assign( 'myOrgsOnCheck', $myOrgsOnCheck );
$myOrgs = \DB::getAll('SELECT * FROM `org` WHERE `id` IN (SELECT `org_id` FROM `multiOrg` WHERE `user_id`=' . $_SESSION['user_id'] . ' AND `status`=1 )');
$smarty -> assign( 'myOrgs', $myOrgs );
*/
?>