include("functions.php"); include("connect.php"); $page = filter($_GET['page']); $telefonas = " "; if (!$page) $dizainas = "design.html"; else $dizainas = "design2.html"; include('phemplate.class.php'); $tpl = new phemplate(); $query = mysql_query("SELECT * FROM Content order by nr"); while($row= mysql_fetch_array($query)) { $url[] = $row["url"]; $title[] = $row["title"]; } $buttons = '
'.$title[0].'
'.$title[1].'
'.$title[2].'

'.$title[3].'

'.$title[4].'

'.$title[5].'
'.$title[6].'
'; $buttons700 = '
'.$title[0].'
'.$title[1].'
'.$title[2].'
'.$title[3].'
'.$title[4].'
'.$title[5].'
'.$title[6].'
'; $query = mysql_fetch_array(mysql_query("SELECT * FROM Content where url = '".$page."'")); $header = $query["title"]; $maintext = decode($query["text"]); $id = $query["id"]; if ($id == 1) { $buttons2 = '
'.$title[4].'
'.$title[2].'
'.$title[1].'
'.$title[3].'
'.$title[5].'
'.$title[6].'

'; } else if ($id == 8) { $buttons2 = '
'.$title[4].'
'.$title[2].'
'.$title[0].'
'.$title[3].'
'.$title[5].'
'.$title[6].'

'; } else if ($id == 2) { $buttons2 = '
'.$title[4].'
'.$title[2].'
'.$title[0].'
'.$title[1].'
'.$title[5].'
'.$title[6].'

'; } else if ($id == 18) { $buttons2 = '
'.$title[4].'
'.$title[2].'
'.$title[0].'
'.$title[3].'
'.$title[1].'
'.$title[6].'

'; } else if ($id == 19) { $buttons2 = '
'.$title[4].'
'.$title[2].'
'.$title[0].'
'.$title[3].'
'.$title[5].'
'.$title[1].'

'; } else if ($id == 17) { $buttons2 = '
'.$title[4].'
'.$title[1].'
'.$title[0].'
'.$title[3].'
'.$title[5].'
'.$title[6].'

'; } else if ($id == 15) { $buttons2 = '
'.$title[1].'
'.$title[2].'
'.$title[0].'
'.$title[3].'
'.$title[5].'
'.$title[6].'

'; } else { $buttons2 = '
'.$title[4].'
'.$title[2].'
'.$title[0].'
'.$title[3].'
'.$title[5].'
'.$title[6].'

'; } $query = mysql_fetch_array(mysql_query("SELECT * FROM Content where url = '".$page."'")); $header = $query["title"]; $maintext = decode($query["text"]); $id = $query["id"]; if (!$header) { $query = mysql_fetch_array(mysql_query("SELECT * FROM Content where id = 1")); $header = $query["title"]; $maintext = decode($query["text"]); } $query = mysql_fetch_array(mysql_query("SELECT * FROM Pageinfo")); $title = $query["title"]; $keywords = $query["keywords"]; $description = $query["description"]; $sukis = $query["footer1"]; $tpl->set_var('buttons', $buttons); $tpl->set_var('buttons700', $buttons700); $tpl->set_var('title', $title); $tpl->set_var('keywords', $keywords); $tpl->set_var('description', $description); $tpl->set_var('header', $header); $tpl->set_var('maintext', $maintext); $tpl->set_var('sukis', $sukis); $tpl->set_var('buttons2', $buttons2); if ($id == "1") { $tpl->set_var('pic1', 'pic2'); $tpl->set_var('pic2', 'pic2'); } else if ($id == "2") { $tpl->set_var('pic1', 'pic3'); $tpl->set_var('pic2', 'pic3'); $telefonas = "Tel. nr. +370 698 01887"; } else if ($id == "18") { $tpl->set_var('pic1', 'pic5'); $tpl->set_var('pic2', 'pic5'); $telefonas = ""; } else if ($id == "19") { $tpl->set_var('pic1', 'pic4'); $tpl->set_var('pic2', 'pic4'); $telefonas = "Tel. nr. +370 698 01887"; } else if ($id == "17") { $tpl->set_var('pic1', 'pic1'); $tpl->set_var('pic2', 'pic7'); $telefonas = "Tel. nr. +370 698 01887"; } else if ($id == "8") { $tpl->set_var('pic1', 'pic1'); $tpl->set_var('pic2', 'pic8'); $telefonas = "Tel. nr. +370 606 50527"; } else if ($id == "15") { $tpl->set_var('pic1', 'pic1'); $tpl->set_var('pic2', 'pic6'); $telefonas = "Tel. nr. +370 698 01887"; } else if ($id == "20") { $tpl->set_var('pic1', 'pic1'); $tpl->set_var('pic2', 'pic7'); $telefonas = "Tel. nr. +370 698 01887"; } $tpl->set_var('telefonas', $telefonas); $tpl->set_file('text', $dizainas); echo $tpl->process('', 'text', 1); ?>