Created project sections front end with dummy images and text for now. Not mobile compatible yet.
This commit is contained in:
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
//////////// Config file /////////////////////
|
||||
/// Used for storing important information ///
|
||||
/// such as passwords, usernames etc. ///
|
||||
//////////////////////////////////////////////
|
||||
|
||||
function dbConn(): PDO|string
|
||||
{
|
||||
$host = "localhost";
|
||||
$dbName = "u987021215_cms";
|
||||
$username = "u987021215_rodude123";
|
||||
$password = "pFHS5qKhkyaDumgf";
|
||||
try
|
||||
{
|
||||
return new PDO("mysql:host=$host;dbname=$dbName", $username, $password);
|
||||
}
|
||||
catch (PDOException $e)
|
||||
{
|
||||
return "Connection failed: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
Vendored
+49
@@ -0,0 +1,49 @@
|
||||
<?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 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
|
||||
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return array(array("errorMessage" => "Error, edu data not found"));
|
||||
}
|
||||
}
|
||||
|
||||
function getWorkData()
|
||||
{
|
||||
$conn = dbConn();
|
||||
$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
|
||||
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return array(array("errorMessage" => "Error, work data not found"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
BIN
Binary file not shown.
|
After Width: | Height: | Size: 71 KiB |
Vendored
BIN
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user