Skip to content
Snippets Groups Projects
Commit fc79b694 authored by Tran Le's avatar Tran Le
Browse files

adding CSS

parent 8b7f4011
Branches
Tags
No related merge requests found
body {
font-family: 'Source Code Pro', sans-serif;
background-color: white;
padding: 2em;
margin: 0 0 2em 0;
max-width: 100%;
}
pre {
font-family: 'Source Code Pro', sans-serif;
font-size: 1.2em;
margin: 0 5em 0 0;
}
nav {
font-weight: bold;
word-spacing: 5px;
text-transform: uppercase;
text-align: center;
display: inline-block;
width: 100%;
}
input {
background-color: #E9EBED;
font-family: 'Source Code Pro', sans-serif;
font-size: 1em;
border: none;
}
button {
border: 2px solid black;
font-family: 'Source Code Pro', sans-serif;
font-size: 1em;
}
\ No newline at end of file
<?
//This file displays all entries in the database in the Homepage (index.php)
//including the entry title, first 140 characters and a Read more link.
echo "hellooooo!";
include_once "models/Blog_Entry_Table.class.php";
include_once "views/list-entries-html.php";
$entryTable = new Blog_Entry_Table( $pdo );
$allEntries = $entryTable->getAllEntries(); //execute the query by invoking the getAllEntries method
//after executing the query, the PDO statement we prepared in the getAllEntries methods will contain the result set
//create a test to check it's all working well
// $firstObject = $allEntries->fetchObject(PDO::FETCH_CLASS); //an variable to hold the first object returned by the query
// print_r($firstObject); //not working?
//Showing individual entry:
//check that the user has clicked on an entry 'id'
$entryClicked = isset($_GET['id']);
if($entryClicked) {
$entryId = $_GET['id'];
$entryData = $entryTable->getEntry( $entryId );
include_once "views/entry-html.php";
echo "Showing entry: " .$entryClicked.;
} else {
echo "No entry showing.";
}
//Getting individual entry:
try {
$sql = "SELECT id, title, text, date_created FROM blog_entry WHERE entry_id = ?";
$data = array($id); //pass entry 'id' to the method to be executed
$statement->execute( $data );
echo "Getting individual entry successful.<br/>";
}
catch (PDOException $e) {
echo "Getting individual entry failed: " . $e->getMessage();
}
//After executing the statement the result should be one blog entry
//which you can return as an object:
$model = $statement->fetchObject();
return $model;
print_r($model);
?>
File added
uploads/william-morris-pattern.jpeg

223 KiB

......@@ -19,7 +19,7 @@
$readmoreLink = "index.php?page=blog&amp;id=$entry->id";
$entriesHTML .= "<li>
<img src='uploads/bart-simpson.png' height='100' width='100'/>
<img src='uploads/william-morris-pattern.jpeg' height='100' width='100'/>
<h2>Post $entry->id: $entry->title</h2>
<p>$entry->intro</p>
<p><a href='$readmoreLink'>Read more</a></p>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment