ManagePaid.template.php 22 KB

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