[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: index.php
<?php require_once '../config/config.php'; requirePermission(['manager']); $pageTitle = 'الإعدادات'; $db = Database::getInstance(); $error = ''; $success = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (isset($_POST['update_settings'])) { try { $whatsappUrl = cleanInput($_POST['whatsapp_api_url'] ?? ''); $whatsappToken = cleanInput($_POST['whatsapp_api_token'] ?? ''); $companyName = cleanInput($_POST['company_name'] ?? ''); $companyPhone = cleanInput($_POST['company_phone'] ?? ''); $db->query("UPDATE settings SET setting_value = ?, updated_by = ? WHERE setting_key = 'whatsapp_api_url'", [$whatsappUrl, $_SESSION['user_id']]); $db->query("UPDATE settings SET setting_value = ?, updated_by = ? WHERE setting_key = 'whatsapp_api_token'", [$whatsappToken, $_SESSION['user_id']]); $db->query("UPDATE settings SET setting_value = ?, updated_by = ? WHERE setting_key = 'company_name'", [$companyName, $_SESSION['user_id']]); $db->query("UPDATE settings SET setting_value = ?, updated_by = ? WHERE setting_key = 'company_phone'", [$companyPhone, $_SESSION['user_id']]); logActivity($_SESSION['user_id'], 'settings_updated', 'تم تحديث إعدادات النظام'); $success = 'تم تحديث الإعدادات بنجاح'; } catch (Exception $e) { $error = 'حدث خطأ أثناء تحديث الإعدادات'; error_log($e->getMessage()); } } } $settingsSql = "SELECT setting_key, setting_value FROM settings"; $settingsData = $db->query($settingsSql)->fetchAll(); $settings = []; foreach ($settingsData as $setting) { $settings[$setting['setting_key']] = $setting['setting_value']; } include '../includes/header.php'; ?> <div class="row"> <div class="col-12 mb-4"> <h2><i class="bi bi-gear"></i> إعدادات النظام</h2> </div> </div> <div class="row"> <div class="col-md-8"> <?php if ($error): ?> <div class="alert alert-danger"><?php echo $error; ?></div> <?php endif; ?> <?php if ($success): ?> <div class="alert alert-success"><?php echo $success; ?></div> <?php endif; ?> <div class="card shadow-sm mb-4"> <div class="card-header bg-primary text-white"> <h5 class="mb-0"><i class="bi bi-building"></i> معلومات الشركة</h5> </div> <div class="card-body"> <form method="POST" action=""> <div class="mb-3"> <label for="company_name" class="form-label">اسم الشركة</label> <input type="text" class="form-control" id="company_name" name="company_name" value="<?php echo htmlspecialchars($settings['company_name'] ?? ''); ?>"> </div> <div class="mb-3"> <label for="company_phone" class="form-label">رقم هاتف الشركة</label> <input type="text" class="form-control" id="company_phone" name="company_phone" value="<?php echo htmlspecialchars($settings['company_phone'] ?? ''); ?>"> </div> <hr> <h5 class="mb-3"><i class="bi bi-whatsapp"></i> إعدادات واتساب</h5> <div class="alert alert-info"> <i class="bi bi-info-circle"></i> <strong>ملاحظة:</strong> لتفعيل إرسال رسائل واتساب التلقائية، يجب إدخال رابط API ورمز Token الخاص بك. </div> <div class="mb-3"> <label for="whatsapp_api_url" class="form-label">رابط WhatsApp API</label> <input type="url" class="form-control" id="whatsapp_api_url" name="whatsapp_api_url" placeholder="https://api.whatsapp.com/..." value="<?php echo htmlspecialchars($settings['whatsapp_api_url'] ?? ''); ?>"> <small class="form-text text-muted">أدخل رابط API الخاص بخدمة واتساب</small> </div> <div class="mb-3"> <label for="whatsapp_api_token" class="form-label">WhatsApp API Token</label> <input type="password" class="form-control" id="whatsapp_api_token" name="whatsapp_api_token" placeholder="أدخل رمز API Token" value="<?php echo htmlspecialchars($settings['whatsapp_api_token'] ?? ''); ?>"> <small class="form-text text-muted">أدخل رمز المصادقة الخاص بك</small> </div> <button type="submit" name="update_settings" class="btn btn-primary"> <i class="bi bi-check-lg"></i> حفظ الإعدادات </button> </form> </div> </div> <div class="card shadow-sm"> <div class="card-header bg-success text-white"> <h5 class="mb-0"><i class="bi bi-people"></i> إدارة المستخدمين</h5> </div> <div class="card-body"> <div class="d-flex justify-content-between align-items-center mb-3"> <p class="mb-0">إضافة وتعديل المستخدمين والصلاحيات</p> <a href="users.php" class="btn btn-success"> <i class="bi bi-person-plus"></i> إدارة المستخدمين </a> </div> </div> </div> </div> <div class="col-md-4"> <div class="card shadow-sm mb-4"> <div class="card-header bg-info text-white"> <h5 class="mb-0"><i class="bi bi-info-circle"></i> معلومات النظام</h5> </div> <div class="card-body"> <table class="table table-sm"> <tr> <td><strong>اسم النظام:</strong></td> <td><?php echo SYSTEM_NAME; ?></td> </tr> <tr> <td><strong>إصدار PHP:</strong></td> <td><?php echo phpversion(); ?></td> </tr> <tr> <td><strong>قاعدة البيانات:</strong></td> <td>MySQL</td> </tr> <tr> <td><strong>المنطقة الزمنية:</strong></td> <td><?php echo date_default_timezone_get(); ?></td> </tr> </table> </div> </div> <div class="card shadow-sm"> <div class="card-header bg-warning text-dark"> <h5 class="mb-0"><i class="bi bi-shield-check"></i> الأمان</h5> </div> <div class="card-body"> <ul class="mb-0"> <li>كلمات المرور مشفرة</li> <li>حماية ضد SQL Injection</li> <li>التحقق من الصلاحيات</li> <li>سجل جميع العمليات</li> </ul> <hr> <a href="../activity_log.php" class="btn btn-warning w-100"> <i class="bi bi-journal-text"></i> عرض سجل النشاطات </a> </div> </div> </div> </div> <?php include '../includes/footer.php'; ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium320.web-hosting.com
Server IP: 66.29.153.54
PHP Version: 8.2.29
Server Software: LiteSpeed
System: Linux premium320.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.86 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:
No
git:
Yes
User Info
Username: aoneqssk
User ID (UID): 1285
Group ID (GID): 1290
Script Owner UID: 1285
Current Dir Owner: 1285