Priority File Manager

📁 public_html
Base Directory:
/home/ecedu/public_html/new/Views/layouts
NameTypeSizeActions
📁 .. Folder -
📄 aboutus-layout.php File 1676
Edit Download
📄 article-layout.php File 22554
Edit Download
📄 back-top.php File 706
Edit Download
📄 body-layout.php File 1313
Edit Download
📄 contactus-layout.php File 4025
Edit Download
📄 department-layout.php File 3736
Edit Download
📄 footer-layout.php File 5862
Edit Download
📄 header-layout.php File 451
Edit Download
📄 header-second.php File 827
Edit Download
📄 index-layout.php File 4027
Edit Download
📄 list-languages.php File 5393
Edit Download
📄 list-news-layout.php File 6488
Edit Download
📄 list-pdf-layout.php File 4459
Edit Download
📄 main-func.php File 59071
Edit Download
📄 main-layout.php File 8313
Edit Download
📄 main-menu.php File 3613
Edit Download
📄 mobile-menu.php File 5453
Edit Download
📄 mobile-side.php File 14998
Edit Download
📄 pdf-layout.php File 3
Edit Download
📄 right_sidebar.php File 3970
Edit Download
📄 search-layout.php File 5408
Edit Download
📄 top-menu.php File 1175
Edit Download
📄 top_slider.php File 2320
Edit Download
'عربي', 'ku' => 'کوردی', 'en' => 'English', ]; $tables = getTables(); $currentLangName = isset($langNames[$lang]) ? $langNames[$lang] : 'English'; // ------------------------------------- // 2) توليد أسماء الجداول تلقائياً // ------------------------------------- // ———– طريقة 1: إذا كنت تعرف عدد الجداول الثابت مسبقاً // ------------------------------------- // 2) تعريف باقي المتغيرات والمصفوفات // ------------------------------------- // نص من نحن - افتراضياً فارغ، قد يعبأ من قاعدة البيانات. // تهيئة المتغيرات الافتراضية $type_id = 0; $_aboutus = ''; $aboutus = ''; $aboutus1 = ''; $aboutus2 = ''; $_contactus = ''; $contactus = ''; $contactus1 = ''; $contactus2 = ''; $address = ''; $social = array_fill(1, 4, ''); // للمواقع الاجتماعية $logo = []; // للشعارات $ads_url1 = ''; $ads_img1 = ''; $details_title = ''; $details1_title = ''; $details2_title = ''; $details_description = ''; $details1_description = ''; $details2_description = ''; $news_path = "service/images/news/"; // 1) محتوى "من نحن" if (!empty($editorialData) && is_array($editorialData)) { $aboutus = $editorialData['text_description'] ?? ''; $aboutus1 = $editorialData['text_description1'] ?? ''; $aboutus2 = $editorialData['text_description2'] ?? ''; switch ($lang) { case 'ku': $_aboutus = $aboutus1 !== '' ? $aboutus1 : $aboutus; break; case 'en': $_aboutus = $aboutus2 !== '' ? $aboutus2 : $aboutus; break; default: $_aboutus = $aboutus; } } // 2) محتوى "اتصل بنا" if (!empty($contactusData) && is_array($contactusData)) { $contactus = $contactusData['text_description'] ?? ''; $contactus1 = $contactusData['text_description1'] ?? ''; $contactus2 = $contactusData['text_description2'] ?? ''; switch ($lang) { case 'ku': $_contactus = $contactus1 !== '' ? $contactus1 : $contactus; break; case 'en': $_contactus = $contactus2 !== '' ? $contactus2 : $contactus; break; default: $_contactus = $contactus; } } // 3) بيانات التواصل الاجتماعي if (!empty($socialData) && is_array($socialData)) { foreach ($socialData as $idx => $item) { $key = $idx + 1; if ($key >= 1 && $key <= 4) { $social[$key] = $item['text_description'] ?? ''; } } } $social1 = $social[1]; $social2 = $social[2]; $social3 = $social[3]; $social4 = $social[4]; // 4) الشعارات if (!empty($imageData) && is_array($imageData)) { foreach ($imageData as $img) { $tid = $img['type_id'] ?? null; $id = $img['img_id'] ?? ''; $ext = $img['img_ext'] ?? ''; if ($tid && $id && $ext) { $logo[$tid] = "service/images/header/img_{$id}.{$ext}"; } } } $logo1 = $logo[1] ?? ''; $logo2 = $logo[2] ?? ''; $logo3 = $logo[3] ?? ''; $logo4 = $logo[4] ?? ''; // 5) إعلانات if (!empty($adsData) && is_array($adsData)) { foreach ($adsData as $ad) { if (($ad['type_id'] ?? null) == 1) { $ads_url1 = !empty($ad['img_url']) ? $ad['img_url'] : '#'; $id = $ad['img_id'] ?? ''; $ext = $ad['img_ext'] ?? ''; $ads_img1 = "service/images/ads/img_{$id}.{$ext}"; } } } $site_title=$L['site_title']; // معلومات عامة عن الموقع $siteInfo = [ 'logo' => $logo1, 'address' => 'العراق – بغداد – الوزيرية – قرب المعهد القضائي', 'address1' => 'عێراق – بەغداد – الوزیریە – نزیک ئەنجومەنی دادوەری', 'address2' => 'Iraq – Baghdad – Al-Waziriyah – Near the Judicial Institute', 'phone' => '',//'+(123) 456-7890', 'email' => 'ec@ec.edu.iq', ]; $address= $siteInfo['address']; if($lang=="ku") $address= $siteInfo['address1']; if($lang=="en") $address= $siteInfo['address2']; // روابط الصفحات الثابتة في شريط الحقوق $footerPages = [ ['aboutus.php', $L['about_us']], ['contactus.php', $L['contact_us']], ['term-of-use.html', $L['term_of_use'] ], ['privacy-policy.html',$L['privacy'] ], ]; $socialPlatforms = [ 11 => [ 'url' => !empty($social1) ? $social1 : 'https://facebook.com', 'icon' => 'facebook', 'name' => !empty($L['facebook']) ? $L['facebook'] : 'Facebook' ], 12 => [ 'url' => !empty($social2) ? $social2 : 'https://x.com/', 'icon' => 'twitter', 'name' => !empty($L['twitter']) ? $L['twitter'] : 'Twitter' ], 13 => [ 'url' => !empty($social3) ? $social3 : 'https://youtube.com', 'icon' => 'youtube', 'name' => !empty($L['youtube']) ? $L['youtube'] : 'YouTube' ], 14 => [ 'url' => !empty($social4) ? $social4 : 'https://instagram.com', 'icon' => 'instagram', 'name' => !empty($L['instagram']) ? $L['instagram'] : 'Instagram' ], ]; // نفترض وجود كائن $functions مسبقاً $today = $functions->getDate($lang); // ------------------------------------- // القائمة الجديدة // ------------------------------------- $showHeaderType=2; $menu =$M; /** * دالة للمساعدة في إرجاع العنوان المناسب حسب اللغة */ function getItemTitle(array $items, string $lang): string { // إذا كان العنوان مصفوفة لغات if (is_array($items ?? null)) { return $items[$lang] ?? ''; } // دعم قديم في حال كان العنوان نصا مفردا return $items ?? ''; } function renderMenu(array $items, string $lang = "ar", bool $isMobile = false, int $level = 0, bool $st = false): string { $html = ''; $m = ''; $currentId = $_GET['i'] ?? 1; foreach ($items as $item) { $title = getItemTitle($item['title'], $lang); $id = $item['id']?? -1; $icon = $item['icon'] ?? ''; $hasChildren = !empty($item['children']); $link =$id == -1 ?'':( ($id == 0) ? 'index.php?lang=' . $lang : 'list-news.php?i=' . $id . '&lang=' . $lang); $iconHtml = $icon ? "" : ''; $isActive = ($id == $currentId) ? ' active-text' : ''; $edit = ($id > 1) ? edit_news($id) : ''; /* --------------------------------------------------- * فرع الموبايل (أكورديون) * --------------------------------------------------*/ if ($isMobile) { if ($hasChildren) { $html .= "

