001.
<div style=
" float: right; margin-right: 55px;"
>
002.
003.
<form name=
"frmSearch"
method=
"post"
action=
"<?=$_SERVER['SCRIPT_NAME'];?>"
>
004.
Search
for
Publications
005.
<select name=
"ddlCountryCode"
id=
"ddlCountryCode"
>
006.
<option value=
"category"
selected>Category</option>
007.
<option value=
"date"
>
Date
</option>
008.
<option value=
"title"
>Title</option>
009.
</select>
010.
011.
<input name=
"txtKeyword"
type=
"text"
id=
"txtKeyword"
value=
"<?=$_POST["
txtKeyword
"];?>"
>
012.
<input type=
"submit"
value=
"Search"
></th>
013.
014.
</form>
015.
016.
<?
017.
if
(
$_POST
[
"txtKeyword"
] !=
""
)
018.
{
019.
020.
021.
$strSQL
=
"SELECT * FROM insight WHERE (incat LIKE '%"
.
$_POST
[
"txtKeyword"
].
"%' or intitle LIKE '%"
.
$_POST
[
"txtKeyword"
].
"%')"
;
022.
$objQuery
= mysql_query(
$strSQL
)
or
die
(
"Error Query ["
.
$strSQL
.
"]"
);
023.
$Num_Rows
= mysql_num_rows(
$objQuery
);
024.
025.
026.
$Per_Page
= 2;
027.
028.
$Page
=
$_GET
[
"Page"
];
029.
if
(!
$_GET
[
"Page"
])
030.
{
031.
$Page
=1;
032.
}
033.
034.
$Prev_Page
=
$Page
-1;
035.
$Next_Page
=
$Page
+1;
036.
037.
$Page_Start
= ((
$Per_Page
*
$Page
)-
$Per_Page
);
038.
if
(
$Num_Rows
<=
$Per_Page
)
039.
{
040.
$Num_Pages
=1;
041.
}
042.
else
if
((
$Num_Rows
%
$Per_Page
)==0)
043.
{
044.
$Num_Pages
=(
$Num_Rows
/
$Per_Page
) ;
045.
}
046.
else
047.
{
048.
$Num_Pages
=(
$Num_Rows
/
$Per_Page
)+1;
049.
$Num_Pages
= (int)
$Num_Pages
;
050.
}
051.
052.
053.
$strSQL
.=
" order by inid ASC LIMIT $Page_Start , $Per_Page"
;
054.
$objQuery
= mysql_query(
$strSQL
);
055.
056.
?>
057.
<br /><br />
058.
<?
059.
while
(
$objResult
= mysql_fetch_array(
$objQuery
))
060.
{
061.
062.
$fdname
=
$objResult
[
"incat"
];
063.
$fddatebook
=
$objResult
[
"indate"
];
064.
$fdtitle
=
$objResult
[
"intitle"
];
065.
$fdlink
=
$objResult
[
"inlink"
];
066.
$fddescription
=
$objResult
[
"indetail"
];
067.
$fdfilesname
=
$objResult
[
"filesname"
];
068.
?>
069.
<table border=
"0"
width=
"650px;"
cellspacing=
"1"
cellpadding=
"1"
align=
"top"
>
070.
071.
<tr>
072.
<td width=
"60"
rowspan=
"4"
><?
echo
"<a href=\"$fdlink\" target=\"_blank\"><img src=\"insight/$fdfilesname\" width=\"60px;\" height=\"90px;\" border=\"1\" align=\"top\"
></a></div></td>
073.
<td width=\
"361\"
></td></tr>
074.
<tr><td > </td></tr>
075.
<tr><td ></td></tr>
076.
<tr><td><span style=\
" font-weight: bold; \">$fdname </span> <br /><span>$fddatebook</span> <br /><span class=\"insighttext\" style=\" font-weight: bold; font-style: italic;\"><a href=\"$fdlink\" target=\"_blank\"
>
$fdtitle
</a></span></td></tr>
077.
<tr><td></td>
078.
<td><span style=\
"margin: 0px; padding: 0px;\">$fddescription</span></td></tr><br /><br />"
; ?>
079.
080.
081.
<?
082.
}
083.
?>
084.
</table>
085.
<br>
086.
Total <?=
$Num_Rows
;?> Record : <?=
$Num_Pages
;?> Page :
087.
<?
088.
if
(
$Prev_Page
)
089.
{
090.
echo
" <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page&txtKeyword=$_GET[txtKeyword]'><< Back</a> "
;
091.
}
092.
093.
for
(
$i
=1;
$i
<=
$Num_Pages
;
$i
++){
094.
if
(
$i
!=
$Page
)
095.
{
096.
echo
"[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i&txtKeyword=$_GET[txtKeyword]'>$i</a> ]"
;
097.
}
098.
else
099.
{
100.
echo
"<b> $i </b>"
;
101.
}
102.
}
103.
if
(
$Page
!=
$Num_Pages
)
104.
{
105.
echo
" <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page&txtKeyword=$_GET[txtKeyword]'>Next>></a> "
;
106.
}
107.
108.
}
109.
?>
110.
111.
112.
113.
</div>