<?php include_once('layout/header.php'); ?>

    <!-- #nav-mobile end -->
        <!-- #body-wrap -->
    <div id="body-wrap">
        
        <!-- #header -->
        <header id="header" class="header-page">
            
            <!-- #nav-mobile-top -->
            <div id="nav-mobile-top">
                
                <!-- .container -->
                <div class="container-fluid">
                	<div class="navmenu">
                        
                        <button type="button" class="navbar-btn-toggle"><i class="ion ion-navicon"></i></button>
                        
                        <div class="navbar-logo">
                            <a href="index.html"><img src="images/logo.png" alt="Logo"></a> <!-- site logo -->
                        </div>
                        
                        
                        
                    </div>
                </div>
                <!-- .container end -->
                
            </div>
            <!-- #nav-mobile-top end -->
            
            <!-- #navigation -->
            <nav id="navigation">
                
                <!-- .navtop -->
                <div class="navtop">
                    
                    <!-- .container -->
                    <div class="container">
                        
                        <div class="nav-txt">
                            <p><i class="ion ion-android-phone-portrait"></i> Have Questions? Call For Free: <strong><a href="#">081-254-5678</a></strong></p>
                        </div>
                        
                        <div class="nav-socials">
                            <a href="#" title="Facebook"><i class="ion ion-social-facebook"></i></a>
                            <a href="#" title="Google Plus"><i class="ion ion-social-googleplus"></i></a>
                            <a href="#" title="Twitter"><i class="ion ion-social-twitter"></i></a>
                            <a href="#" title="Instagram"><i class="ion ion-social-instagram"></i></a>
                            <a href="#" title="Pinterest"><i class="ion ion-social-pinterest"></i></a>
                            <a href="#" title="Vimeo"><i class="ion ion-social-vimeo"></i></a>
                            <a href="#" title="Dribbble"><i class="ion ion-social-dribbble"></i></a>
                            <a href="#" title="Youtube"><i class="ion ion-social-youtube"></i></a>
                        </div>
                        
                    </div>
                    <!-- .container end -->
                    
                </div>
                <!-- .navtop end -->
                
                <!-- .navbar -->
                <div class="navbar">
                    
                    <!-- .container -->
                    <div class="container">
                        <div class="navbar-wrap">
                            
                            <div class="navbar-logo">
                                <a href="index.html"><img src="images/logo.png" alt="Logo"></a> <!-- site logo -->
                            </div>
                            
                            <div class="navbar-menu">
                                <ul class="nav">
                                    <li> <a href="index.php">HOME</a> </li>
                                    
								<li class="menu-item menu-item-has-children">
                                        <a href="#">OUR WORK</a>
                                        <ul class="sub-menu">
                                            <li class="menu-item"><a href="projects.php">PROJECTS</a></li>
											<li class="menu-item"><a href="programs.php">PROGRAMS</a></li>
																						
                                        </ul>
                                    </li>		
									    								<li class="menu-item menu-item-has-children">
                                        <a href="#">MEDIA</a>
                                        <ul class="sub-menu">
                                            <li class="menu-item"><a href="news_updates.php">NEWS UPDATES</a></li>
											<li class="menu-item"><a href="upcoming_events.php">UPCOMING EVENTS</a></li>
											<li class="menu-item"><a href="gallery.php">GALLERY</a></li>
																						
                                        </ul>
                                    </li>										    
										<li class="menu-item menu-item-has-children">
                                        <a href="#">PUBLICATIONS</a>
                                        <ul class="sub-menu">
                                            <li class="menu-item"><a href="downloads.php">DOWNLOADS</a></li>
											<li class="menu-item"><a href="opportunities.php">OPPORTUNITIES</a></li>
											<li class="menu-item"><a href="newsletters.php">NEWS LETTERS</a></li>
												
											
                                        </ul>
                                    </li>															
                                    									
                                    <li> <a href="contact.php">CONTACT US</a> </li>
																		
                                   <li> <a href="donate.php">DONATE</a> </li>
                                </ul>                                
                                
                            </div>

                            
                        </div>
                    </div>
                    <!-- .container end -->
                    
                </div>
                <!-- .navbar end -->
                
            </nav>
            <!-- #navigation end -->
            
            <!-- .sub-header -->
            <div class="sub-header">
            	
                <!-- .container -->
                <div class="container">
                    
                    <h4 class="header-title">Our Projects</h4>
                    <div class="breadcrumbs">
                    	<a href="index.php">Home</a> <span class="sep">/</span> <a href="#">Projects</a> <span class="sep">/</span> <span class="current">Projects</span>
                    </div>
                    
                </div>
                <!-- .container end -->
                
            </div>
            <!-- .sub-header end -->
            
        </header>
        <!-- #header end -->
        
        <!-- #content -->
        <div id="content">
        	
            <!-- .container -->
            <div class="container padding-top80 padding-bottom40">
                
                <!-- .row -->
                <div class="row">
				<?php
            $projects = $con->getRows('projects', array('where' => 'status=1', 'order_by' => 'date desc'));
            if (!empty($projects)) {
                foreach ($projects as $project) { 
                    $status = '';
                    $link = '';
                    if($project['active'] == 0){
                        $status = "Current Project";
                        $link = "current_projects.php";
                    }else{
                        $status = "Completed Project";
                        $link = "completed_projects.php";
                    }
                    ?>
                	
                	<div class="col-sm-4"> <!-- 1 -->
                		<div class="affa-feature-img">
							<figure><img src="assets/uploads/projects/thumbs/<?= $project['thumb'] ?>" style="border-radius: 4%; alt="">
							</figure>
                			<h4><?= $project['title'] ?></h4>
                			<p><?= substr(strip_tags($project['details']), 0, 100) ?></p>
                			<a href="project-details.php?project=<?= $project['project_id'] ?>">Learn More</a>
                		</div>
                	</div>
					
					
					<?php
                        }
                    } else { ?>
                        <div class="post-card">
                            <div class="post-content-wrap">
                                <ul class="post-meta">
                                    <div class="post-content">
                                        <div class="alert alert-warning"> <button type="button" class="close" data-dismiss="alert">
										</button>&nbsp; There are no projects currently please come and check later.</div>
                                    </div>
                            </div>
                        </div>
                    <?php } ?>
                	</div>
                <!-- .row end -->
                
            </div>
            <!-- .container end -->
            
            
            
        </div>
        <!-- #content end -->
        
        <?php include_once('layout/footer.php'); ?>