<?php /****************************************** استدعاء الأخبار فى الصفحة الرئيسية ***************************************/ ?>
 <section  class='backcolor_1'  style='padding-top:100px;'>
    	<div class="container" style='max-width:1200px;'>
			<div class='section-header'>
				<h2 class="section-title" style="padding-right:40px;text-align:right;color:var(--white);visibility: visible; animation-duration: 1000ms; animation-delay: 0.3s; animation-name: fadeIn;">الأخبار
						  
						  
						  <div class="right_lines"></div>
						  <div class="right_lines l2"></div>
						
				</h2>
			</div>

			
                    
				<div class="row" style='padding-top:50px;padding-bottom:100px;' >

					<?php
						
						
						/*  اسم الجدول وبداية الكويرى */  
						$table='news';

						$news_query="select `id`,`title`,`desc`,`date`,`view`,`images`  from news where active=1 order by `priority` desc , `sort` desc , id desc limit 8";

						$news_result=mysqli_query($conn,$news_query);
						$news_num_rows=mysqli_num_rows($news_result);
						mysqli_data_seek($news_result,0);
						while($news_fetch = mysqli_fetch_array($news_result)) {
   		 $news_fetch = clean_array($news_fetch);	
								
								
     
  
							   /*استخراج جميع الصور*/  
							  $current_image=explode(",",$news_fetch['images']);
							  $current_image=explode('.',$current_image[1]);
															
							   /*الصورة الاساسية*/  
							  $first_image= $current_image[0].'_800.webp';
							  $page_title=$news_fetch['title'];
							  $date=explode(' ',$news_fetch['date']);
						
				
					?>

					
                        <div class='col-lg-3 col-md-4 col-sm-6 col-12 big_div ' >
						    <div class='news_div'>   
								
								<div class="linear-background" >
								
									<a   rel='nofollow' href="<?php echo $website_url ;?>/news_article/<?php echo $news_fetch['id']; ?>/<?php echo  url_dash($news_fetch['title']); ?>"
										class='news_img' 
									>
									<div style="background-size:cover;height:25vh;width:100%;background:url('<?php echo $img_path; ?><?php echo $table; ?>/<?php echo $first_image ; ?>  ') no-repeat  center center /cover "></div>

									</a>
								
								</div>
								<div class='news_title'><a <a href="<?php echo $website_url ;?>/news_article/<?php echo $news_fetch['id']; ?>/<?php echo  url_dash($news_fetch['title']); ?>" ><?php echo strip_tags($news_fetch['title']); ?></a></div>
								<div class='news_desc'><?php echo strip_tags($news_fetch['desc']); ?></div>
								<hr>
								<div class=" news_date" ><span class='las la-calendar-alt' style='padding-left: 5px;'></span><?php echo $date[0]; ?></div>
								<a href="<?php echo $website_url ;?>/news_article/<?php echo $news_fetch['id']; ?>/<?php echo  url_dash($news_fetch['title']); ?>"  class=" read_more" >قراءة</a>
						    </div>
 
					 	</div>

						
					<?php } 
					
					?>
					
					
					
				 <?php if($news_num_rows==8){?>
					<div class='container '><a rel="noopener" href="<?php echo $website_url ;?>/news/الأخبار" class="wow fadeInUp btn_2 more_posts wow fadeInUp animated" data-wow-duration="500ms">المزيد<span class="las la-arrow-left"></span> </a></div>
				<?php }?>
			  </div>				
				</div>
                       

                
				
			
 
			
        </div>
    </section>