Location: PHPKode > projects > Astanda Open Directory Project > adp-1.3b/admin/log.php
<?php
//-------------------------------------------------//
//                                                 //
//        ASTANDA DIRECTORY PROJECT  [ADP]         //
//                  Version 1.3b                   //
//               License: SHAREWARE                //
//             http://www.astanda.com              //
//      © Copyright 2005, 2006, Pavel Golovko      //
//                                                 //
//-------------------------------------------------//
//                                                 //
// Any attempt to remove or alter "Powered by ADP" //
// recip link will automatically wave your rights  //
// to any use of ADP software!                     //
//                                                 //
// Reverse engineering and redistribution of       //
// ADP code or any part of its code is strictly    //
// prohibited!                                     //
//                                                 //
//-------------------------------------------------//
//                                                 //
// ADP is distributed in the hope that it will be  //
// useful, but WITHOUT ANY WARRANTY; without even  //
// the implied warranty of MERCHANTABILITY or      //
// FITNESS FOR A PARTICULAR PURPOSE.               //
//                                                 //
//-------------------------------------------------//

menu($adp); switch ($action) { case "main": ?> This section of ADP is still under heavy construction<p> Please post all suggestions to the <a target="_blank" href="http://www.astanda.com/forums/index.php">forums</a>.<p> <? break; case "search": if(isset($_REQUEST['date'])){ $date = $_REQUEST['date']; $result = mysql_query("SELECT COUNT(`id`) FROM `search_log` WHERE `date` = '".$date."'"); echo mysql_error(); if(mysql_num_rows($result)){ while($row = mysql_fetch_array($result)){ $NumberOfResults = $row['0']; } } $NumberOfPages=ceil($NumberOfResults/cfg("admin_limit")); $Nav = ""; $Nav_l = ""; if($page > 1) { $Nav .= "<A HREF=\"index.php?adp=log&action=search&date=".$date."&page=".($page-1)."\"><b><<</b></A>"; } for($i = 1 ; $i <= $NumberOfPages ; $i++){ if($page > 5){ $Nav_l = $page - 5; } $Nav_h = $page + 5; if($i == $page){ $Nav .= " <B>$i</B> "; } elseif(($i > $Nav_l) && ($i < $Nav_h)){ $Nav .= " <A HREF=\"index.php?adp=log&action=search&date=".$date."&page=".$i."\">$i</A> "; } } if($page < $NumberOfPages){ $Nav .= "<A HREF=\"index.php?adp=log&action=search&date=".$date."&page=".($page+1)."\"><b>>></b></A>"; } $result = mysql_query("SELECT * FROM `search_log` WHERE `date` = '".$date."' LIMIT ".($page-1)*cfg("admin_limit").",".cfg("admin_limit").""); echo mysql_error(); if(mysql_num_rows($result)){ ?> Search log for <?=$date?><hr> <? while($row = mysql_fetch_array($result)){ print "<li>(".$row['matches'].") ".$row['text']; } ?> <hr><font size="1"><?=$Nav?></font> <? } } elseif(isset($_REQUEST['delete'])){ mysql_query("DELETE FROM `search_log` WHERE `date` = '".$_REQUEST['delete']."'"); echo mysql_error(); print "Deleted all search logs from: ".$_REQUEST['delete']; print "<p>"; } else{ $result = mysql_query("SELECT COUNT(`date`), `date` FROM `search_log` GROUP BY `date` ORDER BY `date` DESC"); echo mysql_error(); if(mysql_num_rows($result)){ ?><table border="0"><? while($row = mysql_fetch_array($result)){ print "<tr><td><font size=\"2\"><a href=\"index.php?adp=log&action=search&date=".$row['date']."\">".$row['date']."</a></td><td><font size=\"2\">(".$row['0'].")</td><td><a href=\"index.php?adp=log&action=search&delete=".$row['date']."\"><img border=\"0\" src=\"images/delete.png\"></a></td></tr>"; } ?></table><? } } break; }
?>
Return current item: Astanda Open Directory Project