<?php
require "settings.php";
require "db_sql/db_connect.$PHP_EXTENSION";
require "security.$PHP_EXTENSION";
require "functions.$PHP_EXTENSION";

$DB_link = db_connect();
$DB = new sql($DB_link);
$DB2 = new sql($DB_link);

if(!$lang)
   $lang = $DB->first_record("SELECT obrevation FROM am_languages WHERE on_off=1");

require "header.php3";
require "search_functions.php3";

$id = get_user_id();

$common_header = getHeader();
$body_header = getBodyHeader();
$inner_search = display_inner_search();

/*********************** prisijungimas *******************/
	if ($id ){
		$login_body = user_logged($id);
	}
	else { 
	$login_body = prisijungti(); 
} 

require "main.$PHP_EXTENSION";
$data = getContent();

if ($data['report'])
  $report = $data['report'];
$header_report = getHeaderReport($report, $id);

$body_footer = getBodyFooter();

echo $common_header;
echo $header_report;
echo $body_header;
echo $inner_search;
echo $login_body;
echo getBodyMisc();
echo $data['html'];
require "footer.$PHP_EXTENSION";
echo $body_footer;
require( "stat.".$PHP_EXTENSION );



//__________________________________ functions

function getBodyMisc()
{
  $html = " <img src=\"images/gray.gif\" width=\"180\" height=\"1\" vspace=\"10\" border=\"0\"><br>
	          svetainę sukūrė: <a href=\"http://www.amstudio.lt\" target=\"_blank\">amstudio</a>
   </td>
   <td width=\"20\" valign=\"top\"><img src=\"images/spacer.gif\" width=\"20\" height=\"1\"></td>
   <td width=\"555\" valign=\"top\"><img border=\"0\" src=\"images/gray.gif\" width=\"555\" height=\"1\"><br>"; 

	 return $html;
}
function getBodyHeader()
{
  $html = "<table width=\"770\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
  $html.= "<tr>"; 
  $html.= "<td width=\"15\" valign=\"top\"><img src=\"images/spacer.gif\" width=\"15\" height=\"1\" vspace=\"10\"></td>";
  $html.= "<td width=\"180\" valign=\"top\"><img border=\"0\" src=\"images/gray.gif\" width=\"180\" height=\"1\"><br>";
  $html.= "<img src=\"images/spacer.gif\" width=\"1\" height=\"10\"><br>";
	
	return $html;
}

function getBodyFooter()
{
  $html = "</td></tr></table></body></html>";
	
	return $html;
}
?>