showall.php
2.2 KB
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
<?php
if($_GET['PAID']) {
$paidid = $db->quote($_GET['PAID']);
$db->update('USER', array('PAID' => 1), "ID=$paidid");
if($_GET['ISLEADER']) {
mailaa($_GET['ISLEADER'], "Insomnia XI maksusi on rekisteröity", "Hei,\r\nMaksusi Insomnia XI -tapahtumaan on rekisteröity\r\nPääset nyt varaamaan paikkoja osoitteesta http://kauppa.insomnia.fi");
}
}
$all = $db->fetchAll("
SELECT
USER.ID,
USER.NICK,
USER.NAME,
USER.EMAIL,
USER.PAID,
USER.TYPE,
USER.PRICE,
USERGROUP.ID AS GID,
USERGROUP.NAME AS GROUPNAME,
USERGROUP.LEADER_ID
FROM USER
LEFT JOIN USERGROUP_USER ON USERGROUP_USER.members_ID = USER.ID
LEFT JOIN USERGROUP ON USERGROUP.ID = USERGROUP_USER.groups_ID
ORDER BY USER.PAID, USER.PRICE DESC, USERGROUP.ID, USER.ID
");
$asia .= "<table width='100%' id='showalltable'>
<tr>
<td>Img</td>
<td>ID</td>
<td>Nick</td>
<td>Nimi</td>
<td>Sähköposti</td>
<td>Maksettu?</td>
<td>Lipputyyppi</td>
<td>Hinta</td>
<td>Ryhmänimi</td>
<td>Ryhmä#</td>
</tr>
";
foreach ($all as $u) {
$ISLEADER = $u['ID'] == $u['LEADER_ID'] ? 'Ryhmänjohtaja' : FALSE;
$sha1 = sha1("A4VJoyfVecto10nbGCCE41".$u['ID']."H3yvFDAqramaxGYn7mc");
$id = $u['ID'];
$asia .= "<tr style=\" background-color: white;\" onmouseover=\"style.backgroundColor='#84DFC1'\"
onmouseout=\"style.backgroundColor='white'\">";
#$asia .= "<td><img src=\"/index.php?pid=addimg&i=$id&h=$sha1&a=show\"></td>";
$asia .= "<td></td>";
$asia .= "<td>".$u['ID']."</td>";
$asia .= "<td>".$u['NICK']."</td>";
$asia .= "<td>".$u['NAME']."</td>";
$asia .= "<td>".$u['EMAIL']."</td>";
if($ISLEADER != FALSE) {
$maili=$u['EMAIL'];
$linkki = "<a href=index.php?PAID=$id&ISLEADER=$maili>";
} else {
$linkki = "<a href=index.php?PAID=$id>";
}
$asia .= "<td>$linkki".translate_paid($u['PAID'])."</a></td>";
$asia .= "<td>".get_user_type($db, $u['ID'])."</td>";
$asia .= "<td>".$u['PRICE']."</td>";
$asia .= "<td>".$u['GROUPNAME']." $ISLEADER</td>";
$asia .= "<td>".$u['GID']."</td>";
$asia .= "</tr>";
}
$asia .= " </table>";
?>