<?php
// +------------------------------------------------------------------------+
// | PHP Melody version 1.6.7 ( www.phpsugar.com )
// +------------------------------------------------------------------------+
// | PHP Melody IS NOT FREE SOFTWARE
// | If you have downloaded this software from a website other
// | than www.phpsugar.com or if you have received
// | this software from someone who is not a representative of
// | phpSugar, you are involved in an illegal activity.
// | ---
// | In such case, please contact: support@phpsugar.com.
// +------------------------------------------------------------------------+
// | Developed by: phpSugar (www.phpsugar.com) / support@phpsugar.com
// | Copyright: (c) 2004-2011 PhpSugar.com. All rights reserved.
// +------------------------------------------------------------------------+

$showm = '7';
include('header.php');

$action = (int) $_GET['a'];
if($action == 1) 
{ 
	// REMOVE VIDEO, COMMENTS, RATINGS AND REPORTS
	mysql_query("TRUNCATE TABLE pm_searches");
	$info_msg = '<div class="info_msg_ok">All the search queries have been deleted.</div>';
}
?>
<div id="sub_menu">
<li><a href="show_searches.php">Top searches</a></li>
</div>
<div id="content">
<h2>Search queries</h2>

<?php echo $info_msg; ?>
<table width="100%" border="0" cellspacing="1" cellpadding="3">
  <tr>
    <td><img src="images/remove.png" alt="delete" width="16" height="16" align="top" /> <a href="#" class="b_delete" onClick="del_all_searches()">Clear history</a></td>
    <td width="220" valign="top"><div class="totals">Total searches: <?php echo count_entries('pm_searches', '', ''); ?></div></td>
  </tr>
</table>
<table class="tablesorter" cellspacing="1">
 <thead>
  <tr> 
    <th width="20">Rank</th>
    <th>Search keywords</th>
    <th width="10%">Queries</th>
  </tr>
 </thead>
 <tbody>
	<?php echo a_list_searches('50'); ?>
 </tbody>
</table>
</div>
<?php
include('footer.php');
?>