UVOD
1. Za izradu sajta su korišdeni HTML, CSS, PHP, JavaScript i JQuery. Sajt je rađen u Notepad++.
2. Sajt je kreiran za Biciklisticki centar, u nameri da korisnici putem sajta dobijaju potrbne informacije
vezane za usluge centra.
Index stranica
Na ovoj stranici se nalazi navigacioni meni koji sadrzaj vuce iz baze.Na levoj strani se nalazi anketa koja
takodje povlaci sadrzaj iz baze i upisuje u istu. U sredini se nalazi sadrzaj koji se menja u zavisnosti na
koji ste link klinknuli. Neke stranice ucitava iz baze neke include-je preko petlje. Na Home stranici se
nalazi Slide-r sa slikama radjen u jQuery-u sa nekim informacijama o Bicikl centru. Na desnoj strani se
nalazi forma za logovanje I link za registraciju. Prilikom logovanja kao ADMIN (username: ivanada,
password: timada90) pojavljuje se link koji vodi na stranicu gde se nalazi ADMIN PANEL.
<?php
ob_start();
session_start();
@mysql_set_charset('utf8');
$server="127.0.0.1";
$korisnik="biciklce_admin";
$lozinka="123123123";
$ime_baze="biciklce_bike";
$conn=mysql_connect($server,$korisnik,$lozinka);
$baza=mysql_select_db($ime_baze,$conn) or die("Problem pri konektovanju sa bazom!!!");
function logedin(){
if(isset($_SESSION['username'])&&!empty($_SESSION['username'])){
return true;
}else{
return false;
}
}
?>
<html>
<head>
<title>Bicikl Centar</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link type="text/css" rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<script src="lib/prototype.js" type="text/javascript"></script>
<script src="lib/scriptaculous.js?load=effects,builder" type="text/javascript"></script>
<script src="lib/lightbox.js" type="text/javascript"></script>
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript" src="script_jq.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<!-- Galerija slika -->
<script type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jqueryui.min.js"></script>
<script type="text/javascript" src="gallery/js/jquery.timers-1.2.js"></script>
<script type="text/javascript" src="gallery/js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="gallery/js/jquery.galleryview-3.0-dev.js"></script>
<link type="text/css" rel="stylesheet" href="gallery/css/jquery.galleryview-3.0-dev.css" />
<script type="text/javascript">
$(function(){
$('#myGallery').galleryView();
});
</script>
<script type="text/javascript" src="js/coin-slider.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<link rel="stylesheet" href="css/coin-slider-styles.css" type="text/css" />
</head>
<body>
<div id="master">
<div id="top">
<div id="navigation">
<?php
mysql_set_charset('UTF-8');
echo("<ul id='menu'>");
$upit1="SELECT * FROM menu";
$rez1=mysql_query($upit1,$conn);
while($red1=mysql_fetch_array($rez1)){
$x=$red1['menu_id'];
echo("<li><a href=index.php?id=".$red1['page_id'].">".$red1['name']."</a><ul
class='submenu'>");
$upit2="SELECT * FROM submenu WHERE menu_id=$x";
$rez2=mysql_query($upit2,$conn);
while($red2=mysql_fetch_array($rez2)){
echo("<li ><a href=index.php?id=".$red2['page_id'].">".$red2['name']."</a></li>");
}
echo("</ul></li>");
}
echo("</ul>");
?>
</div>
</div>
<div id="content">
<div id="content_left">
<div id="anketa">
<?php
mysql_set_charset('utf8');
if(isset($_POST['odg'])){
$odgovor=$_POST['Usluga'];
$upit="SELECT * FROM odgovori WHERE odgovor = '$odgovor'";
$rez = mysql_query($upit,$conn);
$redd = mysql_fetch_array($rez);
$rate = $redd['glasovi'];
$new_rate = $rate+1;
if($query = mysql_query("UPDATE odgovori SET glasovi =
'$new_rate' WHERE odgovor = '$odgovor'")){
$upit="SELECT * FROM odgovori";
$rez=mysql_query($upit,$conn);
echo "<div class='anketa' id='anketa'>";
echo "Uspesno ste glasali!<br/>";
echo "<h4>Rezultati ankete:</h4>";
echo"<table id='anketa_tbl'>";
while($red=mysql_fetch_array($rez)){
echo"<tr><td>".$red['odgovor'].":</td><td>".
$red['glasovi']."</td></tr>";
}
echo"</table>";
echo"</div>";
}
}else{
$upit="SELECT * FROM anketa";
$rez=mysql_query($upit,$conn);
echo "<div class='anketa' id='anketa'>";
echo"<form method = 'post' action = ''>";
while($red=mysql_fetch_array($rez)){
$a_id=$red['anketa_id'];
echo "<h4>".$red['pitanje']."</h4>";
$upit2="SELECT * FROM odgovori WHERE anketa_id='$a_id'";
$rez2=mysql_query($upit2,$conn);
while($red2=mysql_fetch_array($rez2)){
$n=$red['name'];
echo "<input type='radio' name='$n' value='".
$red2['odgovor']."'>".$red2['odgovor']."</br>";
}
echo "<span style='text-align:center'> <input class='an_but'
type='submit' name='odg' value='Odgovori'></span></br>";
}
echo"</form>";
echo "</div>";
}
?>
</div>
</div>
<div id="content_mid" style="min-height: 600px;">
<?php
if(isset($_GET['id'])){
$x=$_GET['id'];
if($x==11){
include('registration.php');
}elseif($x==12){
include('admin.php');
}
elseif($x==13){
include('pristupnica.php');
}
elseif($x==9){
include('kontakt.php');
}
elseif(isset($x) && $x == 14)
{
include('galerija_slika.php');
}elseif(isset($x) && $x == 1)
{
include('home_page.php');
}
else{
mysql_set_charset('utf8');
$upit="SELECT * FROM pages WHERE page_id=$x";
$rezultat=mysql_query($upit,$conn);
$red = mysql_fetch_array($rezultat);
//echo("<h2>'".$red['name']."'</h2>");
echo $red['content'];
}
}else{
include('home_page.php');
}
?>
<div class="backdrop">
</div>
<div class="box"><div class="close"></div>Lightbox</div>
</div>
<div id="content_right">
<div id="log">
<div id="login">
<?php
if(logedin()){
if($_SESSION['uloga_id']==1){
echo"<a href='index.php?id=12'>Pregled clanova i
korisnika...</a></br><hr>";
}
echo "".$_SESSION['username'].", dobrodošli na sajt Bicikl Centra!
</br><a href='logout.php'>Logout!</a>";
}else{
echo "<form action='' method='POST'>";
echo "<table id='log_tbl'>";
echo "<tr><td>Username:</td></tr>";
echo "<tr><td><input type='text' name='username''></td></tr>";
echo "<tr><td>Password:</td></tr>";
echo "<tr><td><input type='password' name='password'></td></tr>";
echo "<tr><td><input type='submit' name='login'
value='Login!'></td></tr>";
echo "<tr><td><a href='index.php?id=11'>Registrujte se!
</a></td></tr>";
echo "</table>";
echo "</form>";
if(isset($_POST['login'])){
$username=$_POST['username'];
$password=$_POST['password'];
$pass_md5=md5($password);
if(!empty($username)&&!empty($password)){
$query="SELECT * FROM users WHERE username='$username' AND
password='$password'";
$query_run=mysql_query($query,$conn);
if($query_run){
$niz=mysql_fetch_array($query_run);
$_SESSION['name']=$niz['ime']." ".$niz['prezime'];
$_SESSION['username']=$username;
$_SESSION['user_id']=$niz['user_id'];
$_SESSION['uloga_id']=$niz['uloga_id'];
}else{
echo "Pogresno uneto korisnicko ime/lozinka!!!";
}
}else{
echo "Unesite korisnicko ime i lozinku!!!";
}
}
}
?>
</div>
</div>
<a href="index.php?id=13" ><div id="clan" width="120px">
<p>Postanite naš redovan korisnik čime postajete naš član i
ostvarujete pravo na popust od 30% na naše usluge!</p>
</div></a>
</div>
</div>
<div id="bot">
<span><p>&copy; Bicikl Centar 2014<p></span>
</div>
</div>
</body>
</html>
Organizacija
Kodovi
Connect.inc.php
<?php
$mysql_host='localhost';
$mysql_user='root';
$mysql_pass='';
$mysql_db='test';
$conn=mysql_connect($mysql_host,$mysql_user,$mysql_pass);
if(!$conn||!mysql_select_db($mysql_db,$conn)){
die (mysql_error());
}
?>
Login.inc.php
<?php
if(isset($_POST['username'])&& isset($_POST['password'])){
$username=$_POST['username'];
$password=$_POST['password'];
$pass_md5=md5($password);
if(!empty($username)&&!empty($password)){
$query="SELECT 'id' FROM 'users' WHERE
'username'='$username' AND 'password'='$pass_md5'";
if($query_run=mysql_query($query)){
$query_num_rows=mysql_num_rows($query_run);
if($query_num_rows==0){
echo "Pogresno uneto korisnicko ime/lozinka!!!";
}else if($query_num_rows==1){
$user_id=mysql_result($query_run,0,'id');
$_SESSION['user_id']=$user_id;
header('Location:index.php');
}
}
}else{
echo "Morate uneti korisnicko ime i sifru!!!";
}
}
?>
<form action="<?php echo $current_file;?>" method='POST'>
username:<input type='text' name='username'></br>
password:<input type='password' name='password'></br>
<input type='submit' name='login' value='Log in!'>
</form>
Core.php
<?php
ob_start();
session_start();
$current_file=$_SERVER['SCRIPT_NAME'];
/*$http=$_SERVER['HTTP_REFERER'];
*/
function logedin(){
if(isset($_SESSION['username'])&&!empty($_SESSION['username'])){
return true;
}else{
return false;
}
}
function getfield($field){
$query="SELECT '$filed' FROM 'users' WHERE 'id'='".
$_SESSION['user_id']."'";
if($query_run=mysql_query($query)){
if($query_result=mysql_result($query_run, 0,$field)){
return $query_result;
}
}
}
?>
Logout.php
<?php
?>
require 'core.php';
session_destroy();
header('Location:'.$http);
Home_page.php
<div style="padding-top:30px; width:500px;">
<div id="photos">
<div id="home_slider" class="css_shadow">
<div id="games" style="background-color:
transparent;">
<a href="#">
<img src="img/1.jpg" alt="pc1"
width="250px" height="500px"/>
</a>
<a href="#">
<img src="img/2.jpg" alt="pic2"
width="250px" height="500px"/>
</a>
<a href="#">
<img src="img/3.jpg" alt="pic3"
width="250px" height="500px"/>
</a>
<a href="#">
<img src="img/4.jpg" alt="pic4"
width="250px" height="500px"/>
</a>
<a href="#">
<img src="img/5.jpg" alt="pic5"
width="250px" height="500px" />
</a>
</div>
<script>
$('#games').coinslider();
</script>
</div>
</div>
<div id="home_text">
<p>
Biciklistički centar nalazi se na levoj obali Savskog jezera, u blizini kružnog toka, ali u neposrednoj blizini mesta
gde su se i do sada iznajmljivali bicikli i roleri.</br>
Pored iznajmljivanja bicikala i rolera imate mogucnost servsisiranja i parkiranja vaseg bicikla.</br>
Beograđani tokom cele nedelje mogu iskoristiti posebne pogodnosti koje je Biciklistički centar pripremio: </br>
Najam za jedan sat se plaća upola cene (ponedeljak), </br>
Jedna bicikla gratis za parove (utorak), </br>
Besplatan najam za decu ispod 12 godina (sreda), </br>
Besplatan najam za gospođe starije od 50 godina (četvrtak) </br>
I besplatan najam za gospodu iznad 50 godina (petak)!! </p>
</div>
</div>
galerija_slika.php
<div style="width:550px; height:250px; margin-bottom:200px;">
<ul id="myGallery">
<?php
$doc="img/";
if ($handle = opendir($doc)) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
echo '<li><img src="'.$doc.$entry.'" title="Image" alt="Image" />';
}
}
closedir($handle);
}
?>
</ul>
</div>
Kontakt.php
script type="text/javascript">
function isValidEmailAddress(emailAddress) {
var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|
[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|
[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?
(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|
[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|
[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([az]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|
[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|
[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+
(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])
([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|
[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
return pattern.test(emailAddress);
};
function submit_form(form_type)
{
var name = $.trim($('#kontakt_name').val());
var email = $.trim($('#kontakt_mail').val());
var msg = $.trim($('#kontakt_poruka').val());
var error = '';
var valid = 1;
/////////////////VALIDATION I FORM//////////////////////////
if(name == '')
{
$('#kontakt_name').css('border','2px solid #d20000');
valid = 0;
alert('Upisite naslov email-a!');
}else{
$('#kontakt_name').css('border','1px solid #d20000');
$('#kontakt_name').css('border-color','#b9b9b9');
}
var valid_email = isValidEmailAddress(email);
if(valid_email == false)
{
$('#kontakt_mail').css('border','2px solid #d20000');
valid = 0;
alert('Upisite ispravan email!');
}else{
$('#kontakt_mail').css('border','1px solid #d20000');
$('#kontakt_mail').css('border-color','#b9b9b9');
}
if(email_text == '')
{
$('#kontakt_poruka').css('border','2px solid #d20000');
valid = 0;
alert('Upisite tekst email-a!');
}else{
$('#kontakt_poruka').css('border','1px solid #d20000');
$('#kontakt_poruka').css('border-color','#b9b9b9');
}
if(valid == 1)
{
$('#form_button_submit').attr('onClick', '');
$('#kontakt_form').submit();
}else{
}
}
</script>
<div style="float:left;width:100%"id="kontakt">
<div style="float:left;">
<div id="kontakt_form" style="float:left; margin-bottom:30px;padding-left:30px;">
<form action="" method="post">
<table style="text-align:top; ">
<tr><td><h3>Ime i prezime:</h3></td>
<td height="20px" width="160px"><input type="text" height="20px" width="160px"
name="kontakt_name" id="kontakt_name"></td></tr>
<tr><td><h3>E-mail:</h3></td><td height="20px" width="160px"><input type="text"
name="kontakt_mail" id="kontakt_mail"></td></tr>
<tr><td><h3>Poruka:</h3></td><td><textarea col="55" rows="10" name="kontakt_poruka"
id="kontakt_poruka"></textarea></td></tr>
<tr><td><input type="submit" name="kontakt_posalji" value="Posalji"
onCLick="submit_form()" id="form_button_submit"></td>
<td><input type="reset" value="Obrisi"></td></tr>
</table>
<?php
if(isset($_POST['kontakt_posalji']) && isset($_POST['kontakt_ime']) &&
isset($_POST['kontakt_mail']) && isset($_POST['kontakt_sadrzaj'])){
$imePre=$_POST['kontakt_ime'];
$e_mail=$_POST['kontakt_mail'];
$sadrzaj=$_POST['kontakt_sadrzaj'];
if(empty($imePre)||empty($e_mail)||empty($sadrzaj)){
echo"Popunite sva ponudhena polja kontakt forme!!!";
}else{
$re_name="/^[A-Z][a-z]{2,15}\s[A-Z][a-z]{2,15}$/";
$re_email="/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[az]{2,3})/$";
if(preg_match($re_name,$imePre)){
if(preg_match($re_email,$e_mail)){
$to="[email protected]";
$naslov="Pitanja BC!!!";
$sadrzaj.="Poruka je stigla od :".$imePre;
mail($to,$naslov,$sadrzaj,$e_mail);
}
echo"Neispravno uneta e-mail adresa!";
}
echo"Neispravno uneto ime i prezime";
}
}
?>
</form>
</div>
<div id="kontakt_info" style="float:left;">
<p style="margin-left:35px">
Bicikl Centar <br/>
Adresa: Ada Ciganlija bb <br/>
11000 Beograd <br/><br/>
Mob. +381642545668 <br/>
Mob. +381637089708 <br/>
Fix. 0113572263 <br/>
</p>
</div></div>
<div style="margin-left:50px;margin-bottom:20px;width:500px;"><div
style="overflow:hidden;height:400px;width:500px;">
<div id="gmap_canvas" style="height:400px;
width:500px;"></div><style>.gmap{position:relative;line-height:1.12;overflow:hidden;color:#000;whitespace:nowrap;display:block;margin-bottom:2px;font-weight:500;}</style>
<iframe src="http://www.embed-google-map.com/mapembed.php"><a
href="http://www.sparmichl.de/baur-gutschein/" class="map-data">sparmichl.de</a></iframe>
</div><script type="text/javascript">function init_map(){var myOptions = {zoom:15,center:new
google.maps.LatLng(44.79010123189002,20.413086813056225),mapTypeId:
google.maps.MapTypeId.ROADMAP};map = new google.maps.Map(document.getElementById("gmap_canvas"),
myOptions);marker = new google.maps.Marker({map: map,position: new
google.maps.LatLng(44.79010123189002, 20.413086813056225)});
infowindow = new google.maps.InfoWindow({content:"<span class='gmap'><b>Bicikl
Centar</b></span><span class='gmap'>Ada Ciganlija bb</span><span class='gmap'> Beograd</span>" });
google.maps.event.addListener(marker, "click", function()
{infowindow.open(map,marker);});infowindow.open(map,marker);}google.maps.event.addDomListener(window
, "load", init_map);</script>
</div>
</div>
Registration.php
<?php if(isset($_GET['user_id'])) {
$upit="SELECT * FROM `biciklce_bike`.`users` WHERE `users`.`user_id` = ".$_GET['user_id']." ";
$rez= mysql_fetch_assoc(mysql_query($upit,$conn));
echo '<form id="reg_form" class="form" name="reg_form" action="#" method="POST"
onSubmit="reg_provera();">
<table>
<tr colspan="2"><td><h3>Registarcija</h3></td></tr>
<tr><td>Kosisnicko ime:</td><td><input type="text" name="username" id="username"
value="'.$rez['username'].'"></td></tr>
<tr><td>Lozinka:</td><td><input type="password" name="password" id="password" value="'.
$rez['password'].'"></td></tr>
<tr><td>Potvrda lozinke:</td><td><input type="password" name="re_password"
id="re_password" value="'.$rez['password'].'"></td></tr>
<tr><td>Ime:</td><td><input type="text" name="fname" id="fname" value="'.
$rez['ime'].'"></td></tr>
<tr><td>Prezime:</td><td><input type="text" name="lname" id="lname" value="'.
$rez['prezime'].'"></td></tr>
<tr><td>E-mail:</td><td><input type="text" name="email" id="email" value="'.
$rez['email'].'"></td></tr>
<tr><td><input type="reset" value="Ponisti!"></td><td><input type="submit" value="Posalji!"
name="reg_submit" id="reg_submit"></td></tr>
</table>
</form>';
}
else
{
echo '<form id="reg_form" class="form" name="reg_form" action="#" method="POST"
onSubmit="reg_provera();">
<table>
<tr colspan="2"><td><h3>Registarcija</h3></td></tr>
<tr><td>Kosisnicko ime:</td><td><input type="text" name="username"
id="username"></td></tr>
<tr><td>Lozinka:</td><td><input type="password" name="password"
id="password"></td></tr>
<tr><td>Potvrda lozinke:</td><td><input type="password" name="re_password"
id="re_password"></td></tr>
<tr><td>Ime:</td><td><input type="text" name="fname" id="fname"></td></tr>
<tr><td>Prezime:</td><td><input type="text" name="lname" id="lname"></td></tr>
<tr><td>E-mail:</td><td><input type="text" name="email" id="email"></td></tr>
<tr><td><input type="reset" value="Ponisti!"></td><td><input type="submit" value="Posalji!"
name="reg_submit" id="reg_submit"></td></tr>
</table>
</form>';
}
if(isset($_POST['reg_submit'])){
$username=$_POST['username'];
$password=$_POST['password'];
$re_pass=$_POST['re_password'];
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$email=$_POST['email'];
$reg_ime="/^[A-Z]{1}[a-z]{2,15}$/";
$reg_pre="/^[A-Z]{1}[a-z]{3,15}$/";
$reg_email="/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.
[a-z0-9-]+)*(\.[a-z]{2,3})$/";
$md5_pass=md5($password);
$greske=array();
$query1="SELECT * FROM users";
$rez1=mysql_query($query1);
$row=mysql_fetch_array($rez1);
if(!preg_match($reg_ime,$fname)){
$greske[]="Neispravno uneto ime!";
}
if(!preg_match($reg_pre,$lname)){
$greske[]="Neispravno uneto prezime!";
}
if(strlen($username<6)&&strlen($username)>15){
$greske[]="korisnicko ime mora imati izmedju 6 i 15 karaktera!";
}
if(strlen($password<6)&&strlen($password)>15){
$greske[]="Lozinka mora imati izmedju 6 i 15 karaktera!";
}
if($password!=$re_pass){
$greske[]="Ne poklapaju se lozinke!";
}
if(!preg_match($reg_email,$email)){
$greske[]="Neispravno uneta e-mail adresa!";
}
if($username==$row['username']){
$greske[]="Korisnik sa tim korisnickim imenom vec postoji!";
}
if($email==$row['email']){
$greske[]="Ovaj email je vec u upotrebi od strane korisnika!";
}
if(count($greske)>0){
print "<ul style='color:blue'>";
foreach($greske as $greska){
print "<li>".$greska."</li>";
}
print "</ul>";
}else{
$upit="DELETE FROM `biciklce_bike`.`users` WHERE
`users`.`user_id` = ".$_GET['user_id']." ";
$rez=mysql_query($upit,$conn);
$query="INSERT INTO users
VALUES('','$username','$md5_pass','$fname','$lname','$email','2','')";
$rez=mysql_query($query,$conn);
if($rez==true){
/*$from="[email protected]";
$sadrzaj="Za aktivaciju vaseg naloga kliknite <a
href='localhost/sajt/index.php?id=16'>ovde</a>!!!";
$naslov="Aktivacija naloga - Bicikl centar!";
mail($email,$naslov,$sadrzaj);
*/
echo"Uspesno ste registrovani! Proverite vas e-mail da bi ste
aktivirali vas nalog!!!";
header('location', '');
}
}
}
?>
Admin.php
<script type="text/javascript">
function deleteUser(id)
{
$.post("admin.php",
{
delete_user_id: id
},
function(data)
{
alert("delete success");
location.reload();
}
);
}
</script>
<?php
$server="127.0.0.1";
$korisnik="biciklce_admin";
$lozinka="123123123";
$ime_baze="biciklce_bike";
$conn=mysql_connect($server,$korisnik,$lozinka);
$baza=mysql_select_db($ime_baze,$conn) or die("Problem pri konektovanju sa bazom!!!");
//definisemo start promenljivu
if(isset($_GET['start'])){
$start = $_GET['start'];
}else{
$start = 0;
}
//hvatamo ajax poziv
if(isset($_POST['delete_user_id'])){
$upit="DELETE FROM `biciklce_bike`.`users` WHERE `users`.`user_id` = ".$_POST['delete_user_id']." ";
$rez=mysql_query($upit,$conn);
}
if(isset($_SESSION['username'])&&!empty($_SESSION['username'])&&$_SESSION['uloga_id']==1)
{
//konektujemo se u bazu
//definisemo broj rezultata baze podataka i broj prikaza po stranici
$br = mysql_num_rows(mysql_query("SELECT * FROM users"));
$pps = 5;
//uzimamo rezultate iz baze podataka
$q = mysql_query("SELECT *
FROM `users`
LIMIT $start , $pps");
//$upit="SELECT * FROM users";
//$rez=mysql_query($upit,$conn);
echo "<div style='width: 550px; margin-top: 40px;
margin-left:20px; margin-bottom: 20px;'>";
echo"<div style='width:100%; font-size:20px; color:
blue;'>
<div style='width:10%; float:left; textalign:center;'>Id</div>
<div style='width:30%; float:left; textalign:center;'>Username</div>
<div style='width:49%; float:left; textalign:center;'>e-mail</div>
<div style='width:10%;
float:left;'>Status</div>
</div>";
while($red=mysql_fetch_array($q)){
echo"<div style='width:100%;'>
<div style='width:10%; float:left;
margin-top:2px; background-color:rgb(228, 225, 225)';>".$red['user_id']."</div>
<div style='width:30%; float:left;
margin-top:2px; background-color:rgb(228, 225, 225)'><a href='index.php?id=11&user_id=".$red['user_id']."'>".
$red['username']."</a></div>
<div style='width:49%; float:left;
margin-top:2px; background-color:rgb(228, 225, 225)'>".$red['email']."</div>
<div style='width:5%; float:left; margintop:2px; background-color:rgb(228, 225, 225)'>".$red['activiti']."</div>
<div style='width:5%; float:left; margintop:2px; background-color:rgb(228, 225, 225)'><a id='deleteUser' onClick='deleteUser(".$red['user_id'].")'><img
src='delete.png' width='72%' /></a></div>
</div>";
}
echo "</div>";
}
//ukoliko se ne prikazuju pocetni podaci postavljamo dugme 'prethodna stranica'
if($start!=0){
$nstart = $start - $pps;
echo "<span style='align:center'><a href='index.php?start=0'><input type='submit' name=''
value='Pocetak!'></a>";
echo "<a href='index.php?start=$nstart'><input type='submit' name='' value='Nazad!'></a> ";
}
//prikazujemo od kog do kog rezultata prikazujemo i ispisujemo koliko ima rezultata
$raz=$br-$start;
if($raz<$pps){
$zbir = $start + $raz;}
else{$zbir=$start+$pps;
}
echo "<strong>".$start." - ".$zbir."/".$br."</strong>";
//ukoliko se ne prikazuju krajnji podaci postavljamo dugme 'sledeca stranica'
if($start<($br-$pps)){
$nstart = $start + $pps;
$mod=$br%$pps;
if($mod==0){
$kraj=$br-$pps;
}else{
$kraj=$br-$mod;}
echo " <a href='index.php?start=$nstart'><input type='submit' name='' value='Napred!'></a>";
echo "<a href='index.php?start=$kraj'><input type='submit' name='' value='Kraj!'></a></span>";
}
?>
Autor.php
<div id="autor" style="padding-left:50px;">
<img src="ja.jpg" alt="slika autora" style="padding:20px;float:left;">
<p></br></br> Prezime: Teodorovic</br>
Ime: Ivan</br>
Br. indeksa: 331/09</br>
Smer: Internet tehnologije</br>
</p>
</div>
Ponuda.php
<div style='width:100% float:left;'>
<a href="index.php?id=3"><div style='width:95% padding-left:2%; float:left;'>
<div style='float:left; margin-left:2%; width:38%; margin-top:20px'><img
src='img/rent.jpg' height='150px' width='200px'></div><div style='float:left;
width:60%;'><h3>Rentiranje</h3><p>Izanjmljivanje bicikala, rolera i pedalina po poristupacnim cenama!!!
</p></div>
</div ></a>
<a href="index.php?id=4"><div style='width:95%; float:left;'>
<div style='float:left; margin-left:2%; width:38%; margin-top:20px'><img
src='img/rent.jpg' height='150px' width='200px'></div><div style='float:left; width:60%;'><h3>Servis</h3><p>U
nasem centru postoji mogucnost i popravke vasih mezimaca!</p></div>
</div></a>
<a href="index.php?id=5"><div style='width:95%; float:left;'>
<div style='float:left; margin-left:2%; width:38%; margin-top:20px'><img
src='img/rent.jpg' height='150px' width='200px'></div><div style='float:left;
width:60%;'><h3>Parking</h3><p>Ostavite vas bicikl kod nas i bezbrizno spavajte. Mozete ga preuzimati u bilo
koje doba dana i noci tokom cele godine!!!</p></div>
</div></a>
</div>
Rentiranje.php
<div style='width:100% float:left;'>
<div style='width:95% align:center; float:left;'>
<ul><i><b>Bicikl:</b></i>
<li>200 din/sat</li>
<li>600 din/dan</li>
</ul>
<ul><b>Deciji bicikl:</b></i>
<li>100 din/sat</li>
<li>250 din/dan</li>
</ul>
<ul><i><b>Riksa:</b></i></br>
<li>300 din/sat</li>
<li>800 din/dan</li>
</ul>
<ul><i><b>Tandem:</b></i></br>
<li>250 din/sat</li>
<li>600 din/dan</li>
</ul>
<ul><i><b>Roleri:</b></i></br>
<li>200 din/sat>/li>
<li>500 din/dan</li>
</ul>
<ul><i><b>Pedaline:</b></i></br>
<li>400 din/sat</li>
<li>800 din/dan</li>
</ul>
</div >
</div>
Servis.php
<div style='width:100% float:left;'>
<div style='width:95% padding-left:2%; float:left;'>
<div style='float:left; margin-left:2%; width:38%; margin-top:20px'><img
src='img/rent.jpg' height='150px' width='200px'></div>
<div style='float:left; width:60%;'><p>U nasem centru postoji mogucnost i
popravke vasih mezimaca!</p></div>
</div >
</div>
Script.js
$(document).ready(function(){
rotatePics(1);
});
$(document).ready(function(){
$('.lightbox').click(function(){
$('.backdrop, .box').animate({'opacity':'.50'}, 300, 'linear');
$('.box').animate({'opacity':'1.00'}, 300, 'linear');
$('.backdrop, .box').css({'display':'block'});
});
});
function rotatePics(currentPhoto) {
var numberOfPhotos = $('#photos img').length;
currentPhoto = currentPhoto % numberOfPhotos;
$('#photos img').eq(currentPhoto).fadeOut(function() {
// re-order the z-index
$('#photos img').each(function(i) {
$(this).css(
'zIndex', ((numberOfPhotos - i) + currentPhoto) % numberOfPhotos
);
});
$(this).show();
setTimeout(function() {rotatePics(++currentPhoto);}, 4000);
});
}
function reg_provera()
{
var user = document.getElementById('username');
var pass = document.getElementById('password');
var re_pass = document.getElementById('re_password');
var ime = document.getElementById('fname');
var prezime = document.getElementById('lname');
var email = document.getElementById('email');
var greske = new Array();
var greskeID = new Array();
var ispis = new Array();
var reIme = /^[A-Z]{1}[a-z]{2,15}$/;
var rePre = /^[A-Z]{1}[a-z\s]{3,20}$/;
var reEmail = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/;
if(pass!=re_pass){
greske.push("Lozinke se ne poklapaju!");
greskeID.push(pass.id);
greskeID.push(re_pass.id);
}
if(!ime.value.match(reIme))
{
greske.push("Ime nije u dobrom formatu. Izmedju 3 i 15 karaktera!");
greskeID.push(ime.id);
}
if(!prezime.value.match(rePre))
{
greske.push("Prezime nije u dobrom formatu!!!");
greskeID.push(prezime.id);
}
if(!email.value.match(reEmail))
{
greske.push("E-mil nije unet u dobrom formatu!!!");
greskeID.push(prezime.id);
}
if(greske.length != 0)
{
for(var i = 0; i < greskeID.length; i++)
{
document.getElementById(greskeID[i]).style.border="1px solid red";
}
}
}
$(document).ready(function(){
slideShow();
});
function slideShow() {
var current = $('#photos .show');
var next = current.next().length ? current.next() : current.parent().children(':first');
current.hide().removeClass('show');
next.fadeIn().addClass('show');
setTimeout(slideShow, 3000);
}
Style.css
body{background-color:silver;
height:auto;
width:1000px;
margin:auto;
border:1px solid silver;
}
#master{
float:left;
margin:auto;
}
#top{
}
#log{
background-image:url('../head_photo.jpg');
background-repeat:no-repeat;
float:left;
width:1000px;
height:auto;
float:left;
width:100%;
height:auto;
}
#login{
padding-left:10px;
margin-top:5px;
color:silver;
border:2px solid #a1a1a1;
background:#0e4821;
border-radius:5%;
}
#log_tbl{
color:silver;
}
#login a{
color:silver;
}
#navigation{
padding-left:15px;
width:100%;
margin-top:265px;
margin-bottom:5px;
float:left;
text-align:center;
}
ul#menu, ul.submenu{
margin: 0;
padding: 0;
list-style: none;
}
ul#menu li{
margin-right:10px;
font:20;
float: left;
}
li ul.submenu {
display: none;
}
ul#menu li a{
display: block;
text-decoration: none;
color:silver;
padding: 5px 25px;
background-color: #0e4821;
border:1px solid #a1a1a1;
border-radius:3px;
float:none;
}
ul#menu li:hover ul.submenu{
display: block;
position: absolute;
float:left;
}
ul.submenu li:hover{
background: #0a3317;
}
ul#menu li:hover li, ul#menu li:hover a {
float: none;
background: #0a3317;
}
ul#menu li:hover li a:hover {
background: #0e4821;
}
#content_left{
border:1px;
float:left;
width:20%;
height:auto;
margin:auto;
}
#content_mid{
border:1px;
float:left;
width:55%;
height:auto;
margin:auto;
}
#content_right{
border:1px;
float:right;
width:22%;
height:auto;
margin:auto;
}
#clan{
float:left;
padding-left:10px;
padding-right:10px;
margin-top:5px;
color:silver;
border:2px solid #a1a1a1;
background:#0e4821;
border-radius:5%;
}
.anketa{
padding-left:10px;
margin-top:5px;
color:silver;
border:2px solid #a1a1a1;
background:#0e4821;
border-radius:5%;
}
.form{
margin-left:30%;
padding-top:30px;
}
#bot{
width:100%;
float:left;
text-align:center;
color:silver;
border:2px solid #a1a1a1;
background:#0e4821;
border-radius:5%;
}
#photos{
float:left;
margin-bottom:10px;
width:470px;
height:250px;
margin-left:40px;
}
#photos img {
position:absolute;
margin-left:65px;
}
#home_text{
float:left;
padding-left:10px;
padding-right:10px;
}
#img_gal{
margin:10px;
border-radius:5%;
border:1px solid gray;
}
.backdrop{
position:absolute;
top:0px;
left:0px;
width:100%;
height:100%;
background:#000;
opacity: .0;
filter:alpha(opacity=0);
z-index:50;
display:none;
}
.box{
}
.close{
position:absolute;
top:20%;
left:30%;
width:500px;
height:300px;
display:none;
background:#ffffff;
z-index:51;
padding:10px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
border-radius:5px;
-webkit-box-shadow:0px 0px 5px #444444;
-moz-box-shadow:0px 0px 5px #444444;
box-shadow:0px 0px 5px #444444;
float:right;
margin-right:6px;
cursor:pointer;
}
#anketa_tbl{
color:silver;
}
DIZAJN BAZE
Download

Dokumentacija - biciklcentar.rs