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

Revision 207, 1.9 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
2
3/*
4* Export killmails, uses the searchroutine to find them.
5* Currently only supports users,
6* but will be made to support corps and alliances
7*/
8
9require_once('admin_menu.php');
10
11$page = new Page('Administration - Export searcher');
12$page->setAdmin();
13
14$html .= "<form id=search action=\"?a=admin_kill_export_search\" method=post>";
15$html .= "<table class=kb-subtable><tr>";
16$html .= "<td>Type:</td><td>Text: (3 letters minimum)</td>";
17$html .= "</tr><tr>";
18$html .= "<td><input id=searchphrase name=searchphrase type=text size=30/></td>";
19$html .= "<td><input type=submit name=submit value=Search></td>";
20$html .= "</tr></table>";
21$html .= "</form>";
22
23if ($_POST['searchphrase'] != "" && strlen($_POST['searchphrase']) >= 3)
24{
25    $sql = "select plt.plt_id, plt.plt_name, crp.crp_name
26                  from kb3_pilots plt, kb3_corps crp
27                 where lower( plt.plt_name ) like lower( '%".slashfix($_POST['searchphrase'])."%' )
28                   and plt.plt_crp_id = crp.crp_id
29                 order by plt.plt_name";
30    $header = "<td>Pilot</td><td>Corporation</td>";
31    $qry = new DBQuery();
32    if (!$qry->execute($sql))
33        die ($qry->getErrorMsg());
34
35    $html .= "<div class=block-header>Search results</div>";
36
37    if ($qry->recordCount() > 0)
38    {
39        $html .= "<table class=kb-table width=450 cellspacing=1>";
40        $html .= "<tr class=kb-table-header>".$header."</tr>";
41    }
42    else
43        $html .= "No results.";
44
45    while ($row = $qry->getRow())
46    {
47        $html .= "<tr class=kb-table-row-even>";
48        $html .= "<td><a href=\"?a=admin_kill_export_csv&plt_id=".$row['plt_id']."\">".$row['plt_name']."</a></td><td>".$row['crp_name']."</td>";
49        $html .= "</tr>";
50    }
51    if ($qry->recordCount() > 0)
52        $html .= "</table>";
53}
54
55$page->setContent($html);
56$page->addContext($menubox->generate());
57$page->generate();
58?>
Note: See TracBrowser for help on using the browser.