All mysql_-statments replaced by their corresponding mysqli_-statements
[cacert-devel.git] / pages / account / 35.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 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="400">
20
21 <?
22 $query = "select *
23 from `orginfo`,`org`
24 where `orginfo`.`id`=`org`.`orgid`
25 and `org`.`memid`='".intval($_SESSION['profile']['id'])."'";
26
27 $res = mysqli_query($_SESSION['mconn'], $query);
28 while($row = mysqli_fetch_assoc($res))
29 {
30 ?>
31 <tr>
32 <td colspan="3" class="title"><?=_("Organisation")?></td>
33 </tr>
34 <tr>
35 <td class="DataTD"><?=_("Organisation Name")?>:</td>
36 <td colspan="2" class="DataTD" ><b><?=$row['O']?></b></td>
37 </tr>
38 <tr>
39 <td class="DataTD"><?=_("Contact Email")?>:</td>
40 <td colspan="2" class="DataTD"><?=($row['contact'])?></td>
41 </tr>
42 <tr>
43 <td class="DataTD"><?=_("Town/Suburb")?>:</td>
44 <td colspan="2" class="DataTD"><?=($row['L'])?></td>
45 </tr>
46 <tr>
47 <td class="DataTD"><?=_("State/Province")?>:</td>
48 <td colspan="2" class="DataTD"><?=($row['ST'])?></td>
49 </tr>
50 <tr>
51 <td class="DataTD"><?=_("Country")?>:</td>
52 <td colspan="2" class="DataTD"><?=($row['C'])?></td>
53 </tr>
54 <?
55
56 //domain info
57 $query = "select `domain` from `orgdomains` where `orgid`='".intval($row['id'])."'";
58 $res1 = mysqli_query($_SESSION['mconn'], $query);
59 while($domain = mysqli_fetch_assoc($res1))
60 {
61 ?>
62 <tr>
63 <td class="DataTD"><?=_("Domain")?></td>
64 <td colspan="2" class="DataTD"><?=sanitizeHTML($domain['domain'])?></td>
65 </tr>
66 <?
67 }
68
69 ?>
70 <tr>
71 <td class="DataTD"><?=_("Administrator")?></td>
72 <td class="DataTD"><?=_("Master Account")?></td>
73 <td class="DataTD"><?=_("Department")?></td>
74 </tr>
75 <?
76
77 //org admins
78 $query = "select * from `org` where `orgid`='".intval($row['id'])."'";
79 $res2 = mysqli_query($_SESSION['mconn'], $query);
80 while($org = mysqli_fetch_assoc($res2))
81 {
82 $user = mysqli_fetch_assoc(mysqli_query($_SESSION['mconn'], "select * from `users` where `id`='".intval($org['memid'])."'"));
83 ?>
84 <tr>
85 <td class="DataTD"><a href='mailto:<?=$user['email']?>'><?=($user['fname'])?> <?=($user['lname'])?></a></td>
86 <td class="DataTD"><?=($org['masteracc'])?></td>
87 <td class="DataTD"><?=($org['OU'])?></td>
88 </tr>
89 <?
90
91 if(intval($org['masteracc']) === 1 &&
92 intval($org['memid']) === intval($_SESSION['profile']['id']))
93 {
94 $master="account.php?id=32&amp;orgid=".intval($row['id']);
95 ?>
96 <tr>
97 <td colspan="3" class="DataTD"><a href="<?=$master ?>"><?=_("Edit")?></a></td>
98 </tr>
99 <?
100 }
101 }
102 } ?>
103 </table>