本文整理匯總了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>";