comparison forum/Themes/default/ManagePaid.template.php @ 76:e3e11437ecea website

Add forum code
author Chris Cannam
date Sun, 07 Jul 2013 11:25:48 +0200
parents
children
comparison
equal deleted inserted replaced
75:72f59aa7e503 76:e3e11437ecea
1 <?php
2 /**
3 * Simple Machines Forum (SMF)
4 *
5 * @package SMF
6 * @author Simple Machines
7 * @copyright 2011 Simple Machines
8 * @license http://www.simplemachines.org/about/smf/license.php BSD
9 *
10 * @version 2.0
11 */
12
13 // The template for adding or editing a subscription.
14 function template_modify_subscription()
15 {
16 global $context, $settings, $options, $scripturl, $txt, $modSettings;
17
18 // Javascript for the duration stuff.
19 echo '
20 <script type="text/javascript"><!-- // --><![CDATA[
21 function toggleDuration(toChange)
22 {
23 if (toChange == \'fixed\')
24 {
25 document.getElementById("fixed_area").style.display = "inline";
26 document.getElementById("flexible_area").style.display = "none";
27 }
28 else
29 {
30 document.getElementById("fixed_area").style.display = "none";
31 document.getElementById("flexible_area").style.display = "inline";
32 }
33 }
34 // ]]></script>';
35
36 echo '
37 <div id="admincenter">
38 <form action="', $scripturl, '?action=admin;area=paidsubscribe;sa=modify;sid=', $context['sub_id'], '" method="post">
39 <div class="cat_bar">
40 <h3 class="catbg">', $txt['paid_' . $context['action_type'] . '_subscription'], '</h3>
41 </div>';
42
43 if (!empty($context['disable_groups']))
44 echo '
45 <div class="information">
46 <span class="alert">', $txt['paid_mod_edit_note'], '</span>
47 </div>
48 ';
49 echo '
50 <div class="windowbg">
51 <span class="topslice"><span></span></span>
52 <div class="content">
53 <dl class="settings">
54 <dt>
55 ', $txt['paid_mod_name'], ':
56 </dt>
57 <dd>
58 <input type="text" name="name" value="', $context['sub']['name'], '" size="30" class="input_text" />
59 </dd>
60 <dt>
61 ', $txt['paid_mod_desc'], ':
62 </dt>
63 <dd>
64 <textarea name="desc" rows="3" cols="40">', $context['sub']['desc'], '</textarea>
65 </dd>
66 <dt>
67 <label for="repeatable_check">', $txt['paid_mod_repeatable'], '</label>:
68 </dt>
69 <dd>
70 <input type="checkbox" name="repeatable" id="repeatable_check"', empty($context['sub']['repeatable']) ? '' : ' checked="checked"', ' class="input_check" />
71 </dd>
72 <dt>
73 <label for="activated_check">', $txt['paid_mod_active'], '</label>:<br /><span class="smalltext">', $txt['paid_mod_active_desc'], '</span>
74 </dt>
75 <dd>
76 <input type="checkbox" name="active" id="activated_check"', empty($context['sub']['active']) ? '' : ' checked="checked"', ' class="input_check" />
77 </dd>
78 </dl>
79 <hr class="hrcolor" />
80 <dl class="settings">
81 <dt>
82 ', $txt['paid_mod_prim_group'], ':<br /><span class="smalltext">', $txt['paid_mod_prim_group_desc'], '</span>
83 </dt>
84 <dd>
85 <select name="prim_group" ', !empty($context['disable_groups']) ? 'disabled="disabled"' : '', '>
86 <option value="0" ', $context['sub']['prim_group'] == 0 ? 'selected="selected"' : '', '>', $txt['paid_mod_no_group'], '</option>';
87
88 // Put each group into the box.
89 foreach ($context['groups'] as $id => $name)
90 echo '
91 <option value="', $id, '" ', $context['sub']['prim_group'] == $id ? 'selected="selected"' : '', '>', $name, '</option>';
92
93 echo '
94 </select>
95 </dd>
96 <dt>
97 ', $txt['paid_mod_add_groups'], ':<br /><span class="smalltext">', $txt['paid_mod_add_groups_desc'], '</span>
98 </dt>
99 <dd>';
100
101 // Put a checkbox in for each group
102 foreach ($context['groups'] as $id => $name)
103 echo '
104 <label for="addgroup_', $id, '"><input type="checkbox" id="addgroup_', $id, '" name="addgroup[', $id, ']"', in_array($id, $context['sub']['add_groups']) ? ' checked="checked"' : '', ' ', !empty($context['disable_groups']) ? ' disabled="disabled"' : '', ' class="input_check" />&nbsp;<span class="smalltext">', $name, '</span></label><br />';
105
106 echo '
107 </dd>
108 <dt>
109 ', $txt['paid_mod_reminder'], ':<br /><span class="smalltext">', $txt['paid_mod_reminder_desc'], '</span>
110 </dt>
111 <dd>
112 <input type="text" name="reminder" value="', $context['sub']['reminder'], '" size="6" class="input_text" />
113 </dd>
114 <dt>
115 ', $txt['paid_mod_email'], ':<br /><span class="smalltext">', $txt['paid_mod_email_desc'], '</span>
116 </dt>
117 <dd>
118 <textarea name="emailcomplete" rows="6" cols="40">', $context['sub']['email_complete'], '</textarea>
119 </dd>
120 </dl>
121 <hr class="hrcolor" />
122 <input type="radio" name="duration_type" id="duration_type_fixed" value="fixed" ', empty($context['sub']['duration']) || $context['sub']['duration'] == 'fixed' ? 'checked="checked"' : '', ' class="input_radio" onclick="toggleDuration(\'fixed\');" />
123 <strong>', $txt['paid_mod_fixed_price'], '</strong>
124 <br />
125 <div id="fixed_area" ', empty($context['sub']['duration']) || $context['sub']['duration'] == 'fixed' ? '' : 'style="display: none;"', '>
126 <fieldset>
127 <dl class="settings">
128 <dt>
129 ', $txt['paid_cost'], ' (', str_replace('%1.2f', '', $modSettings['paid_currency_symbol']), '):
130 </dt>
131 <dd>
132 <input type="text" name="cost" value="', empty($context['sub']['cost']['fixed']) ? '0' : $context['sub']['cost']['fixed'], '" size="4" class="input_text" />
133 </dd>
134 <dt>
135 ', $txt['paid_mod_span'], ':
136 </dt>
137 <dd>
138 <input type="text" name="span_value" value="', $context['sub']['span']['value'], '" size="4" class="input_text" />
139 <select name="span_unit">
140 <option value="D" ', $context['sub']['span']['unit'] == 'D' ? 'selected="selected"' : '', '>', $txt['paid_mod_span_days'], '</option>
141 <option value="W" ', $context['sub']['span']['unit'] == 'W' ? 'selected="selected"' : '', '>', $txt['paid_mod_span_weeks'], '</option>
142 <option value="M" ', $context['sub']['span']['unit'] == 'M' ? 'selected="selected"' : '', '>', $txt['paid_mod_span_months'], '</option>
143 <option value="Y" ', $context['sub']['span']['unit'] == 'Y' ? 'selected="selected"' : '', '>', $txt['paid_mod_span_years'], '</option>
144 </select>
145 </dd>
146 </dl>
147 </fieldset>
148 </div>
149 <input type="radio" name="duration_type" id="duration_type_flexible" value="flexible" ', !empty($context['sub']['duration']) && $context['sub']['duration'] == 'flexible' ? 'checked="checked"' : '', ' class="input_radio" onclick="toggleDuration(\'flexible\');" />
150 <strong>', $txt['paid_mod_flexible_price'], '</strong>
151 <br />
152 <div id="flexible_area" ', !empty($context['sub']['duration']) && $context['sub']['duration'] == 'flexible' ? '' : 'style="display: none;"', '>
153 <fieldset>';
154
155 //!! Removed until implemented
156 if (!empty($sdflsdhglsdjgs))
157 echo '
158 <dl class="settings">
159 <dt>
160 <label for="allow_partial_check">', $txt['paid_mod_allow_partial'], '</label>:<br /><span class="smalltext">', $txt['paid_mod_allow_partial_desc'], '</span>
161 </dt>
162 <dd>
163 <input type="checkbox" name="allow_partial" id="allow_partial_check"', empty($context['sub']['allow_partial']) ? '' : ' checked="checked"', ' class="input_check" />
164 </dd>
165 </dl>';
166
167 echo '
168 <div class="information">
169 <strong>', $txt['paid_mod_price_breakdown'], '</strong><br />
170 ', $txt['paid_mod_price_breakdown_desc'], '
171 </div>
172 <dl class="settings">
173 <dt>
174 <strong>', $txt['paid_duration'], '</strong>
175 </dt>
176 <dd>
177 <strong>', $txt['paid_cost'], ' (', preg_replace('~%[df\.\d]+~', '', $modSettings['paid_currency_symbol']), ')</strong>
178 </dd>
179 <dt>
180 ', $txt['paid_per_day'], ':
181 </dt>
182 <dd>
183 <input type="text" name="cost_day" value="', empty($context['sub']['cost']['day']) ? '0' : $context['sub']['cost']['day'], '" size="5" class="input_text" />
184 </dd>
185 <dt>
186 ', $txt['paid_per_week'], ':
187 </dt>
188 <dd>
189 <input type="text" name="cost_week" value="', empty($context['sub']['cost']['week']) ? '0' : $context['sub']['cost']['week'], '" size="5" class="input_text" />
190 </dd>
191 <dt>
192 ', $txt['paid_per_month'], ':
193 </dt>
194 <dd>
195 <input type="text" name="cost_month" value="', empty($context['sub']['cost']['month']) ? '0' : $context['sub']['cost']['month'], '" size="5" class="input_text" />
196 </dd>
197 <dt>
198 ', $txt['paid_per_year'], ':
199 </dt>
200 <dd>
201 <input type="text" name="cost_year" value="', empty($context['sub']['cost']['year']) ? '0' : $context['sub']['cost']['year'], '" size="5" class="input_text" />
202 </dd>
203 </dl>
204 </fieldset>
205 </div>
206 <div class="righttext">
207 <input type="submit" name="save" value="', $txt['paid_settings_save'], '" class="button_submit" />
208 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
209 </div>
210 </div>
211 <span class="botslice"><span></span></span>
212 </div>
213 </form>
214 </div>
215 <br class="clear" />';
216
217 }
218
219 function template_delete_subscription()
220 {
221 global $context, $settings, $options, $scripturl, $txt, $modSettings;
222
223 echo '
224 <div id="admincenter">
225 <form action="', $scripturl, '?action=admin;area=paidsubscribe;sa=modify;sid=', $context['sub_id'], ';delete" method="post">
226 <div class="cat_bar">
227 <h3 class="catbg">', $txt['paid_delete_subscription'], '</h3>
228 </div>
229 <div class="windowbg">
230 <span class="topslice"><span></span></span>
231 <div class="content">
232 <p>', $txt['paid_mod_delete_warning'], '</p>
233
234 <input type="submit" name="delete_confirm" value="', $txt['paid_delete_subscription'], '" class="button_submit" />
235 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
236 </div>
237 <span class="botslice"><span></span></span>
238 </div>
239 </form>
240 </div>
241 <br class="clear" />';
242
243 }
244
245 // Add or edit an existing subscriber.
246 function template_modify_user_subscription()
247 {
248 global $context, $settings, $options, $scripturl, $txt, $modSettings;
249
250 // Some quickly stolen javascript from Post, could do with being more efficient :)
251 echo '
252 <script type="text/javascript"><!-- // --><![CDATA[
253 var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
254
255 function generateDays(offset)
256 {
257 var days = 0, selected = 0;
258 var dayElement = document.getElementById("day" + offset), yearElement = document.getElementById("year" + offset), monthElement = document.getElementById("month" + offset);
259
260 monthLength[1] = 28;
261 if (yearElement.options[yearElement.selectedIndex].value % 4 == 0)
262 monthLength[1] = 29;
263
264 selected = dayElement.selectedIndex;
265 while (dayElement.options.length)
266 dayElement.options[0] = null;
267
268 days = monthLength[monthElement.value - 1];
269
270 for (i = 1; i <= days; i++)
271 dayElement.options[dayElement.length] = new Option(i, i);
272
273 if (selected < days)
274 dayElement.selectedIndex = selected;
275 }
276 // ]]></script>';
277
278 echo '
279 <div id="admincenter">
280 <form action="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;sid=', $context['sub_id'], ';lid=', $context['log_id'], '" method="post">
281 <div class="cat_bar">
282 <h3 class="catbg">
283 ', $txt['paid_' . $context['action_type'] . '_subscription'], ' - ', $context['current_subscription']['name'], '
284 ', empty($context['sub']['username']) ? '' : ' (' . $txt['user'] . ': ' . $context['sub']['username'] . ')', '
285 </h3>
286 </div>
287 <div class="windowbg">
288 <span class="topslice"><span></span></span>
289 <div class="content">
290 <dl class="settings">';
291
292 // Do we need a username?
293 if ($context['action_type'] == 'add')
294 echo '
295
296 <dt>
297 <strong>', $txt['paid_username'], ':</strong><br />
298 <span class="smalltext">', $txt['one_username'], '</span>
299 </dt>
300 <dd>
301 <input type="text" name="name" id="name_control" value="', $context['sub']['username'], '" size="30" class="input_text" />
302 </dd>';
303
304 echo '
305 <dt>
306 <strong>', $txt['paid_status'], ':</strong>
307 </dt>
308 <dd>
309 <select name="status">
310 <option value="0" ', $context['sub']['status'] == 0 ? 'selected="selected"' : '', '>', $txt['paid_finished'], '</option>
311 <option value="1" ', $context['sub']['status'] == 1 ? 'selected="selected"' : '', '>', $txt['paid_active'], '</option>
312 </select>
313 </dd>
314 </dl>
315 <fieldset>
316 <legend>', $txt['start_date_and_time'], '</legend>
317 <select name="year" id="year" onchange="generateDays(\'\');">';
318
319 // Show a list of all the years we allow...
320 for ($year = 2005; $year <= 2030; $year++)
321 echo '
322 <option value="', $year, '"', $year == $context['sub']['start']['year'] ? ' selected="selected"' : '', '>', $year, '</option>';
323
324 echo '
325 </select>&nbsp;
326 ', (isset($txt['calendar_month']) ? $txt['calendar_month'] : $txt['calendar_month']), '&nbsp;
327 <select name="month" id="month" onchange="generateDays(\'\');">';
328
329 // There are 12 months per year - ensure that they all get listed.
330 for ($month = 1; $month <= 12; $month++)
331 echo '
332 <option value="', $month, '"', $month == $context['sub']['start']['month'] ? ' selected="selected"' : '', '>', $txt['months'][$month], '</option>';
333
334 echo '
335 </select>&nbsp;
336 ', (isset($txt['calendar_day']) ? $txt['calendar_day'] : $txt['calendar_day']), '&nbsp;
337 <select name="day" id="day">';
338
339 // This prints out all the days in the current month - this changes dynamically as we switch months.
340 for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++)
341 echo '
342 <option value="', $day, '"', $day == $context['sub']['start']['day'] ? ' selected="selected"' : '', '>', $day, '</option>';
343
344 echo '
345 </select>
346 ', $txt['hour'], ': <input type="text" name="hour" value="', $context['sub']['start']['hour'], '" size="2" class="input_text" />
347 ', $txt['minute'], ': <input type="text" name="minute" value="', $context['sub']['start']['min'], '" size="2" class="input_text" />
348 </fieldset>
349 <fieldset>
350 <legend>', $txt['end_date_and_time'], '</legend>
351 <select name="yearend" id="yearend" onchange="generateDays(\'end\');">';
352
353 // Show a list of all the years we allow...
354 for ($year = 2005; $year <= 2030; $year++)
355 echo '
356 <option value="', $year, '"', $year == $context['sub']['end']['year'] ? ' selected="selected"' : '', '>', $year, '</option>';
357
358 echo '
359 </select>&nbsp;
360 ', (isset($txt['calendar_month']) ? $txt['calendar_month'] : $txt['calendar_month']), '&nbsp;
361 <select name="monthend" id="monthend" onchange="generateDays(\'end\');">';
362
363 // There are 12 months per year - ensure that they all get listed.
364 for ($month = 1; $month <= 12; $month++)
365 echo '
366 <option value="', $month, '"', $month == $context['sub']['end']['month'] ? ' selected="selected"' : '', '>', $txt['months'][$month], '</option>';
367
368 echo '
369 </select>&nbsp;
370 ', (isset($txt['calendar_day']) ? $txt['calendar_day'] : $txt['calendar_day']), '&nbsp;
371 <select name="dayend" id="dayend">';
372
373 // This prints out all the days in the current month - this changes dynamically as we switch months.
374 for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++)
375 echo '
376 <option value="', $day, '"', $day == $context['sub']['end']['day'] ? ' selected="selected"' : '', '>', $day, '</option>';
377
378 echo '
379 </select>
380 ', $txt['hour'], ': <input type="text" name="hourend" value="', $context['sub']['end']['hour'], '" size="2" class="input_text" />
381 ', $txt['minute'], ': <input type="text" name="minuteend" value="', $context['sub']['end']['min'], '" size="2" class="input_text" />
382 </fieldset>
383 <input type="submit" name="save_sub" value="', $txt['paid_settings_save'], '" class="button_submit" />
384 </div>
385 <span class="botslice"><span></span></span>
386 </div>
387 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
388 </form>
389 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script>
390 <script type="text/javascript"><!-- // --><![CDATA[
391 var oAddMemberSuggest = new smc_AutoSuggest({
392 sSelf: \'oAddMemberSuggest\',
393 sSessionId: \'', $context['session_id'], '\',
394 sSessionVar: \'', $context['session_var'], '\',
395 sSuggestId: \'name_subscriber\',
396 sControlId: \'name_control\',
397 sSearchType: \'member\',
398 sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
399 bItemList: false
400 });
401 // ]]></script>';
402
403 if (!empty($context['pending_payments']))
404 {
405 echo '
406 <div class="cat_bar">
407 <h3 class="catbg">', $txt['pending_payments'], '</h3>
408 </div>
409 <div class="information">
410 ', $txt['pending_payments_desc'], '
411 </div>
412 <div class="cat_bar">
413 <h3 class="catbg">', $txt['pending_payments_value'], '</h3>
414 </div>
415 <div class="windowbg">
416 <span class="topslice"><span></span></span>
417 <div class="content">
418 <ul class="pending_payments">';
419
420 foreach ($context['pending_payments'] as $id => $payment)
421 {
422 echo '
423 <li class="reset">
424 ', $payment['desc'], '
425 <span class="floatleft"><a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;lid=', $context['log_id'], ';pending=', $id, ';accept">', $txt['pending_payments_accept'], '</a></span>
426 <span class="floatright"><a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;lid=', $context['log_id'], ';pending=', $id, ';remove">', $txt['pending_payments_remove'], '</a></span>
427 </li>';
428 }
429
430 echo '
431 </ul>
432 </div>
433 <span class="botslice"><span></span></span>
434 </div>';
435 }
436
437 echo '
438 </div>
439 <br class="clear" />';
440 }
441
442 // Template for a user to edit/pick their subscriptions.
443 function template_user_subscription()
444 {
445 global $context, $txt, $scripturl, $modSettings;
446
447 echo '
448 <div id="paid_subscription">
449 <form action="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=subscriptions;confirm" method="post">
450 <div class="cat_bar">
451 <h3 class="catbg">', $txt['subscriptions'], '</h3>
452 </div>';
453
454 if (empty($context['subscriptions']))
455 {
456 echo '
457 <div class="information">
458 ', $txt['paid_subs_none'], '
459 </div>';
460 }
461 else
462 {
463 echo '
464 <div class="information">
465 ', $txt['paid_subs_desc'], '
466 </div>';
467
468 // Print out all the subscriptions.
469 $alternate = false;
470 foreach ($context['subscriptions'] as $id => $subscription)
471 {
472 $alternate = !$alternate;
473
474 // Ignore the inactive ones...
475 if (empty($subscription['active']))
476 continue;
477
478 echo '
479 <div class="cat_bar">
480 <h3 class="catbg">', $subscription['name'], '</h3>
481 </div>
482 <div class="windowbg', $alternate ? '' : '2', '">
483 <span class="topslice"><span></span></span>
484 <div class="content">
485 <p><strong>', $subscription['name'], '</strong></p>
486 <p class="smalltext">', $subscription['desc'], '</p>';
487
488 if (!$subscription['flexible'])
489 echo '
490 <div><strong>', $txt['paid_duration'], ':</strong> ', $subscription['length'], '</div>';
491
492 if ($context['user']['is_owner'])
493 {
494 echo '
495 <strong>', $txt['paid_cost'], ':</strong>';
496
497 if ($subscription['flexible'])
498 {
499 echo '
500 <select name="cur[', $subscription['id'], ']">';
501
502 // Print out the costs for this one.
503 foreach ($subscription['costs'] as $duration => $value)
504 echo '
505 <option value="', $duration, '">', sprintf($modSettings['paid_currency_symbol'], $value), '/', $txt[$duration], '</option>';
506
507 echo '
508 </select>';
509 }
510 else
511 echo '
512 ', sprintf($modSettings['paid_currency_symbol'], $subscription['costs']['fixed']);
513
514 echo '
515 <br />
516 <input type="submit" name="sub_id[', $subscription['id'], ']" value="', $txt['paid_order'], '" class="button_submit" />';
517 }
518 else
519 echo '
520 <a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;sid=', $subscription['id'], ';uid=', $context['member']['id'], (empty($context['current'][$subscription['id']]) ? '' : ';lid=' . $context['current'][$subscription['id']]['id']), '">', empty($context['current'][$subscription['id']]) ? $txt['paid_admin_add'] : $txt['paid_edit_subscription'], '</a>';
521
522 echo '
523 </div>
524 <span class="botslice"><span></span></span>
525 </div>';
526 }
527 }
528
529 echo '
530 </form>
531 <br />
532 <div class="title_bar">
533 <h3 class="titlebg">', $txt['paid_current'], '</h3>
534 </div>
535 <div class="information">
536 ', $txt['paid_current_desc'], '
537 </div>
538 <table width="100%" class="table_grid">
539 <thead>
540 <tr class="catbg">
541 <th class="first_th" width="30%">', $txt['paid_name'], '</th>
542 <th align="center">', $txt['paid_status'], '</th>
543 <th align="center">', $txt['start_date'], '</th>
544 <th class="last_th" align="center">', $txt['end_date'], '</th>
545 </tr>
546 </thead>
547 <tbody>';
548
549 if (empty($context['current']))
550 echo '
551 <tr class="windowbg">
552 <td align="center" colspan="4">
553 ', $txt['paid_none_yet'], '
554 </td>
555 </tr>';
556
557 $alternate = false;
558 foreach ($context['current'] as $sub)
559 {
560 $alternate = !$alternate;
561
562 if (!$sub['hide'])
563 echo '
564 <tr class="windowbg', $alternate ? '' : '2', '">
565 <td>
566 ', (allowedTo('admin_forum') ? '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $sub['id'] . '">' . $sub['name'] . '</a>' : $sub['name']), '
567 </td><td>
568 <span style="color: ', ($sub['status'] == 2 ? 'green' : ($sub['status'] == 1 ? 'red' : 'orange')), '"><strong>', $sub['status_text'], '</strong></span>
569 </td><td>
570 ', $sub['start'], '
571 </td><td>
572 ', $sub['end'], '
573 </td>
574 </tr>';
575 }
576 echo '
577 </tbody>
578 </table>
579 </div>
580 <br class="clear" />';
581 }
582
583 // The "choose payment" dialog.
584 function template_choose_payment()
585 {
586 global $context, $txt, $modSettings, $scripturl;
587
588 echo '
589 <div id="paid_subscription">
590 <div class="cat_bar">
591 <h3 class="catbg">', $txt['paid_confirm_payment'], '</h3>
592 </div>
593 <div class="information">
594 ', $txt['paid_confirm_desc'], '
595 </div>
596 <div class="windowbg">
597 <span class="topslice"><span></span></span>
598 <div class="content">
599 <dl class="settings">
600 <dt>
601 <strong>', $txt['subscription'], ':</strong>
602 </dt>
603 <dd>
604 ', $context['sub']['name'], '
605 </dd>
606 <dt>
607 <strong>', $txt['paid_cost'], ':</strong>
608 </dt>
609 <dd>
610 ', $context['cost'], '
611 </dd>
612 </dl>
613 </div>
614 <span class="botslice"><span></span></span>
615 </div>';
616
617 // Do all the gateway options.
618 foreach ($context['gateways'] as $gateway)
619 {
620 echo '
621 <div class="cat_bar">
622 <h3 class="catbg">', $gateway['title'], '</h3>
623 </div>
624 <div class="windowbg">
625 <span class="topslice"><span></span></span>
626 <div class="content">
627 ', $gateway['desc'], '<br />
628 <form action="', $gateway['form'], '" method="post">';
629
630 if (!empty($gateway['javascript']))
631 echo '
632 <script type="text/javascript"><!-- // --><![CDATA[
633 ', $gateway['javascript'], '
634 // ]]></script>';
635
636 foreach ($gateway['hidden'] as $name => $value)
637 echo '
638 <input type="hidden" id="', $gateway['id'], '_', $name, '" name="', $name, '" value="', $value, '" />';
639
640 echo '
641 <br /><input type="submit" value="', $gateway['submit'], '" class="button_submit" />
642 </form>
643 </div>
644 <span class="botslice"><span></span></span>
645 </div>';
646 }
647
648 echo '
649 </div>
650 <br class="clear" />';
651 }
652
653 // The "thank you" bit...
654 function template_paid_done()
655 {
656 global $context, $txt, $modSettings, $scripturl;
657
658 echo '
659 <div id="paid_subscription">
660 <div class="title_bar">
661 <h3 class="titlebg">', $txt['paid_done'], '</h3>
662 </div>
663 <div class="windowbg2">
664 <span class="topslice"><span></span></span>
665 <div class="content">
666 <p>', $txt['paid_done_desc'], '</p>
667 <br />
668 <a href="', $scripturl, '?action=profile;u=', $context['member']['id'], ';area=subscriptions">', $txt['paid_sub_return'], '</a>
669 </div>
670 <span class="botslice"><span></span></span>
671 </div>
672 </div>
673 <br class="clear" />';
674 }
675
676 ?>