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
4b8edb03
Commit
4b8edb03
authored
Aug 02, 2018
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Notification Pagination Fixx
parent
787233f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
32 deletions
+24
-32
Webservice.php
admin/application/controllers/Webservice.php
+24
-32
No files found.
admin/application/controllers/Webservice.php
View file @
4b8edb03
...
...
@@ -5180,58 +5180,50 @@ print_r(date('H:i',$ms));exit();*/
$start
=
0
;
$page_no
=
0
;
}
$notificationResult
=
$this
->
Webservice_model
->
get_doctor_notification_list
(
$authtoken
->
doctor_id
,
0
,
0
);
$result
=
$this
->
Webservice_model
->
get_doctor_notification_list
(
$authtoken
->
doctor_id
,
$start
,
$per_page
);
$count
=
$this
->
Webservice_model
->
get_doctor_notification_list_unread_count
(
$authtoken
->
doctor_id
);
if
(
$count
){
$unread_count
=
$count
->
count
;
}
else
{
$unread_count
=
0
;
}
if
(
$notificationResult
!=
false
){
$total_count
=
count
(
$notificationResult
);
$total_count
=
$count
->
count
;
}
else
{
$total_count
=
0
;
}
$notifArray
=
array
();
if
(
$result
!=
false
){
$total
=
count
(
$result
);
}
else
{
$total
=
0
;
}
if
(
$total
>=
$per_page
){
$notifArray
=
array
();
// if($result != false){
// $total = count($result);
// }else{
// $total = 0;
// }
if
(
$total_count
>=
$per_page
){
$totalPages
=
(
int
)(
$total_count
/
$per_page
);
}
else
{
$totalPages
=
1
;
}
//print_r($result);exit;
if
(
$result
!=
''
){
foreach
(
array_slice
(
$result
,
$start
,
$per_page
)
as
$key
=>
$value
)
{
$value
->
read_status
=
$value
->
read_status
!=
0
?
true
:
false
;
array_push
(
$notifArray
,
$value
);
$totalPages
=
(
int
)(
$total
/
$per_page
);
}
}
else
{
$totalPages
=
1
;
}
//print_r($result);exit;
if
(
$result
!=
''
){
foreach
(
array_slice
(
$result
,
$start
,
$per_page
)
as
$key
=>
$value
)
{
$value
->
read_status
=
$value
->
read_status
!=
0
?
true
:
false
;
array_push
(
$notifArray
,
$value
);
}
}
if
(
$result
!=
false
){
$res
=
array
(
'status'
=>
'success'
,
'data'
=>
array
(
'unread_count'
=>
$
unread
_count
,
'notifications'
=>
$notifArray
),
'data'
=>
array
(
'unread_count'
=>
$
total
_count
,
'notifications'
=>
$notifArray
),
'meta'
=>
array
(
'total_pages'
=>
$totalPages
,
'total'
=>
$total
_count
,
'total'
=>
$total
,
'current_page'
=>
$currentpage
+
1
,
'per_page'
=>
$per_page
)
);
}
else
{
$res
=
array
(
'status'
=>
'success'
,
'data'
=>
array
(
'unread_count'
=>
$
unread
_count
,
'notifications'
=>
[]),
'data'
=>
array
(
'unread_count'
=>
$
total
_count
,
'notifications'
=>
[]),
'meta'
=>
array
(
'total_pages'
=>
$totalPages
,
'total'
=>
$total
_count
,
'total'
=>
$total
,
'current_page'
=>
$currentpage
+
1
,
'per_page'
=>
$per_page
)
);
...
...
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