[190] | 1 | <?php |
---|
| 2 | require_once('common/includes/class.page.php'); |
---|
| 3 | require_once('common/includes/class.kill.php'); |
---|
| 4 | require_once('common/includes/class.pilot.php'); |
---|
| 5 | require_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 | |
---|
| 14 | if (!$pilot->exists()) |
---|
| 15 | { |
---|
| 16 | $html = "That pilot doesn't exist."; |
---|
| 17 | $page->generate($html); |
---|
| 18 | exit; |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | if($_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 | } |
---|
| 28 | if($_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 | |
---|
| 40 | if($_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 | ?> |
---|