website/parts/news_search.inc

66 lines
1.3 KiB
PHP
Raw Permalink Normal View History

<?php
// local vars
$string = $_GET['string'];
$month = $_GET['month'];
$year = $_GET['year'];
function monthForm ($month, $year)
{
need ('feature');
// suppress warnings
@featureOpen ('Date Search');
?>
<FORM name="bymonth" method="get" action="<?=thisURL?>">
<P align="center">
<SELECT name="month">
<?php
for ( $i = 1 ; $i < 13 ; $i++ ) {
printf ("<OPTION%s>%02d</OPTION>", $i == $month ? " selected" : "", $i);
}
?>
</SELECT><STRONG> / </STRONG><SELECT name="year">
<?php
if ($year == "")
$year = date ('Y');
for ($i = 2000; $i <= date ('Y'); $i++ ) {
if ($i == 2005 || $i == 2006)
continue;
printf ("<OPTION%s>%04d</OPTION>", $i == $year ? " selected" : "", $i);
}
?>
</SELECT>
<BR>
<BR>
<INPUT type="submit" value="Search">
</P>
</FORM><?php
featureClose ();
}
function keywordForm ($string)
{
need ('feature');
// suppress warnings
@featureOpen ('Keyword Search');
?>
<FORM name="bystring" method="get" action="<?=thisURL?>">
<P align="center">
<?php
printf ('<INPUT name="string" type="text" size="16" value="%s">', $string);
?>
<BR>
<BR>
<INPUT TYPE="submit" VALUE="Search">
</P>
</FORM><?php
featureClose ();
}
monthForm ($month, $year);
keywordForm ($string);
?>