" . renderMenu($item['children'], $lang, true, $level + 1, true) . "
"; } else { if (!$st) { $html .= "

"; } else { $html .= "
"; } } /* --------------------------------------------------- * فرع الدسكتوب (Dropdown) * --------------------------------------------------*/ } else { // ↓↓ التعديل الرئيسى على المسافات ↓↓ $dropdownClass = $hasChildren ? 'dropdown' : ''; $aBaseClass = $hasChildren ? 'nav-link dropdown-toggle' : 'nav-link'; $aClass = $aBaseClass . ' py-1 px-2'; // Padding أصغر $aAttrs = $hasChildren ? "href='#' role='button' data-bs-toggle='dropdown' aria-expanded='false'" : "href='$link'"; $edit = (!$hasChildren && $id > 1) ? edit_details($id) : ''; $html .= " "; } } return $html; } // Define readMenu function function readMenu(array $items, int $id, string $lang): string { foreach ($items as $item) { $id1 = $item['id'] ?? -1; if ($id == $id1) { return getItemTitle($item['title'], $lang); } if (!empty($item['children'])) { $result = readMenu($item['children'], $id, $lang); if (!empty($result)) { return $result; } } } return ''; } // دالة السلايدر الرئيسي (يسار كبير) function renderMainSlider(array $newsList, string $lang, int $type = 2): string { ob_start(); ?>
0) { $repeatedNews = []; for ($i = 0; $i < $requiredCount; $i++) { $repeatedNews[] = $newsList[$i % $currentCount]; } } else { $repeatedNews = array_slice($newsList, 0, $requiredCount); } $padLeft = '4px'; ?>

