index.php file
Code:
<?php
// Get session info.
session_start();
// Check that i'm logged in
if (@!isset($_SESSION['authid'])) {
// Not actually used. Though here for completeness
}
// Set up the database connection ready for use.
require("common/ab.inc.php");
$connection = mysql_connect($host, $user, $password) or die ("Could not connect to Server.");
$db = mysql_select_db($database, $connection) or die ("Could not select database.");
// Do queries necessary for page.
// Query for items available to display. Only return 3 values in descending order.
$sql = "SELECT tbl_items.*, tbl_categories.name FROM tbl_items, tbl_categories WHERE tbl_items.cat = tbl_categories.id AND tbl_categories.type = 'News' ORDER BY tbl_items.id DESC$
$newsinbrief = mysql_query($sql) or die("Couldn't execute query.");
?>
<?php include("common/head.php"); ?>
<h2 id="pageTitleStrip">Welcome</h2>
<div class="item trans95">
<h3 class="date"></h3>
<h3>The Portfolio web-site of SoSo</h3>
<div class="text">
<div class="divider">
<img class="icon left" src="images/icons/kdmconfig.png" alt="User Icon Icon" width="48" height="48" />
<p>I hold an BSc (hons) degree in Computer Science (2:1) and have a keen interest in website and
web-application design and development, focusing on graphical design. My technical skills are centred
around a thorough understanding of Object Orientated analysis, design and programming techniques.</p>
<p>I specialise in User Interface design and construction using HCI methodologies and am capable of producing
multi-threaded Java/Swing applications, Java Web Services using the Struts and Hibernate frameworks, and
JSR168 compliant portlets and portal systems.</p>
<p>I am a good team player and am able to work independently. I look forward to the prospect of working
in an industry where my current skill set can be put to good use and expanded upon.</p>
</div>
</div>
<ul class="moreLinks">
<li class="category"><a href="display_category.php?id=10" title="View CV">View/Download a CV</a></li>
<li></li>
</ul>
</div>
<?php
if ($myrow = mysql_fetch_array($newsinbrief)) {
do {
?>
<div class="item trans95">
<h3 class="date"><?php echo $myrow["date"] ?></h3>
<h3><?php echo $myrow["title"] ?></h3>
<div class="text">
<div class="divider">
<img class="icon left" src="images/icons/<?php echo $myrow["icon"] ?>" alt="Item Icon" width="48" height="48" />
<?php echo $myrow["text"] ?>
</div>
</div>
<ul class="moreLinks">
<li class="category">
<a href="display_category.php?id=<?php echo $myrow["cat"] ?>" title="Display the items in this category"><?php echo $myrow["name"]$
</li>
<li>
<?php if ($myrow['file']!="") { ?>
<a href="display_item.php?id=<?php echo $myrow["id"] ?>" title="Display rest of item">More...</a>
<?php } else { ?>
More...
<?php } ?>
</li>
</ul>
</div>
<?php
} while ($myrow = mysql_fetch_array($newsinbrief));
} else {
?>
<div class="item trans95">
<h3 class="date"><?php echo date("Y-m-d H:i:s"); ?></h3>
<h3>No Results Returned</h3>
<div class="text">
<div class="divider">
<img class="icon left" src="images/icons/help_index.png" alt="Error Icon" width="48" height="48" /> $
<p>I'm sorry but there were no results returned from the database for the category you searched for.
Perhaps no article/news items have been created. Please check back again later.</p>
</div>
</div>
<ul class="moreLinks">
<li class="category">Error</li>
<li>More...</li>
</ul>
</div>
<?php
}
?>
<div id="itemNav">
<ul class="pagiation">
<li><a href="news_current.php" title="View more news items">More News</a></li>
</ul>
</div>
<?php include("common/tail.php"); ?>