/
user.php
executable file
·136 lines (118 loc) · 4.6 KB
/
user.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
/*
JM-booking
Copyright (C) 2007-2010 Jaermuseet <http://www.jaermuseet.no>
Contact: <hn@jaermuseet.no>
Project: <http://github.com/hnJaermuseet/JM-booking>
Based on ARBS, Advanced Resource Booking System, copyright (C) 2005-2007
ITMC der TU Dortmund <http://sourceforge.net/projects/arbs/>. ARBS is based
on MRBS by Daniel Gardner <http://mrbs.sourceforge.net/>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
include_once("glob_inc.inc.php");
if(isset($_POST['user_id']) && is_numeric($_POST['user_id']))
$user_id = (int)$_POST['user_id'];
elseif(isset($_GET['user_id']) && is_numeric($_GET['user_id']))
$user_id = (int)$_GET['user_id'];
else
{
echo __('Error: No user spesified.');
exit();
}
$user = getUser ($user_id);
if (!count($user))
{
echo __('Can\'t find user');
exit();
}
print_header($day, $month, $year, $area);
echo '<h1>'.__('Viewing user details').'</h1>'.chr(10).chr(10);
if($user['deactivated'])
echo '<div class="error" style="width: 500px;">'.__('This user is deactivated.').'</div>';
if($login['user_access_useredit'] || $login['user_id'] == $user['user_id'])
{
echo '<a href="admin_user2.php?editor=1&id='.$user['user_id'].'">'.
iconHTML('user_edit').
' Endre bruker</a><br />'.chr(10).chr(10);
echo '<a href="admin_user_password.php?id='.$user['user_id'].'">'.
iconHTML('lock_edit').
' Endre passord</a><br /><br />'.chr(10).chr(10);
}
echo '<b>'.__('UserID').':</b> '.$user['user_id'].'<br>'.chr(10);
echo '<b>'.__('Username').':</b> '.$user['user_name'].'<br>'.chr(10);
echo '<b>'.__('Short username').':</b> '.$user['user_name_short'].'<br>'.chr(10);
echo '<b>'.__('E-mail').':</b> '.$user['user_email'].'<br>'.chr(10);
echo '<b>'.__('Phone').':</b> '.$user['user_phone'].'<br>'.chr(10);
echo '<b>Stilling:</b> '.$user['user_position'].'<br>'.chr(10);
echo '<!-- ';
echo '<br><b>Adresse for internettkalender i Outlook:</b><br><input type="text" size="70" value="'.
$systemurl.'/entry_ical.php?user_id='.$user['user_id'].'"><br>'.
'Se <a href="'.wikiLink ('Bookingsystemet/Bookinger_i_Outlook').'">guide på wiki</a> for informasjon om hvordan du legger inn kalenderen'.chr(10);
echo '-->';
echo '<h2>'.__('Upcoming entries for ').' '.$user['user_name'].'</h2>'.chr(10);
filterMakeAlternatives();
$filters = array();
$filters = addFilter($filters, 'user_assigned', $user['user_id']);
$filters = addFilter($filters, 'time_start', 'current', '>');
filterLink($filters); echo '<br><br>'.chr(10).chr(10);
$SQL = genSQLFromFilters($filters, 'entry_id').' order by time_start';
$Q_next_entries = db()->prepare($SQL);
$Q_next_entries->execute();
/*
$Q_next_entries = mysql_query("select entry_id from `entry` where
user_assigned like '%;".$user['user_id'].";%' and
time_start > '".time()."'
order by time_start
limit 50;");*/
if($Q_next_entries->rowCount() <= 0)
echo '<i>'.__('No upcoming entries found').'</i>'.chr(10);
else
{
echo '<table style="border-collapse: collapse;">'.chr(10);
echo ' <tr>'.chr(10);
echo ' <td class="border"><b>'.__('Starts').'</b></td>'.chr(10);
echo ' <td class="border"><b>'.__('Name').'</b></td>'.chr(10);
echo ' <td class="border"><b>'.__('Where').'</b></td>'.chr(10);
echo ' </tr>'.chr(10);
while($R_entry = $Q_next_entries->fetch(PDO::FETCH_ASSOC))
{
$entry = getEntry($R_entry['entry_id']);
if(count($entry))
{
echo ' <tr>'.chr(10);
echo ' <td class="border"><b>'.date('d-m-Y H:i', $entry['time_start']).'</b></td>'.chr(10);
echo ' <td class="border"><a href="entry.php?entry_id='.$entry['entry_id'].'">'.$entry['entry_name'].'</a></td>'.chr(10);
echo ' <td class="border">';
$area = getArea($entry['area_id']);
if(count($area))
echo $area['area_name'].' - ';
$rooms = array();
foreach ($entry['room_id'] as $rid)
{
if($rid == '0')
$rooms[] = __('Whole area');
else
{
$room = getRoom($rid);
if(count($room))
$rooms[] = $room['room_name'];
}
}
echo implode(', ', $rooms);
echo '</td>'.chr(10);
echo ' </tr>'.chr(10);
}
}
echo '</table>'.chr(10);
}
?>