<?php
$this_page = "index";
?>
<meta name="keywords" content="Westcountry Fire Protection, Westcountry Fire Protection, West Country Fire Protection, Fire Prevention, Fire Protection, WFP, ">
<meta name="description" content="Westcountry Fire Protection's home page - we offer comprehensive products and services with friendly, professional and local advice.">
<?php
$browser_title = "Westcountry Fire Protection > Sentri > Fire Alarms Exeter > Fire Alarms Newton Abbot ";
?>
<meta name="keywords" content="Westcountry Fire Protection, Westcountry Fire Protection, West Country Fire Protection, Fire Prevention, Fire Protection, WFP, ">
<meta name="description" content="Westcountry Fire Protection's home page - we offer comprehensive products and services with friendly, professional and local advice.">
<?php
include("includes/header.php");
include("includes/database.php");
// Get latest News Stories
$news_sql = "SELECT id, headline, extract, body, created, author, category, status, starts, expires, CASE WHEN starts != 0 THEN 'yes' ELSE 'no' END AS 'starts_flag', CASE WHEN expires != 0 THEN 'yes' ELSE 'no' END AS 'expires_flag' from syscon_news WHERE status = 'live' ORDER BY created DESC limit 0,4";
$news_query = mysql_query($news_sql, $db_handle);
$length = 120;
while($news_record = mysql_fetch_array($news_query)) {
unset($status);
if($news_record['starts_flag'] == "no" && $news_record['expires_flag'] == "no") {
$status = "yes";
} elseif($news_record['starts_flag'] == "yes" && date(U) > $news_record['starts']) {
$status = "yes";
} elseif($news_record['expires_flag'] == "yes" && date(U) < $news_record['expires']) {
$status = "yes";
}
if($status == "yes") {
if(strlen($news_record['extract']) > $length) {
$extract = stripslashes(substr($news_record['extract'],0,$length)) . "...";
} else {
$extract = stripslashes($news_record['extract']);
}
$latest_news[] = array(
id => $news_record['id'],
headline => stripslashes($news_record['headline']),
extract => $extract,
body => stripslashes($news_record['body']),
created => $news_record['created'],
author => stripslashes($news_record['author']),
category => $news_record['category'],
status => $news_record['status'],
expires => $news_record['expires']
);
}
}
?>