summaryrefslogtreecommitdiff
path: root/html/import/import_ass.php
diff options
context:
space:
mode:
authorMatthijs Kuiper <info@matthijskuiper.nl>2017-02-04 16:05:45 +0100
committerMatthijs Kuiper <info@matthijskuiper.nl>2017-02-04 16:05:45 +0100
commit40dfa7d5c0dc8e4cb2c95e403b6b4b2c4bf70644 (patch)
tree6ac6279ac26749ffe7ca0ae9603fbcae2e757e6e /html/import/import_ass.php
Original UTStats beta 4.2.84.2.8
Diffstat (limited to 'html/import/import_ass.php')
-rwxr-xr-xhtml/import/import_ass.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/html/import/import_ass.php b/html/import/import_ass.php
new file mode 100755
index 0000000..9539bc5
--- /dev/null
+++ b/html/import/import_ass.php
@@ -0,0 +1,34 @@
+<?php
+// Who did the objectives
+ $r_assobj = small_query("SELECT count(id) AS assobjcount FROM uts_temp_$uid WHERE col1 = 'assault_obj' AND col2 = $playerid");
+ $assobjcount = $r_assobj[assobjcount];
+ $upd_assobj = "UPDATE uts_player SET ass_obj = $assobjcount WHERE id = $playerecordid";
+ mysql_query($upd_assobj) or die(mysql_error());
+
+// Get assault game code (unique code give for the 2 games played)
+
+ $r_asscode = small_query("SELECT col2 FROM uts_temp_$uid WHERE col1 = 'assault_gamecode' LIMIT 0,1");
+ $asscode = $r_asscode[col2];
+ $updateasscode = "UPDATE uts_match SET assaultid = '$asscode' WHERE id = $matchid";
+ mysql_query($updateasscode) or die(mysql_error());
+
+// Get Which Teams Attacking
+
+ $r_assteam = small_query("SELECT col2 FROM uts_temp_$uid WHERE col1 = 'assault_attacker' LIMIT 0,1");
+ $assteam = $r_assteam[col2];
+ $updateassteam = "UPDATE uts_match SET ass_att = $assteam WHERE id = $matchid;";
+ mysql_query($updateassteam) or die(mysql_error());
+
+// Did they do it?
+
+ $sql_asswin = "SELECT col0 FROM uts_temp_$uid WHERE col1 = 'game_end' AND col2 = 'Assault succeeded!' LIMIT 0,1";
+ $q_asswin = mysql_query($sql_asswin) or die(mysql_error());
+ $asswin = 0;
+
+ while ($r_asswin = mysql_fetch_array($q_asswin)) {
+ IF ($r_asswin[col0] != NULL ) { $asswin = 1; }
+ }
+
+ $updateasswin = "UPDATE uts_match SET ass_win = $asswin WHERE id = $matchid;";
+ mysql_query($updateasswin) or die(mysql_error());
+?>