ManagePaid.template.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. <?php
  2. /**
  3. * Simple Machines Forum (SMF)
  4. *
  5. * @package SMF
  6. * @author Simple Machines
  7. * @copyright 2013 Simple Machines and individual contributors
  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. </div>
  183. </div>
  184. </form>
  185. </div>';
  186. }
  187. function template_delete_subscription()
  188. {
  189. global $context, $settings, $options, $scripturl, $txt, $modSettings;
  190. echo '
  191. <div id="admincenter">
  192. <form action="', $scripturl, '?action=admin;area=paidsubscribe;sa=modify;sid=', $context['sub_id'], ';delete" method="post">
  193. <div class="cat_bar">
  194. <h3 class="catbg">', $txt['paid_delete_subscription'], '</h3>
  195. </div>
  196. <div class="windowbg">
  197. <div class="content">
  198. <p>', $txt['paid_mod_delete_warning'], '</p>
  199. <input type="submit" name="delete_confirm" value="', $txt['paid_delete_subscription'], '" class="button_submit" />
  200. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  201. <input type="hidden" name="', $context['admin-pmsd_token_var'], '" value="', $context['admin-pmsd_token'], '" />
  202. </div>
  203. </div>
  204. </form>
  205. </div>';
  206. }
  207. // Add or edit an existing subscriber.
  208. function template_modify_user_subscription()
  209. {
  210. global $context, $settings, $options, $scripturl, $txt, $modSettings;
  211. // Some quickly stolen javascript from Post, could do with being more efficient :)
  212. echo '
  213. <script type="text/javascript"><!-- // --><![CDATA[
  214. var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  215. // ]]></script>';
  216. echo '
  217. <div id="admincenter">
  218. <form action="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;sid=', $context['sub_id'], ';lid=', $context['log_id'], '" method="post">
  219. <div class="cat_bar">
  220. <h3 class="catbg">
  221. ', $txt['paid_' . $context['action_type'] . '_subscription'], ' - ', $context['current_subscription']['name'], '
  222. ', empty($context['sub']['username']) ? '' : ' (' . $txt['user'] . ': ' . $context['sub']['username'] . ')', '
  223. </h3>
  224. </div>
  225. <div class="windowbg">
  226. <div class="content">
  227. <dl class="settings">';
  228. // Do we need a username?
  229. if ($context['action_type'] == 'add')
  230. echo '
  231. <dt>
  232. <strong>', $txt['paid_username'], ':</strong><br />
  233. <span class="smalltext">', $txt['one_username'], '</span>
  234. </dt>
  235. <dd>
  236. <input type="text" name="name" id="name_control" value="', $context['sub']['username'], '" size="30" class="input_text" />
  237. </dd>';
  238. echo '
  239. <dt>
  240. <strong>', $txt['paid_status'], ':</strong>
  241. </dt>
  242. <dd>
  243. <select name="status">
  244. <option value="0" ', $context['sub']['status'] == 0 ? 'selected="selected"' : '', '>', $txt['paid_finished'], '</option>
  245. <option value="1" ', $context['sub']['status'] == 1 ? 'selected="selected"' : '', '>', $txt['paid_active'], '</option>
  246. </select>
  247. </dd>
  248. </dl>
  249. <fieldset>
  250. <legend>', $txt['start_date_and_time'], '</legend>
  251. <select name="year" id="year" onchange="generateDays(\'\');">';
  252. // Show a list of all the years we allow...
  253. for ($year = 2005; $year <= 2030; $year++)
  254. echo '
  255. <option value="', $year, '"', $year == $context['sub']['start']['year'] ? ' selected="selected"' : '', '>', $year, '</option>';
  256. echo '
  257. </select>&nbsp;
  258. ', (isset($txt['calendar_month']) ? $txt['calendar_month'] : $txt['calendar_month']), '&nbsp;
  259. <select name="month" id="month" onchange="generateDays(\'\');">';
  260. // There are 12 months per year - ensure that they all get listed.
  261. for ($month = 1; $month <= 12; $month++)
  262. echo '
  263. <option value="', $month, '"', $month == $context['sub']['start']['month'] ? ' selected="selected"' : '', '>', $txt['months'][$month], '</option>';
  264. echo '
  265. </select>&nbsp;
  266. ', (isset($txt['calendar_day']) ? $txt['calendar_day'] : $txt['calendar_day']), '&nbsp;
  267. <select name="day" id="day">';
  268. // This prints out all the days in the current month - this changes dynamically as we switch months.
  269. for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++)
  270. echo '
  271. <option value="', $day, '"', $day == $context['sub']['start']['day'] ? ' selected="selected"' : '', '>', $day, '</option>';
  272. echo '
  273. </select>
  274. ', $txt['hour'], ': <input type="text" name="hour" value="', $context['sub']['start']['hour'], '" size="2" class="input_text" />
  275. ', $txt['minute'], ': <input type="text" name="minute" value="', $context['sub']['start']['min'], '" size="2" class="input_text" />
  276. </fieldset>
  277. <fieldset>
  278. <legend>', $txt['end_date_and_time'], '</legend>
  279. <select name="yearend" id="yearend" onchange="generateDays(\'end\');">';
  280. // Show a list of all the years we allow...
  281. for ($year = 2005; $year <= 2030; $year++)
  282. echo '
  283. <option value="', $year, '"', $year == $context['sub']['end']['year'] ? ' selected="selected"' : '', '>', $year, '</option>';
  284. echo '
  285. </select>&nbsp;
  286. ', (isset($txt['calendar_month']) ? $txt['calendar_month'] : $txt['calendar_month']), '&nbsp;
  287. <select name="monthend" id="monthend" onchange="generateDays(\'end\');">';
  288. // There are 12 months per year - ensure that they all get listed.
  289. for ($month = 1; $month <= 12; $month++)
  290. echo '
  291. <option value="', $month, '"', $month == $context['sub']['end']['month'] ? ' selected="selected"' : '', '>', $txt['months'][$month], '</option>';
  292. echo '
  293. </select>&nbsp;
  294. ', (isset($txt['calendar_day']) ? $txt['calendar_day'] : $txt['calendar_day']), '&nbsp;
  295. <select name="dayend" id="dayend">';
  296. // This prints out all the days in the current month - this changes dynamically as we switch months.
  297. for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++)
  298. echo '
  299. <option value="', $day, '"', $day == $context['sub']['end']['day'] ? ' selected="selected"' : '', '>', $day, '</option>';
  300. echo '
  301. </select>
  302. ', $txt['hour'], ': <input type="text" name="hourend" value="', $context['sub']['end']['hour'], '" size="2" class="input_text" />
  303. ', $txt['minute'], ': <input type="text" name="minuteend" value="', $context['sub']['end']['min'], '" size="2" class="input_text" />
  304. </fieldset>
  305. <input type="submit" name="save_sub" value="', $txt['paid_settings_save'], '" class="button_submit" />
  306. </div>
  307. </div>
  308. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  309. </form>
  310. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?alp21"></script>
  311. <script type="text/javascript"><!-- // --><![CDATA[
  312. var oAddMemberSuggest = new smc_AutoSuggest({
  313. sSelf: \'oAddMemberSuggest\',
  314. sSessionId: smf_session_id,
  315. sSessionVar: smf_session_var,
  316. sSuggestId: \'name_subscriber\',
  317. sControlId: \'name_control\',
  318. sSearchType: \'member\',
  319. sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
  320. bItemList: false
  321. });
  322. // ]]></script>';
  323. if (!empty($context['pending_payments']))
  324. {
  325. echo '
  326. <div class="cat_bar">
  327. <h3 class="catbg">', $txt['pending_payments'], '</h3>
  328. </div>
  329. <div class="information">
  330. ', $txt['pending_payments_desc'], '
  331. </div>
  332. <div class="cat_bar">
  333. <h3 class="catbg">', $txt['pending_payments_value'], '</h3>
  334. </div>
  335. <div class="windowbg">
  336. <div class="content">
  337. <ul class="pending_payments">';
  338. foreach ($context['pending_payments'] as $id => $payment)
  339. {
  340. echo '
  341. <li class="reset">
  342. ', $payment['desc'], '
  343. <span class="floatleft">
  344. <a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;lid=', $context['log_id'], ';pending=', $id, ';accept">', $txt['pending_payments_accept'], '</a>
  345. </span>
  346. <span class="floatright">
  347. <a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;lid=', $context['log_id'], ';pending=', $id, ';remove">', $txt['pending_payments_remove'], '</a>
  348. </span>
  349. </li>';
  350. }
  351. echo '
  352. </ul>
  353. </div>
  354. </div>';
  355. }
  356. echo '
  357. </div>';
  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. }
  423. else
  424. echo '
  425. <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>';
  426. echo '
  427. </div>
  428. </div>';
  429. }
  430. }
  431. echo '
  432. </form>
  433. <br class="clear"/>
  434. <div class="title_bar">
  435. <h3 class="titlebg">', $txt['paid_current'], '</h3>
  436. </div>
  437. <div class="information">
  438. ', $txt['paid_current_desc'], '
  439. </div>
  440. <table width="100%" class="table_grid">
  441. <thead>
  442. <tr class="catbg">
  443. <th class="first_th" width="30%">', $txt['paid_name'], '</th>
  444. <th align="center">', $txt['paid_status'], '</th>
  445. <th align="center">', $txt['start_date'], '</th>
  446. <th class="last_th" align="center">', $txt['end_date'], '</th>
  447. </tr>
  448. </thead>
  449. <tbody>';
  450. if (empty($context['current']))
  451. echo '
  452. <tr class="windowbg">
  453. <td align="center" colspan="4">
  454. ', $txt['paid_none_yet'], '
  455. </td>
  456. </tr>';
  457. $alternate = false;
  458. foreach ($context['current'] as $sub)
  459. {
  460. $alternate = !$alternate;
  461. if (!$sub['hide'])
  462. echo '
  463. <tr class="windowbg', $alternate ? '' : '2', '">
  464. <td>
  465. ', (allowedTo('admin_forum') ? '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $sub['id'] . '">' . $sub['name'] . '</a>' : $sub['name']), '
  466. </td><td>
  467. <span style="color: ', ($sub['status'] == 2 ? 'green' : ($sub['status'] == 1 ? 'red' : 'orange')), '"><strong>', $sub['status_text'], '</strong></span>
  468. </td><td>
  469. ', $sub['start'], '
  470. </td><td>
  471. ', $sub['end'], '
  472. </td>
  473. </tr>';
  474. }
  475. echo '
  476. </tbody>
  477. </table>
  478. </div>';
  479. }
  480. // The "choose payment" dialog.
  481. function template_choose_payment()
  482. {
  483. global $context, $txt, $modSettings, $scripturl;
  484. echo '
  485. <div id="paid_subscription">
  486. <div class="cat_bar">
  487. <h3 class="catbg">', $txt['paid_confirm_payment'], '</h3>
  488. </div>
  489. <div class="information">
  490. ', $txt['paid_confirm_desc'], '
  491. </div>
  492. <div class="windowbg">
  493. <div class="content">
  494. <dl class="settings">
  495. <dt>
  496. <strong>', $txt['subscription'], ':</strong>
  497. </dt>
  498. <dd>
  499. ', $context['sub']['name'], '
  500. </dd>
  501. <dt>
  502. <strong>', $txt['paid_cost'], ':</strong>
  503. </dt>
  504. <dd>
  505. ', $context['cost'], '
  506. </dd>
  507. </dl>
  508. </div>
  509. </div>';
  510. // Do all the gateway options.
  511. foreach ($context['gateways'] as $gateway)
  512. {
  513. echo '
  514. <div class="cat_bar">
  515. <h3 class="catbg">', $gateway['title'], '</h3>
  516. </div>
  517. <div class="windowbg">
  518. <div class="content">
  519. ', $gateway['desc'], '<br />
  520. <form action="', $gateway['form'], '" method="post">';
  521. if (!empty($gateway['javascript']))
  522. echo '
  523. <script type="text/javascript"><!-- // --><![CDATA[
  524. ', $gateway['javascript'], '
  525. // ]]></script>';
  526. foreach ($gateway['hidden'] as $name => $value)
  527. echo '
  528. <input type="hidden" id="', $gateway['id'], '_', $name, '" name="', $name, '" value="', $value, '" />';
  529. echo '
  530. <br /><input type="submit" value="', $gateway['submit'], '" class="button_submit" />
  531. </form>
  532. </div>
  533. </div>';
  534. }
  535. echo '
  536. </div>
  537. <br class="clear" />';
  538. }
  539. // The "thank you" bit...
  540. function template_paid_done()
  541. {
  542. global $context, $txt, $modSettings, $scripturl;
  543. echo '
  544. <div id="paid_subscription">
  545. <div class="title_bar">
  546. <h3 class="titlebg">', $txt['paid_done'], '</h3>
  547. </div>
  548. <div class="windowbg2">
  549. <div class="content">
  550. <p>', $txt['paid_done_desc'], '</p>
  551. <br />
  552. <a href="', $scripturl, '?action=profile;u=', $context['member']['id'], ';area=subscriptions">', $txt['paid_sub_return'], '</a>
  553. </div>
  554. </div>
  555. </div>';
  556. }
  557. ?>