Location: PHPKode > projects > News Manager - RSS aggregator > newsmanager/adv_tpl.php
<?php
/*******************************************************************************
 **  File          :  adv_tpl.php                                             **
 **  Author        :  G.Ramkumar                                              **
 **  Description   :  Advanced search form 							          **
 **  Date          :  14/09/2005                                              **
 **  Last Modified :  14/09/2005                                              **
 **  PHP Version   :  5.0.3                                                   **
 **                                                                           **
 *******************************************************************************/

 $dropcat_qry="select * from category where type='T' and language='$lang' order by category_name asc";
 $drop_res=$pg_sql->query_pass($dropcat_qry,"4");

// *** category
 $dropcat='<select name="category" class="advcont1"><option name="cat" value="All">'.$adv_any__;
 for($i=0;$i<count($drop_res);$i++)
 {
   if($_REQUEST['category'] == $drop_res[$i][category_id])
      $selected= "selected";
   else
      $selected="";
  $dropcat .='<option name="cat" value="'.$drop_res[$i][category_id].'"'. $selected.'>'.$drop_res[$i]['category_name'];

 }
 $dropcat .='</select>';

//**** Oldest date
 $datearr=array("$adv_one__"=>1,"$adv_week__"=>7,"$adv_month__"=>30," $adv_sixmon__"=>180);

 $dropolddate ='<select name="olddate" class="advcont1"><option value="">'.$adv_any__;
 foreach($datearr as $date => $value)
 {
   if($_REQUEST['olddate']== $value)
     $selected="selected";
   else
     $selected="";

   $dropolddate .='<option value="'.$value.'"'.  $selected.'>'.$date;
 }
 $dropolddate .="</select>";

// *** source
$sourcearr=array("Fodkem"=>Fodkem,"others"=>others);
$dropsource ='<select name="source" class="advcont1"><option value="">'.$adv_any__;
foreach($sourcearr as $source=>$val)
{
   if($_REQUEST['source']== $val)
     $selected="selected";
   else
     $selected="";

   $dropsource .='<option value="'.$val.'"'.  $selected.'>'.$source;

}
$dropsource ."</select>";

if($_REQUEST['words']=="any")
  $checked="checked";
if($_REQUEST['words']!="any")
  $static="checked";

if($_REQUEST['sort']=="")
  $static_="checked";

?>
 <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
      <tr>
          <td height="25" colspan="4" class="heading5"><?=$advsearch_?></td>
      </tr>
    <tr>
      <td valign="Top">
      <table width="100%" border="0" cellspacing="0" cellpadding="3">
	<form name="advancedsearch" action="search_results.php?lang=<?=$_REQUEST['lang']?>" method="post" onsubmit="return advfields();">

     <tr>
		<td class="advcont1"><?=$adv_title__?></td>
		<td class="advcont1"><input type="text" name="title" value='<?=str_replace("||","'",$_REQUEST[title])?>'>
		<td class="advcont1" valign="middle"><input type="radio" value="all" name="words" <?=$static?>></td><td class="advcont1" valign="middle"><?=$adv_allwords__?></td>
	</tr>
	<tr>
		<td class="advcont1"><?=$adv_keyword__?></td>
		<td class="advcont1"><input type="text" name="keyword" value="<?=$_REQUEST['keyword']?>">
		<td class="advcont1" valign="middle"><input type="radio" value="any" name="words" <?=$checked?>></td><td class="advcont1" valign="middle"><?=$adv_anywords__?></td>
	</tr>
	<tr>
	   <td class="advcont1"><?=$adv_pubdate__?></td>
	   <td class="advcont1" colspan="3" valign="top"><input type="text"  value="<?=$_REQUEST['pubdate']?>" name="pubdate" size="15" >&nbsp;<a href="javascript:show_calendar('document.advancedsearch.pubdate', document.advancedsearch.pubdate.value);"><img src="images/cal.jpg" alt="calendar" border=0></a></td>

	</tr>
	<tr>
		<td class="advcont1"><?=$adv_olddate__?></td>
		<td class="advcont1" colspan="3">
		  <!--select name="olddate" class="cont1">
		    <option name="olddate" value="">select oldest date
		    <option value="1">one day ago
		    <option value="7">one week ago
		    <option value="31">one month ago
		    <option value="180">six months ago
		  </select-->
		  <?=$dropolddate?>
		</td>
   </tr>
   <tr>
   	  <td class="advcont1"><?=$adv_themes__?></td>
      <td class="advcont1" colspan="3"><?=$dropcat?></td>

   </tr>

   <tr>
 	 <td class="advcont1"><?=$adv_sort__?></td>
 	 <?if($_REQUEST['sort']=='relevance')
 	    $selected1 ="checked";

 	 ?>
 	 <td class="advcont1" colspan="3" align="left"><input type="radio" name="sort" value="relevance" <?=$static?> <?=$selected1?>><?=$adv_relevance__?></td>
   </tr>
   <tr>
 	 <td class="advcont1">&nbsp;</td>
 	 <?if($_REQUEST['sort']=='pubdate')
	  	    $selected ="checked";

 	 ?>
 	 <td class="advcont1" colspan="3"><input type="radio" name="sort" value="pubdate" <?=$selected?>><?=$adv_sort_pub__?></td>
   </tr>
   <tr>
    <td colspan="1">&nbsp;</td>
 	 <td colspan="3" align="left">
 	 <input type="image" src="images/<?=$search_logo?>" alt="Search" name="submit" value="submit">
 	<a onclick="document.advancedsearch.reset();return false;"','href="#"><img alt="Reset" src="images/<?=$reset_logo?>" border="0"></a>
 	</td>

   </tr>

</table>
</td>
</tr>
</table>
Return current item: News Manager - RSS aggregator