[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: bulk-sms.php
<?php date_default_timezone_set("Africa/Accra"); // adjust to your TZ ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); include("../functions.php"); //error_reporting(0); if(!isset($_SESSION['dbmail_Xw211qAAsq4'])){ header("location:../auth-login"); } else { $s_code = $_SESSION['s_code_Xw2119904']; if (isset($_GET['schoolCode']) || !empty($_GET['schoolCode'])) { $schoolCode = test_input($_GET['schoolCode']); } // $username = ""; // $password = ""; // $senderID = ""; $getsmsdata = mysqli_query($new, "SELECT * FROM sms_api WHERE schoolCode = '$s_code'"); $data = mysqli_fetch_array($getsmsdata); $username = $data['username']; $password = $data['password']; $senderID = $data['senderID']; if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (!empty($_POST['numbers']) && !empty($_POST['message'])) { $selectedNumbers = $_POST['numbers']; // Array of selected numbers $message = $_POST['message']; foreach ($selectedNumbers as $dbnum) { $data = json_encode([ 'username' => $username, 'password' => $password, 'source' => $senderID, 'destination' => $dbnum, 'message' => $message, 'ol' => false, ]); $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => 'https://deywuro.com/api/sms', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => [ 'Accept: application/json', 'Content-Type: application/json', ], ]); try { $response = curl_exec($curl); if (curl_errno($curl)) { $message = "Error sending to $dbnum: " . curl_error($curl) . "<br>"; } else { echo "<script> document.addEventListener('DOMContentLoaded', function() { Swal.fire({ title: 'Success!', text: 'Message sent successfully.', icon: 'success', confirmButtonText: 'OK' }); }); </script>"; } } catch (Throwable $th) { $message = "Error sending SMS: " . $th->getMessage() . "<br>"; } finally { curl_close($curl); } } } else { echo "<script> document.addEventListener('DOMContentLoaded', function() { Swal.fire({ title: 'Success!', text: 'Please select at least one recipient and enter a message', icon: 'success', confirmButtonText: 'OK' }); }); </script>"; } } } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>SEND BULK SMS </title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta content="Premium Multipurpose Admin & Dashboard Template" name="description" /> <meta content="Themesbrand" name="author" /> <!-- App favicon --> <!-- DataTables --> <link href="assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" /> <link href="assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css" rel="stylesheet" type="text/css" /> <!-- Responsive datatable examples --> <link href="assets/libs/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css" /> <!-- preloader css --> <link rel="stylesheet" href="assets/css/preloader.min.css" type="text/css" /> <!-- Bootstrap Css --> <link href="assets/css/bootstrap.min.css" id="bootstrap-style" rel="stylesheet" type="text/css" /> <!-- Icons Css --> <link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" /> <!-- App Css--> <link href="assets/css/app.min.css" id="app-style" rel="stylesheet" type="text/css" /> <link href="assets/libs/sweetalert2/sweetalert2.min.css" rel="stylesheet" type="text/css" /> </head> <style> body { background: #f5f6fa; padding: 20px; } .dash-card { max-width: 1100px; margin: auto; padding: 20px; border-radius: 12px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.1); } </style> <script> function toggleSelectAll(source) { let checkboxes = document.querySelectorAll('input[name="numbers[]"]'); checkboxes.forEach(checkbox => checkbox.checked = source.checked); } function insertMessage() { let messageTemplates = { "thank_you": `Hello! \n\nThank you for choosing <?php echo $shopname; ?>. We appreciate your support and look forward to serving you again!\n\nBest regards, \n<?php echo $shopname; ?> Team.`, "PTA": `Goods: Hello, just confirming that we've received the items !\n\n Everything looks goodโthank you!`, "custom": "" }; let selectedTemplate = document.getElementById("templateSelector").value; document.getElementById("messageBox").value = messageTemplates[selectedTemplate]; } </script> <style> .hidden-row { display: none !important; } </style> <script> let searchTimeout; function toggleSelectAll(source) { document.querySelectorAll('input[name="numbers[]"]').forEach(checkbox => { checkbox.checked = source.checked; }); } function liveSearch() { clearTimeout(searchTimeout); // Prevent multiple rapid calls searchTimeout = setTimeout(() => { let input = document.getElementById("searchInput").value.toLowerCase(); let rows = document.querySelectorAll("#customerTable tbody tr"); rows.forEach(row => { let phone = row.dataset.phone; row.classList.toggle("hidden-row", !phone.includes(input)); }); }, 200); // Debounced for performance } </script> <body> <!-- <body data-layout="horizontal"> --> <!-- Begin page --> <div id="layout-wrapper"> <?php include("includes/header.php");?> <?php include("includes/sidebar.php");?> <div class="main-content"> <div class="page-content"> <div class="container-fluid"> <!-- start page title --> <div class="row"> <div class="col-12"> <div class="page-title-box d-sm-flex align-items-center justify-content-between"> <h4 class="mb-sm-0 font-size-18">BULK SMS</h4> <div class="page-title-right"> <ol class="breadcrumb m-0"> <li class="breadcrumb-item"><a href="javascript: void(0);">Home</a></li> <li class="breadcrumb-item active">BULK SMS</li> </ol> </div> </div> </div> </div> <!-- end page title --> <div class="row"> <div class="col-12"> <div class="row"> <!-- Table Column --> <div class="col-md-6"> <div class="table-responsive"> <form method="POST"> <table id="customerTable" class="table table-striped table-bordered" style="width:100%"> <thead style="background-color: #428bca; border: #428bca;"> <tr style="color: #ffffff;"> <th>#</th> <th>Phone</th> <th>Class name</th> <th> <input type="checkbox" id="selectAll" onclick="toggleSelectAll(this)"> All </th> </tr> </thead> <tbody id="tableBody"> <tr><td colspan="4">Loading data...</td></tr> </tbody> </table> </div> </div> <!-- Message Box Column --> <div class="col-md-6"> <label for="templateSelector">Choose a Template:</label> <select id="templateSelector" class="form-control" onchange="insertMessage()"> <option value="custom">โ๏ธ Write Your Own</option> <!-- <option value="thank_you">๐ Thank You Message</option> --> <!-- <option value="Delivery">๐ Promotional Offer</option> --> <option value="PTA">๐ PTA</option> </select> <textarea id="messageBox" name="message" class="form-control mt-3" rows="5" required></textarea> <br> <button type="submit" class="btn btn-success w-100">๐ฉ Send SMS</button> </div> </div> </div> </form> <script> function toggleSelectAll() { let checkboxes = document.querySelectorAll('.student-check'); let allChecked = [...checkboxes].every(ch => ch.checked); checkboxes.forEach(ch => ch.checked = !allChecked); } </script> </div> <!-- End Page-content --> <?php include("includes/footer.php");?> </div> <!-- end main content--> </div> <!-- END layout-wrapper --> <script> document.addEventListener("DOMContentLoaded", function() { const tableBody = document.getElementById("tableBody"); fetch(`load_customer_data.php?s_code=<?php echo $s_code; ?>`) .then(response => response.json()) .then(data => { tableBody.innerHTML = ""; // Clear placeholder if (!data.success || data.records.length === 0) { tableBody.innerHTML = '<tr><td colspan="4">No records found</td></tr>'; return; } data.records.forEach((record, index) => { const tr = document.createElement("tr"); tr.innerHTML = ` <td>${index + 1}</td> <td>${escapeHtml(record.mobile_num)}</td> <td>${escapeHtml(record.classname)}</td> <td> <input type="checkbox" name="numbers[]" value="${escapeHtml(record.mobile_num)}"> </td> `; tableBody.appendChild(tr); }); }) .catch(error => { console.error("Error:", error); tableBody.innerHTML = '<tr><td colspan="4">Error loading data</td></tr>'; }); }); // Toggle Select All checkboxes function toggleSelectAll(checkbox) { const checkboxes = document.querySelectorAll('input[name="numbers[]"]'); checkboxes.forEach(cb => cb.checked = checkbox.checked); } // Escape HTML for safety function escapeHtml(unsafe) { if (!unsafe) return ""; return unsafe.toString() .replace(/&/g, "&") .replace(/</g, "<") .replace(/>/g, ">") .replace(/"/g, """) .replace(/'/g, "'"); } </script> <!-- Right Sidebar --> <div class="right-bar"> <div data-simplebar class="h-100"> <div class="rightbar-title d-flex align-items-center p-3"> <h5 class="m-0 me-2">Theme Customizer</h5> <a href="javascript:void(0);" class="right-bar-toggle ms-auto"> <i class="mdi mdi-close noti-icon"></i> </a> </div> <!-- Settings --> <hr class="m-0" /> <div class="p-4"> <h6 class="mb-3">Layout</h6> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout" id="layout-vertical" value="vertical"> <label class="form-check-label" for="layout-vertical">Vertical</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout" id="layout-horizontal" value="horizontal"> <label class="form-check-label" for="layout-horizontal">Horizontal</label> </div> <h6 class="mt-4 mb-3 pt-2">Layout Mode</h6> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout-mode" id="layout-mode-light" value="light"> <label class="form-check-label" for="layout-mode-light">Light</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout-mode" id="layout-mode-dark" value="dark"> <label class="form-check-label" for="layout-mode-dark">Dark</label> </div> <h6 class="mt-4 mb-3 pt-2">Layout Width</h6> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout-width" id="layout-width-fuild" value="fuild" onchange="document.body.setAttribute('data-layout-size', 'fluid')"> <label class="form-check-label" for="layout-width-fuild">Fluid</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout-width" id="layout-width-boxed" value="boxed" onchange="document.body.setAttribute('data-layout-size', 'boxed')"> <label class="form-check-label" for="layout-width-boxed">Boxed</label> </div> <h6 class="mt-4 mb-3 pt-2">Layout Position</h6> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout-position" id="layout-position-fixed" value="fixed" onchange="document.body.setAttribute('data-layout-scrollable', 'false')"> <label class="form-check-label" for="layout-position-fixed">Fixed</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout-position" id="layout-position-scrollable" value="scrollable" onchange="document.body.setAttribute('data-layout-scrollable', 'true')"> <label class="form-check-label" for="layout-position-scrollable">Scrollable</label> </div> <h6 class="mt-4 mb-3 pt-2">Topbar Color</h6> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="topbar-color" id="topbar-color-light" value="light" onchange="document.body.setAttribute('data-topbar', 'light')"> <label class="form-check-label" for="topbar-color-light">Light</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="topbar-color" id="topbar-color-dark" value="dark" onchange="document.body.setAttribute('data-topbar', 'dark')"> <label class="form-check-label" for="topbar-color-dark">Dark</label> </div> <h6 class="mt-4 mb-3 pt-2 sidebar-setting">Sidebar Size</h6> <div class="form-check sidebar-setting"> <input class="form-check-input" type="radio" name="sidebar-size" id="sidebar-size-default" value="default" onchange="document.body.setAttribute('data-sidebar-size', 'lg')"> <label class="form-check-label" for="sidebar-size-default">Default</label> </div> <div class="form-check sidebar-setting"> <input class="form-check-input" type="radio" name="sidebar-size" id="sidebar-size-compact" value="compact" onchange="document.body.setAttribute('data-sidebar-size', 'md')"> <label class="form-check-label" for="sidebar-size-compact">Compact</label> </div> <div class="form-check sidebar-setting"> <input class="form-check-input" type="radio" name="sidebar-size" id="sidebar-size-small" value="small" onchange="document.body.setAttribute('data-sidebar-size', 'sm')"> <label class="form-check-label" for="sidebar-size-small">Small (Icon View)</label> </div> <h6 class="mt-4 mb-3 pt-2 sidebar-setting">Sidebar Color</h6> <div class="form-check sidebar-setting"> <input class="form-check-input" type="radio" name="sidebar-color" id="sidebar-color-light" value="light" onchange="document.body.setAttribute('data-sidebar', 'light')"> <label class="form-check-label" for="sidebar-color-light">Light</label> </div> <div class="form-check sidebar-setting"> <input class="form-check-input" type="radio" name="sidebar-color" id="sidebar-color-dark" value="dark" onchange="document.body.setAttribute('data-sidebar', 'dark')"> <label class="form-check-label" for="sidebar-color-dark">Dark</label> </div> <div class="form-check sidebar-setting"> <input class="form-check-input" type="radio" name="sidebar-color" id="sidebar-color-brand" value="brand" onchange="document.body.setAttribute('data-sidebar', 'brand')"> <label class="form-check-label" for="sidebar-color-brand">Brand</label> </div> <h6 class="mt-4 mb-3 pt-2">Direction</h6> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout-direction" id="layout-direction-ltr" value="ltr"> <label class="form-check-label" for="layout-direction-ltr">LTR</label> </div> </div> </div> <!-- end slimscroll-menu--> </div> <!-- /Right-bar --> <!-- Right bar overlay--> <div class="rightbar-overlay"></div> <!-- JAVASCRIPT --> <script src="assets/libs/jquery/jquery.min.js"></script> <script src="assets/libs/bootstrap/js/bootstrap.bundle.min.js"></script> <script src="assets/libs/metismenu/metisMenu.min.js"></script> <script src="assets/libs/simplebar/simplebar.min.js"></script> <script src="assets/libs/node-waves/waves.min.js"></script> <script src="assets/libs/feather-icons/feather.min.js"></script> <!-- pace js --> <script src="assets/libs/pace-js/pace.min.js"></script> <!-- Required datatable js --> <script src="assets/libs/datatables.net/js/jquery.dataTables.min.js"></script> <script src="assets/libs/datatables.net-bs4/js/dataTables.bootstrap4.min.js"></script> <!-- Buttons examples --> <script src="assets/libs/datatables.net-buttons/js/dataTables.buttons.min.js"></script> <script src="assets/libs/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js"></script> <script src="assets/libs/jszip/jszip.min.js"></script> <script src="assets/libs/pdfmake/build/pdfmake.min.js"></script> <script src="assets/libs/pdfmake/build/vfs_fonts.js"></script> <script src="assets/libs/datatables.net-buttons/js/buttons.html5.min.js"></script> <script src="assets/libs/datatables.net-buttons/js/buttons.print.min.js"></script> <script src="assets/libs/datatables.net-buttons/js/buttons.colVis.min.js"></script> <!-- Responsive examples --> <script src="assets/libs/datatables.net-responsive/js/dataTables.responsive.min.js"></script> <script src="assets/libs/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js"></script> <script src="assets/libs/sweetalert2/sweetalert2.min.js"></script> <!-- Datatable init js --> <script src="assets/js/pages/datatables.init.js"></script> <script src="assets/js/app.js"></script> <script src="assets/js/pages/validation.init.js"></script> <script src="assets/js/pages/modal.init.js"></script> <script> var myModal = document.getElementById('myModal') var myInput = document.getElementById('myInput') myModal.addEventListener('shown.bs.modal', function () { myInput.focus() }) </script> </body> </html>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.74 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002