Operator_Jon
Erfahrenes Mitglied
ok, zuerst einmal ist das du ok^^
den rest per icq!
den rest per icq!
Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
<?php
include('connection.php');
$a_user = array("id" => "2");
$to_build = "1";
$select = mysql_select_db ($db_game, $db);
$uc = mysql_query("SELECT * FROM `construct`, `construction` WHERE construction.`ID` = construct.`b_id` AND construct.`member_id` LIKE \"$a_user[id]\" AND construct.`b_id` LIKE \"$to_build\"");
$uc_menge = mysql_num_rows($uc);
echo "Anzahl: $uc_menge";
if(!$uc_menge){
?>
<form name="form" action="<?php $_PHP_SELF ?>?action=build" method="post">
<input type="submit" value="verbessern" />
</form>
<?php
}
else{
echo "doch was da ..";
$a_data = mysql_fetch_array($uc);
$data = $a_data[3]; //Bau seit ...
$data = time() - $data;
$data2 = $a_data[6]; //Bauzeit
$data = $data2 - $data;
echo "<form name'form'><input type='hidden' name='field' value='$data'</form>";
if ($data2 <= $data){
$query = "DELETE FROM `construct` WHERE construct.`b_id` = \"$to_build\"";
mysql_query($query);
}
else{
?>
<SCRIPT type="text/javascript">
var field = window.document.form.field.value;
var TargetTime = new Date();
var TimeBeginn = TargetTime.getTime();
function CountDown(myid, seconds) {
var CurrentDate = new Date();
var CurrentTime = CurrentDate.getTime();
var TimeEnd = TimeBeginn + (seconds*1000);
TargetTime.setTime(TimeEnd);
var Targetbox=document.getElementById(myid);
var OpenTime = Math.floor((TargetTime-CurrentTime)/1000);
var s = OpenTime % 60;
var m = ((OpenTime-s)/60) % 60;
var h = ((OpenTime-s-m*60)/(60*60));
var fh = ((h < 10) ? "0" : "");
var fm = ((m < 10) ? ":0" : ":");
var fs = ((s < 10) ? ":0" : ":");
var Time = fh+h+fm+m+fs+s;
var OutputString=Time;
if(OpenTime<=0) { // Event wenn der Countdown abgelaufen ist
var OutputString="Jetzt!";
}
Targetbox.innerHTML=OutputString; // Ausgabe des Strings in der Betreffenden Zelle
window.setTimeout("CountDown('" + myid + "', '" + seconds + "')", 1000);
}
</script>
<span id='id'><script type='text/javascript'>CountDown('id', 'field');</script></span>
<?php
}
}
if ($action == "build"){
$insert_into_db = mysql_query("insert into construct (member_id, b_id, time) values (\"$a_user[id]\",'$to_build',\"time()\"");
echo "<meta http-equiv=\"refresh\" content=\"4; URL=countdown.php\">Weiterleitung in 4 Sekunden!";
}
?>
<span id='id'><script type='text/javascript'>CountDown('id', 'field');</script></span>
<span id='id'><script type='text/javascript'>CountDown('id',field);</script></span>
echo "<form name'form'><input type='hidden' name='field' value='$data'</form>";
echo "<form name'form'><input type='hidden' name='field' value='$data'></form>";
echo "<form name=\"form\"><input type='hidden' name='h_field' value='$data'></form>";
$insert_into_db = mysql_query("insert into construct (member_id, b_id, time) values (\"$a_user[id]\",'$to_build',\"time()\"");
$insert_into_db = mysql_query("insert into construct (member_id, b_id, time) values ('".$a_user[id]."','".$to_build."','".time()."'");