-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
55 lines (53 loc) · 1.59 KB
/
header.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
<body>
<header>
<img alt="Logo INPRL" class="logo" src="img/logo.png"><div class="name">Instituto Nacional<br>
de Prevensión de Riesgos Laborales</div>
</header>
<?php
if (!isset($_SESSION['user'])) {
?>
<nav class="menu">
<ul>
<li><a href="index.php">El INPRL</a></li>
<li><a href="info_riesgos.php">Información sobre riesgos</a></li>
<li id="login_b"><a href="#login">Iniciar Sesión</a></li>
</ul>
</nav>
<div class="login_cont">
<div class="login">
<form class="login_form" action="index.php" method="post">
<input type="text" name="user" placeholder="DNI">
<input type="pass" name="pw" placeholder="Contraseña">
<button>Entrar</button>
</form>
<div>¿No tienes una cuenta? <a id="registro" href="#">Registrate</a></div>
</div>
</div>
<?php
}
else {
?>
<nav class="menu">
<ul>
<li><a href="index.php">El INPRL</a></li>
<li><a href="info_riesgos.php">Información sobre riesgos</a></li>
<li><a href="nuevo-parte.php">Nuevo Parte</a></li>
<li><a href="modificar-parte.php">Modificar Parte</a></li>
<li><a href="consulta-parte.php">Consulta de Partes</a></li>
<li><a href="index.php?logout=true">Cerrar Sesión</a></li>
</ul>
</nav>
<?php
}
?>
<script type="text/javascript">
$('.login').css('left', ($('#login_b').position().left));
// Mostrar o esconder formulario de login
$('#login_b').click(function() {
$('.login').toggle('medium');
});
// Mostrar ocultar formulario de registro
$('#registro').click(function() {
$('.cont_registro').slideToggle('medium');
});
</script>