本文整理汇总了PHP中Paging::cariPosisi方法的典型用法代码示例。如果您正苦于以下问题:PHP Paging::cariPosisi方法的具体用法?PHP Paging::cariPosisi怎么用?PHP Paging::cariPosisi使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paging
的用法示例。
在下文中一共展示了Paging::cariPosisi方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
$mapel = mysql_query("SELECT * FROM mata_pelajaran WHERE id_kelas = '{$data_siswa['id_kelas']}'");
echo "<table>\n <tr><th>No</th><th>Mata Pelajaran</th><th>Materi</th></tr>";
$no = 1;
while ($r = mysql_fetch_array($mapel)) {
echo "<tr><td>{$no}</td>\n <td>{$r['nama']}</td>";
echo "<td><input type=button class='tombol' value='Lihat File Materi'\n onclick=\"window.location.href='?module=materi&act=daftarmateri&id={$r['id_matapelajaran']}';\"></td></tr>";
$no++;
}
echo "</table>";
}
break;
case "daftarmateri":
if ($_SESSION[leveluser] == 'siswa') {
$p = new Paging();
$batas = 5;
$posisi = $p->cariPosisi($batas);
$mapel = mysql_query("SELECT * FROM mata_pelajaran WHERE id_matapelajaran = '{$_GET['id']}'");
$data_mapel = mysql_fetch_array($mapel);
$materi = mysql_query("SELECT * FROM file_materi WHERE id_matapelajaran = '{$_GET['id']}' LIMIT {$posisi},{$batas} ");
$cek_materi = mysql_num_rows($materi);
if (!empty($cek_materi)) {
echo "<br><b class='judul'>Daftar File Materi {$data_mapel['nama']} </b><br><p class='garisbawah'></p>";
echo "<table>";
$no = $posisi + 1;
while ($r = mysql_fetch_array($materi)) {
echo "<tr><td rowspan='5'>{$no}</td>";
if (!empty($r[nama_file])) {
$pecah = explode(".", $r[nama_file]);
$ekstensi = $pecah[1];
if ($ekstensi == 'zip') {
echo "<td rowspan='5'><img src='images/zip.png'></td>";