summaryrefslogtreecommitdiff
path: root/pages/wot/16.php
blob: 43e97c24dd1ea1a3fe7db00e8d1ca7446a934bd9 (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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
/*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
*/

//*******************  TTP Console ************

if ($_SESSION['profile']['ttpadmin'] < 1) {
	echo _("You are not allowed to view this page.");
	exit;
}

//Check for test or productive environment, in case of test the user data for the print out is extended by 'test system'
$testserver='';
if ($_SESSION['_config']['normalhostname']=='cacert1.it-sls.de') {
	$testserver=' test system';
}

$row = $_SESSION['_config']['notarise'];
$fname = $row['fname'];
$mname = $row['mname'];
$lname = $row['lname'];
$suffix = $row['suffix'];
$fullname = $fname." ".$mname." ".$lname." ".$suffix;
$dob = date_format($row['dob'], 'Y-m-d');
$userid = $row['id'];

//List TTP Assurances and TotalPoints
//changed get_received_assurances ($userid, $support)

//include_once($_SESSION['_config']['filepath']."/includes/wot.inc.php");
include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php");

output_received_assurances(intval($userid),2); //support==2 => TTP


$query = "select sum(`points`) as `points` from `notary` where `to`='".intval($userid)."'";
$dres = mysql_query($query);
$drow = mysql_fetch_assoc($dres);

$points=$drow['points'];

$res = get_received_assurances(intval($userid), $support);
$ttp_assurances_count=$num_rows = mysql_num_rows($res);

//Form
?>

<table>
	<tr>
		<td class="title"><?=sprintf(_('Total assurance points for %s'),$fullname)?></td>
	</tr>
	<tr>
		<td><?=$points?></td>
	</tr>
</table>

<form action="https://pdf.cacert.eu/cacertpdf.php" method="get">
	<table>
		<tr>
			<td colspan="2" class="title">_('TTP CAP form creation')</td>
		</tr>
		<tr>
			<td colspan="2" class="title">_('User information')</td>
		</tr>
		<tr>
			<td><?=_('Fullname')?><input type="hidden" name="fullname" value="<?=$fullname.$testserver?>"/></td>
			<td><?=$fullname?></td>
		</tr>
		<tr>
			<td><?=_('Date of Birth')?><input type="hidden" name="dob" value="<?=$dob.$testserver?>"/></td>
			<td><?=$dob?></td>
		</tr>
		<tr>
			<td><?=_('Email')?><input type="hidden" name="email" value="<?=$fullname.$testserver?>"/></td>
			<td><?=$email?></td>
		</tr>
		<tr>
			<td colspan="2" class="title">_('TTP Admin postal address')</td>
		</tr>
		<tr>
			<td><?=_('Line').' 1'?></td>
			<td><input type="text" name="adress" /></td>
		</tr>
		<tr>
			<td><?=_('Line').' 2'?></td>
			<td><input type="text" name="adress1" /></td>
		</tr>
		<tr>
			<td><?=_('Line').' 3'?></td>
			<td><input type="text" name="adress2" /></td>
		</tr>
		<tr>
			<td><?=_('Line').' 4'?></td>
			<td><input type="text" name="adress3" /></td>
		</tr>
		<tr>
			<td><?=_('Line').' 5'?></td>
			<td><input type="text" name="adress4" /></td>
		</tr>
		<tr>
			<td><?=_('Country where the TTP will be visited')?></td>
			<td>
			<?
				$ttpcountries=get_array_from_ini('../config/ttp.ini');
				echo create_selectbox_HTML('country',$ttpcountries, '',TRUE);
			?>
			</td>
		</tr>
		<tr>
			<td colspan="2" class="title">
			<?
			if ($points>=100 || $ttp_assurances_count>=2) {
				_('No TTP assurance allowed');
			}else{
				?><input type="submit" value="<?=_('Create TTP CAP pdf file')?>"/><?
			}?>
			</td>
		</tr>
	</table>
	<input type="hidden" name="lang" value="en"/>
</form>


<a href="wot.php?id=6><?=_("Back")?></a>