root/dev/common/admin/admin_move_pilot.php

Revision 361, 2.0 KB (checked in by beans, 14 years ago)

* Updated the admin panel. Should now be more "easy" to use.

Line 
1<?php
2require_once('common/includes/class.kill.php');
3require_once('common/includes/class.pilot.php');
4require_once('common/includes/class.corp.php');
5
6$dbconn = new DBConnection();
7$pilot = new Pilot($_GET['plt_id']);
8
9$page = new Page('Administration - Change Pilots Corp ('.$pilot->getName().')');
10$page->setAdmin();
11
12
13if (!$pilot->exists())
14{
15    $html = "That pilot doesn't exist.";
16    $page->generate($html);
17    exit;
18}
19
20if($_POST['confirm'])
21{
22        $sql = "UPDATE `kb3_pilots` SET `plt_crp_id` = '".$_POST['crp_id']."' WHERE `plt_id` =".$_POST['plt_id'];
23        $qry = new DBQuery();
24        $qry->execute($sql);
25        $html .= "Pilot Moved";
26}
27if($_REQUEST['crp'])
28{
29        $corp = new Corporation(intval($_GET['crp']));
30
31        $html .= "<form id=change method=post action=><table class=kb-subtable>";
32        $html .= "<tr><td><input name=crp_id type=hidden value=".$_GET['crp'].">";
33        $html .= "<input name=plt_id type=hidden value=".$_GET['plt_id'].">";
34        $html .= "Confirm move<b> ".$pilot->getName()."</b> to <b>".$corp->getName()."</b></td></tr>";
35        $html .= "<tr><td><input type=submit name=confirm value=\"Move\"></td></tr>";
36        $html .= "</table>";
37}
38
39if($_POST['search'])
40{
41        $sql = "SELECT * FROM `kb3_corps` WHERE crp_name LIKE '%".$_POST['search']."%'";
42        $qry = new DBQuery();
43        $qry->execute($sql);
44                                                                                //$html .= $sql ;
45        $html .= "<div class=block-header2>Results</div>";
46        $html .= "<table class=kb-subtable>";
47                while ($row = $qry->getRow())
48                {
49                $html .= "<tr><td><a href=\"?a=admin_move_pilot&plt_id=".$_GET['plt_id']."&crp=".$row['crp_id']."\">";
50                $html .= $row['crp_name']."<br/>";
51                $html .= "</td><tr>";
52                }
53        $html .= "</table>";
54
55}
56
57$html .= "<div class=block-header2>Search</div>";
58$html .= "<form id=options name=options method=post action=>";
59$html .= "<table class=kb-subtable>";
60$html .= "<tr><td>Seach for corp</td><td><input name=search id=serach type=text size=10 /></td></tr>";
61$html .= "<tr><td><input type=submit name=find value=\"Find\"></td><td></td></tr>";
62$html .= "</table>";
63
64$page->setContent($html);
65$page->generate();
66?>
Note: See TracBrowser for help on using the browser.