summaryrefslogtreecommitdiff
path: root/pages/account/35.php
blob: 64f62e1b2507b601b0a3d6f9673e6832ff51e2e8 (plain)
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
<? /*
    LibreSSL - CAcert web application
    Copyright (C) 2004-2008  CAcert Inc.

    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; version 2 of the License.

    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
*/ ?>

<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="400">

<?
$query = "select *
			from `orginfo`,`org`
			where `orginfo`.`id`=`org`.`orgid`
			and `org`.`memid`='".intval($_SESSION['profile']['id'])."'";

$res = mysqli_query($_SESSION['mconn'], $query);
while($row = mysqli_fetch_assoc($res))
{
	?>
	<tr>
		<td colspan="3" class="title"><?=_("Organisation")?></td>
	</tr>
	<tr>
		<td class="DataTD"><?=_("Organisation Name")?>:</td>
		<td colspan="2" class="DataTD" ><b><?=$row['O']?></b></td>
	</tr>
	<tr>
		<td class="DataTD"><?=_("Contact Email")?>:</td>
		<td colspan="2" class="DataTD"><?=($row['contact'])?></td>
	</tr>
	<tr>
		<td class="DataTD"><?=_("Town/Suburb")?>:</td>
		<td colspan="2" class="DataTD"><?=($row['L'])?></td>
	</tr>
	<tr>
		<td class="DataTD"><?=_("State/Province")?>:</td>
		<td colspan="2" class="DataTD"><?=($row['ST'])?></td>
	</tr>
	<tr>
		<td class="DataTD"><?=_("Country")?>:</td>
		<td colspan="2" class="DataTD"><?=($row['C'])?></td>
	</tr>
	<?
	
	//domain info
	$query = "select `domain` from `orgdomains` where `orgid`='".intval($row['id'])."'";
	$res1 = mysqli_query($_SESSION['mconn'], $query);
	while($domain = mysqli_fetch_assoc($res1))
	{
		?>
		<tr>
			<td class="DataTD"><?=_("Domain")?></td>
			<td colspan="2" class="DataTD"><?=sanitizeHTML($domain['domain'])?></td>
		</tr>
		<?
	}
	
	?>
	<tr>
		<td class="DataTD"><?=_("Administrator")?></td>
		<td class="DataTD"><?=_("Master Account")?></td>
		<td class="DataTD"><?=_("Department")?></td>
	</tr>
	<?
	
	//org admins
	$query = "select * from `org` where `orgid`='".intval($row['id'])."'";
	$res2 = mysqli_query($_SESSION['mconn'], $query);
	while($org = mysqli_fetch_assoc($res2))
	{
		$user = mysqli_fetch_assoc(mysqli_query($_SESSION['mconn'], "select * from `users` where `id`='".intval($org['memid'])."'"));
		?> 
		<tr>
			<td class="DataTD"><a href='mailto:<?=$user['email']?>'><?=($user['fname'])?> <?=($user['lname'])?></a></td>
			<td class="DataTD"><?=($org['masteracc'])?></td>
			<td class="DataTD"><?=($org['OU'])?></td>
		</tr>
		<?
		
		if(intval($org['masteracc']) === 1 &&
				 intval($org['memid']) === intval($_SESSION['profile']['id']))
		{ 
			$master="account.php?id=32&amp;orgid=".intval($row['id']);
			?>
			<tr>
				<td colspan="3" class="DataTD"><a href="<?=$master ?>"><?=_("Edit")?></a></td>
			</tr>
			<?
		}
	} 
} ?>
</table>