include '../config.php';
if (isset($_REQUEST['subject'])) { $subject1 = $_REQUEST['subject']; } else if (isset($_POST['subject'])) { $subject1 = $_POST['subject']; }
$subject = trim(str_replace("-", " ", $subject1));
if (isset($_REQUEST['pano'])) { $pano = $_REQUEST['pano']; } else { $pano = 0; }
if (isset($_POST['subject'])) {
if ($subject != '') {
$update_qr = mysql_query("INSERT INTO ce_quotes_search (q_search) VALUES ('".$subject."') ON DUPLICATE KEY UPDATE s_cnt=s_cnt+1, modified=now()",$link);
}}
$pano_f = ($pano) * 20;
$s_rcnt=mysql_query("SELECT count(*) as rowcnt FROM ce_quotations where subject = '". $subject ."' or quotes like '%". $subject ."%'",$link);
$s_rcnt1=mysql_fetch_array($s_rcnt);
$rowcnt =$s_rcnt1['rowcnt'];
include '../header1.php' ?>
quotes
include 'quote_search.php'; ?>
if ($subject1 != '') {
if ($pano == 0) {
$s_bg=mysql_query("SELECT * FROM ce_quotations where subject = '". $subject ."' union SELECT * FROM ce_quotations where quotes like '%". $subject ."%' order by rand() limit 20",$link);
} else {
$s_bg=mysql_query("SELECT * FROM ce_quotations where subject = '". $subject ."' union SELECT * FROM ce_quotations where quotes like '%". $subject ."%' limit ".$pano_f.",20",$link);
}
} else {
$s_bg=mysql_query("SELECT * FROM ce_quotations order by rand() limit 20",$link);
}
while($s_bg1=mysql_fetch_array($s_bg))
{
$qid = $s_bg1['qid'];
$quotes = $s_bg1['quotes'];
$author = $s_bg1['author'];
$subject = $s_bg1['subject'];
$remarks = $s_bg1['remarks'];
if ($author != '' ) { $author = ' - '.$author; }
$cnt++;
?>
} ?>
if ($subject1 != '') { ?>
if ($pano-1 > 0) { ?>
} else { ?>
} ?>
if ($pano*20 < $rowcnt) { ?>
} else { ?>
} ?>
for ($qi=1; $qi<=($rowcnt/20)+1; $qi++) {
?>
} ?>
} else { ?>
Quotes on :
$s_sub=mysql_query("SELECT subject, count(*) as s_cnt FROM ce_quotations where subject <> '' group by subject order by subject ",$link);
while ( $s_sub1=mysql_fetch_array($s_sub))
{
$subject =$s_sub1['subject'];
$s_cnt =$s_sub1['s_cnt'];
if ($s_cnt > 40) {
?>
,
} } ?>
} ?>
include '../footer1.php'; ?>