-
Notifications
You must be signed in to change notification settings - Fork 3
/
mypage.php
75 lines (63 loc) · 2.89 KB
/
mypage.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
<?php
if (isset($_SESSION['logget_ind'])) {
$brugerid = isset($_POST['brugerID']) ? $_POST['brugerID']: '';
if ($brugerid != "") {
$query = "UPDATE Bruger SET Fornavn = '" . addslashes($_POST['fornavn']) ."',".
" Efternavn = '" . addslashes($_POST['efternavn']) ."'".
" WHERE BrugerId = " . $_POST['brugerID'];
echo $query;
$result = doSQLQuery($query);
}
$query = "SELECT Email,BrugerId,ForNavn, Efternavn FROM Bruger WHERE Brugerid = '".$_SESSION['brugerid']."'";
$result = doSQLQuery($query);
$line = db_fetch_array($result);
$brugernavn = $_SESSION['brugernavn'];
$email = $line["Email"];
$brugerid = $line["BrugerId"];
?>
<p></p>
<form id="mypform" name="mypform" method="post" action="main.php?page=mypage">
<input type="hidden" name="brugerID" id="brugerID" value="<?php echo $brugerid; ?>">
<table id="musiker_table" cellspacing="0" cellpadding="3" width="600">
<tr><td height="15" background="img/tabletop_bg.gif" colspan="2"><div align="left"><strong>Om mig:</strong></div></td></tr>
<tr bgcolor="#f2f2f2">
<td align="left">Fornavn: <input type="text" name="fornavn" value="<?php echo $line["ForNavn"]; ?>" /> Efternavn: <input type="text" name="efternavn" value="<?php echo $line["Efternavn"]; ?>" /></td>
</tr>
<tr>
<td align="left">E-mail: <?php echo $email; ?></td>
</tr>
<tr bgcolor="#f2f2f2">
<td align="center"><input class="submit_btn" type="submit" name="Submit" value="Gem ændringer" /></td>
</tr>
</table>
</form>
<p></p>
<table id="musiker_table" cellspacing="0" cellpadding="3" width="600">
<tr>
<td height="15" background="img/tabletop_bg.gif"><div align="left"><strong>Setlister hvor jeg er på:</strong></div></td>
</tr>
<?php
if ($DB_TYPE == "mysql") {
$query = "SELECT Program.Dato,Program.ProgramId,Program.Arrangement FROM Program INNER JOIN ProgramBruger ON ProgramBruger.ProgramID=Program.ProgramID WHERE ProgramBruger.BrugerID=".$brugerid." AND DateDiff(Dato, '$curyear-$curmonth-$today') > -1 ORDER BY Dato LIMIT 3;";
} else if ($DB_TYPE == "odbc") {
$query = "SELECT TOP 3 Program.Dato,Program.ProgramId,Program.Arrangement FROM Program INNER JOIN ProgramBruger ON ProgramBruger.ProgramID=Program.ProgramID WHERE ProgramBruger.BrugerID=".$brugerid." AND DateDiff('s', Dato, '$curyear-$curmonth-$today') < 1 ORDER BY Dato;";
}
$result = doSQLQuery($query);
$colour = "";
while ($line = db_fetch_array($result)) {
echo " <tr".$colour.">\n";
$tmp = $line["Dato"];
$eventDate = substr($tmp,8,2)."/".substr($tmp,5,2)."/".substr($tmp,0,4);
echo " <td><a href=\"main.php?page=program&eventId=".$line["ProgramId"]."\">".$line["Arrangement"]." d. ".$eventDate."</a></td>\n";
echo " </tr>\n";
if ($colour == "") {
$colour = " bgcolor=\"#f2f2f2\"";
} else {
$colour = "";
}
}
?>
</table>
<?php
} // seesion and admin
?>