-
Notifications
You must be signed in to change notification settings - Fork 0
/
_include.php
55 lines (53 loc) · 1.72 KB
/
_include.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
session_start();
include "admin/auth.php";
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vägkorset</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link type="text/css" href="css/custom-theme/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
<link href='http://fonts.googleapis.com/css?family=Architects+Daughter|Permanent+Marker|Aclonica|Muli' rel='stylesheet' type='text/css' />
<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.16/jquery-ui.min.js"></script>
<script type="text/javascript">
<?php $cond = (isset($_GET['error']) && $_GET['error'] == 1) || (isset($_GET['login_required']) && $_GET['login_required'] == 1);?>
var cont = 1, <?php echo "error = ".($cond?"true":"false").", cur = '".current_user()."';";
?>
$(document).ready(function(){
$('#admin-login').dialog({
resizable: false,
autoOpen: false,
modal: true,
buttons: {
"Logga in": function() {
$('#loginform').submit();
},
Avbryt: function() {
$(this).dialog("close");
}
}
});
$('#mainheader').find('button').button().click(function(){
if (cur)
window.location="admin";
else
$('#admin-login').dialog('open');
});
$('#mainheader>span').click(function(){
window.location='index.php';
});
$('#accordion').accordion({ header: "h3", navigation: true});
$('#tabs').tabs();
$('.button').button();
$('#loginform input').keydown(function(e){
if(e.keyCode==13) $('#loginform').submit();
});
if (error){
$('#admin-login').dialog('open');
}
});
</script>