Linked backend to frontend and fixed basic formatting in few files
This commit is contained in:
		
							parent
							
								
									9c4e487b11
								
							
						
					
					
						commit
						97718c7aee
					
				
							
								
								
									
										31
									
								
								dist/api/projectData.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								dist/api/projectData.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,31 @@
 | 
			
		||||
<?php
 | 
			
		||||
namespace api;
 | 
			
		||||
use PDO;
 | 
			
		||||
 | 
			
		||||
require_once "./config.php";
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Project Data Class
 | 
			
		||||
 * Define all functions which either get, update, create or delete timeline data
 | 
			
		||||
 */
 | 
			
		||||
class projectData
 | 
			
		||||
{
 | 
			
		||||
    function getProjectData()
 | 
			
		||||
    {
 | 
			
		||||
        $conn = dbConn();
 | 
			
		||||
        $stmt = $conn->prepare("SELECT title, isMainProject, information, imgLocation, projectLink, githubLink FROM projects order by date LIMIT 4;");
 | 
			
		||||
        $stmt->execute();
 | 
			
		||||
 | 
			
		||||
        // set the resulting array to associative
 | 
			
		||||
        $result = $stmt->fetchAll(PDO::FETCH_ASSOC);
 | 
			
		||||
 | 
			
		||||
        if ($result)
 | 
			
		||||
        {
 | 
			
		||||
            return $result;
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            return array(array("errorMessage" => "Error, project data not found"));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										7
									
								
								dist/api/timelineData.php
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								dist/api/timelineData.php
									
									
									
									
										vendored
									
									
								
							@ -1,11 +1,14 @@
 | 
			
		||||
<?php
 | 
			
		||||
namespace api;
 | 
			
		||||
use PDO;
 | 
			
		||||
 | 
			
		||||
require_once "./config.php";
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * TimelineData class
 | 
			
		||||
 * Define all functions which either get, update, create or delete timeline data
 | 
			
		||||
 */
 | 
			
		||||
class TimelineData
 | 
			
		||||
class timelineData
 | 
			
		||||
{
 | 
			
		||||
    function getEduData()
 | 
			
		||||
    {
 | 
			
		||||
@ -46,4 +49,4 @@ class TimelineData
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,16 +1,19 @@
 | 
			
		||||
<?php
 | 
			
		||||
namespace api;
 | 
			
		||||
use PDO;
 | 
			
		||||
 | 
			
		||||
require_once "./config.php";
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Project Data Class
 | 
			
		||||
 * Define all functions which either get, update, create or delete timeline data
 | 
			
		||||
 */
 | 
			
		||||
class ProjectData
 | 
			
		||||
class projectData
 | 
			
		||||
{
 | 
			
		||||
    function getProjectData()
 | 
			
		||||
    {
 | 
			
		||||
        $conn = dbConn();
 | 
			
		||||
        $stmt = $conn->prepare("SELECT title, information, imgLocation, projectLink, githubLink FROM projects;");
 | 
			
		||||
        $stmt = $conn->prepare("SELECT title, isMainProject, information, imgLocation, projectLink, githubLink FROM projects order by date LIMIT 4;");
 | 
			
		||||
        $stmt->execute();
 | 
			
		||||
 | 
			
		||||
        // set the resulting array to associative
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user