66 lines
3.4 KiB
PHP
Executable File
66 lines
3.4 KiB
PHP
Executable File
<?php
|
|
ini_set('display_errors', 0 );
|
|
if ( !$_SESSION['user_id'] ) header ( 'Location: /login/' );
|
|
if ( ID==0 ) header ( 'Location: /lk-tovar/' );
|
|
require_once MYDIR . '/api/php/db.php';
|
|
require_once MYDIR . '/api/php/clean.php';
|
|
|
|
/* ----------------------------------------------------------------------
|
|
14.10.2022
|
|
Меню личного кабинета
|
|
---------------------------------------------------------------------- */
|
|
$smarty -> assign ( 'mnulk', MYDIR . '/skin/inc/mnulk.html');
|
|
$smarty -> assign ( 'myorg', MYDIR . '/api/modules/lk-edit-tovar/myorg.html');
|
|
|
|
/* ----------------------------------------------------------------------
|
|
02.06.2022
|
|
Получаем опции пользователя
|
|
---------------------------------------------------------------------- */
|
|
$userOption = DB::getAll('SELECT * FROM `userOption` WHERE `user_id` = ' . $_SESSION['user_id'] . ' LIMIT 1');
|
|
$smarty -> assign( 'userOption', $userOption );
|
|
|
|
/* ----------------------------------------------------------------------
|
|
30.11.2022
|
|
Узнаем, продает ли этот товар кто-то еще
|
|
---------------------------------------------------------------------- */
|
|
$multiTovar = DB::getAll('SELECT * FROM `multyTovar` WHERE `tovar_id` = ' . Clean::int(ID));
|
|
$count=count($multiTovar);
|
|
$smarty -> assign( 'countDillers', $count-1 );
|
|
/* ----------------------------------------------------------------------
|
|
30.11.2022
|
|
Получаем карточку товара
|
|
---------------------------------------------------------------------- */
|
|
$tovar = DB::getAll('SELECT * FROM `tovar` WHERE `id` = ' . Clean::int(ID) . ' LIMIT 1');
|
|
$smarty -> assign( 'tovar', $tovar );
|
|
|
|
/* ----------------------------------------------------------------------
|
|
30.11.2022
|
|
Получаем картинки
|
|
---------------------------------------------------------------------- */
|
|
|
|
/* ----------------------------------------------------------------------
|
|
30.11.2022
|
|
Получаем штрих коды
|
|
---------------------------------------------------------------------- */
|
|
|
|
/* ----------------------------------------------------------------------
|
|
30.11.2022
|
|
Получаем отзывы по Вашему магазину
|
|
---------------------------------------------------------------------- */
|
|
/* ----------------------------------------------------------------------
|
|
30.11.2022
|
|
Получаем цены всех магазинов
|
|
---------------------------------------------------------------------- */
|
|
for ($i=0; $i<$count; $i++)$multiTovar[$i]['magazin']=$value = DB::getValue('SELECT `txt` FROM `org` WHERE `id` = ' . $multiTovar[$i]['org_id'] . ' LIMIT 1');
|
|
$smarty -> assign( 'multiTovar', $multiTovar );
|
|
|
|
/* ----------------------------------------------------------------------
|
|
03.12.2022
|
|
Получаем цены всех своиХ магазинов
|
|
---------------------------------------------------------------------- */
|
|
|
|
$myOrg = DB::getAll('SELECT `id`, `txt` FROM `org` WHERE `id` IN (SELECT `org_id` FROM `multiOrg` WHERE `user_id` = ' . $_SESSION['user_id'] . ')');
|
|
for ($i=0; $i<count($myOrg); $i++)$myOrg[$i]['cena'] = DB::getValue('SELECT `cena` FROM `multyTovar` WHERE `org_id` = ' . $myOrg[$i]['id'] . ' AND `tovar_id` = ' . ID . ' LIMIT 1');
|
|
$smarty -> assign( 'myOrg', $myOrg );
|
|
|
|
?>
|