<?
$C=chr(34);
echo "<TITLE> بحث - Powered by VBZooM</TITLE>";

	?>
	<BODY background="image/body1.gif" leftMargin=0 RightMargin=0 topMargin=0 marginheight="0" marginwidth="0">

	<STYLE>
	BODY {SCROLLBAR-FACE-COLOR:#F3F3D6; SCROLLBAR-HIGHLIGHT-COLOR: #F3F3D6; SCROLLBAR-SHADOW-COLOR: #F3F3D6; SCROLLBAR-3DLIGHT-COLOR: #B59C5A; SCROLLBAR-ARROW-COLOR: RED; SCROLLBAR-TRACK-COLOR: #DDE09E; SCROLLBAR-DARKSHADOW-COLOR: #B59C5A}
	</STYLE>

	<STYLE>
	A {TEXT-DECORATION: NONE}
	A.chan:link {COLOR: Black}
	A.chan:hover {COLOR: #FF0080}

	.InputButton {FONT-SIZE: 12px; FONT-FAMILY: Ms sans serif,Verdana,Geneva,Helvetica}
	.Select {FONT-SIZE: 12px; FONT-FAMILY: Ms sans serif,Verdana,Geneva,Helvetica}
	</STYLE>
	<?

	// الاتصال بقاعدة البيانات
	include("admin/config.php");
	$Connect =mysql_connect($DBHostName,$DBUserName,$DBPassword);
	$Select =mysql_select_db($DBName,$Connect);


if ($REQUEST_METHOD=="POST" or $FindWord!="")
{

$TABLE= "<TABLE border=1 cellPadding=1 cellSpacing=1 BACKGROUND='image/body2.gif' bordercolor=#ffffff width=100%>";
$TD[1]="<TD ALIGN=Right BACKGROUND='image/body2.gif' width=15%><p Dir=Rtl>";
$TD[2]="<TD ALIGN=Right BACKGROUND='image/body2.gif' width=20%><p Dir=Rtl>";

$STD="</TD>";
$TR="<TR>";
$STABLE="</TABLE>";

if ($SearchIn==1) {$PageNo=50;}
if ($SearchIn==2) {$PageNo=10;}
if ($SearchIn==3) {$PageNo=2;}
if ($SearchIn==4) {$PageNo=50;}
if ($SearchIn==5) {$PageNo=50;}

	Echo $TABLE;

	Echo "<TD ALIGN=right BACKGROUND='image/body2.gif' width=10%><p Dir=Rtl>";
	Echo "<FONT face='Arial' SIZE=3 COLOR=#ff0000>";
	Echo "<b>Germany</b>";
	Echo "</TD>";

	Echo "<TD ALIGN=right BACKGROUND='image/body2.gif' width=10%><p Dir=Rtl>";
	Echo "<FONT face='Arial' SIZE=3 COLOR=#ff0000>";
	Echo "<b>English</b>";
	Echo "</TD>";

	Echo "<TD ALIGN=right BACKGROUND='image/body2.gif' width=15%><p Dir=Rtl>";
	Echo "<FONT face='Monotype Koufi, DecoType Naskh Variants, Andalus, Arial' SIZE=3 COLOR=#ff0000>";
	Echo "ابن كثير";
	Echo "</TD>";

	Echo "<TD ALIGN=right BACKGROUND='image/body2.gif' width=15%><p Dir=Rtl>";
	Echo "<FONT face='Monotype Koufi, DecoType Naskh Variants, Andalus, Arial' SIZE=3 COLOR=#ff0000>";
	Echo "الجلالين";
	Echo "</TD>";

	Echo "<TD ALIGN=right BACKGROUND='image/body2.gif' width=15%><p Dir=Rtl>";
	Echo "<FONT face='Monotype Koufi, DecoType Naskh Variants, Andalus, Arial' SIZE=3 COLOR=#ff0000>";
	Echo "القرآن الكريم";
	Echo "</TD>";

	Echo "<TD ALIGN=right BACKGROUND='image/body2.gif' width=15%><p Dir=Rtl>";
	Echo "<FONT face='Monotype Koufi, DecoType Naskh Variants, Andalus, Arial' SIZE=3 COLOR=#ff0000>";
	Echo "الصفحة";
	Echo "</TD>";

	Echo "<TD ALIGN=right BACKGROUND='image/body2.gif' width=15%><p Dir=Rtl>";
	Echo "<FONT face='Monotype Koufi, DecoType Naskh Variants, Andalus, Arial' SIZE=3 COLOR=#ff0000>";
	Echo "الآية";
	Echo "</TD>";

	Echo "<TD ALIGN=right BACKGROUND='image/body2.gif' width=20%><p Dir=Rtl>";
	Echo "<FONT face='Monotype Koufi, DecoType Naskh Variants, Andalus, Arial' SIZE=3 COLOR=#ff0000>";
	Echo "السورة";
	Echo "</TD>";

	Echo "<TD ALIGN=right BACKGROUND='image/body2.gif' width=15%><p Dir=Rtl>";
	Echo "<FONT face='Monotype Koufi, DecoType Naskh Variants, Andalus, Arial' SIZE=3 COLOR=#ff0000>";
	Echo "الجزءة";
	Echo "</TD>";

	if ($Page=="") {$Page=1;}
	$FromRecord=($Page-1)*$PageNo;

	if ($AloneWord==1) {$FindWord=" $FindWord ";}

	if ($SearchIn==1) {$Sql = "select * from quran where BINARY Verse Like'%$FindWord%' and SuraNo>=$FromSuraNo and SuraNo<=$ToSuraNo order by QuranID ASC LIMIT $FromRecord,$PageNo";}
	if ($SearchIn==2) {$Sql = "select * from quran where BINARY Meaning1 Like'%$FindWord%' and SuraNo>=$FromSuraNo and SuraNo<=$ToSuraNo order by QuranID ASC LIMIT $FromRecord,$PageNo";}
	if ($SearchIn==3) {$Sql = "select * from quran where BINARY Meaning2 Like'%$FindWord%' and SuraNo>=$FromSuraNo and SuraNo<=$ToSuraNo order by QuranID ASC LIMIT $FromRecord,$PageNo";}
	if ($SearchIn==4) {$Sql = "select * from quran where English Like'%$FindWord%' and SuraNo>=$FromSuraNo and SuraNo<=$ToSuraNo order by QuranID ASC LIMIT $FromRecord,$PageNo";}
	if ($SearchIn==5) {$Sql = "select * from quran where Germany Like'%$FindWord%' and SuraNo>=$FromSuraNo and SuraNo<=$ToSuraNo order by QuranID ASC LIMIT $FromRecord,$PageNo";}


	$Result = mysql_query($Sql);
	while ($Row = mysql_fetch_array($Result))
	{
	Echo $TR;
	$QuranID=$Row[$QuranID];

	Echo "<TD ALIGN=Right bgcolor=#fffffa width=5%><p Dir=Rtl>";
	Echo "<FONT face='Ms sans serif' SIZE=2 COLOR=#000000>";
	Echo "<a href='language.php?Action=4&ShowByQuranID=1&QuranID=$Row[QuranID]'><img src='image/c4.jpg' alt='الترجمة للألمانية' border=0></a>";
	Echo $STD;

	Echo "<TD ALIGN=Right bgcolor=#fffffa width=5%><p Dir=Rtl>";
	Echo "<FONT face='Ms sans serif' SIZE=2 COLOR=#000000>";
	Echo "<a href='language.php?Action=3&ShowByQuranID=1&QuranID=$Row[QuranID]'><img src='image/c4.jpg' alt='الترجمة للإنجليزية' border=0></a>";
	Echo $STD;

	Echo "<TD ALIGN=Right bgcolor=#fffffa width=15%><p Dir=Rtl>";
	Echo "<FONT face='Ms sans serif' SIZE=2 COLOR=#000000>";
	Echo "<a href='meaning.php?Action=2&ShowByQuranID=1&QuranID=$Row[QuranID]'><img src='image/c3.jpg' alt='تفسير ابن كثير' border=0></a>";
	Echo $STD;

	Echo "<TD ALIGN=Right bgcolor=#fffffa width=15%><p Dir=Rtl>";
	Echo "<FONT face='Ms sans serif' SIZE=2 COLOR=#000000>";
	Echo "<a href='meaning.php?Action=1&ShowByQuranID=1&QuranID=$Row[QuranID]'><img src='image/c2.jpg' alt='تفسير الجلالين' border=0></a>";
	Echo $STD;

	Echo "<TD ALIGN=Right bgcolor=#fffffa width=15%><p Dir=Rtl>";
	Echo "<FONT face='Ms sans serif' SIZE=2 COLOR=#000000>";
	Echo "<a href='quran.php?ShowByQuranID=1&QuranID=$Row[QuranID]'><img src='image/c1.jpg' alt='القرآن الكريم' border=0></a>";
	Echo $STD;

	Echo $TD[1];
	Echo "<FONT face='Ms sans serif' SIZE=2 COLOR=#000000>";
	Echo $Row[PageNo];
	Echo $STD;

	Echo $TD[1];
	Echo "<FONT face='Ms sans serif' SIZE=2 COLOR=#000000>";
	Echo $Row[VerseNo];
	Echo $STD;

	Echo $TD[2];
	Echo "<FONT face='Monotype Koufi, DecoType Naskh Variants, Andalus, Arial' SIZE=3 COLOR=#000000>";
	Echo $Row[SuraName];
	Echo $STD;

	Echo $TD[1];
	Echo "<FONT face='Ms sans serif' SIZE=2 COLOR=#000000>";
	Echo $Row[PartNo];
	Echo $STD;

	Echo $TR;

	if ($SearchIn==1) {$SearchText=$Row[Verse];}
	if ($SearchIn==2) {$SearchText=$Row[Meaning1];}
	if ($SearchIn==3) {$SearchText=$Row[Meaning2];}
	if ($SearchIn==4) {$SearchText=$Row[English];}
	if ($SearchIn==5) {$SearchText=$Row[Germany];}

	$SearchText = str_replace("$FindWord", "<font color=red>$FindWord</font>", $SearchText);

	if ($SearchIn==1 or $SearchIn==2 or $SearchIn==3)
	{
	Echo "<TD colspan=9 ALIGN=right background='image/body1.gif' width=100%><p Dir=Rtl>";
	}
	else
	{
	Echo "<TD colspan=9 ALIGN=left background='image/body1.gif' width=100%>";
	}
	

	Echo "<FONT face='DecoType Naskh Variants, Andalus, Arial' SIZE=5 COLOR=#000000>";
	Echo $SearchText;
	Echo "</TD>";

	}
	Echo $STABLE;



Echo "<BR>";

Echo "<TABLE align=center border=2 cellPadding=2 cellSpacing=2 BACKGROUND='image/body2.gif' bordercolor=#ffffff width=80%>";

// طباعة ارقام الصفحات 
if ($SearchIn==1) {$RowsNo=mysql_num_rows(mysql_query("select * from quran where BINARY Verse Like'%$FindWord%' and SuraNo>=$FromSuraNo and SuraNo<=$ToSuraNo"));}
if ($SearchIn==2) {$RowsNo=mysql_num_rows(mysql_query("select * from quran where BINARY Meaning1 Like'%$FindWord%' and SuraNo>=$FromSuraNo and SuraNo<=$ToSuraNo"));}
if ($SearchIn==3) {$RowsNo=mysql_num_rows(mysql_query("select * from quran where BINARY Meaning2 Like'%$FindWord%' and SuraNo>=$FromSuraNo and SuraNo<=$ToSuraNo"));}
if ($SearchIn==4) {$RowsNo=mysql_num_rows(mysql_query("select * from quran where English Like'%$FindWord%' and SuraNo>=$FromSuraNo and SuraNo<=$ToSuraNo"));}
if ($SearchIn==5) {$RowsNo=mysql_num_rows(mysql_query("select * from quran where Germany Like'%$FindWord%' and SuraNo>=$FromSuraNo and SuraNo<=$ToSuraNo"));}

$MaxPage=(Int) ((($RowsNo-1)/$PageNo)+1);
Echo "<P dir=rtl>";

Echo "<TD colspan=2 ALIGN=right BACKGROUND='image/body2.gif' width=100%><p Dir=Rtl>";
Echo "<FONT face='Monotype Koufi, DecoType Naskh Variants, Andalus, Arial' SIZE=3 COLOR=#000000>";
Echo "معلومات البحث";
Echo "</TD>";

Echo "<TR>";

Echo "<TD ALIGN=right BACKGROUND='image/body1.gif' width=60%><p Dir=Rtl>";
Echo "<FONT face='ms sans serif' SIZE=2 COLOR=#000000>";
Echo "$RowsNo";
Echo "</TD>";

Echo "<TD ALIGN=right BACKGROUND='image/body1.gif' width=60%><p Dir=Rtl>";
Echo "<FONT face='Monotype Koufi, DecoType Naskh Variants, Andalus, Arial' SIZE=3 COLOR=#000000>";
Echo "عدد الآيات";
Echo "</TD>";

Echo "<TR>";

Echo "<TD colspan=2 ALIGN=right BACKGROUND='image/body2.gif' width=100%><p Dir=Rtl>";
Echo "<FONT face='Monotype Koufi, DecoType Naskh Variants, Andalus, Arial' SIZE=3 COLOR=#000000>";
Echo "الصفحات";
Echo "</TD>";

Echo "<TR>";

Echo "<TD colspan=2 ALIGN=middle BACKGROUND='image/body1.gif' width=100%><p Dir=Rtl>";

	for ($i=1 ;$i<=$MaxPage ; $i++)
	{
		If ($i==$Page)
		{
		Echo "<FONT face='ms sans serif' size=2 color=#cfcfcf> | <FONT face='ms sans serif' size=2 color=red> $i ";
		}
		Else
		{
		Echo "<FONT face='ms sans serif' size=2 Color=#cfcfcf> | <a class=chan href='search.php?Page=$i&FindWord=$FindWord&FromSuraNo=$FromSuraNo&ToSuraNo=$ToSuraNo&SearchIn=$SearchIn'>$i</a>";
		}
	}

	Echo "<FONT face='ms sans serif' size=2 Color=#cfcfcf> | <BR></p>";


Echo "</TD>";
Echo "</TABLE>";


}
else
{
?>
<BODY background="image/body1.gif" leftMargin=0 RightMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<?

$FONT[1]="<FONT face='Monotype Koufi,Andalus' SIZE=3 COLOR=#000000>";


$TABLE= "<TABLE border=1 cellPadding=1 cellSpacing=1 BACKGROUND='image/body2.gif' bordercolor=#ffffff width=100%>";
$TD[1]="<TD ALIGN=Right width=80%><p Dir=Rtl>";
$TD[2]="<TD ALIGN=Middle width=20%><p Dir=Rtl>";
$STD="</TD>";
$TR="<TR>";
$STABLE="</TABLE>";

	Echo "<Form Name='Search' method='POST' action='search.php'>";
	Echo "<Input type='Hidden' Name='Page' Value='1'>";

	Echo $TABLE;

	Echo "<TD colspan=2 ALIGN=Middle width=80% height=$Height>";
	Echo $FONT[1];
	Echo "إبحث عن الكلمة أو الجملة";
	Echo $STD;

	Echo $TR;

	Echo $TD[1];
	Echo "<Input type='text' Name='FindWord' Size='40' maxlength=50 style='FONT-FAMILY: Fixedsys, Verdana, Arial'><BR>";
	Echo $STD;

	Echo $TD[2];
	Echo $FONT[1];
	Echo "إبحث عن";
	Echo $STD;

	Echo $TR;

	Echo $TD[1];
	Echo $FONT[1];
	Echo "<Input type='radio' Name='AloneWord' value='0' checked=true>  جزء من غيرها  &nbsp;&nbsp <Input type='radio' Name='AloneWord' value='1'> مستقلة <BR>";
	Echo $STD;

	Echo $TD[2];
	Echo $FONT[1];
	Echo "الكلمة المطلوبة";
	Echo $STD;

	Echo $TR;

	Echo $TD[1];

	Echo "<p dir=rtl><select name='FromSuraNo' Class=Select>";
	$Sql = "select * from sura where SuraNo>=1";
	$Result = mysql_query($Sql);
	while ($Row = mysql_fetch_array($Result))
	{
		if ($Row[SuraNo]==1)
		{
		Echo "<option selected value=$Row[SuraNo]>سورة $Row[SuraName]</option>";
		}
		else
		{
		Echo "<option value=$Row[SuraNo]>سورة $Row[SuraName]</option>";
		}
	}

	Echo $STD;
	Echo "</SELECT>";


	Echo $TD[2];
	Echo $FONT[1];
	Echo "إبدأ من السورة";
	Echo $STD;

	Echo $TR;

	Echo $TD[1];

	Echo "<p dir=rtl><select name='ToSuraNo' Class=Select>";
	$Sql = "select * from sura where SuraNo>=1";
	$Result = mysql_query($Sql);
	while ($Row = mysql_fetch_array($Result))
	{
		if ($Row[SuraNo]==114)
		{
		Echo "<option selected value=$Row[SuraNo]>سورة $Row[SuraName]</option>";
		}
		else
		{
		Echo "<option value=$Row[SuraNo]>سورة $Row[SuraName]</option>";
		}
	}

	Echo "</SELECT>";
	Echo $STD;

	Echo $TD[2];
	Echo $FONT[1];
	Echo "وانتهي إلى سورة";
	Echo $STD;

	Echo $TR;

	Echo $TD[1];
		Echo "<p dir=rtl><select name='SearchIn' Class=Select>";
		Echo "<option selected value='1'> القرآن الكريم </option>";
		Echo "<option value='2'> تفسير الجلالين </option>";
		Echo "<option value='3'> تفسير ابن كثير </option>";
		Echo "<option value='4'> الترجمة الإنجليزية </option>";
		Echo "<option value='5'> الترجمة الألمانية </option>";
	Echo "</SELECT>";


	Echo $STD;



	Echo $TD[2];
	Echo $FONT[1];
	Echo "البحث فى";
	Echo $STD;

	Echo "</Table>";

	?>
	<BR>
	<center>
	<Input type='submit' Value='ابدأ البحث' class=InputButton>
	</center>
	</Form>
	<?
}

echo "<br>";
Echo "<TABLE border=0 Cellpadding=0 cellSpacing=0 width=100%><TD Align=middle bgcolor=ffffff width=100%> <font face='arial' size=1 color=RED> HOLY-BOOK </font> <font face='arial' size=1> ! COPYRIGHT © 2003 BY KHALED MAMDOUH.All rights reserved. <BR> POWERED BY: VBZooM V1.02 <a href='http://www.vbzoom.com'> www.vbzoom.com </a> </font> </TD></TABLE>";

?>

