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

79 lines
4.2 KiB
PHP
Raw Normal View History

2022-12-11 13:55:49 +05:00
<?php
ini_set('display_errors', 0);
2023-02-08 16:59:59 +05:00
2023-03-11 21:03:29 +05:00
if ( $db['type'] == 'mysql' ) \DB::alterTable( "ALTER TABLE `org` ADD `bic` int(10) NULL, ADD `rs` varchar(40) COLLATE 'utf8_general_ci' NULL AFTER `bic`, ADD FOREIGN KEY (`bic`) REFERENCES `bic` (`id`)" );
if ( $db['type']=='sqlite3' ) \DB::alterTable( "ALTER TABLE `org` ADD `bic` TEXT" );
if ( $db['type']=='sqlite3' ) \DB::alterTable( "ALTER TABLE `org` ADD `rs` TEXT" );
if ( $db['type'] == 'mysql' ) \DB::alterTable( "ALTER TABLE `org` ADD `podval_scheta` longtext NULL" );
2023-04-09 19:52:26 +05:00
if ( $db['type'] == 'mysql' ) \DB::alterTable( "ALTER TABLE `org` ADD `dir` varchar(200) NULL" );
if ( $db['type'] == 'mysql' ) \DB::alterTable( "ALTER TABLE `org` ADD `buh` varchar(200) NULL" );
2023-03-11 21:03:29 +05:00
if ( $db['type']=='sqlite3' ) \DB::alterTable( "ALTER TABLE `org` ADD `podval_scheta` TEXT" );
2023-04-09 19:52:26 +05:00
if ( $db['type']=='sqlite3' ) \DB::alterTable( "ALTER TABLE `org` ADD `dir` TEXT" );
if ( $db['type']=='sqlite3' ) \DB::alterTable( "ALTER TABLE `org` ADD `buh` TEXT" );
2023-03-11 21:03:29 +05:00
$smarty -> assign( 'editor_js', '<script language="javascript" type="text/javascript" src="/api/soft/tinymce/4.3.12/tinymce.min.js"></script><script language="javascript" type="text/javascript" src="/api/soft/tinymce/4.3.12/load.php"></script>');
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/' );
/* ----------------------------------------------------------------------
15.02.2022
Получаем справочник типов складов
2022-12-11 13:55:49 +05:00
---------------------------------------------------------------------- */
$smarty -> assign( 'sp_sklad_tip', \DB::getAll("SELECT * FROM `sp_sklad_tip` ORDER BY `txt`") );
2022-12-11 13:55:49 +05:00
/* ----------------------------------------------------------------------
15.02.2022
Получаем справочник регионов
---------------------------------------------------------------------- */
$smarty -> assign( 'region', \DB::getAll("SELECT * FROM `region` WHERE `strana_id`=1 ORDER BY `txt`") );
2022-12-11 13:55:49 +05:00
/* ----------------------------------------------------------------------
15.02.2022
Получаем справочник городов
2022-12-11 13:55:49 +05:00
---------------------------------------------------------------------- */
$smarty -> assign( 'city', \DB::getAll("SELECT * FROM `city` WHERE `strana_id`=1 ORDER BY `txt`") );
2022-12-11 13:55:49 +05:00
/* ----------------------------------------------------------------------
15.02.2022
Подключение модулей
---------------------------------------------------------------------- */
$smarty -> assign( 'modal_new_sklad', "api/modules/lk-my-orgs/modal_new_sklad.html" );
$smarty -> assign( 'inc_org_edit', "api/modules/lk-my-orgs/inc_org_edit.html" );
2022-12-11 13:55:49 +05:00
?>