Viewing File: /people/testlab/www/testlab.com.pl/index.php.bak1

<?php include('inc/db.php'); ?>
<?php include("config.php");

if ($_GET['language']!='') $_SESSION['language']=$_GET['language'];
if (!isset($_SESSION['language'])) $_SESSION['language']=1;

$db = new DBConnect();
$db2 = new DBConnect();
$db3 = new DBConnect();
$sql= "select * from `ustawienia` where typ='title';";
$result = $db ->query($sql);
$row=$db->fetchrow();
$title=$row['text'];
$sql= "select * from `ustawienia` where typ='blokada';";
$result = $db ->query($sql);
$row=$db->fetchrow();
$blokada=$row['text'];

if ($_GET['link']!='')
{
$sql = "select * from `pages` where link='".$_GET['link']."'";
$result = $db ->query($sql);
if ($row=$db->fetchrow()) $_GET['page']=$row['id'];
}

if ($_GET['page']!='')
{
$sql = "select * from `pages` where id=".$_GET['page']."";
$result = $db ->query($sql);
if ($row=$db->fetchrow()){
if ($row['title']!='') $subtitle=$row['title'];
else $subtitle=$row['nazwa'];
$keywords=$row['keywords'];
$opis=$row['desc'];
$current=$row['menu'];
if ($current==0) $current=$row['id'];
if ($current!=0) $logo = $current; else $logo=$row['id'];


    $t=str_replace(" ","",strip_tags($row['tresc']));
	if (($t==''))  //jesli nie ma tresci strony ani skryptu to otwiera pierwsza podstrone
	if (($row['sidemenu']==1))
	{
	$sql = "select * from `pages` where menu=".$_GET['page']." and widoczna = 1 order by pozycja";
	$result = $db ->query($sql);
	  if ($row=$db->fetchrow())
	  {
	   if ($row['title']!='') $subtitle=$row['title'];
           else $subtitle=$row['nazwa'];

		$current=$row['menu'];
		if ($current!=0) $logo = $current; else $logo=$row['id'];
        $_GET['page']=$row['id'];
      }
	}
	else $katalog_produktow=1;

}
}
else
{
$sql= "select * from `pages` where widoczna=1 and menu=0 order by pozycja;";
$result = $db ->query($sql);
if ($row=$db->fetchrow()){
$current=$row['id'];
if ($row['title']!='') $subtitle=$row['title'];
else $subtitle=$row['nazwa'];

$keywords=$row['keywords'];
$opis=$row['desc'];
}
$katalog_produktow=1;
}

$sql= "select * from `ustawienia` where typ='opis';";
$result = $db ->query($sql);
$row=$db->fetchrow();
if ($opis=='') $opis=$row['text'];
$sql= "select * from `ustawienia` where typ='keywords';";
$result = $db ->query($sql);
$row=$db->fetchrow();
if ($keywords=='') $keywords=$row['text'];



