-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsave_unit_narcdesc.php
More file actions
48 lines (38 loc) · 1.5 KB
/
save_unit_narcdesc.php
File metadata and controls
48 lines (38 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);
// error_reporting(E_ALL);
date_default_timezone_set('Europe/Berlin');
session_start();
require('./logger.php');
require_once('./db.php');
$narcDesc = isset($_GET["narcdesc"]) ? $_GET["narcdesc"] : "";
$playerId = isset($_GET["playerid"]) ? $_GET["playerid"] : "";
$gameId = isset($_GET["gameid"]) ? $_GET["gameid"] : "";
$unitId = isset($_GET["unitid"]) ? $_GET["unitid"] : "";
$roundNo = isset($_GET["round"]) ? $_GET["round"] : "";
echo "<!DOCTYPE html>\n";
echo "<html lang='en'>\n";
echo "<body>\n";
echo "<p style='font-family:Arial,sans-serif;font-size:14px;color:yellow;'>";
// -----------------------------------------------------------------------------------------------------------------
// https://www.php.net/manual/en/mysqli.begin-transaction.php
if (!empty($gameId) && !empty($unitId) && !empty($roundNo)) {
echo "SAVING DATA...<br><br>";
$sql = "UPDATE asc_unitstatus SET narc_desc='".$narcDesc."' WHERE playerid=".$playerId." AND gameid=".$gameId." AND unitid=".$unitId." AND round=".$roundNo;
echo $sql;
if (mysqli_query($conn, $sql)) {
echo "Record (asc_unitstatus) updated successfully.";
echo "</p>";
mysqli_commit($conn);
//echo "<script>top.location.reload();</script>";
} else {
echo "Error (asc_options) updating record: " . mysqli_error($conn);
echo "</p>";
}
} else {
echo "Missing data! Nothing was stored!<br>";
}
echo "</body>\n";
echo "</html>\n";
?>