Linked backend with frontend and styled curriculum vitae for mobile
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
<?php
|
||||
require_once "./config.php";
|
||||
|
||||
/**
|
||||
* TimelineData class
|
||||
* Define all functions which either get, update, create or delete timeline data
|
||||
*/
|
||||
class TimelineData
|
||||
{
|
||||
function getEduData()
|
||||
{
|
||||
$conn = dbConn();
|
||||
$stmt = $conn->prepare("SELECT * FROM edu;");
|
||||
$stmt = $conn->prepare("SELECT DATE_FORMAT(startPeriod, '%b, %Y') as startPeriod, DATE_FORMAT(endPeriod, '%b, %Y') as endPeriod, grade, course FROM edu ORDER BY startPeriod DESC;");
|
||||
$stmt->execute();
|
||||
|
||||
// set the resulting array to associative
|
||||
@@ -18,14 +22,14 @@ class TimelineData
|
||||
}
|
||||
else
|
||||
{
|
||||
return array("errorMessage" => "Error, edu data not found");
|
||||
return array(array("errorMessage" => "Error, edu data not found"));
|
||||
}
|
||||
}
|
||||
|
||||
function getWorkData()
|
||||
{
|
||||
$conn = dbConn();
|
||||
$stmt = $conn->prepare("SELECT * FROM work;");
|
||||
$stmt = $conn->prepare("SELECT DATE_FORMAT(startPeriod, '%b, %Y') as startPeriod, DATE_FORMAT(endPeriod, '%b, %Y') as endPeriod, companyName, area, title FROM work ORDER BY startPeriod DESC;");
|
||||
$stmt->execute();
|
||||
|
||||
// set the resulting array to associative
|
||||
@@ -37,7 +41,7 @@ class TimelineData
|
||||
}
|
||||
else
|
||||
{
|
||||
return array("errorMessage" => "Error, work data not found");
|
||||
return array(array("errorMessage" => "Error, work data not found"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user