'; } $news = $newsList[0]; $title = htmlspecialchars(getLocalizedTitle($news, $lang)); $description = htmlspecialchars(getShortDescription($news, $lang, $functions, $limit)); $imagePath = htmlspecialchars(getImagePath($news, $type)); $author = htmlspecialchars(getAuthor($news)); $dateStr = formatNewsDate($news, 'd F Y'); $newsId = (int)$news['news_id']; return '
'; } function renderSidePostsBlock(array $newsList, string $lang, int $type, $l, int $limit = 4): string { if (empty($newsList) || count($newsList) <= 1) return ''; $output = '
'; $side_posts = array_slice($newsList, 1); $count = 0; foreach ($side_posts as $news) { if ($count++ >= $limit) break; $title = htmlspecialchars(getLocalizedTitle($news, $lang)); $imagePath = htmlspecialchars(getImagePath($news, $type)); $dateStr = formatNewsDate($news); $newsId = (int)$news['news_id']; $output .= ' '; } $output .= readMore($newsList, $type, $lang ,$l); $output .= '
'; return $output; } function renderNewsBlockSection(array $newsList, string $lang, int $type, string $sectionTitle, $functions, $l): string { ob_start(); ?>
' . htmlspecialchars($L['no_last_news'] ?? 'No news available') . '

'; } $table = $tables[$tableId]; $img_path = "service/images/news/$table/"; ob_start(); ?>
' . htmlspecialchars($L['no_last_news'] ?? 'No news available') . '