if ($_GET['news']!='')
{
$sql = "select * from `aktualnosci` where id=".$_GET['news'].";";
$result = $db->query($sql);
$row=$db->fetchrow();
$subtitle = $row['nazwa'];
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html >

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<meta name="Description" content="<?=$opis;?>" >
<meta name="Keywords" content="<?=$keywords;?>" >
<meta name="Robots" content="index,follow" >
<script type='text/javascript' src='inc/advajax.js'></script>
<script type='text/javascript' src='inc/java.js'></script>
<script type='text/javascript' src='inc/md5.js'></script>
<script type="text/javascript" src="inc/menu.js"></script>
		<link rel="stylesheet" href="css/imageflow.css" type="text/css">
		<script type="text/javascript" src="inc/imageflow.js"></script>
		<script type="text/javascript" src="inc/swfobject.js"></script>
		
<link href="css/multibox.css" rel="stylesheet" type="text/css" >
<link href="css/imagemenu.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" href="css/noobslide.css" type="text/css" media="screen" >
<link rel="stylesheet" href="css/css.php" type="text/css" media="all" >
<?
if ($_GET['page']==187)
echo '
<script type="text/javascript" src="inc/mootools-1.2-core-nc.js"></script>
<script type="text/javascript" src="inc/mootools-1.2-more.js"></script>';
else
echo '
<script type="text/javascript" src="inc/mootools.js"></script>
<script type="text/javascript" src="inc/mootools.svn.js"></script>

';

?>
<script type="text/javascript" src="inc/overlay.js"></script>
<script type="text/javascript" src="inc/multibox.js"></script>

 <script type="text/javascript" src="inc/slideshow.js"></script>
 <script type="text/javascript" src="inc/imagemenu.js"></script>
 <script type="text/javascript" src="inc/noobslide.js"></script>
 
 <script src='inc/datepicker.js' type='text/javascript'></script>
<link href='css/datepicker.css' type='text/css' rel='stylesheet'>
<title><?=$subtitle;?> - <?=$title;?></title>

<?include("funkcje.php");?>
<meta name="google-site-verification" content="SPZEFuZrYsL92QHVe03cxDvmEL54L8yEs_et5Z1tpIc" />
</head>
<?
if ($blokada=='true') 
{
include ("uc.php");
}
?>
<body>

<?
//if ($_GET['page']=='') //strona glowna
//{
//}
//else
{
?>
<div style="text-align: center; background-color: lightgrey;">
Ta strona używa ciasteczek (cookies), dzięki którym nasz serwis może działać lepiej. <a style="display: inline; background: none; color: black;" href="http://wszystkoociasteczkach.pl/">Dowiedz się więcej</a>
</div>
<div id=header>
    <div id=banner <?if ($_SESSION['language']==2) echo " style='background:url(pliki/naglowek_ang.png)' ";?>>
	<div  style='position:absolute'><a href="../"><img src="pliki/logo.jpg" border=0 alt='Testlab - urządzenia do badań własności materiałów'></a></div>
	
<?
$sql = "select * from `ustawienia` where typ='popup';";
$result = $db->query($sql);
$row=$db->fetchrow();
//$popup  = str_replace("'","",$row['text']);
//$popup  = str_replace("\"","",$popup);
$popup=$row['text'];

if ($popup!='') 
if ($_SESSION['popup']!=1)
{
echo $popup;
$_SESSION['popup']=1;
}
?>
	
<?include ("script/sbanery.php");?>	
	<?//include ("search.php");?>	
	<div id=animacja>
	<?
	

$sql = "select * from `pages` where id  in (537,538,539)	and jezyk=".$_SESSION['language']."";
$result = $db->query($sql);
$row=$db->fetchrow();
$sk = $row['id'];

$sql = "select * from `aktualnosci` where skrypt_id=$sk and (`tresc_krotka` like '".$_GET['page'].",%' or `tresc_krotka` like '%,".$_GET['page'].",%'  or `tresc_krotka`='')  order by rand() limit 1";
$result = $db->query($sql);
//echo $sql;
while ($row=$db->fetchrow())
{
$typ = end(explode(".",$row['plik']));
if ($typ!='swf')
{
echo "<div >";
if ($row['opcje']=='_blank') $row['link']='http://'.$row['link'];
if ($row['link']!='http://') echo "<a href='".$row['link']."' target='".$row['opcje']."' title=''>";
if (file_exists("upload/".$row['plik'].".jpg")) echo "<img src='upload/".$row['plik'].".jpg' alt='' style='vertical-align:middle;'>";
if (($row['nazwa']!='') || ($row['tresc']!='')) echo " ".$row['nazwa']." ".$row['tresc']; 
if ($row['link']!='http://') echo "</a>";
echo "</div>";
}
else
{
echo "<div id=baner".$row['id']." style='height:140px;width:570px;z-index:1;'> </div>";
?>
<script type="text/javascript">
			
var so = new SWFObject("upload/<?echo "".$row['plik'];?>", "movie", "570", "140", "6", "#fff'");
so.addParam("loop", "true");
so.addParam("allowfullscreen", "true");
so.addParam("wmode", "transparent");
so.write("baner<?echo $row['id']?>");
			
		</script>
		<?
}

}
	?>
	
	</div>
	<div id=szybki_kontakt>
	<div id=szybki_kontakt_header>
	<?
	$sql = "select * from `pages` where id in (466,535,536,668) and jezyk=".$_SESSION['language']."";
    $result = $db ->query($sql);
    $row=$db->fetchrow();
	echo "".$row['nazwa'];
	?>
	</div>
	<?
	echo "".str_replace("<br />","<br>",$row['tresc']);
	?>
	
	</div>
	<?//include("script/kontakt_bez_kodu_na_glowna.php");?>

      
<?//include ("news_right.php");?>



<?//include("script/s405.php");?>
<?include ("lang.php");?>	
<?include ("menu.php");?>
<?include ("search.php");?>
<?include ("path.php");?>
</div>
</div>


<div id=page>
<?
if ($_GET['page']=='')
{
$sql= "select * from `menu` where jezyk=".$_SESSION['language']." and widoczna=1 and id>1 order by pozycja;";
$result = $db ->query($sql);
$row=$db->fetchrow();
$sql= "select * from `pages` where jezyk=".$_SESSION['language']." and widoczna=1 and sidemenu=1 order by pozycja;";
}
else
{
$sql = "select * from `pages` where id=".$_GET['page']."";
}

$result = $db ->query($sql);
$row=$db->fetchrow();
$skrypty_dodatkowe=$row['skrypty_dodatkowe'];
$sidemenu=$row['sidemenu'];


include ("sidemenu.php");?>




<div id=mainwrapper>
<?//include ("news_left.php");?>
<?//include ("path.php");?>
<?//include ("ankieta.php");?>
<?//include("script/s321.php");?>
<div id=main>


<?
if ($_GET['page']=='')
{
$sql= "select * from `menu` where jezyk=".$_SESSION['language']." and widoczna=1 and id>1 order by pozycja;";
$result = $db ->query($sql);
$row=$db->fetchrow();
$sql= "select * from `pages` where jezyk=".$_SESSION['language']." and widoczna=1 and sidemenu=1 order by pozycja;";
}
else
{
$sql = "select * from `pages` where id=".$_GET['page']."";
}

$result = $db ->query($sql);
$row=$db->fetchrow();
$skrypty_dodatkowe=$row['skrypty_dodatkowe'];
$mainmenu=$row['menu'];

$sql = "select * from `aktualnosci` where skrypt_id=195 and (`tresc_krotka` like '".$row['id'].",%' or `tresc_krotka` like '%,".$row['id'].",%'  or `tresc_krotka`='')  order by rand()";
$result = $db2->query($sql);
while ($row2=$db2->fetchrow())
if (file_exists("upload/".$row2['plik'].".jpg")) 
echo "<img src='upload/".$row2['plik'].".jpg' alt='' style='vertical-align:middle;margin:auto;border:0px;margin-bottom:10px;'>";



$_POST['searchfield']=$_GET['searchfield'];
if ($_POST['searchfield']!='')
{
$chars = array(
    "\xb9" => "a", "\xa5" => "A", "\xe6" => "c", "\xc6" => "C",
    "\xea" => "e", "\xca" => "E", "\xb3" => "l", "\xa3" => "L",
    "\xf3" => "o", "\xd3" => "O", "\x9c" => "s", "\x8c" => "S",
    "\x9f" => "z", "\xaf" => "Z", "\xbf" => "z", "\xac" => "Z",
    "\xf1" => "n", "\xd1" => "N",
 
    "\xc4\x85" => "a", "\xc4\x84" => "A", "\xc4\x87" => "c", "\xc4\x86" => "C",
    "\xc4\x99" => "e", "\xc4\x98" => "E", "\xc5\x82" => "l", "\xc5\x81" => "L",
    "\xc3\xb3" => "o", "\xc3\x93" => "O", "\xc5\x9b" => "s", "\xc5\x9a" => "S",
    "\xc5\xbc" => "z", "\xc5\xbb" => "Z", "\xc5\xba" => "z", "\xc5\xb9" => "Z",
    "\xc5\x84" => "n", "\xc5\x83" => "N",
 
    "\xb1" => "a", "\xa1" => "A", "\xe6" => "c", "\xc6" => "C",
    "\xea" => "e", "\xca" => "E", "\xb3" => "l", "\xa3" => "L",
    "\xf3" => "o", "\xd3" => "O", "\xb6" => "s", "\xa6" => "S",
    "\xbc" => "z", "\xac" => "Z", "\xbf" => "z", "\xaf" => "Z",
    "\xf1" => "n", "\xd1" => "N",
);

$ilosc=0;

$sql= "select aktualnosci.* from `aktualnosci` join pages on aktualnosci.skrypt_id=pages.id where jezyk=".$_SESSION['language']." and aktualnosci.tresc like '%".$_POST['searchfield']."%' or aktualnosci.nazwa like '%".$_POST['searchfield']."%' or aktualnosci.tresc like '".$_POST['searchfield']."%' or aktualnosci.nazwa like '".$_POST['searchfield']."%' or aktualnosci.tresc like '%".$_POST['searchfield']."' or aktualnosci.nazwa like '%".$_POST['searchfield']."' order by aktualnosci.id;";
$result = $db ->query($sql);

if ($db->numrows()!=0) $ilosc++;

while ($row=$db->fetchrow())
{
$nazwa=str_replace("-","",$row['nazwa']);
$nazwa=str_replace("\"","",$nazwa);
$nazwa=str_replace(":","",$nazwa);
$nazwa=str_replace("?","",$nazwa);
$nazwa=str_replace("__","_",$nazwa);
echo "<a href='".str_replace(" ","_",$nazwa).",".$row['skrypt_id'].",".$row['id']."'>".$row['nazwa']."</a><br>";
$tresc = str_replace("<br>"," ",$row['tresc']);
$tresc = str_replace("&nbsp;"," ",$row['tresc']);
$tresc = strip_tags($tresc);
$tresc = strtr($tresc, $chars);
echo substr($tresc,0,300)."...";
echo "<br>";
echo "<br>";
}

$sql= "select * from `pages` where jezyk=".$_SESSION['language']." and widoczna=1 and (tresc like '%".$_POST['searchfield']."%' or nazwa like '%".$_POST['searchfield']."%' or tresc like '%".$_POST['searchfield']."' or nazwa like '%".$_POST['searchfield']."'or tresc like '".$_POST['searchfield']."%' or nazwa like '".$_POST['searchfield']."%') order by pozycja;";
$result = $db ->query($sql);
if ($db->numrows()!=0) $ilosc++;

while ($row=$db->fetchrow())
{
echo "<a href='".$row['link'].".html'>".$row['nazwa']."</a><br>";
$tresc = str_replace("<br>"," ",$row['tresc']);
$tresc = str_replace("&nbsp;"," ",$row['tresc']);
$tresc = strip_tags($tresc);
$tresc = strtr($tresc, $chars);
echo substr($tresc,0,300)."...";
echo "<br>";
echo "<br>";
}

if ($ilosc==0) echo "<div id=nie_znaleziono>".$languages['nie_znaleziono']."</div>";

}
else
if ($_GET['param']=='sitemap')
{
$sql= "select * from `pages` where jezyk=".$_SESSION['language']." and widoczna=1 and menu=0 order by pozycja;";
$result = $db ->query($sql);
echo naglowek("Mapa serwisu:");
echo "<ul >";
while ($row=$db->fetchrow())
{
echo "<li ><a href='".$row['link'].".html'";
$sql= "select * from `pages` where jezyk=".$_SESSION['language']." and widoczna=1 and menu=".$row['id']." order by pozycja;";
$db2 ->query($sql);
echo "style='height:30px;'>".$row['nazwa']."</a> - ".$row['desc'];
if ($db2->numrows()>0)
{
 echo "
 <div ><ul>";
 while ($row2=$db2->fetchrow()) 
 {
 echo "<li><a href='".$row2['link'].".html'>".$row2['nazwa']."</a> - ".$row2['desc'];
 $sql= "select * from `aktualnosci` where skrypt_id=".$row2['id']." order by data;";
 $db3 ->query($sql);
 if ($db3->numrows()>0)
 {
 echo " <div ><ul>";
 while ($row3=$db3->fetchrow()) 
 {
 $nazwa=str_replace("-","",$row3['nazwa']);
$nazwa=str_replace("\"","",$nazwa);
$nazwa=str_replace(":","",$nazwa);
$nazwa=str_replace("?","",$nazwa);
$nazwa=str_replace("__","_",$nazwa);
$link=$nazwa.",".$row2['id'].",".$row3['id'];
 echo "<li><a href='".$link."'>".$row3['nazwa']."</a></li>";
 }
 echo "</ul></div>";
 
 }
 echo"</li>";
 }
echo "</ul></div>";
}
$sql= "select * from `aktualnosci` where skrypt_id=".$row['id']." order by data;";
 $db3 ->query($sql);
 if ($db3->numrows()>0)
 {
 echo " <div ><ul>";
 while ($row3=$db3->fetchrow()) 
 {
 $nazwa=str_replace("-","",$row3['nazwa']);
$nazwa=str_replace("\"","",$nazwa);
$nazwa=str_replace(":","",$nazwa);
$nazwa=str_replace("?","",$nazwa);
$nazwa=str_replace("__","_",$nazwa);
$link=$nazwa.",".$row['id'].",".$row3['id'];
 echo "<li><a href='".$link."'>".$row3['nazwa']."</a></li>";
 }
 echo "</ul></div>";
 
 }
echo "</li>";
}
echo "</ul>";
}
else
{


if (($_GET['page']=='649')||($_GET['page']==''))
{
?>
<div id=news_container>
<?
$sql= "select * from `pages` where id=785;";
$result = $db2 ->query($sql);
$row2=$db2->fetchrow();

?>
<?//naglowek($row['nazwa']);?>
<?	echo "".str_replace("<br />","<br>",$row2['tresc']);?>
</div>
<?
}

//sidemenu 2
if ($_GET['sidemenu']>0)
{
    include("submenu2.php");
}
else
{
if (($row['po_zalogowaniu']==0)||(isset($_SESSION['user_name'])))
{
//if ($row['po_zalogowaniu']==1) include ("login.php");
//else
if ($row['menu']>0)
{
$sql= "select * from `pages` where id=".$row['menu']."";
 $db3 ->query($sql);
$row3=$db3->fetchrow();
//naglowek($row3['nazwa']." &raquo; ".$row['nazwa'])	;	
naglowek($row['nazwa'])	;	

}
else naglowek($row['nazwa'])	;																


if ($row['skrypt']=='0') 
{
echo "".$row['tresc'];
}
else 
{
if ($row['nazwa_skryptu']=='')
{
if (file_exists("script/s".$row['id'].".php")) {$_GET['page']=$row['id'];include("script/s".$row['id'].".php");

if ($katalog_produktow==1) 
   {
     include("submenu.php");
   }
}
else 
echo "<font color=red>Błąd!!! Nie można załadować skryptu.</font>";
}
else
{
if (file_exists("script/".$row['nazwa_skryptu'].".php")) {$_GET['page']=$row['id'];include("script/".$row['nazwa_skryptu'].".php");

if ($katalog_produktow==1) 
   {
     include("submenu.php");
   }
}
else 
if (file_exists("script/s".$row['id'].".php")) {$_GET['page']=$row['id'];include("script/s".$row['id'].".php");
if ($katalog_produktow==1) 
   {
     include("submenu.php");
   }
}
else 
echo "<font color=red>Błąd!!! Nie można załadować skryptu.</font>";
}
}


}
else //wymaga logowania
{
echo "<center>Ta strona dostępna jest po zalogowaniu.</center>";
//include ("login.php");
}

//if ($mainmenu!=0)
// echo "<br><br><div id=powrot><a href='javascript:history.back()'>".$languages['powrot']."</a></div>";

}
}
?>

</div>

</div>



</div>
<?
}
?>
<div id=footer>
<div id=footer_tresc>
<?include ("script/s669.php");?>
<?include ("bottom_menu.php");?>
<?

$sql= "select * from `pages` where id=12;";
$result = $db ->query($sql);
$row=$db->fetchrow();
echo "".str_replace("<br />","<br>",$row['tresc']);
echo "<div id=wykonanie>Projekt serwisu: <a href='http://niewiadomski.biz' target=_blank>niewiadomski.biz</a><br>
Oprogramowanie: <a href='http://choruzy.pl' target=_blank>choruzy.pl</a></div>";
?>
</div>
</div>

<script type="text/javascript">
			var box = {};
			window.addEvent('domready', function(){
			box = new MultiBox('mb', {descClassName: 'multiBoxDesc', useOverlay: true});
				
			});

			
//var so = new SWFObject("pliki/anim.swf", "movie", "640", "180", "6", "#fff'");
//so.addParam("loop", "true");
//so.addParam("allowfullscreen", "true");
//so.addParam("wmode", "transparent");
//so.write("animacja");
		</script>
		
<?
if ($skrypty_dodatkowe!='')
{
echo '<script type="text/javascript">
'.$skrypty_dodatkowe.'
	</script>
';
}

?>		
</body>
</html>

Back to Directory File Manager