completed more of the report system
This commit is contained in:
parent
9b73237786
commit
fc27db85a3
|
|
@ -35,13 +35,13 @@ if ($validXML) {
|
||||||
"Description" => $reportdescription
|
"Description" => $reportdescription
|
||||||
);
|
);
|
||||||
|
|
||||||
//die(json_encode($jsonData));
|
|
||||||
|
|
||||||
foreach($chats as $chat) {
|
foreach($chats as $chat) {
|
||||||
$userid = (int)$chat['userID'];
|
$userid = (int)$chat['userID'];
|
||||||
|
$username = (string)getUsername($userid);
|
||||||
$userchat = (string)$chat;
|
$userchat = (string)$chat;
|
||||||
|
|
||||||
$chatData = array(
|
$chatData = array(
|
||||||
|
"username" => $username,
|
||||||
"userid" => $userid,
|
"userid" => $userid,
|
||||||
"chat" => $userchat
|
"chat" => $userchat
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
header('Content-Type: application/json');
|
if (!$_GET['id'])
|
||||||
|
{
|
||||||
|
redirect("/MCP/reports/");
|
||||||
|
}
|
||||||
|
|
||||||
$body = <<<EOT
|
$body = <<<EOT
|
||||||
<h5 class="text-center">Report Data</h5>
|
<h5 class="text-center">Report Data</h5>
|
||||||
|
|
@ -10,22 +13,17 @@ $body = <<<EOT
|
||||||
<div class="col-sm marg-bot-15">
|
<div class="col-sm marg-bot-15">
|
||||||
<div class="card marg-auto" style="min-height:16rem;">
|
<div class="card marg-auto" style="min-height:16rem;">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h6>Reporter ID: </h6>
|
<button onclick="closeReport()" class="btn btn-danger" style="float:right;">Mark Closed</button>
|
||||||
<h6>Place ID: </h6>
|
<h6 id="reporter-id"></h6>
|
||||||
<h6>Job ID: ""</h6>
|
<h6 id="place-id"></h6>
|
||||||
|
<h6 id="job-id"></h6>
|
||||||
<hr>
|
<hr>
|
||||||
<h6>Abuser ID: </h6>
|
<h6 id="abuser-id"></h6>
|
||||||
<h6>Report Reason: ""</h6>
|
<h6 id="report-reason"></h6>
|
||||||
<h6>Description: ""</h6>
|
<h6 id="report-description"></h6>
|
||||||
<hr>
|
<hr>
|
||||||
<h5>Chat Log:</h5>
|
<h5>Chat Log:</h5>
|
||||||
<div id="message-container">
|
<div id="message-container">
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="container mt-2 mb-2 text-center">
|
|
||||||
<div id="page-buttons" class="btn-group" role="group" aria-label="First group">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -36,11 +34,50 @@ $body = <<<EOT
|
||||||
/*
|
/*
|
||||||
Alphaland 2021
|
Alphaland 2021
|
||||||
*/
|
*/
|
||||||
|
var getparam = new URLSearchParams(window.location.search).get("id");
|
||||||
|
|
||||||
|
function populateReport()
|
||||||
|
{
|
||||||
|
getJSONCDS("https://www.alphaland.cc/MCP/reports/data/?id="+getparam)
|
||||||
|
.done(function(jsonData) {
|
||||||
|
$("#reporter-id").html("Reporter ID: "+jsonData.ReporterUid);
|
||||||
|
$("#place-id").html("Place ID: "+jsonData.PlaceId);
|
||||||
|
$("#job-id").html('Job ID: "'+jsonData.JobId+'"');
|
||||||
|
$("#abuser-id").html("Abuser ID: "+jsonData.AbuserId);
|
||||||
|
$("#report-reason").html('Report Reason: "'+jsonData.Reason+'"');
|
||||||
|
$("#report-description").html('Report Description: "'+jsonData.Description+'"');
|
||||||
|
|
||||||
|
|
||||||
|
var html = `<div class="row">
|
||||||
|
<div class="col-sm marg-bot-15">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h6>Username: <a class="red-a" href="/profile/view?id={userid}"> {username}</a></h6>
|
||||||
|
<div class="row marg-bot-15">
|
||||||
|
<div class="col-sm" style="overflow:hidden;">
|
||||||
|
<p>"{chat}"</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
|
||||||
|
$("#message-container").html(parseHtml(html, 1000, jsonData, "No logged chats"));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeReport()
|
||||||
|
{
|
||||||
|
alert("will close");
|
||||||
|
}
|
||||||
|
|
||||||
|
populateReport();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
EOT;
|
EOT;
|
||||||
|
|
||||||
pageHandler();
|
pageHandler();
|
||||||
$ph->pageTitle("Chat Logs");
|
$ph->pageTitle("Report");
|
||||||
$ph->body = $body;
|
$ph->body = $body;
|
||||||
$ph->output();
|
$ph->output();
|
||||||
Loading…
Reference in New Issue