<?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                   //
//                                                                          //
// ======================================================================== //
if(!checkactive('contact')) include(dirname(__FILE__)."/lib/notactive.php" );
$sname = simpletitle($lang['title_contact']);

if($_REQUEST['do']=="send"){
	
	$mail = "";
	reset($_POST);
	
	while (list($key, $val) = each($_POST)) {
		if ($key != "Submit") {
			if($key == "cemail") $key = $lang['contact_email'];
			$mail .= stripslashes($key) . ": " . stripslashes($val) . "";
			$mail .= "\n";
		}
	}
	$body = $mail;
	
	@mail($pref['sendemail'], $lang['title_contact'] . " (" . $HTTP_SERVER_VARS['HTTP_HOST'] .")", stripslashes($body),
     "From: $_REQUEST[cemail]\r\n"
    ."Reply-To: $pref[sendemail]\r\n"
	."X-Mailer: PHP/" . phpversion());
	
	$tmpl->assign('ok', 1);
} 

$tmpl->assign('lang', $lang);
$tmpl->assign('theme', $THEME);
$tmpl->assign('area', $area);

$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);

$tmpl->assign('content', parsetrue('container/'.container('contact_in'), $lang['title_contact'], $tmpl->fetch('other/contact.tpl')));
?>