Example #1
0
	<tr align="center"><td style="width:150px">Geschwindigkeit</td><td style="width:150px"><select name="speed" size="1" style="border:0; width:150px; height:20px" onchange="berechne()">
					<option value="100" ' . $speedstep100 . '>100%</option>
	 				<option value="90" ' . $speedstep90 . '>90%</option>
					<option value="80" ' . $speedstep80 . '>80%</option>
					<option value="70" ' . $speedstep70 . '>70%</option>	
					<option value="60" ' . $speedstep60 . '>60%</option>	
					<option value="50" ' . $speedstep50 . '>50%</option>	
					<option value="40" ' . $speedstep40 . '>40%</option>
					<option value="30" ' . $speedstep30 . '>30%</option>	
					<option value="20" ' . $speedstep20 . '>20%</option>	
					<option value="10" ' . $speedstep10 . '>10%</option>	
				</select></td></tr>
	<tr align="center"><td style="width:150px">Einheiten</td><td style="width:150px">' . $anzahl . '</td></tr>
	<tr align="center"><td style="width:150px">Entfernung</td><td style="width:150px"><a id="entfernung" name="entfernung">' . $entfernung * 2.5 . '</a> km</td></tr>
	<tr align="center"><td style="width:150px">Geschwindigkeit</td><td style="width:150px"><div id="s">' . $maxspeed . '.00 km/h</div></td></tr>
	<tr align="center"><td style="width:150px">Dauer</td><td style="width:150px"><div id="d">' . time2str(felder2time($entfernung * 10 / $maxspeed) - 3600) . '<br />+1:00:00<br />=' . time2str(felder2time($entfernung * 10 / $maxspeed)) . '</div></td></tr>
	<tr align="center"><td style="width:150px">Gesamtplatz</td><td style="width:150px">' . $platz . '</td></tr>
	<tr align="center"><td style="width:150px">Verbrauch in Liter</td><td style="width:150px"><div id="v1">' . $verbrauch . ' Liter</div></td></tr>
	<tr align="center"><td style="width:150px">Verbrauch in Einh.</td><td style="width:150px"><div id="v2">' . $verbrauch_einh . ' Einh.</div></td></tr>
	<tr align="center"><td style="width:150px">Eisen</td><td class="input"><input onChange="berechne();" onkeyup="berechne();" type="text" name="eisen" value="' . $_POST['eisen'] . '" style="border:0; width:150px; height:14px;"></td></tr>
	<tr align="center"><td style="width:150px">Titan</td><td class="input"><input onChange="berechne();" onkeyup="berechne();" type="text" name="titan" value="' . $_POST['titan'] . '" style="border:0; width:150px; height:14px"></td></tr>
	<tr align="center"><td style="width:150px">Oel</td><td class="input"><input onChange="berechne();" onkeyup="berechne();" type="text" name="oel" value="' . $_POST['oel'] . '" style="border:0; width:150px; height:14px"></td></tr>
	<tr align="center"><td style="width:150px">Uran</td><td class="input"><input onChange="berechne();" onkeyup="berechne();" type="text" name="uran" value="' . $_POST['uran'] . '" style="border:0; width:150px; height:14px"></td></tr>
	<tr align="center"><td style="width:150px">Gold</td><td class="input"><input onChange="berechne();" onkeyup="berechne();" type="text" name="gold" value="' . $_POST['gold'] . '" style="border:0; width:150px; height:14px"></td></tr>
	<tr align="center"><td style="width:150px">Chanje</td><td class="input"><input onChange="berechne();" onkeyup="berechne();" type="text" name="chanje" value="' . $_POST['chanje'] . '" style="border:0; width:150px; height:14px"></td></tr>	
	<tr align="center"><td style="width:150px">Restplatz</td><td style="width:150px;' . $red . '"><div id="w">' . round($restplatz, 0) . '</div></td></tr>
	</table>
	<br />
	<input type="submit" name="starten" value="Mission starten">
	<input type="hidden" name="action" value="mission" />
	<input type="hidden" name="anz1" value="' . $_POST['anz1'] . '" />
Example #2
0
            } else {
                $entfernung += $to_position['y'] + $to_position['z'] * 20 - ($own_position['y'] + $own_position['z'] * 20);
            }
            if (!$row) {
                $content .= '<span style="font-size: 12px";><b>Du kannst diese Mission nicht beschiessen!</b></span><br />';
            } else {
                if ($row['ankunft'] < date('U')) {
                    $content .= '<span style="font-size: 12px";><b>Du kannst diese Mission nicht beschiessen da sie bereits auf dem R&uuml;ckweg ist!</b></span><br />';
                } elseif ($row['ankunft'] < date('U') + 300) {
                    $content .= '<span style="font-size: 12px";><b>Du kannst diese Mission nicht beschiessen da sie bereits weniger wie 5 minuten von deiner Basis entfernt ist!</b></span><br />';
                } else {
                    mysql_query("UPDATE `raketen` SET `einh1` = '" . ($raksilo['einh1'] - $_POST['anz1']) . "', `einh2` = '" . ($raksilo['einh2'] - $_POST['anz2']) . "', `einh3` = '" . ($raksilo['einh3'] - $_POST['anz3']) . "', `einh4` = '" . ($raksilo['einh4'] - $_POST['anz4']) . "', `einh5` = '" . ($raksilo['einh5'] - $_POST['anz5']) . "', `einh6` = '" . ($raksilo['einh6'] - $_POST['anz6']) . "' WHERE `omni` = '" . $_SESSION['user']['omni'] . "' LIMIT 1;");
                    $ankunftK = $row['ankunft'] - date('U');
                    //$ankunft  = (date('U')) + ($ankunftK * $row['speed'] / 666);
                    $entfernung = $entfernung / 100 * ($row['ankunft'] - date('U')) / (($row['ankunft'] - $row['started']) / 100);
                    $ankunft = date(U) + felder2time($entfernung * 10 / 666) - 3600;
                    $content .= '<span style="font-size: 12px";><b>Beschuss gestartet, Einschlag in ' . countdown($ankunft - date('U')) . '.</b></span><br />';
                    mysql_query("INSERT INTO `beschuss` ( `id` , `start` , `ziel` , `type` , `einh1` , `einh2` , `einh3` , `einh4` , `einh5` , `einh6` , `ankunft` ) VALUES ('', '" . $_SESSION['user']['omni'] . "', '" . $_POST['ziel'] . "', '" . $type . "', '" . $_POST['anz1'] . "', '" . $_POST['anz2'] . "', '" . $_POST['anz3'] . "', '" . $_POST['anz4'] . "', '" . $_POST['anz5'] . "', '" . $_POST['anz6'] . "', '" . $ankunft . "');");
                    $eid = mysql_insert_id($dbh);
                    $selectResult = mysql_query("INSERT INTO `events` ( `id` , `type` , `eid` , `date` ) VALUES ('', '5', '" . $eid . "', '" . $ankunft . "');");
                    do {
                        $raksilo['einh' . $i] -= $_POST['anz' . $i];
                        $i++;
                    } while ($i <= 6);
                }
            }
        }
    }
}
do {
    $count++;