public static function generateMatOptions() { $curr_plan = \planets::getParam('pid'); $mats = mysql_query("SELECT * FROM " . $GLOBALS['DB_table_prefix'] . "mats ORDER BY rm_name ASC"); $options = '<option value="-1" name="none" SELECTED DISABLED>None</option>'; for ($i = 0; $i < mysql_num_rows($mats); $i++) { $mid = mysql_result($mats, $i, "rm_uid"); $rm_name = mysql_result($mats, $i, "rm_name"); $options .= '<option value="' . $mid . '" name="' . $rm_name . '">' . $rm_name . '</option>'; } return $options; }
//Include the standard header info on all pages include 'includes/header.php'; //Save the planet's ID, if any selected $pid = \planets::getParam('pid'); //Display any error or success messages if (\planets::getParam('msg') != '') { echo \message::dispMsg(\planets::getParam('msg')); echo "<br/>"; } //Processes submissions of new deposits if (\planets::getParam('mode') == 'submit' && $pid != '') { $who = addslashes(\planets::getParam('who')); $mat = \planets::getParam('mat'); $size = \planets::getParam('size'); $x = \planets::getParam('surfX'); $y = \planets::getParam('surfY'); //Verifies no blank parameters if ($who == '' || $mat == '' || $size == '' || $x == '' || $y == '') { header("Location: " . $GLOBALS['site_name'] . "?pid=" . $pid . "&msg=1"); exit; } //Verifies planet exists if (!\planets::planetExists($pid)) { header("Location: " . $GLOBALS['site_name'] . "?msg=2"); exit; } //Verifies RM exists if (!\planets::matExists($mat)) { header("Location: " . $GLOBALS['site_name'] . "?pid=" . $pid . "&msg=3"); exit; }