@header('Content-Type: text/html; charset=windows-1256');
@ob_start("ob_gzhandler");
include_once "inc/conn.php";
include_once "inc/functions.php";
?>
$targetpage = "hadith_txt.php"; //your file name (the name of this file)
$limit =20; //how many items to show per page
$page = $_GET['page'];
if($page)
$start = ($page - 1) * $limit; //first item to display on this page
else
$start = 0;
$adjacents = 3;
$book_num=mysql_query("select count(*) as CC from main");
$booknum_fetch=mysql_fetch_array($book_num);
$total_pages=$booknum_fetch['CC'];
if($bookid)
{
$bookContent = mysql_query("select hadith.id,hadith.hadith_txt,hadith.num,hadith.part,hadith.pag,hadith.bkno,bk.bkname from main hadith,bkinfo bk where hadith.bkno='$bookid' and bk.bkno=hadith.bkno limit $start,$limit");
//$total_pages=mysql_num_rows($bookContent);
while($row4 = mysql_fetch_array($bookContent))
{
$hadith_txt = $row4[hadith_txt];
$id=$row4[id];
$BookName=$row4[bkname];
$hadithnum=$row4[num];
$part=$row4[part];
$hadithpage=$row4[pag];
echo "
$hadith_txt |
النص الكامل |
كتاب :$BookName حديث رقم : $hadithnum جزء : $part صفحة : $hadithpage |
";
}
}
else
{
$bookContent = mysql_query("select hadith.id,hadith.hadith_txt,hadith.num,hadith.part,hadith.pag,hadith.bkno,bk.bkname from main hadith,bkinfo bk where bk.bkno=hadith.bkno limit $start,$limit");
//$total_pages=mysql_num_rows($bookContent);
while($row4 = mysql_fetch_array($bookContent))
{
$hadith_txt = $row4[hadith_txt];
$id=$row4[id];
$BookName=$row4[bkname];
$hadithnum=$row4[num];
$part=$row4[part];
$hadithpage=$row4[pag];
echo "
$hadith_txt |
النص الكامل |
كتاب :$BookName حديث رقم : $hadithnum جزء : $part صفحة : $hadithpage |
";
}
}
// echo $page;
if($bookid)
$param="&bookid=$bookid";
else
$param="";
echo $pagination=Paging($adjacents,$total_pages,$targetpage,$limit,$start,$page,$param);
?>