initial: bootstrap from BukidBountyApp base
This commit is contained in:
@@ -0,0 +1,202 @@
|
||||
<br><br><br><br>
|
||||
|
||||
<div class="card" id="primary-card">
|
||||
<div class="card-header ui-sortable-handle" style="cursor: move">
|
||||
<h2 class="card-title" style="font-size: 2.5rem;" id="FinancialReportsDailyTargetDate">Financial Reports (Daily)
|
||||
</h2>
|
||||
|
||||
<div class="card-tools">
|
||||
<input type="date" class="form-control" id="FinancialReportsDailyTargetDateSelect">
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table id="accounting_reports_list_table">
|
||||
<thead>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<h4>Total Bet Amount </h4>
|
||||
</td>
|
||||
<td>
|
||||
<h4 id="totalbetamountfield_AccountingFinancialReportDaily">+</h4>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<h4>Commission for Team Players (15%)</h4>
|
||||
</td>
|
||||
<td>
|
||||
<h4 id="commissionamountplayer_AccountingFinancialReportDaily">-</h4>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<b>
|
||||
<h4 id="BetAmountMinusCommissionPlayers_AccountingFinancialReportDaily"></h4>
|
||||
</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<h4 id=""></h4>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<h4>Total Prizes to Dispense</h4>
|
||||
</td>
|
||||
<td>
|
||||
<h4 id="totalprizesamountfield_AccountingFinancialReportDaily">-</h4>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id='NetRevenueRowAccountFinancialReportsDaily'>
|
||||
<td>
|
||||
<h4><b id="NetRevenueLabel">Net Revenue</b></h4>
|
||||
</td>
|
||||
<td>
|
||||
<b>
|
||||
<h4 id="NetRevenueAmountfield_AccountingFinancialReportDaily"></h4>
|
||||
</b>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br><br><br>
|
||||
<script>
|
||||
|
||||
if (typeof targetdate === 'undefined' || targetdate === null) {
|
||||
targetdate = '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function GenerateDailyAccountingFinancialReportsNow(response) {
|
||||
|
||||
if (typeof currenttarget === 'object' && currenttarget.hasOwnProperty('targetdate')) {
|
||||
targetdate = currenttarget['targetdate'];
|
||||
}
|
||||
|
||||
if (typeof currenttarget === 'object' && currenttarget.hasOwnProperty('currenttarget')) {
|
||||
currenttarget = currenttarget['currenttarget'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (typeof targetdate === 'undefined' || targetdate === null || !targetdate) {
|
||||
targetdate = getDateInGMT8();
|
||||
targetdateObject = new Date(getDateInGMT8());
|
||||
}
|
||||
targetdateObject = new Date(targetdate);
|
||||
|
||||
|
||||
texttargetdate = formatDate(targetdateObject);
|
||||
|
||||
|
||||
|
||||
commissionprizeplayer = response.totalbetamount * 0.15;
|
||||
|
||||
|
||||
betMinusCommission = response.totalbetamount - commissionprizeplayer;
|
||||
|
||||
|
||||
|
||||
NetRevenueAmount = betMinusCommission - response.totalamountofprizes;
|
||||
|
||||
|
||||
if (NetRevenueAmount < 0) {
|
||||
$('#NetRevenueLabel').html('Net Loss');
|
||||
$('#NetRevenueAmountfield_AccountingFinancialReportDaily').css('color', 'red');
|
||||
$('#NetRevenueRowAccountFinancialReportsDaily').css('color', 'red');
|
||||
|
||||
$('#NetRevenueRowAccountFinancialReportsDaily').css('border', '2px solid red');
|
||||
} else {
|
||||
$('#NetRevenueLabel').html('Net Gain');
|
||||
$('#NetRevenueAmountfield_AccountingFinancialReportDaily').css('color', 'black');
|
||||
$('#NetRevenueRowAccountFinancialReportsDaily').css('color', 'black');
|
||||
|
||||
$('#NetRevenueRowAccountFinancialReportsDaily').css('border', '2px solid black');
|
||||
}
|
||||
|
||||
commissionprizeplayer = formatCurrency(commissionprizeplayer);
|
||||
betMinusCommission = formatCurrency(betMinusCommission);
|
||||
NetRevenueAmount = formatCurrency(NetRevenueAmount);
|
||||
totalbetamount = formatCurrency(response.totalbetamount);
|
||||
totalamountofprizes = formatCurrency(response.totalamountofprizes);
|
||||
|
||||
$('#FinancialReportsDailyTargetDate').html('Financial Reports for ' + texttargetdate);
|
||||
|
||||
$('#totalbetamountfield_AccountingFinancialReportDaily').html('+ ' + totalbetamount);
|
||||
$('#totalprizesamountfield_AccountingFinancialReportDaily').html('- ' + totalamountofprizes);
|
||||
|
||||
$('#commissionamountplayer_AccountingFinancialReportDaily').html('- ' + commissionprizeplayer);
|
||||
|
||||
|
||||
$('#BetAmountMinusCommissionPlayers_AccountingFinancialReportDaily').html('  <b>' + betMinusCommission + '</b>');
|
||||
|
||||
|
||||
|
||||
$('#NetRevenueAmountfield_AccountingFinancialReportDaily').html('  <b>' + NetRevenueAmount + '</b>');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function GenerateAccountFinancialReportDaily() {
|
||||
AjaxDo('?Accounting/FinancialReport/Daily', { targetdate: targetdate, currenttarget: currenttarget }, GenerateDailyAccountingFinancialReportsNow, null, reqtype = 'POST');
|
||||
}
|
||||
|
||||
|
||||
GenerateAccountFinancialReportDaily();
|
||||
|
||||
|
||||
TargetdateInput = document.getElementById('FinancialReportsDailyTargetDateSelect');
|
||||
|
||||
|
||||
TargetdateInput.value = getDateInGMT8();
|
||||
|
||||
TargetdateInput.addEventListener('change', function () {
|
||||
targetdate = TargetdateInput.value;
|
||||
GenerateAccountFinancialReportDaily();
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style>
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
</style>
|
||||
83
legacy/pages-html/slvl/adminpagesadvanced/accounting_reports
Normal file
83
legacy/pages-html/slvl/adminpagesadvanced/accounting_reports
Normal file
@@ -0,0 +1,83 @@
|
||||
<br><br><br><br>
|
||||
|
||||
<div class="card" id="primary-card">
|
||||
<div class="card-header ui-sortable-handle" style="cursor: move">
|
||||
<h1 class="card-title" style="font-size: 2.5rem;">Accounting Reports</h1>
|
||||
<div class="card-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table id="accounting_reports_list_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Report
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
/* Style each row as a button */
|
||||
.dataTable tbody tr {
|
||||
padding: .5rem 1rem;
|
||||
font-size: 1.25rem;
|
||||
line-height: 1.5;
|
||||
border-radius: .3rem;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
function GenerateAccountingReportsListRow(Name) {
|
||||
var parts = Name.split('-');
|
||||
|
||||
// Assign the parts to variables
|
||||
var text = parts[0];
|
||||
var value = parts[1];
|
||||
|
||||
return `<tr> <td><center><button class="btn-block btn-lg" onclick="ButtonGo('${value}',0);">${text}</button></center></td> </tr>`; }
|
||||
|
||||
async function GenerateAccountReportsListRows(responsearray) {
|
||||
let newhtmltable = [];
|
||||
|
||||
for (let i = 0; i < responsearray.length; i++) { newhtmltable.push(GenerateAccountingReportsListRow(responsearray[i])); }
|
||||
|
||||
|
||||
$("#accounting_reports_list_table").find("tbody").html(newhtmltable.join(''));
|
||||
|
||||
let reportslist = $("#accounting_reports_list_table").DataTable({
|
||||
"destroy": true,
|
||||
order: [[0, 'desc']],
|
||||
pageLength: 5,
|
||||
lengthMenu: [[5], [5]]
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$('#primary-card').fadeIn(200);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function GenerateAccountingReportsListTable() {
|
||||
AjaxDo('?AccountingReports/List', null, GenerateAccountReportsListRows, null, reqtype = 'POST');
|
||||
}
|
||||
|
||||
|
||||
GenerateAccountingReportsListTable();
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1,6 @@
|
||||
<script>
|
||||
$('#usertypecontrol').show();
|
||||
$('#userparentcontrol').show();
|
||||
$('#user-create-nickname-input-group').show();
|
||||
RePopulateParentList();
|
||||
</script>
|
||||
@@ -0,0 +1,185 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="card-body card-info" id="main-card-body" style="">
|
||||
<div class="row">
|
||||
<div class="col-md-18">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="card" id="secondary-card">
|
||||
<div class="card-header ui-sortable-handle" style="cursor: move;">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h4 class="card-title">Transfer My Credit</h4>
|
||||
</div>
|
||||
<div class="col">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card-tools">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body " id="credit-amount-request-form">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<input class="form-control" type="number" id="transfer-credit-amount-field" placeholder="Amount to Transfer" >
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<button value="Transfer" id ="Transfer-credit-initial-button" class=" form-control btn btn-primary" onclick="CreateAndShowModalTransferMyCreditConfirmation()">Transfer Credit</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function CreateAndShowModalTransferMyCreditConfirmation(){
|
||||
if (!$('#transfer-credit-amount-field').val()){return false;}
|
||||
|
||||
const modalid="modal-credit-transfer-confirmation";
|
||||
const modaltitle="Continue?";
|
||||
const modalbody=`
|
||||
<p>You are sending credit from your account to the target User?</p>
|
||||
|
||||
`;
|
||||
const modalfooter=`<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary" onclick="TransferMyCreditNow();" id="transfer-credit-now">Continue</button>`;
|
||||
|
||||
|
||||
CreateAndShowModal(modalid,modaltitle,modalbody,modalfooter,modalfooterclose=false,topclosebutton=true,modalbodyclass='modal-body',modalheaderclass='modal-header');
|
||||
|
||||
|
||||
}
|
||||
|
||||
function SuccessCreditTransferResponse(){
|
||||
|
||||
const modalid="modal-credit-transfer-success";
|
||||
const modaltitle="Success";
|
||||
const modalbody=`
|
||||
<p>Transfer has been sucessful.</p>
|
||||
|
||||
`;
|
||||
const modalfooter=`<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>`;
|
||||
|
||||
|
||||
CreateAndShowModal(modalid,modaltitle,modalbody,modalfooter,modalfooterclose=false,topclosebutton=true,modalbodyclass='modal-body',modalheaderclass='modal-header');
|
||||
$("#modal-credit-transfer-confirmation").modal('hide');
|
||||
Backkey();
|
||||
}
|
||||
|
||||
function ErrorCreditTransferResponse(){
|
||||
|
||||
const modalid="modal-credit-transfer-failed";
|
||||
const modaltitle="Failed";
|
||||
const modalbody=`
|
||||
<p>Failed to transfer credit. Try Again Later.</p>
|
||||
|
||||
`;
|
||||
const modalfooter=`<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>`;
|
||||
|
||||
|
||||
CreateAndShowModal(modalid,modaltitle,modalbody,modalfooter,modalfooterclose=false,topclosebutton=true,modalbodyclass='modal-body ',modalheaderclass='modal-header bg-danger');
|
||||
$("#modal-credit-transfer-confirmation").modal('hide');
|
||||
|
||||
}
|
||||
|
||||
|
||||
function TransferMyCreditNow(){
|
||||
|
||||
|
||||
function TransferCreditToUserNow(response){
|
||||
if (response===true){SuccessCreditTransferResponse();
|
||||
|
||||
}
|
||||
else if (response===false){ErrorCreditTransferResponse();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
AjaxDo('?user/sendmycredit', {amount: $("#transfer-credit-amount-field").val().trim(), user_target: currenttarget}, TransferCreditToUserNow, null, reqtype = 'POST');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
var currenttarget=0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
<script>
|
||||
function OpenTransferMyCreditButtonHtml(){return HomeMenuButtons('assets/transfercredit.png', 'Transfer My Credit', '','','45%', '45%','', buttononclick = "gotoPage('transfer_my_credit',currenttarget);", divclass = 'col-4','opentransfermycreditforuserbuttondiv');}
|
||||
$('#user_controls').append(OpenTransferMyCreditButtonHtml());
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user