initial: bootstrap from BukidBountyApp base

This commit is contained in:
Jonathan Sykes
2026-06-06 18:43:00 +08:00
commit eb4a5731fb
5674 changed files with 160857 additions and 0 deletions

View File

@@ -0,0 +1,238 @@
<br><br><br><br>
<div class="card" id="secondary-card" style="display:none;">
<div class="card-header ui-sortable-handle" style="cursor: move;">
<h3 class="card-title">Credit Requests</h3>
<div class="card-tools"></div>
</div>
<div class="card-body">
<table id="Credit_Requests_list_table">
<thead>
<tr>
<th>From</th>
<th>User</th>
<th>Request<br>Date</th>
<th>Request<br>Amount</th>
<th>ACTION</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<script>
function ApproveCreditRequestSuccessModal(Number, amount) {
const modalid = "modal-approve-credit_request-success";
const modaltitle = "Success";
const modalbody = `
<p>The following Credit Request is approved.</p><br>`+ CreditRequestMessageSpecificAmmountsandRequestor(Number, amount);
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-approve-credit_request-confirmation').modal('hide');
ReloadPage();
}
function ApproveCreditRequestFailedModal(Number, amount,response) {
if (!response){response='';}
const modalid = "modal-approve-credit_request-failed";
const modaltitle = "Error";
const modalbody = `
<p>Error! The following Credit request was not approved. Please try again later.</p><br>`+ CreditRequestMessageSpecificAmmountsandRequestor(Number, amount)+
`<br><br>`+response;
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-approve-credit_request-confirmation').modal('hide');
ReloadPage();
}
function ApproveCreditRequest(Number, amount, hashkey) {
function ApproveCreditRequestNow(response) {
if (response === true) {
ApproveCreditRequestSuccessModal(Number, amount);
} else if (response === false) {
ApproveCreditRequestFailedModal(Number, amount);
} else {
ApproveCreditRequestFailedModal(Number, amount,response);
}
}
AjaxDo('?admin/advanced/credit_request/approve', {
target_hash: hashkey
}, ApproveCreditRequestNow, null, reqtype = 'POST');
}
function RejectCreditRequestSuccessModal(Number, amount) {
const modalid = "modal-reject-credit_request-success";
const modaltitle = "Success";
const modalbody = `
<p>The following Credit Request is Denied.</p><br>` + CreditRequestMessageSpecificAmmountsandRequestor(Number, amount);
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-reject-credit_request-confirmation').modal('hide');
ReloadPage();
}
function RejectCreditRequestFailedModal(Number, amount) {
const modalid = "modal-reject-credit_request-failed";
const modaltitle = "Failed";
const modalbody = `
<p>Error! The following Credit Request was not Denied. Please try again later</p><br>` + CreditRequestMessageSpecificAmmountsandRequestor(Number, amount);
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-reject-credit_request-confirmation').modal('hide');
ReloadPage();
}
function RejectCreditRequest(Number, amount, hashkey) {
function RejectCreditRequestNow(response) {
if (response === true) {
RejectCreditRequestSuccessModal(Number, amount);
} else if (response === false) {
RejectCreditRequestFailedModal(Number, amount);
}
}
AjaxDo('?admin/advanced/credit_request/reject', {
target_hash: hashkey
}, RejectCreditRequestNow, null, reqtype = 'POST');
}
function CreditRequestMessageSpecificAmmountsandRequestor(Number, amount) {
return ` Requested By : ${Number}<br>
Amount&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp &nbsp: ${amount}<br>`;
}
function ApproveCreditRequestModal(Number, amount, Hashkey) {
const modalid = "modal-approve-credit_request-confirmation";
const modaltitle = "Approve";
const modalbody = `
<p>Are You sure you want to approve the credit request?</p><br>` +
CreditRequestMessageSpecificAmmountsandRequestor(Number, amount);
const modalfooter = `<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" onclick="ApproveCreditRequest('${Number}',${amount},'${Hashkey}');" id="approve-credit-request">Continue</button>`;
CreateAndShowModal(modalid, modaltitle, modalbody, modalfooter, modalfooterclose = false, topclosebutton = true, modalbodyclass = 'modal-body', modalheaderclass = 'modal-header');
}
function RejectCreditRequestModal(Number, amount, Hashkey) {
const modalid = "modal-reject-credit_request-confirmation";
const modaltitle = "Reject";
const modalbody = `
<p>Are you sure you want to deny the credit request?</p><br>` +
CreditRequestMessageSpecificAmmountsandRequestor(Number, amount);
const modalfooter = `<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" onclick="RejectCreditRequest(${Number},${amount},'${Hashkey}');" id="approve-credit-request">Continue</button>`;
CreateAndShowModal(modalid, modaltitle, modalbody, modalfooter, modalfooterclose = false, topclosebutton = true, modalbodyclass = 'modal-body', modalheaderclass = 'modal-header');
}
function GenerateCreditRequestDetailsRow(From,To, date, amount, status, Hashkey) {
let activecheckbox = '';
const approvebutton = `<button class="btn btn-warning btn-block" onclick="ApproveCreditRequestModal('${To}',${amount},'${Hashkey}')">Approve</button>`;
const rejectbutton = `<button class="btn btn-danger btn-block" onclick="RejectCreditRequestModal('${To}',${amount},'${Hashkey}')">Reject</button>`;
if (status === 0) {
actionbutton = approvebutton + rejectbutton;
} else if (status === -1) {
actionbutton = 'Denied';
} else if (status === 1) {
actionbutton = 'Approved';
}else if (status === 2) {
actionbutton = 'Directly Sent by You.';
}
return `<tr>
<td>${From}</td>
<td>${To}</td>
<td>${date}</td>
<td>${amount}</td>
<td>${actionbutton}</td>
</tr>`;
}
async function GenerateCreditRequestRows(responsearray) {
//console.log(responsearray);
$("#Credit_Requests_list_table").find("tbody").html('');
let newhtmltable = '';
for (let i = 0; i < responsearray.length; i++) {
newhtmltable += GenerateCreditRequestDetailsRow(responsearray[i]['creditor'],responsearray[i]['target_user'], responsearray[i]['request_date'], responsearray[i]['amount'], responsearray[i]['status'], responsearray[i]['hashkey']);
}
//$("#User_list_table").find("tbody").replaceWith(newhtmltable);
// new DataTable('#User_list_table');
$("#Credit_Requests_list_table").find("tbody").html(newhtmltable);
$("#Credit_Requests_list_table").DataTable({
"destroy": true,
order: [
[1, 'desc']
],
pageLength: 5,
lengthMenu: [
[5],
[5]
]
})
$('#secondary-card').fadeIn(200);
}
function GenerateCreditRequestTable() {
AjaxDo('?admin/list/credit_requests', null, GenerateCreditRequestRows, null, reqtype = 'POST');
}
GenerateCreditRequestTable();
</script>

View File

@@ -0,0 +1,50 @@
<script id="main-script">
cardshtml='<br><br><br>'+CreateBalanceCard(titletext='Welcome Team Leader',maincardid='main-card-body',firstrowtext='Total Balance',firstrowvalueid='total-balance',firstrowvaluetext='...' ,secondrowtext='',secondrowvalueid='',secodrowvaluetext='',secondrowvisible=false,footerrowid='phone-number',footerrowtext='...')
+ `<br><br>`;
cardshtml+= createCard(cardtitle='',cardid='secondary-card',cardtools='',cardbodyid='HomeMenuButtons',cardbodytext='',cardbodyclassadd='row','',true);
cardshtml+= createCard(cardtitle='Draws Today',cardid='draws',cardtools='',cardbodyid='div_draw_numbers_today',cardbodytext='',cardbodyclassadd='',maincardstyle='');
cardshtml+= createCard(cardtitle='Winning Numbers Today',cardid='winning-numbers-today-home',cardtools='',cardbodyid='div_winning_numbers_today',cardbodytext='',cardbodyclassadd='',maincardstyle='');
cardshtml+='<br><br>';
$('#main-body').html(cardshtml);
loaddrawnumberstoday();
loadwinningnumberstoday();
if (typeof HomeButtonsHtml === 'undefined') {
let HomeButtonsHtml = '';
}
HomeButtonsHtml='';
HomeButtonsHtml = HomeMenuButtons('assets/qrcode.svg','Scan QR', 'qr_reader',0,'35%','35%');
HomeButtonsHtml += HomeMenuButtons('assets/user-list.png','Users', 'user_list',0,'20%','35%');
HomeButtonsHtml += HomeMenuButtons('assets/lotteryschedule.png','Game Schedule', 'lottery_schedule',0,'20%','50%');
HomeButtonsHtml += HomeMenuButtons('assets/CreateUser.png','Create User', 'create_user',0,'20%','40%');
HomeButtonsHtml += HomeMenuButtons('assets/creditrequests.png','Credit Requests', 'credit_requests',0,'20%','40%');
HomeButtonsHtml += HomeMenuButtons('assets/request-credit.png','Request Credit', 'request_credit',0,'20%','40%');
HomeButtonsHtml += HomeMenuButtons('assets/reports.png','Reports', 'MyReports',0,'20%','40%');
HomeButtonsHtml += HomeMenuButtons('assets/gear.png','Account Settings', 'account_settings',0,'20%','40%');
$('#HomeMenuButtons').html(HomeButtonsHtml);
//$("#balance_bottom_nav").hide();
$('#bets_history_bottom_nav').hide();
loaduserdatadashboard();
loaddrawnumberstoday();
loadwinningnumberstoday();
setInterval(loaduserdatadashboard, '20000');
setInterval(loaddrawnumberstoday, '20000');
setInterval(loadwinningnumberstoday, '20000');
</script>

View File

@@ -0,0 +1,25 @@
<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;">Reports</h1>
<div class="card-tools">
</div>
</div>
<div class="card-body ">
<div class="row card-body">
<div class="col-md-6" style="padding-bottom: 1.5rem;">
<button class="btn-block btn-lg" onclick="ButtonGo('DailyBetsTransfersProfitsSummary',0);">Daily Summary of Transfers, Bets, Prizes and Profits </button>
</div>
<div class="col-md-6" style="padding-bottom: 1.5rem; display:none;">
<button class="btn-block btn-lg" onclick="ButtonGo('DailyTransfersReport',0);">Daily Transfers</button>
</div>
<div class="col-md-6" style="padding-bottom: 1.5rem; display:none;">
<button class="btn-block btn-lg" onclick="ButtonGo('BetAmountsAndPrizes30Days',0);">Bet Amounts And Prizes for
the Last 30 Days</button>
</div>
</div>
</div>
</div>