//parse logo html (if logo exits)
if(trim($row['logo'])!="uploads/"){
if(@is_file($row['logo'])){
$xtpl->parse('main.storelogo');
}
}
//parse additional store info html (if exits)
if(trim($row['pageHTML']) != ""){
$xtpl->parse('main.additionalinfo');
}else{
$xtpl->parse('main.noadditionalinfo');
}
//parse hours html (If hours exits)
if(trim($row['hours']) != ""){
$xtpl->parse('main.storehours');
}else{
$xtpl->parse('main.nohourslisted');
}
//if display website, parse website html
if($row['website'] != "" && $row['displayWebsite'] == '1'){
$xtpl->parse('main.websiteHTML');
}
//if categories, look up categories
if($row['categories'] != ""){
$sql = sprintf("select * from categories where FIND_IN_SET(id,'%s') > 0 order by Title asc",$row['categories']);
$cResult = $mysql->exSql($sql) or die($mysql->debugPrint());
$catList = array();
while($cRow = mysql_fetch_assoc($cResult)){
$catList[] = $cRow['Title'];
}
$xtpl->assign("categorylist",@implode(", ",$catList));
$xtpl->parse('main.categories');
}
//if services, look up services
if($row['services'] != ""){
$sql = sprintf("select * from services where FIND_IN_SET(id,'%s') > 0 order by Title asc",$row['services']);
$sResult = $mysql->exSql($sql) or die($mysql->debugPrint());
$serviceList = array();
while($sRow = mysql_fetch_assoc($sResult)){
$serviceList[] = $sRow['Title'];
}
$xtpl->assign("servicelist",@implode(", ",$serviceList));
$xtpl->parse('main.services');
}
//if dislay weekly ad, parse weekly ad html
if($row['displayWeeklyAd'] == '1'){
$xtpl->parse('main.weeklyAdHTML');
}
//Google Maps JavaSript
$js = "\n";
$js .= "";
$xtpl->assign('googleMapScript', $js);
//parse and output to template
$xtpl->parse('main');
$xtpl->out('main');
if($settingsRow['enablecaching']=="1"){
require('http://www.carepresto.com/cp/dynamic_cache_footer.php');
}
?>