<?php
session_start();
include("connect.php");
include("includes/func_guestbook.php");
include("includes/bbcode.php");
$folder=$foldergeustbook;
$action = $_GET['action'];
if(!isset($action)) $action = "home";

IF ($action=="home"){

tpl_header($LANGAUGE[59]);
bar($namelinks1,$LANGAUGE[59],"","");
table($LANGAUGE[59],sjl_alzwar(),1);
tpl_footer();

}ELSEIF ($action=="add_sjl_alzwar"){

tpl_header($LANGAUGE[124]);
bar($namelinks1,$namelinks9,$LANGAUGE[124],"");

if ($add_threads == "1"){
table($LANGAUGE[124],sjl_alzwar_add(),1);
}else{
table($LANGAUGE[124],$LANGAUGE[125],1);
}
tpl_footer();

}ELSEIF ($action=="add_sjlalzwar_indatabase"){
if ($add_threads == "1"){
if($_POST['code'] != $_SESSION['captchacode'] OR $_SESSION["captchacode"]=='')
{
tpl_header($LANGAUGE[126]);
table($LANGAUGE[126],$LANGAUGE[178],1);
tpl_footer();
exit;
}

$name         = text(1,$_POST['name']);
$message      = text(1,$_POST['message']);
$country      = text(1,$_POST['countryid']);
$email        = text(1,$_POST['sender']);

$d = time();
$ip = $_SERVER['REMOTE_ADDR'];

if ($name==""){
$xxz = $LANGAUGE[127];
$fff = "no";
}

if ($message==""){
$xxz = $LANGAUGE[128];
$fff = "no";
}

if ($country==""){
$xxz = $LANGAUGE[129];
$fff = "no";
}

if (!eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+.([a-zA-z]{2,4})$',$email)){
$xxz = $LANGAUGE[130];
$fff = "no";
}

if($fff != "no"){
$query = mysql_query ("INSERT INTO sjl_alzwar (name,threads,country,email,date,ip,active,countryid) VALUES ('$name','$message','$country','$email','$d','$ip','$activeguestbook','$country')");
$xxzz = $LANGAUGE[132];
if ($htmlorphp=="1"){
$links = "guestbok.html";
}else{
$links = "guestbook.php?action=home";
}
$xxzz .= "<meta http-equiv='Refresh' content='2;URL=$links' />";
}else{
$xxzz = $xxz.$LANGAUGE[131];
}
}else{
$xxzz = $LANGAUGE[125];
}

tpl_header($LANGAUGE[126]);
table($LANGAUGE[126],$xxzz,1);
tpl_footer();
}
?>