Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $locationmxy ="25";
- $locationmxx ="25";
- include "globals.php";
- $tresder=(int) rand(100,999);
- if($ir['jail'] or $ir['hospital']) {
- echo "This page cannot be accessed while in jail or hospital.";
- $h->endpage();
- exit;
- }
- $locationx = $ir['locationx'];
- $locationy = $ir['locationy'];
- $moves = $ir['moves'];
- $action = isset($_GET['action']) ? $_GET['action'] : '';
- $actions = [
- 'moven' => 'do_move1_north',
- 'movenw' => 'do_move1_northwest',
- 'movene' => 'do_move1_northeast',
- 'movew' => 'do_move1_west',
- 'movee' => 'do_move1_east',
- 'moves' => 'do_move1_south',
- 'movesw' => 'do_move1_southwest',
- 'movese' => 'do_move1_southeast',
- 'search1' => 'do_search1_ad',
- 'search2' => 'do_search2_ad',
- 'staff' => 'do_staff',
- 'stafftowncreate' => 'staff_town_create',
- 'stafftowncreatedo' => 'staff_town_create_do',
- 'stafftownedit' => 'staff_town_edit',
- 'stafftowneditdo' => 'staff_town_edit_do',
- 'stafftowneditcom' => 'staff_town_edit_com',
- 'stafftowndelete' => 'staff_town_delete',
- 'stafftowndeletedo' => 'staff_town_delete_do',
- 'staffcreate' => 'staff_create',
- 'staffcreatedo' => 'staff_create_do',
- 'staffedit' => 'staff_edit',
- 'staffeditdo' => 'staff_edit_do',
- 'staffeditcom' => 'staff_edit_com',
- 'staffdelete' => 'staff_delete',
- 'staffdeletedo' => 'staff_delete_do',
- 'staffmoveuser' => 'staff_move_user',
- 'staffmoveuserdo' => 'staff_move_user_do',
- 'staffmoveusercom' => 'staff_move_user_com',
- ];
- if (array_key_exists($action, $actions)) {
- $function = $actions[$action];
- if (function_exists($function)) {
- call_user_func($function);
- }
- }
- default: echo "<br /><hr /><h3>The Maps</h3>";
- if($ir['user_level'] == 2)
- {
- echo "<a href=move.php?action=staff>Staff Options</a><br />";
- }
- echo "
- <small>Being a donator you are 2x more likely to find money and gold while searching the map.</small><br />
- <small>Please Note that most images are only temporary until system is completed</small>
- <table width='95%'>
- <tr><td></td>
- <td align='center'>
- </td><tr>
- <tr><td align='center' valign='top' width='100'><hr />";
- $northstop = ($locationy == 0) ? "<img src='/images/no.png' width='44' height='44'>" : "<a href='move.php?action=moven'><img src='/images/up.png'></a>";
- $northstopwest = ($locationy == 0) ? "<img src='/images/no.png' width='42' height='42'>" : "<a href='move.php?action=movenw'><img src='/images/nw.png'></a>";
- $northstopeast = ($locationy == 0) ? "<img src='/images/no.png' width='42' height='42'>" : "<a href='move.php?action=movene'><img src='/images/ne.png'></a>";
- $eaststop = ($locationy == $locationmxy) ? "<img src='/images/no.png' width='44' height='44'>" : "<a href='move.php?action=movee'><img src='/images/right.png'></a>";
- $southstop = ($locationx == $locationmxx) ? "<img src='/images/no.png' width='44' height='44'>" : "<a href='move.php?action=moves'><img src='/images/down.png'></a>";
- $southstopwest = ($locationx == 0) ? "<img src='/images/no.png' width='42' height='42'>" : "<a href='move.php?action=movesw'><img src='/images/sw.png'></a>";
- $southstopeast = ($locationx == 0) ? "<img src='/images/no.png' width='42' height='42'>" : "<a href='move.php?action=movese'><img src='/images/se.png'></a>";
- $weststop = ($locationx == 0) ? "<img src='/images/no.png' width='44' height='44'>" : "<a href='move.php?action=movew'><img src='/images/left.png'></a>";
- if ($moves <= 0) {
- echo "No Moves, Nav Disabled";
- } else {
- echo "
- Your Map Location: <font color='blue' size='3'>
- <font color='green'>" . $locationx . "</font>,
- <font color='red'>" . $locationy . "</font><br />
- You have <font color='yellow'>" . $moves . "</font> left.</font><hr />
- <table>
- <tr>
- <td><font color='red'><b>N</b></font><font color='green'><b>W</b></font></td>
- <td></td>
- <td align='center'><font color='red'><b>N</b></font></td>
- <td></td>
- <td><font color='red'><b>N</b></font><font color='green'><b>E</b></font></td>
- </tr>
- <tr>
- <td></td>
- <td align='center'>" . $northstopwest . "</td>
- <td align='center'>" . $northstop . "</td>
- <td align='center'>" . $northstopeast . "</td>
- <td></td>
- </tr>
- <tr>
- <td><font color='green'><b>W</b></font></td>
- <td align='center'>" . $weststop . "</td>
- <td align='center'><b>+</b></td>
- <td align='center'>" . $eaststop . "</a></td>
- <td><font color='green'><b>E</b></font></td>
- </tr>
- <tr>
- <td></td>
- <td align='center'>" . $southstopwest . "</td>
- <td align='center'>" . $southstop . "</td>
- <td align='center'>" . $southstopeast . "</td>
- <td></td>
- </tr>
- <tr>
- <td><font color='red'><b>S</b></font><font color='green'><b>W</b></font></td>
- <td></td>
- <td align='center'><font color='red'><b>S</b></font></td>
- <td></td>
- <td><font color='red'><b>S</b></font><font color='green'><b>E</b></font></td>
- </tr>
- </table>";
- }
- echo "<hr /><h4>Misc</h4>";
- $ulocation = array();
- $ulocationq = $db->query("SELECT * FROM users");
- while ($r = $db->fetch_row($ulocationq)) {
- $username = $r['username'];
- $ulocation[$r['userid']] = array();
- $ulocation[$r['userid']][0] = $r['locationy'];
- $ulocation[$r['userid']][1] = $r['locationx'];
- }
- if ($ir['donatordays']) {
- $range = 50;
- } else {
- $range = 20;
- }
- $x1 = rand(1, $range);
- $y1 = rand(1, 50);
- $x2 = rand(1, $range);
- $y2 = rand(1, 50);
- $x3 = rand(1, $range);
- $y3 = rand(1, 50);
- $x4 = rand(1, $range);
- $y4 = rand(1, 50);
- // Display Missions
- $mission = $db->query("SELECT * FROM mapmission");
- while ($mapm = $db->fetch_row($mission)) {
- $id = $mapm['id'];
- $mmy = $mapm['locationy'];
- $mmx = $mapm['locationx'];
- $missionnamelink = $mapm['missionlink'];
- if (($locationy == $mmy) && ($locationx == $mmx)) {
- echo "<a href='move.php?action=" . $id . "'>" . $missionnamelink . "</a>";
- }
- }
- // Display Towns
- $town = $db->query("SELECT * FROM maptowns");
- while ($t = $db->fetch_row($town)) {
- $name = $t['townID'];
- $tmy = $t['locationy'];
- $tmx = $t['locationx'];
- if (($locationy == $tmy) && ($locationx == $tmx)) {
- echo "<h3>Town of $name<br /> <a href='movetown1.php'><u>Check it Out</u></a><br /></h3>";
- }
- }
- if (($locationy == $y1) && ($locationx == $x1)) { echo "<h3>Hmm.. Whats that?<br /> <a href='move.php?action=search1'><u>Check it Out</u></a><br /></h3>"; }
- if (($locationy == $y2) && ($locationx == $x2)) { echo "<h3>Hmm.. Whats that?<br /> <a href='move.php?action=search2'><u>Check it Out</u></a><br /></h3>"; }
- if (($locationy == $y3) && ($locationx == $x3)) { echo "<h3>Hmm.. Whats that?<br /> <a href='move.php?action=search1'><u>Check it Out</u></a><br /></h3>"; }
- if (($locationy == $y4) && ($locationx == $x4)) { echo "<h3>Hmm.. Whats that?<br /> <a href='move.php?action=search2'><u>Check it Out</u></a><br /></h3>"; }
- $i = 1;
- foreach($ulocation as $loc)
- {
- if (($locationy == $loc[1]) && ($locationx == $loc[0]) && ($i != $user_id)) {
- echo "<h3>Another User is Here.</h3>
- <a href='viewuser.php?u=".$i."'>View user ID ".$i."</a><br />
- <a href='attack.php?ID=".$i."'>Attack user ID ".$i."</a><br />
- <a href='mailbox.php?action=compose&ID=".$i."'>Mail user ID ".$i."</a><br />
- ";
- }
- $i++;
- }
- echo "<hr />
- <u><b>Legend</b></u><br />
- <table width='110px'>
- <tr>
- <td>You</td>
- <td> - </td>
- <td><img src='/images/punki.jpg' width='20' height='20'></td>
- </tr>
- <tr>
- <td>Users</td>
- <td> - </td>
- <td><img src='/images/cop.jpg' width='20' height='20'></td>
- </tr>
- <tr>
- <td>Town</td>
- <td> - </td>
- <td><img src='/images/city.png' width='20' height='20'></td>
- </tr>
- <tr>
- <td>Missions</td>
- <td> - </td>
- <td><img src='/images/mission.png' width='20' height='20'></td>
- </tr>
- </table>
- <hr />";
- function do_staff()
- {
- global $db, $ir, $c;
- if ($ir['user_level'] != 2) {
- die("403");
- }
- echo "<br /><br />
- This Is Brand new so give me a chance to get all these options added and written.<br />
- The Plan with this section is to be able to edit and create new missions to be put on the maps.<br />
- If this goes to plan we should have all options controlling the map and all of its functions.<br />
- <br /><br />Please do not use links below. These Missions links do work but are not yet ready for the map.<br /><br />
- <i>Mission</i><br />
- <a href='move.php?action=staffcreate'>Create Mission</a><br />
- <a href='move.php?action=staffedit'>Edit Mission</a><br />
- <a href='move.php?action=staffdelete'>Delete Mission</a><br /><br />
- <i>Towns</i><br />
- <a href='move.php?action=stafftowncreate'>Create Town</a><br />
- <a href='move.php?action=stafftownedit'>Edit Town</a><br />
- <a href='move.php?action=stafftowndelete'>Delete Town</a><br /><br />
- <i>Other</i><br />
- <a href='move.php?action=staffmoveuser'>Move User's Location</a><br />
- <br />
- <a href='move.php'>Back to Map</a><br />";
- }
- // Move Functions
- function do_move1($direction, $locationUpdate, $moveUpdate)
- {
- global $db, $userid;
- $db->query("UPDATE users SET $locationUpdate, moves=moves$moveUpdate WHERE userid=$userid");
- echo "Moved $direction<br /><meta http-equiv='refresh' content='0;URL=move.php' /> ";
- }
- do_move1('North', 'locationy=locationy-1', '-1');
- do_move1('North West', 'locationy=locationy-1, locationx=locationx-2', '-1');
- do_move1('North East', 'locationy=locationy-1, locationx=locationx+2', '-1');
- do_move1('East', 'locationx=locationx+1', '-1');
- do_move1('West', 'locationx=locationx-1', '-1');
- do_move1('South West', 'locationy=locationy+1, locationx=locationx-1', '+2');
- do_move1('South East', 'locationy=locationy+1, locationx=locationx+1', '-2');
- do_move1('South', 'locationy=locationy+1', '-1');
- // searches
- function do_search1_ad()
- {
- global $db, $userid;
- $db->query("UPDATE users SET money=money+1000000 WHERE userid='$userid'");
- echo "You Found 1000000 coins.<a href='move.php'>Continue</a>";
- }
- function do_search2_ad()
- {
- global $db, $userid;
- $db->query("UPDATE users SET crystals=crystals+10000 WHERE userid='$userid'");
- echo "You Found 10000 gold.<a href='move.php'>Continue</a>";
- }
- // Staff Section
- function do_staff()
- {
- global $db,$ir, $c;
- if($ir['user_level'] != 2)
- {
- die("403");
- }
- echo "<br /><br />
- This Is Brand new so give me a chance to get all these options added and written.<br />
- The Plan with this section is to be able to edit and create new missions to be put on the maps.<br />
- If this goes to plan we should have all options controlling the map and all of its functions.<br />
- <br /><br />Please do not use links below. These Missions links do work but are not yet ready for the map.<br /><br />
- <i>Mission</i><br />
- <a href=move.php?action=staffcreate>Create Mission</a><br />
- <a href=move.php?action=staffedit>Edit Mission</a><br />
- <a href=move.php?action=staffdelete>Delete Mission</a><br /><br />
- <i>Towns</i><br />
- <a href=move.php?action=stafftowncreate>Create Town</a><br />
- <a href=move.php?action=stafftownedit>Edit Town</a><br />
- <a href=move.php?action=stafftowndelete>Delete Town</a><br /><br />
- <i>Other</i><br />
- <a href=move.php?action=staffmoveuser>Move Users Location</a><br />
- <br />
- <a href=move.php>Back to Map</a><br />
- ";
- }
- function staff_create()
- {
- global $ir;
- if ($ir['user_level'] != 2) {
- die("Restricted Area");
- }
- ?>
- <h3>Create Mission(s)</h3>
- Welcome to the mission section. Here you can create your mission to add to the maps.<br />
- <form action="move.php?action=staffcreatedo" method="post">
- Location Y: <input type="text" name="locationy" /><br />
- Location X: <input type="text" name="locationx" /><br />
- Mission Name: <input type="text" name="missionname" /><br />
- Mission Length: <input type="text" name="missionlength" value="1" /><br />
- Start Mission Link Text: <input type="text" name="missionlink" /><br />
- Mission Text: <textarea rows="6" cols="60" name="missiontext"></textarea><br /><hr />
- Leave Mission Next Step Blank to End Mission.<br />
- Mission Next Step: <textarea rows="6" cols="60" name="missionnext"></textarea><br />
- Mission Next Step Location:<br />
- Location Y: <input type="text" name="locationynext" /><br />
- Location X: <input type="text" name="locationxnext" /><br /><hr />
- Mission Reward<br />
- Cash: <input type="text" name="cash" /><br />
- Gold: <input type="text" name="crystals" /><br />
- Reward rewarded after mission?: <input type="text" name="rewardnumber" value="1"><br />
- <input type="submit" value="Add Mission" />
- </form>
- <?php
- }
- function staff_create_do()
- {
- global $db, $ir;
- if ($ir['user_level'] != 2) {
- die("Restricted Area");
- }
- $locationY = (int)$_POST['locationy'];
- $locationX = (int)$_POST['locationx'];
- $missionName = $db->escape($_POST['missionname']);
- $missionLength = (int)$_POST['missionlength'];
- $missionLink = $db->escape($_POST['missionlink']);
- $missionText = $db->escape($_POST['missiontext']);
- $missionNext = $db->escape($_POST['missionnext']);
- $locationYNext = (int)$_POST['locationynext'];
- $locationXNext = (int)$_POST['locationxnext'];
- $cash = (int)$_POST['cash'];
- $crystals = (int)$_POST['crystals'];
- $rewardNumber = (int)$_POST['rewardnumber'];
- $query = "INSERT INTO mapmission (locationy, locationx, missionname, missionlength, missionlink, missiontext, missionnext, locationynext, locationxnext, cash, crystals, rewardnumber)
- VALUES ($locationY, $locationX, '$missionName', $missionLength, '$missionLink', '$missionText', '$missionNext', $locationYNext, $locationXNext, $cash, $crystals, $rewardNumber)";
- $db->query($query);
- echo "Mission Created<br /><a href='move.php'>Back to Map<a/>";
- }
- function staff_edit()
- {
- global $ir;
- if ($ir['user_level'] != 2) {
- die("Restricted Area");
- }
- ?>
- <form action="move.php?action=staffeditdo" method="post">
- Item: <?php echo mission_dropdown($c,'mission'); ?><br />
- <input type="submit" value="Edit Mission" />
- </form>
- <?php
- }
- function staff_edit_do()
- {
- global $db, $ir;
- if ($ir['user_level'] != 2) {
- die("Restricted Area");
- }
- $missionId = (int)$_POST['mission'];
- $d = $db->query("SELECT * FROM mapmission WHERE id={$missionId}");
- $miss = $db->fetch_row($d);
- ?>
- <h3>Edit Mission(s)</h3>
- Welcome to the mission section. Here you can edit your mission to fix typos or update your mission.<br />
- <form action="move.php?action=staffeditcom" method="post">
- <input type="hidden" name="id" value="<?php echo $miss['id']; ?>" />
- Location Y: <input type="text" name="locationy" value="<?php echo $miss['locationy']; ?>" /><br />
- Location X: <input type="text" name="locationx" value="<?php echo $miss['locationx']; ?>" /><br />
- Mission Name: <input type="text" name="missionname" value="<?php echo $db->escape($miss['missionname']); ?>" /><br />
- Mission Length: <input type="text" name="missionlength" value="<?php echo $miss['missionlength']; ?>" /><br />
- Start Mission Link Text: <input type="text" name="missionlink" value="<?php echo $db->escape($miss['missionlink']); ?>" /><br />
- Mission Text: <textarea rows="6" cols="60" name="missiontext"><?php echo $db->escape($miss['missiontext']); ?></textarea><br /><hr />
- Leave Mission Next Step Blank to End Mission.<br />
- Mission Next Step: <textarea rows="6" cols="60" name="missionnext"><?php echo $db->escape($miss['missionnext']); ?></textarea><br />
- Mission Next Step Location:<br />
- Location Y: <input type="text" name="locationynext" value="<?php echo $miss['locationynext']; ?>" /><br />
- Location X: <input type="text" name="locationxnext" value="<?php echo $miss['locationxnext']; ?>" /><br /><hr />
- Mission Reward<br />
- Cash: <input type="text" name="cash" value="<?php echo $miss['cash']; ?>" /><br />
- Gold: <input type="text" name="crystals" value="<?php echo $miss['crystals']; ?>" /><br />
- Reward rewarded after mission?: <input type="text" name="rewardnumber" value="<?php echo $miss['rewardnumber']; ?>" /><br />
- <input type="submit" value="Edit Mission" />
- </form>
- <?php
- }
- function staff_edit_com()
- {
- global $db, $ir;
- if ($ir['user_level'] != 2) {
- die("Restricted Area");
- }
- $locationY = (int)$_POST['locationy'];
- $locationX = (int)$_POST['locationx'];
- $missionName = $db->escape($_POST['missionname']);
- $missionLength = (int)$_POST['missionlength'];
- $missionLink = $db->escape($_POST['missionlink']);
- $missionText = $db->escape($_POST['missiontext']);
- $missionNext = $db->escape($_POST['missionnext']);
- $locationYNext = (int)$_POST['locationynext'];
- $locationXNext = (int)$_POST['locationxnext'];
- $cash = (int)$_POST['cash'];
- $crystals = (int)$_POST['crystals'];
- $rewardNumber = (int)$_POST['rewardnumber'];
- $query = "UPDATE mapmission SET locationy={$locationY}, locationx={$locationX}, missionname='{$missionName}', missionlength={$missionLength}, missionlink='{$missionLink}', missiontext='{$missionText}', missionnext='{$missionNext}', locationynext={$locationYNext}, locationxnext='{$locationXNext}', cash='{$cash}', crystals='{$crystals}', rewardnumber='{$rewardNumber}' WHERE id={$_POST['id']}";
- $db->query($query);
- echo "Mission Edited<br /><a href='move.php'>Back to Map<a/>";
- }
- function staff_delete()
- {
- global $db, $ir;
- if ($ir['user_level'] > 2) {
- die("Restricted Area");
- }
- ?>
- <h3>Deleting Mission</h3>
- The Mission will be permanently removed from the game.<br />
- <form action="move.php?action=staffdeletedo" method="post">
- Item: <?php echo mission_dropdown($c,'mission'); ?><br />
- <input type="submit" value="Delete Mission" />
- </form>
- <?php
- }
- function staff_delete_do()
- {
- global $db, $ir;
- if ($ir['user_level'] > 2) {
- die("Restricted Area");
- }
- $missionId = (int)$_POST['mission'];
- $d = $db->query("SELECT * FROM mapmission WHERE id={$missionId}");
- $miss = $db->fetch_row($d);
- $db->query("DELETE FROM mapmission WHERE id={$missionId}");
- echo "The {$db->escape($miss['mission'])} Mission was removed from the game.";
- }
- function staff_town_create()
- {
- global $db, $ir;
- if ($ir['user_level'] != 2) {
- die("Restricted Area");
- }
- ?>
- <h3>Create Town</h3>
- Welcome to the create town section, Here you can create your town to add to the maps.<br />
- <form action="move.php?action=stafftowncreatedo" method="post">
- Town Name: <input type="text" name="townID" /><br />
- Location Y: <input type="text" name="locationx" /><br />
- Location X: <input type="text" name="locationy" /><br />
- <input type="submit" value="Add Town" />
- </form>
- <?php
- }
- function staff_town_create_do()
- {
- global $db, $ir;
- if ($ir['user_level'] != 2) {
- die("Restricted Area");
- }
- $townID = $db->escape($_POST['townID']);
- $locationy = (int)$_POST['locationy'];
- $locationx = (int)$_POST['locationx'];
- $db->query("INSERT INTO maptowns SET townID='{$townID}', locationy={$locationy}, locationx={$locationx}");
- echo "Town Created<br /><a href='move.php'>Back to Map<a/>";
- }
- function staff_town_edit()
- {
- global $db, $ir, $c;
- if ($ir['user_level'] != 2) {
- die("Restricted Area");
- }
- ?>
- <form action="move.php?action=stafftowneditdo" method="post">
- Item: <?php echo town_dropdown($c, 'town'); ?><br />
- <input type="submit" value="Edit Town" />
- </form>
- <?php
- }
- function staff_town_edit_do()
- {
- global $db, $ir, $c;
- if ($ir['user_level'] != 2) {
- die("Restricted Area");
- }
- $townID = $db->escape($_POST['town']);
- $d = $db->query("SELECT * FROM maptowns WHERE townID='{$townID}'");
- $miss = $db->fetch_row($d);
- ?>
- <h3>Edit Town</h3>
- Welcome to the town section, Here you can edit your town's ID and location.<br />
- <form action="move.php?action=stafftowneditcom" method="post">
- <input type="hidden" name="id" value="<?php echo $miss['id']; ?>" />
- Town name: <input type="text" name="townID" value="<?php echo $miss['townID']; ?>" /><br />
- Location Y: <input type="text" name="locationy" value="<?php echo $miss['locationy']; ?>" /><br />
- Location X: <input type="text" name="locationx" value="<?php echo $miss['locationx']; ?>" /><br />
- <input type="submit" value="Edit Town" />
- </form>
- <?php
- }
- function staff_town_edit_com()
- {
- global $db, $ir, $c;
- if ($ir['user_level'] != 2) {
- die("Restricted Area");
- }
- $townID = $db->escape($_POST['townID']);
- $locationy = (int)$_POST['locationy'];
- $locationx = (int)$_POST['locationx'];
- $db->query("UPDATE maptowns SET townID='{$townID}', locationy={$locationy}, locationx={$locationx}");
- echo "Town Edited<br /><a href='move.php'>Back to Map<a/>";
- }
- function staff_town_delete()
- {
- global $db, $ir, $c, $h, $userid;
- if ($ir['user_level'] > 2) {
- die("Restricted Area");
- }
- ?>
- <h3>Deleting Town</h3>
- The Town Location will be permanently removed from the game.<br />
- <form action="move.php?action=stafftowndeletedo" method="post">
- Item: <?php echo town_dropdown($c, 'town'); ?><br />
- <input type="submit" value="Delete Town" />
- </form>
- <?php
- }
- function staff_town_delete_do()
- {
- global $db, $ir, $c, $h, $userid;
- if ($ir['user_level'] > 2) {
- die("Restricted Area");
- }
- $townID = $db->escape($_POST['town']);
- $d = $db->query("SELECT * FROM maptowns WHERE townID='{$townID}'");
- $miss = $db->fetch_row($d);
- $db->query("DELETE FROM maptowns WHERE townID='{$townID}'");
- echo "The {$miss['townID']} Town was removed from the game.";
- }
- function staff_move_user()
- {
- global $db, $ir, $c, $h, $userid;
- if ($ir['user_level'] != 2) {
- die("Restricted Area");
- }
- ?>
- <h3>Editing Users Location</h3>
- Enter user's ID<br />
- <form action="move.php?action=staffmoveuserdo" method="post">
- User: <input type="text" name="user" value="0" /><br />
- <input type="submit" value="Edit User Location" />
- </form>
- <?php
- }
- function staff_move_user_do()
- {
- global $db, $ir, $c, $h, $userid;
- if ($ir['user_level'] != 2) {
- die("403");
- }
- $userID = $db->escape($_POST['user']);
- $d = $db->query("SELECT * FROM users WHERE userid='{$userID}'");
- $user = $db->fetch_row($d);
- ?>
- <h3>Editing User's Location</h3>
- <form action="move.php?action=staffmoveusercom" method="post">
- <input type="hidden" name="userid" value="<?php echo $userID; ?>" /><br />
- <br /><br />
- location x: <input type="text" name="locationx" value="<?php echo $user['locationx']; ?>" /><br />
- location y: <input type="text" name="locationy" value="<?php echo $user['locationy']; ?>" /><br />
- <input type="submit" value="Edit user location" />
- </form>
- <br />
- <?php
- }
- function staff_move_user_com()
- {
- global $db, $ir, $c, $h, $userid;
- if ($ir['user_level'] != 2) {
- die("Restricted Area");
- }
- $userID = $db->escape($_POST['userid']);
- $locationX = $db->escape($_POST['locationx']);
- $locationY = $db->escape($_POST['locationy']);
- $db->query("UPDATE users SET locationx='{$locationX}', locationy='{$locationY}' WHERE userid='{$userID}'");
- echo "User has been moved to location <font color='green'>{$locationX}</font>, <font color='red'>{$locationY}</font><meta http-equiv='refresh' content='2;URL=move.php' />";
- }
- // Map interaction functions
- function do_leave()
- {
- echo "You Left, Returning to Map.<meta http-equiv='refresh' content='1;URL=move.php' /> ";
- }
- $h->endpage();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement