私はサッカートーナメント/カップのための賭博ゲームをプログラミングしています。このゲームでは、試合の開始5分前まで、ユーザーはベットをフォームに置くことができます。その時点以降、フィールドは無効にされ/グレー表示されるので、入力値は表示されますが、編集可能なものはありません。mysqlタイムスタンプのタイムスタンプに基づいて入力フィールドを無効にする
time
とdate
(mysqlテーブルの各ゲームに保存されている)に基づいて、これらの「スコア入力フィールド」を自動的に無効にすることはできますか?
コードの詳細やmysqlテーブルの詳細が必要な場合は、質問してください。
SQLクエリ&テーブル
$records = mysqli_query($conn, "
SELECT
sp.spiel_id,
DATE_FORMAT(sp.datum, \"%d.%m.%Y\") AS datum,
DATE_FORMAT(sp.zeit, \"%H:%i\") AS zeit,
sp.heimteam_id,
sp.gastteam_id,
sp.tore_heimteam,
sp.tore_gastteam,
ht.teamname AS heimteam_name,
at.teamname AS gastteam_name,
t.match_id,
t.user_id,
t.tipp_heim,
t.tipp_gast,
t.punkte_tipp,
u.user_id,
u.username
FROM
spielplan sp
LEFT JOIN mannschaften ht
ON sp.heimteam_id = ht.mannschafts_id
LEFT JOIN mannschaften at
ON sp.gastteam_id = at.mannschafts_id
LEFT JOIN tipps t
ON sp.spiel_id = t.match_id
LEFT JOIN users u
ON t.user_id = u.user_id
WHERE
username = '".$_SESSION["username"]."'
ORDER BY
spiel_id ASC
");
while($fields = mysqli_fetch_assoc($records)) {
?>
<tr>
<input type="hidden" name="spiel_ids[]" value="<?php echo $fields["spiel_id"] ?>">
<td><?php echo $fields["datum"] ?></td>
<td><?php echo $fields["zeit"] ?></td>
<td><?php echo $fields["heimteam_name"] ?></td>
<td><?php echo $fields["tore_heimteam"] ?></td>
<td>:</td>
<td><?php echo $fields["tore_gastteam"] ?></td>
<td><?php echo $fields["gastteam_name"] ?></td>
<input type="hidden" name="user_ids[]" value="<?php echo $fields["user_id"] ?>">
<td><input type="tel" maxlength="2" size="5" name="tipps_heim[]" value="<?php echo $fields["tipp_heim"] ?>"></td>
<td><input type="tel" maxlength="2" size="5" name="tipps_gast[]" value="<?php echo $fields["tipp_gast"] ?>"></td>
<td><?php echo $fields["punkte_tipp"] ?></td>
</tr>
<?php
}
?>
SQL、...男 –
何も私はそれを達成する方法については考えているよう。私の唯一の考えは、javascriptを使用して、 "match-time"から5分を差し引いた入力フィールドに 'readonly'を追加することです。 – mario