Initial commit of PQS
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
$dbconnect = mysqli_connect('localhost', 'pqs', 'pqs') or die('Could not connect: ' . mysqli_error($dbconnect));
|
||||
mysqli_select_db($dbconnect, 'pqs') or die('Could not select database');
|
||||
if (isset($_GET['call'])) {
|
||||
$wcall = $_GET['call'];
|
||||
echo "DEBUG: call is set<br>wcall = $wcall<br>";
|
||||
switch ($wcall) {
|
||||
case "updatemerc":
|
||||
echo "DEBUG: updatemerc is called<br>";
|
||||
$wdo = "";
|
||||
if (isset($_GET['wdo'])) $wdo = $_GET['wdo'];
|
||||
switch ($wdo) {
|
||||
case "add":
|
||||
echo "DEBUG: updatemerc add is called<br>";
|
||||
$sql = "UPDATE pqs_queue SET merc = 1 WHERE id = $_GET[playerid]";
|
||||
echo "sql:<br>$sql<br>";
|
||||
mysqli_query($dbconnect, $sql) or die('Update Merc status failed: ' . mysqli_error($dbconnect));
|
||||
break;
|
||||
case "remove":
|
||||
echo "DEBUG: updatemerc remove is called<br>";
|
||||
$sql = "UPDATE pqs_queue SET merc = 0 WHERE id = $_GET[playerid]";
|
||||
echo "sql:<br>$sql<br>";
|
||||
mysqli_query($dbconnect, $sql) or die('Update Merc status failed: ' . mysqli_error($dbconnect));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case "updateinfo":
|
||||
$sql = "SELECT Updated FROM pqs_infopanel";
|
||||
$getid = mysqli_query($dbconnect, $sql) or die('Query failed: ' . mysqli_error($dbconnect));
|
||||
$rs1 = mysqli_fetch_array($getid);
|
||||
$updateinfo = $rs1[0];
|
||||
mysqli_query($dbconnect, $sql) or die('Query failed: ' . mysqli_error($dbconnect));
|
||||
echo json_encode($updateinfo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
mysqli_close($dbconnect);
|
||||
?>
|
||||
Reference in New Issue
Block a user