Linked backend with frontend and styled curriculum vitae for mobile

This commit is contained in:
2021-08-31 18:50:08 +01:00
parent 539e6cc23d
commit b88c35ca5b
12 changed files with 158 additions and 79 deletions
+8 -4
View File
@@ -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"));
}
}