-
Notifications
You must be signed in to change notification settings - Fork 0
/
account.php
68 lines (56 loc) · 2.63 KB
/
account.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
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
require("parts/header.php");
require("parts/banner_account.php");
require("php/privateSessionControl.php");
require("php/parameters.php");
?>
<div id="main">
<div id="container_home">
<div id="account">
<span id="details">
<form action="#" method="post" >
<table><tr>
<?php
$con = mysqli_connect(SERVER,USER,PSW);
mysqli_select_db($con,DB);
$email = $_SESSION["email"];
$query = "SELECT * FROM user WHERE email='".$email."';";
$res = mysqli_query($con,$query);
$user = mysqli_fetch_assoc($res);
echo '<td><input type="text" id="nome" name="nome" value="'.$user["nome"].'" placeholder="Nome"></td>';
echo '<td><input type="text" id="cognome" name="cognome" value="'.$user["cognome"].'" placeholder="Cognome"></td>';
echo '</tr><tr>';
if(strcmp($user["sesso"],"")==0)
echo '<td>Sesso: <input type="text" id="sesso" name="sesso" placeholder="Sesso"></td>';
else
echo '<td>Sesso: <input type="text" id="sesso" name="sesso" value="'.$user["sesso"].'" placeholder="Sesso"></td>';
if(strcmp($user["genere"],"")==0)
echo '<td>Genere preferito: <input type="text" id="genere" name="genere" placeholder="Genere"></td>';
else
echo '<td>Genere preferito: <input type="text" id="genere" name="genere" value="'.$user["genere"].'" placeholder="Genere"></td>';
echo '</tr>';
echo '<tr><td><input type="password" id="password" name="password" placeholder="Password"></td></tr>';
?>
</table>
<br>
<input type="submit" id="modifica" name="modifica" value="Modifica">
</form>
</span>
<span id="insertbook">
<form action="#" method="post">
<input type="text" id="isbn" name="isbn" placeholder="ISBN" onclick="">
<input type="submit" id="inseriscilibro" name="inseriscilibro" value="Inserisci un nuovo libro">
</form>
</span>
</div>
<div style="width:100%;">
<?php require("php/riempiLibriPrestati.php"); ?>
</div>
</div>
</div>
<?php
require("php/accountModificaDati.php");
require("php/accountInserisciLibro.php");
?>
</body>
</html>