Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
blackcat.dev-vt2b.ru
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Акимов Владимир
blackcat.dev-vt2b.ru
Commits
38ceb98d
Commit
38ceb98d
authored
Oct 02, 2024
by
Владимир Акимов
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Бронирование чайных
parent
99e47d1e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
19 deletions
+45
-19
component.php
local/components/vt2b/shedule/component.php
+2
-1
template.php
...l/components/vt2b/shedule/templates/.default/template.php
+4
-1
init.php
local/php_interface/init.php
+39
-17
No files found.
local/components/vt2b/shedule/component.php
View file @
38ceb98d
...
...
@@ -54,6 +54,8 @@ foreach($arResult["ADDRESS"] as $k=>$adress) {
}
// добавляем чайные
$arSelect
=
array
(
"ID"
,
"IBLOCK_ID"
,
"NAME"
,
"PROPERTY_PRICE"
);
$arItem
=
[];
if
(
$k
==
9
){
$add
=
24
;
...
...
@@ -66,7 +68,6 @@ foreach($arResult["ADDRESS"] as $k=>$adress) {
);
$res
=
CIBlockElement
::
GetList
(
array
(),
$arFilter
,
false
,
false
,
$arSelect
);
while
(
$ob
=
$res
->
GetNextElement
())
{
$arSelect
=
array
(
"ID"
,
"IBLOCK_ID"
,
"NAME"
,
"PROPERTY_*"
);
$arItem
=
$ob
->
GetFields
();
$arResult
[
"ADDRESS"
][
$k
][
'ITEMS'
][]
=
$arItem
;
...
...
local/components/vt2b/shedule/templates/.default/template.php
View file @
38ceb98d
...
...
@@ -35,9 +35,12 @@
<div
class=
"quest__title addr-quests berezka"
>
<div
class=
"quest__title-text"
>
<?=
$arItem
[
'NAME'
]
?>
</div>
</div>
<?
if
(
$arItem
[
'IBLOCK_ID'
]
==
7
){
?>
<?
if
(
$arItem
[
'IBLOCK_ID'
]
==
7
){
?>
<div
class=
"slots tt_v1__slots"
>
<?
$time
=
"11:00"
;
$price
=
$arItem
[
'PROPERTY_PRICE_VALUE'
];
for
(
$i
=
0
;
$i
<=
24
;
$i
++
)
{
$ti
=
explode
(
":"
,
$time
);
$hour
=
(
int
)
$ti
[
0
];
...
...
local/php_interface/init.php
View file @
38ceb98d
...
...
@@ -260,22 +260,28 @@ function teaBron($time,$date,$questId){
return
$teas
;
}
function
closedTea
(
$date
,
$time
,
$teaId
){
function
closedTea
(
$date
,
$time
,
$teaId
)
{
// получаем бронирование чайных
$iblockId
=
13
;
$arSelect
=
Array
(
"ID"
,
"IBLOCK_ID"
,
"PROPERTY_*"
);
$iblockId
=
13
;
$arSelect
=
array
(
"ID"
,
"IBLOCK_ID"
,
"PROPERTY_*"
);
$date
=
date
(
'Y-m-d'
,
strtotime
(
$date
));
$arFilter
=
Array
(
"IBLOCK_ID"
=>
$iblockId
,
"ACTIVE"
=>
"Y"
,
"PROPERTY_TEA"
=>
$teaId
,
"PROPERTY_DATE"
=>
$date
$teas
=
[];
$arFilter
=
array
(
"IBLOCK_ID"
=>
$iblockId
,
"ACTIVE"
=>
"Y"
,
"PROPERTY_TEA"
=>
$teaId
,
"PROPERTY_DATE"
=>
$date
);
$res
=
CIBlockElement
::
GetList
(
A
rray
(),
$arFilter
,
false
,
false
,
$arSelect
);
while
(
$ob
=
$res
->
GetNextElement
())
{
$res
=
CIBlockElement
::
GetList
(
a
rray
(),
$arFilter
,
false
,
false
,
$arSelect
);
while
(
$ob
=
$res
->
GetNextElement
())
{
$arItem
=
$ob
->
GetFields
();
$arItem
[
'PROPERTIES'
]
=
$ob
->
GetProperties
();
$teas
[]
=
$arItem
;
}
$t
=
[];
foreach
(
$teas
as
$arItem
)
{
$hourBeg
=
explode
(
':'
,
$arItem
[
'PROPERTIES'
][
'TIME_BEGIN'
][
'VALUE'
]);
$hourBegin
=
$hourBeg
[
0
];
$minBegin
=
$hourBeg
[
1
];
...
...
@@ -284,17 +290,33 @@ function closedTea($date,$time,$teaId){
$minEnd
=
$hourEn
[
1
];
$hou
=
explode
(
':'
,
$time
);
$hour
=
$hou
[
0
];
$min
=
$hou
[
0
];
$min
=
$hou
[
1
];
// если время брони совпадает
if
(
$hour
>=
$hourBegin
&&
$hour
<
$hourEnd
)
{
return
true
;
}
elseif
(
$time
==
$arItem
[
'PROPERTIES'
][
'TIME_END'
][
'VALUE'
])
{
return
true
;
}
else
return
false
;
if
(
$hour
>
$hourBegin
&&
$hour
<
$hourEnd
)
{
$t
[]
=
"close"
;
break
;
}
elseif
(
$hour
==
$hourEnd
&&
$min
<=
$minEnd
)
{
$t
[]
=
"close"
;
break
;
}
elseif
(
$hour
==
$hourBegin
&&
$min
>=
$minBegin
)
{
$t
[]
=
"close"
;
break
;
}
else
{
$t
[]
=
"open"
;
}
}
if
(
in_array
(
"close"
,
$t
)){
return
true
;
}
else
return
false
;
}
//формирование списка времени для чайных
function
timeend
(
$tim
,
$teaId
,
$date
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment