root/dev/common/admin/admin_comments_delete.php @ 207

Revision 207, 1.3 KB (checked in by ralle030583, 15 years ago)

- added system search
- added 12 new ship Signatures (thx to Arthur Ffrub)
- removed again some not needed includes

Line 
1<?php
2require_once('common/includes/class.kill.php');
3
4$page = new Page("Administration - Deletion of Comment ID \"".$_GET['c_id']."\"");
5$page->setAdmin();
6
7if ($_GET['confirm'])
8{
9    $qry = new DBQuery();
10    $qry->execute("delete from kb3_comments where id='".$_GET['c_id']."'");
11    $html .= "Comment ID \"".$_GET['c_id']."\" deleted!";
12    $html .= "<br><br><a href=\"javascript:window.close();\">[close]</a>";
13}
14else
15{
16    $html .= "Confirm deletion of Comment ID \"".$_GET['c_id']."\": ";
17    $qry = new DBQuery();
18    $qry->execute("SELECT id, name, comment FROM kb3_comments WHERE `id`='".$_GET['c_id']."'");
19    if ($qry->recordCount() == 0)
20    {
21        // no commment
22        $html .= "Error: comment does not exist<br>\n";
23    }
24    else
25    {
26        while ($data = $qry->getRow())
27        {
28            $name = $data['name'];
29            $comment = $data['comment'];
30            $html .= "<div class=\"comment-text\"><a href=\"?a=search&searchtype=pilot&searchphrase=".$name."\">".$name."</a>:<p>".$comment."</p>";
31            $html .= "</div><br/>";
32        }
33        $html .= "<button onClick=\"window.location.href='?a=admin_comments_delete&confirm=yes&c_id=" . $_GET['c_id'] . "'\">Yes</button> ";
34        $html .= "<button onClick=\"window.close();\">No</button>";
35    }
36}
37$page->setContent($html);
38$page->generate();
39?>
Note: See TracBrowser for help on using the browser.