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