All mysql_-statments replaced by their corresponding mysqli_-statements
[cacert-devel.git] / pages / account / 57.php
1 <? /*
2 LibreSSL - CAcert web application
3 Copyright (C) 2004-2008 CAcert Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; version 2 of the License.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */ ?>
18 <?
19 include_once($_SESSION['_config']['filepath'].'/includes/notary.inc.php');
20
21 if ($_SESSION['profile']['admin'] != 1 || !array_key_exists('userid',$_REQUEST) || intval($_REQUEST['userid']) < 1) {
22
23 echo _('You do not have access to this page');
24
25 } else {
26 $user_id = intval($_REQUEST['userid']);
27 $query = "select * from `users` where `id`='$user_id' and `users`.`deleted`=0";
28 $res = mysqli_query($_SESSION['mconn'], $query);
29 if(mysqli_num_rows($res) <= 0)
30 {
31 echo _("I'm sorry, the user you were looking for seems to have disappeared! Bad things are afoot!");
32 } else {
33 $row = mysqli_fetch_assoc($res);
34 ?>
35 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
36 <tr>
37 <td colspan="5" class="title"><?=_('CCA agreement of').' '.sanitizeHTML($row['fname']).' '.sanitizeHTML($row['mname']).' '.sanitizeHTML($row['lname'])?></td>
38 </tr>
39 </table>
40
41
42 <br>
43 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
44 <tr>
45 <td class="DataTD"><b><?=_('CCA type')?></b></td>
46 <td class="DataTD"><b><?=_('Date')?></b></td>
47 <td class="DataTD"><b><?=_('Method')?></b></td>
48 <td class="DataTD"><b><?=_('Type')?></b></td>
49 </tr>
50 <?
51 $data=get_first_user_agreement($user_id, 'CCA', 1);
52 if (!isset($data['active'])){
53 $type='';
54 }else{
55 $type=_('active');
56 }
57 ?>
58 <tr>
59 <td class="DataTD"><?=_('First active CCA')?></td>
60 <td class="DataTD"><?=isset($data['date'])?$data['date']:''?></td>
61 <td class="DataTD"><?=isset($data['method'])?$data['method']:''?></td>
62 <td class="DataTD"><?=$type?></td>
63 </tr>
64 <?
65 $data=get_first_user_agreement($user_id, 'CCA', 0);
66 if (!isset($data['active'])){
67 $type="";
68 }else{
69 $type=_('passive');
70 }
71 ?>
72 <tr>
73 <td class="DataTD"><?=_('First passive CCA')?></td>
74 <td class="DataTD"><?=isset($data['date'])?$data['date']:''?></td>
75 <td class="DataTD"><?=isset($data['method'])?$data['method']:''?></td>
76 <td class="DataTD"><?=$type?></td>
77 </tr>
78 <?
79 $data=get_last_user_agreement($user_id, 'CCA');
80 if (!isset($data['active'])){
81 $type="";
82 }elseif($data['active']==1){
83 $type=_('active');
84 }else{
85 $type=_('passive');
86 }
87 ?>
88 <tr>
89 <td class="DataTD"><?=_('Last CCA')?></td>
90 <td class="DataTD"><?=isset($data['date'])?$data['date']:''?></td>
91 <td class="DataTD"><?=isset($data['method'])?$data['method']:''?></td>
92 <td class="DataTD"><?=$type?></td>
93 </tr>
94 </table>
95 <br>
96 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
97 <tr>
98 <?
99 if ($_SESSION['profile']['admin'] == 1 && array_key_exists('userid',$_REQUEST) && intval($_REQUEST['userid']) > 0) {
100 ?>
101 <tr><td colspan="3" class="DataTD"><a href="account.php?id=43&amp;userid=<?=intval($user_id)?>">back</a></td></tr>
102 <? }
103 ?> </table>
104 <?
105 }
106 }
107 ?>