root/dev/common/admin/admin_move_pilot.php @ 190

Revision 190, 2.1 KB (checked in by exi, 16 years ago)

This is a big update...
Moved all admin scripts to common/admin.
Moved all includes and classes to common/includes.
Edited all include-paths to reflect the movement.
Fixed a bug with the session system allowing every registered user to access admin pages.
Replaced calls to date() to use a wrapper so gmdate can be used.
Replaced some calls to $config with calls to the static object.
Fixed a big which caused the portrait_grab to not download a new picute.
Added a classified-state to kills.
Removed the sync_server server script in this tree.
Added code to help modules find the includes to index.php.

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