";
if ($dispbooks!="N")
{
print "";
}
else
{
print " | ";
}
print " ";
include("../scripts/leftbar2024.php");
include("../scripts/sidebar2024.php");
print " ";
print "";
include("../scripts/leftbar2024.php");
include("../scripts/sidebar2024.php");
print " ";
print "";
include("../scripts/leftbar2024.php");
include("../scripts/sidebar2024.php");
print " ";
if ($dispbooks=="N")
{
print "";
include("../scripts/leftbar2024.php");
print " ";
print "";
include("../scripts/leftbar2024.php");
print " ";
}
print " | ";
print "";
$filterstrg="";
if ($inimp!="" and isset($inimp))
{
$filterstrg=" pr_imprint='$inimp'";
}
if ($dispbooks!="N")
{
// first off calculate the total number in the category/author etc
$notitles="0";
$totcnt=0;
// check the file to get total number to include based on exclusion rules
$result=mysqli_query($linkns, "SELECT pr_code FROM 00productmeta WHERE (pr_status='A' and pr_f4ok='Y' and (pr_genre1='$cat' OR pr_genre2='$cat' OR pr_genre3='$cat' OR pr_genre4='$cat' OR pr_genre5='$cat')) ORDER by pr_recno DESC");
$numrows = mysqli_num_rows($result);
if ($numrows!=0) { $notitles="1"; }
$endsh=(intval($numrows/20)*20)+1;
if (!isset($sh) or $sh==""){$sh=1;}
$shlast=$sh+19;
if ($shlast>$numrows){$shlast=$numrows;}
$pfcnt=0;
$swcnt=1;
print "";
print " ";
print " ";
// display the header first
print "";
print " ";
print " ";
if ($notitles=="0")
{
$resultgr=mysqli_query($linkns, "SELECT * FROM 00genres where gr_code='$cat' ");
while($rowgr = mysqli_fetch_row($resultgr))
{
print "$rowgr[2]";
}
print "No titles were found in this category.";
}
else
{
// enter a little table for the header section!
print " ";
print " ";
print " ";
print " ";
print " | ";
print "";
print "";
print " ";
print " ";
$resultgr=mysqli_query($linkns, "SELECT * FROM 00genres where gr_code='$cat' ");
while($rowgr = mysqli_fetch_row($resultgr))
{
print "$rowgr[2]";
if ($rowgr[3]!="" and $rowgr[3]!=" ")
{
print " - $rowgr[3]";
}
print "Click cover for book page and excerpt";
}
print "";
print " | ";
print " ";
if ($numrows>20)
{
print "";
print " ";
print " | ";
// based on the current page number
$curpage=(intval($sh/20))+1;
$starpage=(intval($curpage/10)*10)+1;
$finpage=(intval($numrows/20))+1;
$endpage=(intval($finpage/10)*10)+1;
$preendpage=$endpage-10;
if ($preendpage<1) {$preendpage=1; }
if ($curpage>20)
{
print "";
print " ";
print "";
print " | ";
}
else
{
print "";
print " | ";
}
if ($curpage>10)
{
$backcnt=$starpage-10;
$backcnt=$backcnt*20-19;
print "";
print " ";
print "";
print " | ";
}
else
{
print "";
print " | ";
}
print "";
print " ";
print "PAGE: ";
// now display 10 pages from the starpage count
$cnt=0;
$page=$starpage;
while ($cnt<10 and $page<$finpage)
{
$page=$starpage+$cnt;
$startcnt=$page*20;
$startcnt=$startcnt-19;
if ($startcnt!=$sh)
{
print " $page ";
}
else
{
print " $page ";
}
$cnt++;
}
print " | ";
if ($curpage<$endpage)
{
$nextcnt=$starpage+10;
$nextcnt=($nextcnt*20)-19;
$fincnt=$finpage*20-19;
if ($nextcnt>$fincnt) {$nextcnt=$endpage*20-19;}
print "";
print " ";
print "";
print " | ";
}
else
{
print "";
print " | ";
}
if ($curpage<$preendpage)
{
$fincnt=$finpage*20-19;
print "";
print " ";
print "";
print " | ";
}
else
{
print "";
print " | ";
}
print " | ";
print " ";
} // if numrows>20
print " ";
print " | ";
print " ";
}
print "";
print " ";
// now process the products file for category/author etc
$pdbflg="Y";
$cnt=0;
$numcells=1;
if ($catseq=="A") // alphabetical by title
{
$resultp=mysqli_query($linkns, "SELECT pr_code FROM 00productmeta WHERE (pr_status='A' and pr_f4ok='Y' AND (pr_genre1='$cat' OR pr_genre2='$cat' OR pr_genre3='$cat' OR pr_genre4='$cat' OR pr_genre5='$cat')) ORDER by pr_f4gold DESC, pr_titlelc");
} // end of list by latest addition first
if ($catseq=="R") // Date added - most recent titles first
{
$resultp=mysqli_query($linkns, "SELECT pr_code FROM 00productmeta WHERE (pr_status='A' and pr_f4ok='Y' AND (pr_genre1='$cat' OR pr_genre2='$cat' OR pr_genre3='$cat' OR pr_genre4='$cat' OR pr_genre5='$cat')) ORDER by pr_f4gold DESC, pr_recno DESC");
} // end of date added
if ($catseq=="D") // best-selling this year
{
$resultp=mysqli_query($linkns, "SELECT pr_code FROM 00productmeta WHERE (pr_status='A' and pr_f4ok='Y' AND (pr_genre1='$cat' OR pr_genre2='$cat' OR pr_genre3='$cat' OR pr_genre4='$cat' OR pr_genre5='$cat')) ORDER by pr_f4gold DESC, pr_totyrsold DESC");
} // end of best-selling this year
if ($catseq=="E") // best-selling all time
{
$resultp=mysqli_query($linkns, "SELECT pr_code FROM 00productmeta WHERE (pr_status='A' and pr_f4ok='Y' AND (pr_genre1='$cat' OR pr_genre2='$cat' OR pr_genre3='$cat' OR pr_genre4='$cat' OR pr_genre5='$cat')) ORDER by pr_f4gold DESC, pr_totnosold DESC");
} // end of best-selling all time
if ($catseq=="L") // word count low high
{
$resultp=mysqli_query($linkns, "SELECT pr_code FROM 00productmeta WHERE (pr_status='A' and pr_f4ok='Y' AND (pr_genre1='$cat' OR pr_genre2='$cat' OR pr_genre3='$cat' OR pr_genre4='$cat' OR pr_genre5='$cat')) ORDER by pr_f4gold DESC, pr_words");
} // end of word count - low high
if ($catseq=="M") // word count high low
{
$resultp=mysqli_query($linkns, "SELECT pr_code FROM 00productmeta WHERE (pr_status='A' and pr_f4ok='Y' AND (pr_genre1='$cat' OR pr_genre2='$cat' OR pr_genre3='$cat' OR pr_genre4='$cat' OR pr_genre5='$cat')) ORDER by pr_f4gold DESC, pr_words DESC");
} // end of word count - high low
if ($catseq=="P") // list price low high
{
$resultp=mysqli_query($linkns, "SELECT pr_code FROM 00productmeta WHERE (pr_status='A' and pr_f4ok='Y' AND (pr_genre1='$cat' OR pr_genre2='$cat' OR pr_genre3='$cat' OR pr_genre4='$cat' OR pr_genre5='$cat')) ORDER by pr_f4gold DESC, pr_pubprice");
} // end of price - low high
if ($catseq=="Q") // list price high low
{
$resultp=mysqli_query($linkns, "SELECT pr_code FROM 00productmeta WHERE (pr_status='A' and pr_f4ok='Y' AND (pr_genre1='$cat' OR pr_genre2='$cat' OR pr_genre3='$cat' OR pr_genre4='$cat' OR pr_genre5='$cat')) ORDER by pr_f4gold DESC, pr_pubprice DESC");
} // end of price - high low
while($rowp = mysqli_fetch_row($resultp) )
{
$pfcnt++;
if ($pfcnt>=$sh and $pfcnt<=$shlast)
{
$pr=$rowp[0];
include("../scripts/bookprocmeta.php");
include("../scripts/booklayout2022.php");
print " ";
}
}
print " ";
if ($notitles!="0")
{
// display the header first
print "";
print " ";
print " ";
if ($notitles=="0")
{
$resultgr=mysqli_query($linkns, "SELECT * FROM 00genres where gr_code='$cat' ");
while($rowgr = mysqli_fetch_row($resultgr))
{
print " $rowgr[2] ";
}
print "No titles were found in this category. Please try again soon.";
}
// enter a little table for the header section!
print " ";
print " ";
print " ";
print " ";
print " | ";
print "";
print "";
print " ";
print " ";
$resultgr=mysqli_query($linkns, "SELECT * FROM 00genres where gr_code='$cat' ");
while($rowgr = mysqli_fetch_row($resultgr))
{
print "$rowgr[2]";
if ($rowgr[3]!="" and $rowgr[3]!=" ")
{
print " - $rowgr[3]";
}
}
print "";
print " | ";
print " ";
if ($numrows>20)
{
print "";
print " ";
print " | ";
// based on the current page number
$curpage=(intval($sh/20))+1;
$starpage=(intval($curpage/10)*10)+1;
$finpage=(intval($numrows/20))+1;
$endpage=(intval($finpage/10)*10)+1;
$preendpage=$endpage-10;
if ($preendpage<1) {$preendpage=1; }
if ($curpage>20)
{
print "";
print " ";
print "";
print " | ";
}
else
{
print "";
print " | ";
}
if ($curpage>10)
{
$backcnt=$starpage-10;
$backcnt=$backcnt*20-19;
print "";
print " ";
print "";
print " | ";
}
else
{
print "";
print " | ";
}
print "";
print " ";
print "PAGE: ";
// now display 10 pages from the starpage count
$cnt=0;
$page=$starpage;
while ($cnt<10 and $page<$finpage)
{
$page=$starpage+$cnt;
$startcnt=$page*20;
$startcnt=$startcnt-19;
if ($startcnt!=$sh)
{
print " $page ";
}
else
{
print " $page ";
}
$cnt++;
}
print " | ";
if ($curpage<$endpage)
{
$nextcnt=$starpage+10;
$nextcnt=($nextcnt*20)-19;
$fincnt=$finpage*20-19;
if ($nextcnt>$fincnt) {$nextcnt=$endpage*20-19;}
print "";
print " ";
print "";
print " | ";
}
else
{
print "";
print " | ";
}
if ($curpage<$preendpage)
{
$fincnt=$finpage*20-19;
print "";
print " ";
print "";
print " | ";
}
else
{
print "";
print " | ";
}
print " | ";
print " ";
} // if numrows>20
print " ";
print " | ";
print " ";
}
print " | ";
print " ";
}
print " | ";
include("../scripts/bottombar2024.php");
?>
| |