<?php
// ======================================================================== //
//                                                                          //
//   KooBI- Webportalsystem                                                 //
//   SCRiPTMAFiA 2005 - THE DiRTY HANDS ON YOUR SCRiPTS                     //
//                                                                          //
//   ====================================================================   //
//                                                                          //   
//   dream4 | webservices - Am Michelsgrund 7 - 69469 Weinheim - Germany    //    
//   tel. +49(0) 6201 - 980442 / fax. +49(0) 6201 - 64809                   //
//                                                                          //
// ======================================================================== //
ob_start();
if (!permission("showstatic")) {
	$EOUT = stderror("nopermission", $lang['nopermission_t'], str_replace("__URL__", "index.php", $lang['redirect']), "index.php", 1);
	$error = 1;
	$NOOUT = 1;
}

if($_REQUEST['count']!="no") $sql = new dbc("UPDATE ".PREFIX."_static SET hits=hits+1 WHERE  pagename='".$_REQUEST['page']."'");
$sql = new dbc("SELECT title,pagename FROM ".PREFIX."_static WHERE  pagename='".$_REQUEST['page']."'");
$row = $sql->fetchrow();
$tmpl->assign('lang',$lang);
$tmpl->register_function('printpoll', 'printpoll');

$sql = new dbc("SELECT
company_email,
company_website,
company_city,
company_street,
company_zip,
company_country,
company_email_support,
company_email_siteadmin,
company_impressum,
company_agb,
company_phone,
company_fax,
company_mobile,
company_owner,
company_email_support,
company_email_siteadmin
FROM ".PREFIX."_settings
");

$row_st = $sql->fetchrow();
$tmpl->assign('email', $row_st->company_email);
$tmpl->assign('website', $row_st->company_website);
$tmpl->assign('sitename', $pref['hpname']);
$tmpl->assign('street', $row_st->company_street);
$tmpl->assign('city', $row_st->company_city);
$tmpl->assign('zipcode', $row_st->company_zip);
$tmpl->assign('country', $row_st->company_country);
$tmpl->assign('email_support', $row_st->company_email_support);
$tmpl->assign('email_siteadmin', $row_st->company_email_siteadmin);
$tmpl->assign('phone', $row_st->company_phone);
$tmpl->assign('fax', $row_st->company_fax);
$tmpl->assign('owner', $row_st->company_owner);
$tmpl->assign('mobile', $row_st->company_mobile);
$tmpl->assign('impressum', $row_st->company_impressum);
$tmpl->assign('agb', $row_st->company_agb);


if( (!$row) || (!file_exists("static/".$_REQUEST['page'].".tpl"))) { 
	$EOUT = msg("error_once", "docnotfound" , str_replace("__URL__", "index.php", $lang['redirect']), "index.php");
	$NOOUT = 1;
}

$sname = simpletitle($row->title);
$tmpl->assign("content", parsetrue("container/".container("static"), $row->title, $tmpl->fetch("../../static/".$row->pagename.".tpl")));
?>