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
aa8d5669
Commit
aa8d5669
authored
Aug 02, 2018
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temp
parent
6efa2cf5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
16 deletions
+21
-16
Webservice.php
admin/application/controllers/Webservice.php
+18
-15
Webservice_model.php
admin/application/models/Webservice_model.php
+3
-1
No files found.
admin/application/controllers/Webservice.php
View file @
aa8d5669
...
...
@@ -3031,37 +3031,40 @@ print_r(date('H:i',$ms));exit();*/
$currentpage
=
(
int
)
$_GET
[
'page'
];
$currentpage
=
$currentpage
==
0
?
$currentpage
:
$currentpage
-
1
;
$start
=
$currentpage
*
$per_page
;
$page_no
=
$_GET
[
'page'
];
}
else
{
$currentpage
=
0
;
$start
=
0
;
$page_no
=
0
;
}
$notificationResult
=
$this
->
Webservice_model
->
notification
(
$auth_result
->
userid
,
0
,
0
);
$result
=
$this
->
Webservice_model
->
notification
(
$auth_result
->
userid
,
$start
,
$per_page
);
$count
=
$this
->
Webservice_model
->
notification_list_unread_count
(
$auth_result
->
userid
);
if
(
$count
){
$
total
_count
=
$count
->
count
;
$
unread
_count
=
$count
->
count
;
}
else
{
$
total
_count
=
0
;
$
unread
_count
=
0
;
}
$notiArray
=
array
();
if
(
$result
!=
false
){
$total
=
count
(
$result
);
if
(
$notificationResult
!=
false
){
$total_count
=
count
(
$notificationResult
);
}
else
{
$total
=
0
;
$total
_count
=
0
;
}
if
(
$total
>=
$per_page
){
$totalPages
=
(
int
)(
$total
/
$per_page
);
$totalPages
=
(
int
)(
$total_count
%
$per_page
==
0
?
$total_count
/
$per_page
:
(
$total_count
/
$per_page
)
+
1
);
}
else
{
$totalPages
=
0
;
$totalPages
=
1
;
}
if
(
$result
!=
false
){
foreach
(
array_slice
(
$result
,
$start
,
$per_page
)
as
$key
=>
$value
)
{
foreach
(
$result
as
$key
=>
$value
)
{
array_push
(
$notiArray
,
$value
);
...
...
@@ -3072,11 +3075,11 @@ print_r(date('H:i',$ms));exit();*/
$res
=
array
(
'status'
=>
'success'
,
'data'
=>
array
(
'unread_count'
=>
$
total
_count
,
'unread_count'
=>
$
unread
_count
,
'notification_list'
=>
$notiArray
),
'meta'
=>
array
(
'total_pages'
=>
$totalPages
,
'total'
=>
$total
,
'total'
=>
$total
_count
,
'current_page'
=>
$currentpage
+
1
,
'per_page'
=>
$per_page
)
);
...
...
@@ -3084,9 +3087,9 @@ print_r(date('H:i',$ms));exit();*/
}
else
{
$res
=
array
(
"status"
=>
"success"
,
"data"
=>
array
(
'unread_count'
=>
$
total
_count
,
'notification_list'
=>
[]),
"data"
=>
array
(
'unread_count'
=>
$
unread
_count
,
'notification_list'
=>
[]),
'meta'
=>
array
(
'total_pages'
=>
$totalPages
,
'total'
=>
$total
,
'total'
=>
$total
_count
,
'current_page'
=>
$currentpage
+
1
,
'per_page'
=>
$per_page
)
);
...
...
admin/application/models/Webservice_model.php
View file @
aa8d5669
...
...
@@ -1905,7 +1905,9 @@ class Webservice_model extends CI_Model {
$this
->
db
->
join
(
'tbl_booking'
,
'tbl_booking.id = tbl_patient_notification.booking_id'
);
$this
->
db
->
join
(
'tbl_doctors'
,
'tbl_doctors.id = tbl_booking.doctor_id'
);
$this
->
db
->
join
(
'tbl_specialization'
,
'tbl_specialization.id = tbl_doctors.specialization'
);
$this
->
db
->
limit
(
$per_page
,
$start
);
if
(
$start
!=
0
||
$per_page
!=
0
){
$this
->
db
->
limit
(
$per_page
,
$start
);
}
$this
->
db
->
order_by
(
'tbl_patient_notification.id'
,
'DESC'
);
$query
=
$this
->
db
->
get_where
(
'tbl_patient_notification'
,
array
(
'tbl_patient_notification.patient_id'
=>
$id
))
->
result
();
if
(
count
(
$query
)
>
0
){
...
...
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