Last active
January 8, 2021 15:34
-
-
Save KuJoe/86c51c3e813c3d6d10399d91bf878a25 to your computer and use it in GitHub Desktop.
UserSpice pagination not working example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once '../users/init.php'; | |
require_once $abs_us_root.$us_url_root.'users/includes/template/prep.php'; | |
if (!securePage($_SERVER['PHP_SELF'])) { | |
die(); | |
} | |
?> | |
<style> | |
tfoot input { | |
width: 100%; | |
box-sizing: border-box; | |
} | |
</style> | |
<div class="content mt-3"> | |
<h2 class="mb-3">Links</h2> | |
<?php resultBlock($errors, $successes); | |
$lnks = $db->query('SELECT * FROM links ORDER BY added DESC')->results(); | |
?> | |
<div class="card"> | |
<div class="card-body"> | |
<table id="paginate" class='table table-hover table-striped table-list-search display'> | |
<thead> | |
<th>Redirect</th> | |
<th>URL</th> | |
<th>Clicks</th> | |
<th>Added</th> | |
<th>User</th> | |
<th>Analytics</th> | |
<th>Manage</th> | |
</thead> | |
<tbody> | |
<?php foreach ($links as $r) { ?> | |
<tr> | |
<td><a href="<?=$r->url; ?>"><?=$r->url; ?></a></td> | |
<td><a href="https://<?=$r->link; ?>">https://<?=$r->link; ?></a></td> | |
<td><?=$r->hits; ?></td> | |
<td><?=$r->added; ?></td> | |
<td><a href="admin.php?view=user&id=<?=$r->uid; ?>" /><?=$r->uid; ?></a></td> | |
<td><a href="../analytics.php?s=<?=$r->link; ?>" />View</a></td> | |
<td><a href="admin_edit_link.php?s=<?=$r->link; ?>" />Edit</a></td> | |
</tr> | |
<?php } ?> | |
</tbody> | |
</table> | |
</div> | |
</div> | |
</div> | |
<script> | |
$(document).ready(function() { | |
$('#paginate').DataTable( | |
{ | |
"pageLength": 20 | |
} | |
); | |
}); | |
</script> | |
<script src="./js/pagination/jquery.dataTables.js" type="text/javascript"></script> | |
<script src="./js/pagination/dataTables.js" type="text/javascript"></script> | |
<?php require_once $abs_us_root.$us_url_root.'users/includes/html_footer.php'; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment