2025-06-16 18:28:08 +05:00

60 lines
3.3 KiB
PHP
Executable File
Raw Permalink 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
/* ----------------------------------------------------------------------
Сделать проверку на авторизацию и на владение организацией - ok
Сделать аякс-загрузку документов по различным типам
---------------------------------------------------------------------- */
ini_set('display_errors', 0);
require_once MYDIR . '/api/php/db.php';
require_once MYDIR . '/api/php/clean.php';
/* ----------------------------------------------------------------------
12.11.2022
Проверяем подлинность пользователя
---------------------------------------------------------------------- */
if ( !$_SESSION['user_id'] ) header( 'Location: /login/' );
$user_id = DB::getValue('SELECT `user_id` FROM `multiOrg` WHERE `org_id` = ' . Clean::int(ID) );
if ( $_SESSION['user_id'] != $user_id ) header( 'Location: /403/' );
/* ----------------------------------------------------------------------
14.10.2022
Меню личного кабинета
---------------------------------------------------------------------- */
$smarty -> assign ( 'mnulk', MYDIR . '/skin/inc/mnulk.html');
$smarty -> assign ( 'headerlk', MYDIR . '/api/modules/lk_edit_org/header-lk.html');
$smarty -> assign ( 'os', MYDIR . '/api/modules/lk_edit_org/os.html');
$smarty -> assign ( 'docs', MYDIR . '/api/modules/lk_edit_org/docs.html');
$smarty -> assign ( 'mag', MYDIR . '/api/modules/lk_edit_org/mag.html');
/* ----------------------------------------------------------------------
15.10.2022
Информацию об организации
---------------------------------------------------------------------- */
$org = DB::getAll('SELECT * FROM `org` WHERE `id` = ' . ID . ' LIMIT 1');
$smarty -> assign( 'org', $org );
/* ----------------------------------------------------------------------
02.06.2022
Получаем опции пользователя
---------------------------------------------------------------------- */
$userOption = DB::getAll('SELECT * FROM `userOption` WHERE `user_id` = ' . $_SESSION['user_id'] . ' LIMIT 1');
$smarty -> assign( 'userOption', $userOption );
/* ----------------------------------------------------------------------
06.12.2022
Получаем регионы
---------------------------------------------------------------------- */
$region = DB::getAll('SELECT * FROM `region` WHERE `strana_id` = 1');
$smarty -> assign( 'region', $region );
/* ----------------------------------------------------------------------
06.12.2022
Получаем города
---------------------------------------------------------------------- */
$city = DB::getAll('SELECT * FROM `city` WHERE `strana_id` = 1');
$smarty -> assign( 'city', $city );
/* ----------------------------------------------------------------------
07.12.2022
Получаем список магазинов
---------------------------------------------------------------------- */
$markets = DB::getAll('SELECT * FROM `markets` WHERE `org_id` = ' . ID);
for ($i=0; $i<count($markets); $i++)$markets[$i]['city'] = DB::getValue('SELECT `txt` FROM `city` WHERE `id` = ' . $markets[$i]['city_id']);
$smarty -> assign( 'markets', $markets );
?>