source code taken from cacert-20090625.tar.bz2
[cacert.git] / cacert / 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 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="400">
19 <tr>
20 <td colspan="3" class="title"><?=_("Organisations")?></td>
21 </tr>
22 <tr>
23 <td class="DataTD">#</td>
24 <td class="DataTD"><?=_("Organisation")?></td>
25 <td class="DataTD"><?=_("Admins")?></td>
26 </tr>
27 <?
28 $query = "select * from `orginfo`,`org` where `orginfo`.`id`=`org`.`orgid` and `org`.`memid`='".intval($_SESSION['profile']['id'])."'";
29 $res = mysql_query($query);
30 while($row = mysql_fetch_assoc($res))
31 {
32 //number of admins for the org
33 $r2 = mysql_query("select * from `org` where `orgid`='".intval($row['id'])."'");
34 $admincount = mysql_num_rows($r2);
35
36 // number of domains for the org
37 $r2 = mysql_query("select * from `orgdomains` where `orgid`='".intval($row['id'])."'");
38 $domcount = mysql_num_rows($r2);
39 ?>
40 <tr>
41 <td class="DataTD"><?=intval($row['id'])?></td>
42 <td class="DataTD"><?=($row['O'])?>, <?=($row['ST'])?> <?=sanitizeHTML($row['C'])?></td>
43 <td class="DataTD"><a href="account.php?id=32&amp;orgid=<?=$row['id']?>"><?=_("Admins")?> (<?=$admincount?>)</a></td>
44 </tr>
45 <?
46 // display the domains of each organisation
47 $query3 = "select * from `orgdomains` where `orgid`='".intval($row['id'])."'";
48 $res3 = mysql_query($query3);
49 while($detailorg = mysql_fetch_assoc($res3))
50 {
51 ?>
52 <tr>
53 <td class="DataTD"><?=intval($detailorg['id'])?></td>
54 <td class="DataTD"><?=_("Domain available")?></td>
55 <td class="DataTD"><?=sanitizeHTML($detailorg['domain'])?></td>
56 </tr>
57 <? } } ?>
58 </table>