'; } $table = $tables[$tableId]; $img_path = "service/images/news/$table/"; ob_start(); ?>
= $maxCount) break; $newsId = (int)$news['news_id']; $title = getLocalizedTitle($news, $lang); $imagePath = $img_path . "img_" . $newsId . '.' . $news['img_ext']; ?>
= 5) { return ' ' . htmlspecialchars($L['read_more']) . ' '; } return ''; } function playIcon($news, $lang, $type){ $id=$news['news_id']; $url=$news['news_link']; if($url) return '
'; else return ''; } /** * إرجاع كود SVG لشبكات التواصل مع إمكانية مضاعفة الحجم. * * @param string $name اسم الشبكة: facebook | twitter | youtube | instagram * @param float $scale عامل التكبير (1 = الحجم الأصلي؛ 2 = ضعف الحجم؛ …) * @return string كود SVG جاهز للإدراج */ function getSocialIconSvg(string $name, float $scale = 1): string { $base = 1 * $scale . 'rem'; $icons = [ 'facebook' => ' ', 'twitter' => ' ', 'youtube' => ' ', 'instagram' => ' ' ]; if (isset($icons[$name])) { return preg_replace('/subText($description, 0, $length); } function getShortDescription(array $news, string $lang, $functions, int $maxLength = 500): string { $description = getLocalizedDescription($news, $lang); return $functions->subText($description, 0, $maxLength); } /** * تعيد المسار الكامل للصورة بناءً على id الخبر وامتداد الصورة. */ function getImagePath(array $news, int $tableId): string { $tables = getTables(); $tableName = isset($tables[$tableId]) ? $tables[$tableId] : 'dbs_news1'; return "service/images/news/{$tableName}/img_{$news['news_id']}.{$news['img_ext']}"; } function getTables(): array { $maxTables = 48; $tables = []; for ($i = 1; $i <= $maxTables; $i++) { $tables[$i] = 'dbs_news' . $i; } return $tables; } /** * تنسيق تاريخ الخبر. */ function formatNewsDate(array $news, string $format = 'd F Y'): string { // return date($format, strtotime($news['news_date'])); $lang = $_GET['lang'] ?? 'ar'; return localizedDate($news['news_date'],$lang); } /** * إعادة اسم المؤلف (حاليًا فارغ؛ قابل للتعديل لاحقًا). */ function getAuthor(array $news): string { // يمكن تعديل الدالة لإرجاع اسم المؤلف الحقيقي مستقبلاً return ''; } /** * دالة اختصار نص: */ function subText(string $txt, int $len = 120): string { return mb_strlen($txt, 'UTF-8') > $len ? mb_substr($txt, 0, $len, 'UTF-8') . '…' : $txt; } /** * دالة لتنسيق التاريخ. */ function formatDate(string $date): string { $lang = $_GET['lang'] ?? 'ar'; return localizedDate($date,$lang); } /** * أرجع التاريخ بالصيغة المحلية (ar-IQ, ku-IQ, en). * * @param string $dateStr نصّ التاريخ المقبول من DateTime (مثلاً 2025-05-31) * @param string|null $lang كود اللغة: 'ar' أو 'ku' أو 'en'؛ * إذا تُرك null يُستخدم لغة الموقع الافتراضية. * @return string مثال: "السبت، 31 أيار، 2025" */ function localizedDate(string $dateStr, ?string $lang = null): string { $lang = $lang ?: (locale_get_default() ?: 'ar'); // احتياط /* ❶ جرّب IntlDateFormatter متى ما توفّر */ if (class_exists('IntlDateFormatter')) { // ar => ar_IQ، ku => ku_IQ، en => en_US $localeMap = ['ar' => 'ar', 'ku' => 'ku', 'en' => 'en']; $locale = $localeMap[$lang] ?? 'ar'; $fmt = new IntlDateFormatter( $locale . '@calendar=gregorian', IntlDateFormatter::FULL, IntlDateFormatter::NONE, 'Asia/Baghdad', IntlDateFormatter::GREGORIAN, 'EEEE، d MMMM، y' // مثال الناتج: السبت، 31 أيار، 2025 ); return $fmt->format(new DateTime($dateStr)); } /* ❷ ــ مسار بديل يدوي إن لم يتوافر intl */ $dayLists = [ 'ar' => ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"], 'ku' => ["یه‌كشه‌ممه‌","دووشه‌ممه‌","سێشه‌ممه‌","چوارشه‌ممه‌","پێنجشه‌ممه‌","هه‌ینی","شه‌ممه‌"], 'en' => ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"] ]; $monthLists = [ 'ar' => ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب", "أيلول","تشرين الأول","تشرين الثاني","كانون الأول"], 'ku' => ["کانونی یەکەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب", "ئەیلوول","تشرینی یەکەم","تشرینی دووەم","کانونی دووەم"], 'en' => ["January","February","March","April","May","June", "July","August","September","October","November","December"] ]; // اختر القوائم مع افتراضي عربي $days = $dayLists[$lang] ?? $dayLists['ar']; $months = $monthLists[$lang] ?? $monthLists['ar']; $dt = new DateTime($dateStr); return sprintf( "%s، %d %s، %d", $days[$dt->format('w')], // اسم اليوم $dt->format('j'), // رقم اليوم $months[$dt->format('n') - 1], // اسم الشهر $dt->format('Y') // السنة ); } function makeEmbedSrc(string $url): array { // نعيد [src, extra_script] — الثاني لإرفاق سكربت عند الحاجة // 1) YouTube if (preg_match('~(?:youtu\.be/|youtube\.com/(?:watch\\?v=|v/|embed/|shorts/))([\\w-]{11})~', $url, $m)) { return ["https://www.youtube.com/embed/{$m[1]}?rel=0", '']; } // 2) Facebook (فيديو أو بث مباشر) if (preg_match('~facebook\.com/.+/videos/[0-9]+~', $url)) { // التحقق من قابلية التضمين $embed_check = get_headers($url, 1); // إذا كانت النتيجة "403 Forbidden"، الفيديو لا يمكن تضمينه if (isset($embed_check['HTTP/1.1']) && strpos($embed_check['HTTP/1.1'], '403') !== false) { return [null, "يمكن مشاهدة هذا الفديو على فيسبوك من خلال هذا الرابط"]; } return ["https://www.facebook.com/plugins/video.php?href=" . urlencode($url) . "&show_text=0", '']; } // 3) TikTok if (preg_match('~tiktok\.com/@[^/]+/video/([0-9]+)~', $url, $m)) { return ["https://www.tiktok.com/embed/v2/{$m[1]}", // Player '']; } // 4) Instagram if (preg_match('~instagram\.com/p/([A-Za-z0-9_-]+)/?~', $url, $m)) { // طريقة iframe البسيطة return ["https://www.instagram.com/p/{$m[1]}/embed", // أو استخدم oEmbed API '']; } // خدمة غير مدعومة return ['', '']; } /** * دوال تحكم واجهة (تحرير اجتماعي، إعلانات، صور، أخبار... إلخ). */ function edit_social(): string { $edit_mode = isEditMode(); if ($edit_mode) { return ''; } return ''; } function edit_ads(): string { $edit_mode = isEditMode(); if ($edit_mode) { return ''; } return ''; } function edit_image(int $i): string { $edit_mode = isEditMode(); if ($edit_mode) { return sprintf( '', $i ); } return ''; } function edit_image1(int $i): string { $edit_mode = isEditMode(); if ($edit_mode) { return sprintf( '
', $i ); } return ''; } function edit_news(int $i): string { $edit_mode = isEditMode(); if ($edit_mode) { return sprintf( '', $i ); } return ''; } function edit_details(int $i): string { if (isEditMode()) { return sprintf( "", $i ); } return ''; } function edit_about(): string { $edit_mode = isEditMode(); if ($edit_mode) { return sprintf( '' ); } return ''; } function edit_contact(): string { $edit_mode = isEditMode(); if ($edit_mode) { return sprintf( '' ); } return ''; } function edit_pdf(): string { $edit_mode = isEditMode(); if ($edit_mode) { return sprintf( '' ); } return ''; } function edit_button(int $i, int $a, int $e, int $d): string { $edit_mode = isEditMode(); if ($edit_mode) { return sprintf( '', $i, $a, $e, $d ); } return ''; } function logout_button(): string { $edit_mode = isEditMode(); if ($edit_mode) { return ''; } return ''; } function retern_button(): string { $edit_mode = isEditMode(); if ($edit_mode) { return ''; } return ''; } function isEditMode(){ $functions = new Functions(); return $functions->isLogined(); }