Location: PHPKode > projects > Skills Evaluator - Free HR evaluation software > skills-evaluator_1.3/http/a_search_terms_.php
<?php include "config.php"; include "functions.php"; ?>

<!-- include core java - ajax functions file, here will be used to open in same page content edit and delete options -->
 <script src="functions.js" type="text/javascript"></script>


<!--div code to define area for ajax loading of content edit and delete pages -->
<div id="content_edit" style="position:absolute;

                           top:100;
                           left:60;
                           visibility:visible; 
						   background-color:#FF9933;
						   filter:alpha(opacity=100);
						   opacity: 1;
                           width:0; 
                           height:0px; 
                           layer-backgroundcolor:#FFFFCC; 
						   border:3px none #000000; 
                           z-index:2"></div>

<?php global $db_id;

include $template."/header.php";
echo "<link rel='stylesheet' type='text/css' href='".$template."/default.css'>"; 
 if (isset($_SESSION["user"][0]))
  if (($_SESSION["user"][5]>3)&&($_SESSION["user"][3]==md5(clean($_POST["pass"]))))
  {

 
 if(isset($_POST["set_order"])) $set_order=clean($_POST["set_order"]); else $set_order="id";
 
  if ($set_order=='id')  $set_order1='ID';
  if ($set_order=='term')  $set_order1='Term';
  if ($set_order=='date')  $set_order1='Date';
  if ($set_order=='results')  $set_order1='Results';
  
  $from_record=clean($_POST['from_record']);
  $record_numbers=clean($_POST['record_numbers']);

if($from_record=='') $from_record=0;
if($record_numbers=='') $record_numbers=100;
         
echo "<b>".$lang['Search_Terms']."</b><hr><br><form name='form1' method='post' action=''>Order By: <select name='set_order'>
  <option value='id'>id</option>
      <option value='".$set_order."' selected>".$set_order1."</option>
    <option value='term' >Term</option>
	<option value='date' >Date</option>
	<option value='results' >Results</option>
</select><br>Group by Term:<input type='checkbox' name='group_by' value='1' />
 <br>
 Show <input name='record_numbers' type='text' size='5' value=".$record_numbers." /> records starting from record <input name='from_record' type='text' size='5' value=".$from_record." /> 
 <br>Your Password: <input class='textbox' type='password' name='pass'>
<input type='submit' name='Submit' value='Go'></form><hr>";



if(clean($_POST["group_by"])==1){
 $query="SELECT id,fields,term,date,AVG(results),sef_name,COUNT(*) FROM search_terms  GROUP BY term ORDER BY ".$set_order." DESC LIMIT ".$from_record.",".$record_numbers;
 }else{
  $query="SELECT * FROM search_terms ORDER BY ".$set_order." DESC LIMIT ".$from_record.",".$record_numbers;
 }
 $result=mysql_query($query, $db_id); $nr=0;
 
 echo "Showing ".$record_numbers." records starting from record ".$from_record." <br><br><table width='100%' border='1'>";
 echo "<tr>
    <td nowrap='nowrap'>id</td>
    <td nowrap='nowrap'>Term</td>
	<td nowrap='nowrap'>Date</td>";
if(clean($_POST["group_by"])==1) echo "<td nowrap='nowrap'>Avg. Results</td><td nowrap='nowrap'>No of Searches</td>"; else  echo "<td nowrap='nowrap'>Results</td>";

 echo "</tr>";
 for (; $row=mysql_fetch_row($result); $nr++) {
 
echo "<tr>
    <td nowrap='nowrap'>".$row[0]."</td>
    <td nowrap='nowrap'><a target='blank' href='content_view.php?".$row[5]."&sw=search_view&search_id=".$row[0]."'>".$row[2]."</a></td>
	<td nowrap='nowrap'>".date("d/m/Y", $row[3])."</td>
	<td nowrap='nowrap'>".round($row[4])."</td>";
if(clean($_POST["group_by"])==1)  echo "<td nowrap='nowrap'>".$row[6]."</td>";
 echo " </tr>";
  }
  if ($nr==0) echo "No Terms found";
  echo"</table>";
  }
  else echo "<meta http-equiv='refresh' content='0;url=".customfc('a_panel.php')."'>";
 else system_mesages($lang['accessDenied'],'',1,1); 
?>
	  <?php include $template."/footer.php";
 ?>
</body>

</html>
Return current item: Skills Evaluator - Free HR evaluation software