Viewing File: /people/testlab/www/testlab.com.pl/script/slider.php

<?
$db = new DBConnect();
$db2 = new DBConnect();
$sql="select * from pages where id='".$_GET['page']."'";
$db->query($sql);
$row=$db->fetchrow(); 
$nazwa_strony=$row['nazwa'];
$opis_strony=$row['tresc'];
echo "<div id='tresc_glowna' >".$opis_strony."</div>";

if ($_GET['news']!='')
{
$sql = "select * from `aktualnosci` where id=".$_GET['news']." union select * from `aktualnosci` where skrypt_id=".$_GET['page']." and id<>".$_GET['news']." ;";

}
else
$sql = "select * from `aktualnosci` where skrypt_id=".$_GET['page']." order by pozycja,id;";
$result = $db->query($sql);
$ilosc_slajdow=$db->numrows();
$niewidoczne=$ilosc_slajdow-1;
?>
 
<script type="text/javascript"> 
var t;
var time=0;

function autoplay()
{

if ($('slider_status').innerHTML=='wyłączone')
{
$('slider_status').innerHTML='włączone';
time=1;
//onTime();
}
else
{
$('slider_status').innerHTML='wyłączone';
time=0;
}
}

window.addEvent('domready', function(){ 
	  var totIncrement		= 0;
	  var increment			= 600; //szer obrazka + marginesy
	  var maxRightIncrement	= increment*(-<?echo "$niewidoczne";?>); // w nawiasie ilosc elementow poza ekranem
	  var fx = new Fx.Style('slider-list', 'margin-left', {
				duration: 2000,
				transition: Fx.Transitions.Back.easeInOut,
				wait: true
	   });
	   
	   //-------------------------------------
	  // EVENTS for the button "previous"
	  $('previous').addEvents({ 
          'click' : function(event){ 
		  if(totIncrement<0){
					totIncrement = totIncrement+increment;
					
				}
				else 
				totIncrement = maxRightIncrement;
				fx.stop()
				fx.start(totIncrement);
			}			  	  
      }); 
	 
       //-------------------------------------
	  // EVENTS for the button "next"
  	  $('next').addEvents({ 
          'click' : function(event){ 
			 if(totIncrement>maxRightIncrement){
				 totIncrement = totIncrement-increment;
		    }
			else 	 totIncrement = 0;			
			fx.stop()
			fx.start(totIncrement);
			
			
          }		  		  
      })
 
	 
});
	</script> 
	
	
<style type="text/css"> 
#slider-stage{width:600px; overflow:auto; overflow-x:hidden; overflow-y:hidden; height:400px; margin:0 auto;margin-top:5px;}
#slider-buttons{width:600px; margin:0 auto;text-align:right; }
	#slider-list{width:<?echo 600*$ilosc_slajdow;?>px; border:0; margin:0; padding:0; left:260px;}
	#slider-list li{
		list-style:none; 
		margin:0; 
		padding:0; 
		border:0; 
		margin-right:4px;
		padding:4px; 
		background:#efefef;
		float:left;
		width:588px;
		height:400px;
		}
.slider_button{
margin-top:4px;
margin-right:10px;
width:34px;
height:34px;
border:0px;
cursor:pointer;
}		
</style> 
 

<div id="slider-stage"> 
<ul id="slider-list"> 
<?
$z=0;
while ($row=$db->fetchrow()) 
{
$z++;
echo "<li id='i$z'>".$row['tresc']."</li> ";
}    
 ?>   
</ul> 
</div> 
<div id="slider-buttons"> 
<!--<div style='width:200px;float:left;text-align:left;'><input type=button id="play" value='' class=slider_button style='background:url(pliki/play_pause.png)' onclick=autoplay()> <div id=slider_status style='font-weight:bold;float:right;padding-top:15px'>wyłączone</div><div style='float:right;padding-top:15px'>autoodtwarzanie&nbsp;:&nbsp;</div></div>-->
<input type=button id="previous" value='' class=slider_button style='background:url(pliki/prev.png)'><input type=button class=slider_button id="next" value='' style='background:url(pliki/next.png)'> 
</div> 
Back to Directory File Manager