Skip to main content
Homepage
Explore
Search or go to…
/
Sign in
Explore
Primary navigation
Project
P
PHP app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Collapse sidebar
Snippets
Groups
Projects
Show more breadcrumbs
IF3110-2023-02-18
PHP app
Commits
64f99d02
Commit
64f99d02
authored
Oct 8, 2023
by
Bitha17
Browse files
Options
Downloads
Patches
Plain Diff
add history pagination and edit display history by user id
parent
fea20cbc
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/Views/history/history.php
+21
-1
21 additions, 1 deletion
app/Views/history/history.php
with
21 additions
and
1 deletion
app/Views/history/history.php
+
21
−
1
View file @
64f99d02
...
...
@@ -22,7 +22,12 @@
$minStock
=
isset
(
$_GET
[
'min_stock'
])
?
$_GET
[
'min_stock'
]
:
null
;
// Get search results or all pembelian (history)
$pembelians
=
$pembelianController
->
getAllPembelian
();
$pembelians
=
$pembelianController
->
getPembelianByUserId
(
$_SESSION
[
'user_id'
]);
$paginationData
=
$pembelianController
->
paginateHistory
(
$pembelians
);
$pembelians
=
$paginationData
[
'pembelian'
];
$totalEvents
=
$paginationData
[
'total'
];
$currentPage
=
$paginationData
[
'page'
];
$maxPage
=
$paginationData
[
'maxpage'
];
?>
<!DOCTYPE html>
...
...
@@ -39,6 +44,7 @@
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/../../styles/container.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/../../styles/auth.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/../../styles/dropdown.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/../../styles/pagination.css"
>
</head>
<body>
...
...
@@ -52,6 +58,20 @@
include
'../template/history.php'
;
endforeach
;
?>
</div>
<div
class=
"pagination"
>
<?php
if
(
$currentPage
>
1
)
:
?>
<a
href=
"?page=
<?=
$currentPage
-
1
?>
"
>
Previous
</a>
<?php
endif
;
?>
<?php
for
(
$i
=
1
;
$i
<=
$maxPage
;
$i
++
)
:
?>
<a
href=
"?page=
<?=
$i
?>
"
<?=
(
$i
==
$currentPage
)
?
'class="active"'
:
''
?>
>
<?=
$i
?>
</a>
<?php
endfor
;
?>
<?php
if
(
$currentPage
<
$maxPage
)
:
?>
<a
href=
"?page=
<?=
$currentPage
+
1
?>
"
>
Next
</a>
<?php
endif
;
?>
</div>
</div>
<?php
include
'../template/footer.php'
;
?>
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment