PHP WebShell
Текущая директория: /var/www/bitcardoApp/user/data
Просмотр файла: contacts.php
<? include '../common/header.php'; ?>
<!-- Main Container -->
<div class="container mt-3">
<div class="row">
<? include '../common/nav.php'; ?>
<!-- Main Content -->
<main class="col-md-9 col-lg-10 px-md-5 mb-5">
<? include '../common/page-header.php'; ?>
<div class="container my-4 px-md-5">
<div class="d-flex justify-content-center align-items-center mb-3">
<h4 class="mb-0 text-center">Contacts</h4>
</div>
<div class="row">
<div class="col-6 offset-md-2 col-md-4 justify-content-center">
<input type="text" id="contactSearch" class="form-control mb-4 mx-auto" placeholder="Search name">
</div>
<div class="col-6 col-md-4 border-start pt-1 text-center">
<button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#addBeneficiaryModal">Add New Beneficiary</button>
</div>
</div>
<div class="row" id="contactList">
<!-- Contact Cards -->
</div>
<div class="text-center mt-3">
<center>
<button id="showMoreBtn" class="btn btn-outline-secondary">Show more</button>
</center>
</div>
</div>
</main>
</div>
</div>
<script>
const contacts = [
{ name: 'Adaeze Ugo' },
{ name: 'Bello Elijah' },
{ name: 'Chinonso Okafor' },
{ name: 'Damilola Adeyemi' },
{ name: 'Emeka Obi' },
{ name: 'Fatima Idris' },
{ name: 'Gbenga Ojo' },
{ name: 'Hauwa Bello' },
{ name: 'Ifeanyi Nnaji' },
{ name: 'Joy Eze' },
{ name: 'Kemi Alabi' },
{ name: 'Lekan Shonubi' },
{ name: 'Mfon Ekong' },
{ name: 'Ngozi Okeke' },
{ name: 'Omotola Balogun' },
{ name: 'Paul Iroko' },
{ name: 'Queen Onoh' },
{ name: 'Rasheed Olayemi' },
{ name: 'Seyi Awolowo' },
{ name: 'Tunde Bakare' }
];
// Sort alphabetically by name
contacts.sort((a, b) => a.name.localeCompare(b.name));
const listContainer = document.getElementById('contactList');
const showMoreBtn = document.getElementById('showMoreBtn');
const searchInput = document.getElementById('contactSearch');
let visibleCount = 0;
function getInitials(name) {
return name.split(' ').map(word => word[0]).join('').toUpperCase();
}
function renderContacts(reset = false) {
if (reset) {
listContainer.innerHTML = '';
visibleCount = 0;
}
const query = searchInput.value.toLowerCase();
const filtered = contacts.filter(c => c.name.toLowerCase().includes(query));
const itemsToShow = filtered.slice(0, visibleCount + 6);
listContainer.innerHTML = '';
itemsToShow.forEach(contact => {
const col = document.createElement('div');
col.className = 'currency-col p-2 d-flex currency-card visible';
col.innerHTML = `
<div class="card shadow-sm w-100">
<div class="card-body d-flex justify-content-between align-items-center">
<div class="d-flex align-items-center">
<div class="bg-secondary text-white rounded-circle d-flex align-items-center justify-content-center me-3" style="width:40px; height:40px; font-weight:bold;">
${getInitials(contact.name)}
</div>
<div>
<strong>${contact.name}</strong>
</div>
</div>
<div>
<i class="bi bi-chevron-compact-right"></i>
</div>
</div>
</div>`;
listContainer.appendChild(col);
});
visibleCount = itemsToShow.length;
showMoreBtn.style.display = visibleCount < filtered.length ? 'block' : 'none';
}
showMoreBtn.addEventListener('click', () => renderContacts());
searchInput.addEventListener('input', () => renderContacts(true));
renderContacts();
</script>
<!-- Add Beneficiary Modal -->
<div class="modal fade" id="addBeneficiaryModal" tabindex="-1" aria-labelledby="addBeneficiaryModalLabel" aria-hidden="true">
<div class="modal-dialog">
<form id="addBeneficiaryForm" action="add_beneficiary.php" method="post" autocomplete="off">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addBeneficiaryModalLabel">Add New Beneficiary</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<h6>Beneficiary Info</h6>
<div class="mb-3">
<label for="ben_fname" class="form-label">First Name</label>
<input type="text" class="form-control" id="ben_fname" name="ben_fname" required>
</div>
<div class="mb-3">
<label for="ben_lname" class="form-label">Last Name</label>
<input type="text" class="form-control" id="ben_lname" name="ben_lname" required>
</div>
<div class="mb-3">
<label for="ben_wallet_coin" class="form-label">Wallet Coin</label>
<select class="form-select" id="ben_wallet_coin" name="ben_wallet_coin" required>
<option value="" disabled selected>Select Coin</option>
<option value="NGN">Naira (NGN)</option>
<option value="TUSDT">Tether (TUSDT)</option>
<!-- Add more coin options as needed -->
</select>
</div>
<div class="mb-3" id="walletBankNameGroup" style="display: none;">
<label for="ben_bank_name" class="form-label">Bank Name</label>
<input type="text" class="form-control" id="ben_bank_name" name="ben_bank_name">
</div>
<div class="mb-3">
<label for="ben_wallet_add" class="form-label" id="walletAddressLabel">Wallet/Account Number</label>
<input type="text" class="form-control" id="ben_wallet_add" name="ben_wallet_add">
</div>
<div class="mb-3">
<label for="ben_wallet_label" class="form-label">Bank <small>(e.g. "FirstBank", "GTBank") if Naira</small></label>
<input type="text" class="form-control" id="ben_wallet_label" name="ben_wallet_label">
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Add Beneficiary</button>
</div>
</div>
</form>
</div>
</div>
<? include '../common/footer.php'; ?>
Выполнить команду
Для локальной разработки. Не используйте в интернете!