<?php
oB_start();
session_start();
include_once 'common.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Логин прозорец с jQuery [ by stoqnski ] </title>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1251' />
<script type="text/javascript" src="login.js"></script>
<script>
$(document).ready(function() {
$('a[name=modal]').click(function(e) {
e.preventDefault();
var id = $(this).attr('href');
var maskHeight = $(document).height();
var maskWidth = $(window).width();
$('#mask').css({'width':maskWidth,'height':maskHeight});
$('#mask').fadeIn(1000);
$('#mask').fadeTo("slow",0.8);
var winH = $(window).height();
var winW = $(window).width();
$(id).css('top', winH/2-$(id).height()/2);
$(id).css('left', winW/2-$(id).width()/2);
$(id).fadeIn(2000);
});
$('.window .close').click(function (e) {
e.preventDefault();
$('#mask').hide();
$('.window').hide();
});
$('#mask').click(function () {
$(this).hide();
$('.window').hide();
});
});
</script>
<style>
body {
font-family:verdana;
font-size:15px;
}
a {color:#333; text-decoration:none}
a:hover {color:#ccc; text-decoration:none}
#mask {
position:absolute;
left:0;
top:0;
z-index:9000;
background-color:#;
display:none;
}
#boxes .window {
position:absolute;
left:0;
top:0;
width:440px;
height:200px;
display:none;
z-index:9999;
padding:20px;
background-color:#FFF;
}
#boxes #dialog {
width:375px;
height:203px;
padding:10px;
background-color:#ffffff;
}
#boxes #dialog1 {
width:375px;
height:130px;
}
#dialog1 .d-header {
background:url(images/login-header.png) no-repeat 0 0 transparent;
width:375px;
height:150px;
}
#dialog1 .d-header input {
position:relative;
top:60px;
left:100px;
border:2px solid #EB0873;
height:22px;
width:200px;
font-size:15px;
padding:5px;
margin-top:4px;
}
#dialog1 .d-blank {
float:left;
background:url(images/login-blank.png) no-repeat 0 0 transparent;
width:267px;
height:53px;
}
#dialog1 .d-login {
float:left;
width:108px;
height:53px;
}
</style>
</head>
<body>
<a href="#dialog1" name="modal"><?php echo LANG_LOGIN;?></a>
<style type="text/css">
@import url("log/css/contact.css");
@import url("log/css/lay.css");
</style>
<?php
if (!$logged[username])
{
if (!$_POST[login])
{
?>
<div id="boxes">
<div id="dialog1" class="window">
<div id="contact_form">
<FORM action="" method="POST">
<span class="input">
<center><label for="name"><b>Потребител:</b> </label><br>
<input id="name" name="username" type="text">
</span>
<span class="input">
<label for="pass"><b>Парола:</b> </label><br>
<input id="pass" name="password" type="password">
</span>
<span id="submit" class="input">
<label for="submit"></label>
<center><input id="send" value="Влез" type="submit" name="login"></center></center>
</span>
</form>
</div>
</div>
<div id="bot"></div>
</div>
</body>
</html>
<?php
}
?>
<?php
include ("config.php");
if($_POST[login]) {
// the form has been submitted. We continue...
$username=$_POST['username'];
$password = md5($_POST[password]);
// the above lines set variables with the submitted information.
$info = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());
$data = mysql_fetch_array($info);
if($data[password] != $password) {
// the password was not the user's password!
echo "Грешен потребител или парола!";
}else
{
// the password was right!
$query = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());
$user = mysql_fetch_array($query);
// gets the user's information
setcookie("id", $user[id],time()+(60*60*24*5), "/", "");
setcookie("pass", $user[password],time()+(60*60*24*5), "/", "");
// the above lines set 2 cookies. 1 with the user's id and another with his/her password.
echo ("<meta http-equiv=\"Refresh\" content=\"0; URL=http://localhost/Maxell.bg/login/login.php\"/>Вие успешно влязохте в акаунта си.");
// modify the above line...add in your site url instead of yoursite.com
}
}
}
else
{
// we now display the user controls.
echo "
<div class='login'>
".LANG_WELCOME."<b> $logged[username]</b><br/>
<a href=\"editprofile.php\">".LANG_UPDATE_PROFILE."</a><br />
<a href=\"members.php\">".LANG_SEE_ALL_REGISTERED_USERS."</a><br />
<a href=\"logout.php\">".LANG_GET_OUT_OF_MY_ACCOUNT."</a>
<a class='uplo' href='../upload/upload.php'>".LANG_UPLOAD."</a>
</div>
<div class='ezik'>
".LANG_LANGUAGE."
<a href='login.php?lang=bg'><img src='images/bg_icon.gif' /></a>
<a href='login.php?lang=en'><img src='images/en_icon.gif' /></a>
</div>
<div class='meny'>
<img class='bam'src='baner4.jpg'/>
<div class='web'>
<a href='../index.php' target='_blank'>".LANG_MENU_HOME."</a>
<a href='http://localhost/phpBB3/index.php?sid=307bff827c455af31e03dc30b408b8e8'target='_blank'>".LANG_MENU_FORUM."</a>
<a href='../filmi.php'target='_blank'>".LANG_MENU_MOVIES."</a>
<a href='../video/danni.php' target='_blank'>".LANG_MENU_VIDEO."</a>
<a href='igri.html'target='_blank'>".LANG_MENU_GAMES."</a>
<a href='programi.html'target='_blank'>".LANG_MENU_PROGRAMS."</a>
<a href='music.html'target='_blank'>".LANG_MENU_MUSIC."</a>
<a href='help.html'target='_blank'>".LANG_MENU_HELP."</a>
<a href='http://localhost/contact/contact.php'target='_blank'>".LANG_MENU_CONTACTS."</a>
</div>
<img class='pic' src='baner3.jpg'/>
</div>
<form>
<textarea class='asdf' name='asdf' rows='10' cols='30'>Какви филми предпочитате да гледате:</textarea><br/>
<input name='sent' type='submit' size='19px' value='Изпрати'>
</form>
<div id='text'>Този сайт е на вас любителите на филми.
В него ще намерите филми от всякакъв жанр,освен това ще има и програми,музика,игри и форум.
Филмите освен свяляне и ще могат да се гледат онлайн.
</div>
</body>
</html>";
}
?>