Ejemplo n.º 1
0
    if ($size < 0 || !is_numeric($size)) {
        header("Location: " . $GLOBALS['site_name'] . "?pid=" . $pid . "&msg=4");
        exit;
    }
    //Verifies x-coordinate is valid given the current planet
    if (!($x >= 0 && $x < \planets::getMaxPlanetGroundCoord($pid))) {
        header("Location: " . $GLOBALS['site_name'] . "?pid=" . $pid . "&msg=5");
        exit;
    }
    //Verifies y-coordinate is valid given the current planet
    if (!($y >= 0 && $y < \planets::getMaxPlanetGroundCoord($pid))) {
        header("Location: " . $GLOBALS['site_name'] . "?pid=" . $pid . "&msg=6");
        exit;
    }
    //Adds/Removes/Updates the deposit and redirects with an appropriate success/error message
    \planets::addDeposit($pid, $size, $who, $mat, $x, $y);
}
?>
<script type="text/javascript">
    function setPID() {
	var planetSel = document.getElementById("planet");
	var planetID = planetSel.options[planetSel.selectedIndex].value;
	form = document.createElement('form');
	form.setAttribute('method', 'POST');
	form.setAttribute('action', 'http://dot.swc-tf.com/ted_pm/');
	myvar = document.createElement('input');
	myvar.setAttribute('name', 'pid');
	myvar.setAttribute('type', 'hidden');
	myvar.setAttribute('value', planetID);
	form.appendChild(myvar);
	document.body.appendChild(form);