-
Notifications
You must be signed in to change notification settings - Fork 0
/
profil2.php
96 lines (73 loc) · 2.23 KB
/
profil2.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!--/*
***************** IMPRESSUM *******************
Studiengang: MultiMediaTechnology
fhs-nummer: fhs34789
Zweck: Basisquaifikation 1 (QPT1)
Autor: Ludwig Schamböck
*/ -->
<!doctype html>
<html>
<head>
<title>QPT</title>
<meta charset="utf-8">
<link rel="stylesheet" href="kube/css/kube.css">
<link rel="stylesheet" href="css/default.css">
<script type="text/javascript" src="js/search.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#edit").hide();
$("#showedit").click(function(){
$("#edit").slideToggle('slow');
});
});
</script>
</head>
<body>
<img src="images/logo.png" alt="logo" class="logo-profil">
<div class="content">
<?php
include "functions.php";
if(isset($_SESSION['id'])){
$myname = $_SESSION['id'];
$query = $dbh->query ( "SELECT * FROM users WHERE id = $myname" );
$mn = $query->fetch(PDO::FETCH_OBJ);
?>
<div class="profilbg">
<h2 style="padding: 3%; color: #fff;"> Hallo <?php echo $mn->username; ?></h2>
<div id="edit">
<form method="post" action="profil.php" enctype="multipart/form-data">
<input type="text" placeholder="beschreibe dich oder die Band" name="beschreibung">
<input type="submit" class="btn" value="fertig">
</form>
</div>
<input type="button" value="bearbeiten" class="btn btn-round" id="showedit" style="margin-left: 80%; margin-top: -40%;">
<div class="profildiv">
<img src=" <?php echo $mn->profilbild; ?> ">
</div>
<div class="beschreibung">
<p> <?php echo $mn->beschreibung; ?> </p>
</div>
</div>
<?php
$beschreibung = "";
$vollstaendig = false;
if(array_key_exists("beschreibung", $_POST)){
if(trim($_POST['beschreibung']) == "") $vollstaendig = false;
else $beschreibung = htmlspecialchars(trim($_POST['beschreibung']));
if ($vollstaendig=true ) {
$update = $dbh->prepare("UPDATE users SET beschreibung=? WHERE id = ?");
$update->execute(array($beschreibung, $myname));
}
}
?>
<?php
}
else{
header('location:index.html');
}
include "navigation.php";
?>
</div>
</body>
</html>