Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
IPok_Web
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
IPok
IPok_Web
Commits
15653dc4
Commit
15653dc4
authored
6 years ago
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
available dates
parent
7d833303
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
Webservice.php
admin/application/controllers/Webservice.php
+9
-3
No files found.
admin/application/controllers/Webservice.php
View file @
15653dc4
...
...
@@ -1835,11 +1835,12 @@ class Webservice extends CI_Controller {
}
else
{
$db_day_array
[]
=
[];
}
$time
=
strtotime
(
$data
[
'month'
]
.
$data
[
'year'
]);
$getmonth
=
$this
->
get_month
(
$data
[
'month'
]);
$time
=
strtotime
(
$getmonth
.
$data
[
'year'
]);
$search_form
=
date
(
'Y-m-01'
,
$time
);
$search_to
=
date
(
'Y-m-t'
,
$time
);
$req_month_number
=
date
(
'm'
,
strtotime
(
$
data
[
'month'
]
));
$req_month_number
=
date
(
'm'
,
strtotime
(
$
getmonth
));
$tod_month_number
=
date
(
'm'
);
$month_today
=
date
(
'F'
);
$year_today
=
date
(
'Y'
);
...
...
@@ -1851,7 +1852,7 @@ class Webservice extends CI_Controller {
if
(
in_array
(
$day
,
$db_day_array
)){
if
(
count
(
$result_booked
[
'leave'
])
>
0
){
foreach
(
$result_booked
[
'leave'
]
as
$key
=>
$value
)
{
if
((
date
(
'j'
,
$value
->
start_date
)
<=
date
(
'j'
,
strtotime
(
$i
)))
&&
(
date
(
'j'
,
$value
->
end_date
)
>=
date
(
'j'
,
strtotime
(
$i
)))
&&
(
date
(
'F'
,
$value
->
start_date
)
==
$
data
[
'month'
])
&&
(
date
(
'F'
,
$value
->
end_date
)
==
$data
[
'month'
]
)
&&
(
date
(
'Y'
,
$value
->
start_date
)
==
$data
[
'year'
])
&&
(
date
(
'Y'
,
$value
->
end_date
)
==
$data
[
'year'
]))
{
if
((
date
(
'j'
,
$value
->
start_date
)
<=
date
(
'j'
,
strtotime
(
$i
)))
&&
(
date
(
'j'
,
$value
->
end_date
)
>=
date
(
'j'
,
strtotime
(
$i
)))
&&
(
date
(
'F'
,
$value
->
start_date
)
==
$
getmonth
)
&&
(
date
(
'F'
,
$value
->
end_date
)
==
$getmonth
)
&&
(
date
(
'Y'
,
$value
->
start_date
)
==
$data
[
'year'
])
&&
(
date
(
'Y'
,
$value
->
end_date
)
==
$data
[
'year'
]))
{
array_push
(
$res
[
'data'
][
'not_available'
],
date
(
'j'
,
strtotime
(
$i
)));
}
else
{
if
(
strtotime
(
$i
)
<
strtotime
(
$date_today
)){
...
...
@@ -1909,6 +1910,11 @@ class Webservice extends CI_Controller {
}
print
json_encode
(
$res
);
}
public
function
get_month
(
$id
){
if
(
$id
==
'1'
){
$res
=
'January'
;
}
else
if
(
$id
==
'2'
){
$res
=
'February'
;
}
else
if
(
$id
==
'3'
){
$res
=
'March'
;
}
else
if
(
$id
==
'4'
){
$res
=
'April'
;
}
else
if
(
$id
==
'5'
){
$res
=
'May'
;
}
else
if
(
$id
==
'6'
){
$res
=
'June'
;
}
else
if
(
$id
==
'7'
){
$res
=
'July'
;
}
else
if
(
$id
==
'8'
){
$res
=
'August'
;
}
else
if
(
$id
==
'9'
){
$res
=
'September'
;
}
else
if
(
$id
==
'10'
){
$res
=
'October'
;
}
else
if
(
$id
==
'11'
){
$res
=
'November'
;
}
else
{
$res
=
'December'
;
}
return
$res
;
}
/*..........................................................................................*/
/*....................................... booking list.......................................*/
...
...
This diff is collapsed.
Click to expand it.
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