<?php /****************************************** استدعاء المشاريع فى الصفحة الرئيسية ***************************************/ ?>
 <section class='backcolor_0' 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(--magenta);visibility: visible; animation-duration: 1000ms; animation-delay: 0.3s; animation-name: fadeIn;"><i class="las la-compress-arrows-alt title_icon"></i>
				مشاريع الجمعية
				<a style="float:left" rel="noopener" href="<?php echo $website_url ;?>/projects/مشاريع-الجمعية" class="d-none d-lg-block wow fadeInUp btn_3 dark more_posts wow fadeInUp animated" data-wow-duration="500ms">الانتقال لخدمات الجمعية<span class="las la-arrow-left"></span> </a>
		  
		
						
				</h2>
			</div>

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

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

						$projects_query="select `id`,`title`,`done_percent`,`desc`,`begin_date`,`view`,`images`  from projects where active=1 order by `priority` desc , `sort` desc , id desc limit 8";

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

					
                        <div class="col-lg-3 col-md-4 col-sm-6 col-12 big_div wow fadeInUp animated" data-wow-duration="1500ms"  >
						    <div  class="news_div ">   
								
								<div class="linear-background" >
								
									<a   rel='nofollow' href="<?php echo $website_url ;?>/project/<?php echo $projects_fetch['id']; ?>/<?php echo  url_dash($projects_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 href="<?php echo $website_url ;?>/project/<?php echo $projects_fetch['id']; ?>/<?php echo  url_dash($projects_fetch['title']); ?>"><?php echo strip_tags($projects_fetch['title']); ?></a></div>
								<div class='news_desc'><?php echo strip_tags($projects_fetch['desc']); ?></div>
								<div class='proj_percent_cont'>
									
									
									<div class="project_percent_div">
										<div class="project_done" style='width:<?php echo $projects_fetch['done_percent']; ?>%'></div>
									</div>
									<div class='project_percent_value'><?php echo $projects_fetch['done_percent']; ?>%</div>
								</div>
								
								
								<div class=" news_date" style='font-family:cairo;'><span class='las la-tasks' style='padding-left: 5px;'></span> الحالة : <?php if($projects_fetch['done_percent']=='100'){echo 'تم الانتهاء';}else{echo 'جارى التنفيذ' ;} ?></div>

								<a  href="<?php echo $website_url ;?>/project/<?php echo $projects_fetch['id']; ?>/<?php echo  url_dash($projects_fetch['title']); ?>" class=" read_more" >تفاصيل<i class="las la-arrow-left"></i></a>
						    </div>
 
					 	</div>

						
					<?php } ?>
					
					
					<?php if($projects_num_rows==8){?>
						<div class='container '><a rel="noopener" href="<?php echo $website_url ;?>/projects/المشاريع" 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 class='d-block d-lg-none' style="text-align:left; width:100%; margin-top:20px;margin-left:40px;">
					<a rel="noopener" href="<?php echo $website_url ;?>/projects/مشاريع-الجمعية" class="wow fadeInUp btn_3 more_posts_wide wow fadeInUp animated" data-wow-duration="500ms">المزيد<span class="las la-arrow-left"></span></a>
				</div> 

              
				
			
 
        </div>
    </section>