/
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/news_form.php
(6769B)
<?php include 'includes/header.php'; ?> <?php $title = ''; $content = ''; $image = ''; $video_type = 'none'; $video_url = ''; $video_file = ''; $id = null; if (isset($_GET['id'])) { $id = $_GET['id']; $stmt = $conn->prepare("SELECT * FROM news WHERE id = ?"); $stmt->bind_param("i", $id); $stmt->execute(); $result = $stmt->get_result(); $article = $result->fetch_assoc(); if ($article) { $title = $article['title']; $content = $article['content']; $image = $article['image']; $video_type = $article['video_type'] ?? 'none'; $video_url = $article['video_url'] ?? ''; $video_file = $article['video_file'] ?? ''; } } ?> <div class="row"> <div class="col-12"> <div class="d-flex justify-content-between align-items-center mb-4"> <h2 class="fs-3"><?php echo $id ? 'تعديل الخبر' : 'إضافة خبر جديد'; ?></h2> <a href="news.php" class="btn btn-secondary"> <i class="fas fa-arrow-right me-2"></i>العودة للقائمة </a> </div> <div class="glass-card p-4"> <form action="news_process.php" method="post" enctype="multipart/form-data"> <input type="hidden" name="id" value="<?php echo $id; ?>"> <div class="mb-3"> <label for="title" class="form-label">عنوان الخبر</label> <input type="text" name="title" id="title" class="form-control" value="<?php echo htmlspecialchars($title); ?>" required> </div> <div class="mb-3"> <label for="content" class="form-label">محتوى الخبر</label> <textarea name="content" id="content" class="form-control" rows="10" required><?php echo htmlspecialchars($content); ?></textarea> </div> <div class="mb-3"> <label for="image" class="form-label">صورة الخبر</label> <input type="file" name="image" id="image" class="form-control" accept="image/*"> <?php if ($image): ?> <div class="mt-3"> <p class="text-muted mb-2">الصورة الحالية:</p> <img src="../uploads/news/<?php echo htmlspecialchars($image); ?>" alt="<?php echo htmlspecialchars($title); ?>" class="img-thumbnail" style="max-width: 200px;"> </div> <?php endif; ?> </div> <div class="mb-3"> <label class="form-label">نوع الفيديو المضمن</label> <div class="d-flex gap-3"> <div class="form-check"> <input class="form-check-input" type="radio" name="video_type" id="video_type_none" value="none" <?php echo ($video_type == 'none') ? 'checked' : ''; ?>> <label class="form-check-label" for="video_type_none">بدون فيديو</label> </div> <div class="form-check"> <input class="form-check-input" type="radio" name="video_type" id="video_type_url" value="url" <?php echo ($video_type == 'url') ? 'checked' : ''; ?>> <label class="form-check-label" for="video_type_url">رابط خارجي (YouTube)</label> </div> <div class="form-check"> <input class="form-check-input" type="radio" name="video_type" id="video_type_file" value="file" <?php echo ($video_type == 'file') ? 'checked' : ''; ?>> <label class="form-check-label" for="video_type_file">ملف فيديو محلي</label> </div> </div> </div> <div class="mb-3" id="url_section" style="<?php echo ($video_type != 'url') ? 'display:none;' : ''; ?>"> <label for="video_url" class="form-label">رابط الفيديو (YouTube)</label> <input type="url" name="video_url" id="video_url" class="form-control" value="<?php echo htmlspecialchars($video_url); ?>" placeholder="https://www.youtube.com/watch?v=..."> </div> <div class="mb-3" id="file_section" style="<?php echo ($video_type != 'file') ? 'display:none;' : ''; ?>"> <label for="video_file" class="form-label">ملف الفيديو</label> <input type="file" name="video_file" id="video_file" class="form-control" accept="video/*"> <?php if ($video_file): ?> <div class="mt-2"> <small class="text-muted">الملف الحالي: <?php echo htmlspecialchars($video_file); ?></small> <input type="hidden" name="current_video_file" value="<?php echo htmlspecialchars($video_file); ?>"> </div> <?php endif; ?> </div> <div class="d-flex gap-2"> <button type="submit" class="btn btn-primary"> <i class="fas fa-save me-2"></i><?php echo $id ? 'حفظ التعديلات' : 'إضافة الخبر'; ?> </button> <a href="news.php" class="btn btn-secondary"> <i class="fas fa-times me-2"></i>إلغاء </a> </div> </form> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded', function() { const typeNone = document.getElementById('video_type_none'); const typeUrl = document.getElementById('video_type_url'); const typeFile = document.getElementById('video_type_file'); const urlSection = document.getElementById('url_section'); const fileSection = document.getElementById('file_section'); function toggleSections() { if (typeUrl.checked) { urlSection.style.display = 'block'; fileSection.style.display = 'none'; } else if (typeFile.checked) { urlSection.style.display = 'none'; fileSection.style.display = 'block'; } else { urlSection.style.display = 'none'; fileSection.style.display = 'none'; } } typeNone.addEventListener('change', toggleSections); typeUrl.addEventListener('change', toggleSections); typeFile.addEventListener('change', toggleSections); }); </script> <?php include 'includes/footer.php'; ?>
Save
cmd:
run