completed more of the report system
This commit is contained in:
parent
9b73237786
commit
fc27db85a3
|
|
@ -35,13 +35,13 @@ if ($validXML) {
|
|||
"Description" => $reportdescription
|
||||
);
|
||||
|
||||
//die(json_encode($jsonData));
|
||||
|
||||
foreach($chats as $chat) {
|
||||
$userid = (int)$chat['userID'];
|
||||
$username = (string)getUsername($userid);
|
||||
$userchat = (string)$chat;
|
||||
|
||||
$chatData = array(
|
||||
"username" => $username,
|
||||
"userid" => $userid,
|
||||
"chat" => $userchat
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
|
||||
header('Content-Type: application/json');
|
||||
if (!$_GET['id'])
|
||||
{
|
||||
redirect("/MCP/reports/");
|
||||
}
|
||||
|
||||
$body = <<<EOT
|
||||
<h5 class="text-center">Report Data</h5>
|
||||
|
|
@ -10,22 +13,17 @@ $body = <<<EOT
|
|||
<div class="col-sm marg-bot-15">
|
||||
<div class="card marg-auto" style="min-height:16rem;">
|
||||
<div class="card-body">
|
||||
<h6>Reporter ID: </h6>
|
||||
<h6>Place ID: </h6>
|
||||
<h6>Job ID: ""</h6>
|
||||
<button onclick="closeReport()" class="btn btn-danger" style="float:right;">Mark Closed</button>
|
||||
<h6 id="reporter-id"></h6>
|
||||
<h6 id="place-id"></h6>
|
||||
<h6 id="job-id"></h6>
|
||||
<hr>
|
||||
<h6>Abuser ID: </h6>
|
||||
<h6>Report Reason: ""</h6>
|
||||
<h6>Description: ""</h6>
|
||||
<h6 id="abuser-id"></h6>
|
||||
<h6 id="report-reason"></h6>
|
||||
<h6 id="report-description"></h6>
|
||||
<hr>
|
||||
<h5>Chat Log:</h5>
|
||||
<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>
|
||||
|
|
@ -36,11 +34,50 @@ $body = <<<EOT
|
|||
/*
|
||||
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>
|
||||
|
||||
EOT;
|
||||
|
||||
pageHandler();
|
||||
$ph->pageTitle("Chat Logs");
|
||||
$ph->pageTitle("Report");
|
||||
$ph->body = $body;
|
||||
$ph->output();
|
||||
Loading…
Reference in New Issue