/
var
/
www
/
vhosts
/
m-auto.co
/
httpdocs
/
admin
/
/var/www/vhosts/m-auto.co/httpdocs/admin
mkdir
upload
Name
Size
Mode
Actions
assets/
-
0755
rm
includes/
-
0755
rm
7-6-2026.zip
10206
0644
edit
dl
rm
about_edit.php
3899
0644
edit
dl
rm
about_process.php
1367
0644
edit
dl
rm
auth.php
684
0644
edit
dl
rm
bookings.php
5367
0644
edit
dl
rm
booking_delete.php
924
0644
edit
dl
rm
branches.php
2470
0644
edit
dl
rm
branch_delete.php
1290
0644
edit
dl
rm
branch_form.php
4694
0644
edit
dl
rm
branch_process.php
1233
0644
edit
dl
rm
brands.php
2578
0644
edit
dl
rm
brand_delete.php
1327
0644
edit
dl
rm
brand_form.php
2369
0644
edit
dl
rm
brand_process.php
1660
0644
edit
dl
rm
cars.php
6946
0644
edit
dl
rm
car_delete.php
2886
0644
edit
dl
rm
car_form.php
40348
0644
edit
dl
rm
car_image_actions.php
5142
0644
edit
dl
rm
car_process.php
10426
0644
edit
dl
rm
categories.php
2167
0644
edit
dl
rm
category_delete.php
746
0644
edit
dl
rm
category_form.php
1607
0644
edit
dl
rm
category_process.php
943
0644
edit
dl
rm
dashboard.php
4965
0644
edit
dl
rm
index.php
2713
0644
edit
dl
rm
login_process.php
1532
0644
edit
dl
rm
logout.php
100
0644
edit
dl
rm
news.php
3448
0644
edit
dl
rm
news_delete.php
771
0644
edit
dl
rm
news_form.php
6769
0644
edit
dl
rm
news_process.php
2527
0644
edit
dl
rm
offers.php
2810
0644
edit
dl
rm
offer_delete.php
1327
0644
edit
dl
rm
offer_form.php
4573
0644
edit
dl
rm
offer_process.php
2115
0644
edit
dl
rm
settings.php
5217
0644
edit
dl
rm
settings_process.php
692
0644
edit
dl
rm
slider.php
3529
0644
edit
dl
rm
slider_delete.php
1345
0644
edit
dl
rm
slider_form.php
4529
0644
edit
dl
rm
slider_process.php
1983
0644
edit
dl
rm
themes.php
4703
0644
edit
dl
rm
theme_delete.php
1332
0644
edit
dl
rm
theme_form.php
1522
0644
edit
dl
rm
theme_process.php
1785
0644
edit
dl
rm
users.php
4480
0644
edit
dl
rm
user_delete.php
1055
0644
edit
dl
rm
user_form.php
5463
0644
edit
dl
rm
user_process.php
3193
0644
edit
dl
rm
videos.php
4942
0644
edit
dl
rm
video_delete.php
1717
0644
edit
dl
rm
video_form.php
7181
0644
edit
dl
rm
video_process.php
3336
0644
edit
dl
rm
Edit:
/var/www/vhosts/m-auto.co/httpdocs/admin/users.php
(4480B)
<?php include 'includes/header.php'; require_permission('users_view'); // Fetch all users $users_result = $conn->query("SELECT id, username, email FROM users ORDER BY id ASC"); ?> <div class="container-fluid"> <div class="d-sm-flex align-items-center justify-content-between mb-4"> <h1 class="h3 mb-0 text-gray-800">إدارة المستخدمين</h1> <?php if (has_permission('users_add')): ?> <a href="user_form.php" class="btn btn-primary btn-icon-split"> <span class="icon text-white-50"> <i class="fas fa-plus"></i> </span> <span class="text">إضافة مستخدم جديد</span> </a> <?php else: ?> <div class="alert alert-warning"> ليس لديك صلاحية لإضافة مستخدمين جدد </div> <?php endif; ?> </div> <?php if (isset($_GET['success'])): ?> <div class="alert alert-success alert-dismissible fade show" role="alert"> تم حفظ البيانات بنجاح! <button type="button" class="btn-close" data-bs-dismiss="alert"></button> </div> <?php endif; ?> <div class="card shadow mb-4"> <div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">قائمة المستخدمين</h6> </div> <div class="card-body"> <div class="table-responsive"> <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> <thead> <tr> <th>المعرف</th> <th>اسم المستخدم</th> <th>البريد الإلكتروني</th> <th>نوع المستخدم</th> <th>الإجراءات</th> </tr> </thead> <tbody> <?php while($user = $users_result->fetch_assoc()): ?> <tr> <td><?php echo $user['id']; ?></td> <td><?php echo htmlspecialchars($user['username']); ?></td> <td><?php echo htmlspecialchars($user['email'] ?? 'غير محدد'); ?></td> <td> <?php if ($user['id'] == 1): ?> <span class="badge bg-success">مدير عام</span> <?php else: ?> <?php // Check if user has any permissions $perm_check = $conn->query("SELECT COUNT(*) as perm_count FROM user_permissions WHERE user_id = " . $user['id']); $perm_result = $perm_check->fetch_assoc(); if ($perm_result['perm_count'] > 0): ?> <span class="badge bg-primary">مستخدم مخول</span> <?php else: ?> <span class="badge bg-secondary">مستخدم عادي</span> <?php endif; ?> <?php endif; ?> </td> <td> <a href="user_form.php?id=<?php echo $user['id']; ?>" class="btn btn-info btn-sm"> <i class="fas fa-edit"></i> تعديل </a> <?php // Prevent deleting the user with ID 1 (the main admin) ?> <?php if ($user['id'] != 1 && $_SESSION['user_id'] != $user['id']): ?> <a href="user_delete.php?id=<?php echo $user['id']; ?>" class="btn btn-danger btn-sm" onclick="return confirm('هل أنت متأكد من رغبتك في حذف هذا المستخدم؟');"> <i class="fas fa-trash"></i> حذف </a> <?php endif; ?> </td> </tr> <?php endwhile; ?> </tbody> </table> </div> </div> </div> </div> <?php include 'includes/footer.php'; ?>
Save
query("SELECT id, username, email FROM users ORDER BY id ASC"); ?>
إدارة المستخدمين
إضافة مستخدم جديد
ليس لديك صلاحية لإضافة مستخدمين جدد
تم حفظ البيانات بنجاح!
قائمة المستخدمين
المعرف
اسم المستخدم
البريد الإلكتروني
نوع المستخدم
الإجراءات
fetch_assoc()): ?>
مدير عام
query("SELECT COUNT(*) as perm_count FROM user_permissions WHERE user_id = " . $user['id']); $perm_result = $perm_check->fetch_assoc(); if ($perm_result['perm_count'] > 0): ?>
مستخدم مخول
مستخدم عادي
تعديل
حذف