Browse Source

ニジカ Pagination

bc-detail
みてるぞ 8 months ago
parent
commit
57b261a751
6 changed files with 30 additions and 8 deletions
  1. BIN
      broadcast/assets/page-body.png
  2. BIN
      broadcast/assets/page-first.png
  3. BIN
      broadcast/assets/page-last.png
  4. +2
    -1
      broadcast/index.frm.php
  5. +17
    -7
      broadcast/pagination.cmp.php
  6. +11
    -0
      broadcast/style.css

BIN
broadcast/assets/page-body.png View File

Before After
Width: 60  |  Height: 115  |  Size: 1.0 KiB

BIN
broadcast/assets/page-first.png View File

Before After
Width: 60  |  Height: 115  |  Size: 3.1 KiB

BIN
broadcast/assets/page-last.png View File

Before After
Width: 60  |  Height: 115  |  Size: 9.3 KiB

+ 2
- 1
broadcast/index.frm.php View File

@@ -101,7 +101,8 @@
<?php foreach (array_slice ($log_data, <?php foreach (array_slice ($log_data,
($page - 1) * $length, ($page - 1) * $length,
$length, $length,
true) as $record): ?>
true)
as $record): ?>
<div class="mb-4"> <div class="mb-4">
<div> <div>
<?= $record['date_time'] ?> <?= $record['date_time'] ?>


+ 17
- 7
broadcast/pagination.cmp.php View File

@@ -2,37 +2,47 @@
<ul class="pagination opacity-0"> <ul class="pagination opacity-0">
<?php if ($page > 1): ?> <?php if ($page > 1): ?>
<li class="page-item"> <li class="page-item">
<a class="page-link no-wrap" href="javascript: void (0)" onclick="Script.jumpTo (1)">|&lt;</a>
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (1)">
<img src="./assets/page-first.png" />|&lt;
</a>
</li> </li>
<?php else: ?> <?php else: ?>
<li class="page-item disabled"> <li class="page-item disabled">
<span class="page-link">|&lt;</span>
<span class="page-link">
<img src="./assets/page-first.png" />|&lt;
</span>
</li> </li>
<?php endif ?> <?php endif ?>


<?php for ($i = max (min ($page + 10, $pages_max) - 20, 1); $i < $page; ++$i): ?> <?php for ($i = max (min ($page + 10, $pages_max) - 20, 1); $i < $page; ++$i): ?>
<li class="page-item page-<?= $page - $i ?>"> <li class="page-item page-<?= $page - $i ?>">
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $i ?>)"><?= $i ?></a>
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $i ?>)">
<img src="./assets/page-body.png" /><?= $i ?>
</a>
</li> </li>
<?php endfor ?> <?php endfor ?>


<li class="page-item active" aria-current="page"> <li class="page-item active" aria-current="page">
<span class="page-link"><?= $page ?></span>
<span class="page-link"><img src="./assets/page-body.png" /><?= $page ?></span>
</li> </li>


<?php for ($i = $page + 1; $i <= min (max ($page - 10, 1) + 20, $pages_max); ++$i): ?> <?php for ($i = $page + 1; $i <= min (max ($page - 10, 1) + 20, $pages_max); ++$i): ?>
<li class="page-item page-<?= $i - $page ?>"> <li class="page-item page-<?= $i - $page ?>">
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $i ?>)"><?= $i ?></a>
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $i ?>)">
<img src="./assets/page-body.png" /><?= $i ?>
</a>
</li> </li>
<?php endfor ?> <?php endfor ?>


<?php if ($page < $pages_max): ?> <?php if ($page < $pages_max): ?>
<li class="page-item"> <li class="page-item">
<a class="page-link no-wrap" href="javascript: void (0)" onclick="Script.jumpTo (<?= $pages_max ?>)">&gt;|</a>
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $pages_max ?>)">
<img src="./assets/page-last.png" />&gt;|
</a>
</li> </li>
<?php else: ?> <?php else: ?>
<li class="page-item disabled"> <li class="page-item disabled">
<span class="page-link">&gt;|</span>
<span class="page-link"><img src="./assets/page-last.png" />&gt;|</span>
</li> </li>
<?php endif ?> <?php endif ?>
</ul> </ul>


+ 11
- 0
broadcast/style.css View File

@@ -18,9 +18,20 @@
max-width: 6px; max-width: 6px;
} }


.pagination
{

}

.page-item .page-item
{ {
width: 3.5em; width: 3.5em;
text-align: center; text-align: center;
vertical-align: middle;
}

.page-item:not(:not(.disabled, .active)) img
{
filter: invert(100%);
} }



Loading…
Cancel
Save