service_panel.tpl 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <link rel="stylesheet" type="text/css" href="../resources/css/style.css"/>
  2. <script type="text/javascript" src="../resources/js/modals.js"></script>
  3. <div id="buy-courses-tabs">
  4. <ul class="nav nav-tabs buy-courses-tabs" role="tablist">
  5. <li id="buy-courses-tab" class="" role="presentation">
  6. <a href="course_panel.php" aria-controls="buy-courses" role="tab">{{ 'MyCourses'| get_lang }}</a>
  7. </li>
  8. {% if sessions_are_included %}
  9. <li id="buy-sessions-tab" class="" role="presentation">
  10. <a href="session_panel.php" aria-controls="buy-sessions" role="tab">{{ 'MySessions'| get_lang }}</a>
  11. </li>
  12. {% endif %}
  13. {% if services_are_included %}
  14. <li id="buy-services-tab" class="active" role="presentation">
  15. <a href="service_panel.php" aria-controls="buy-services"
  16. role="tab">{{ 'MyServices'| get_plugin_lang('BuyCoursesPlugin') }}</a>
  17. </li>
  18. {% endif %}
  19. <li id="buy-courses-tab" class="" role="presentation">
  20. <a href="payout_panel.php" aria-controls="buy-courses"
  21. role="tab">{{ 'MyPayouts'| get_plugin_lang('BuyCoursesPlugin') }}</a>
  22. </li>
  23. </ul>
  24. <table class="table table-striped table-hover">
  25. <thead>
  26. <tr>
  27. <th>{{ 'Service'| get_plugin_lang('BuyCoursesPlugin') }}</th>
  28. <th class="text-center">{{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  29. <th class="text-center">{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  30. <th class="text-center">{{ 'OrderDate'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  31. <th class="text-center">{{ 'OrderReference'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  32. <th class="text-center">{{ 'ServiceSaleInfo'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  33. </tr>
  34. </thead>
  35. <tbody>
  36. {% for sale in sale_list %}
  37. <tr class="{{ sale.status == service_sale_statuses.status_cancelled ? 'buy-courses-cross-out' : '' }}">
  38. <td>{{ sale.name }}</td>
  39. <td class="text-center">{{ sale.service_type }}</td>
  40. <td class="text-center">{{ sale.currency ~ ' ' ~ sale.price }}</td>
  41. <td class="text-center">{{ sale.date }}</td>
  42. <td class="text-center">{{ sale.reference }}</td>
  43. <td class="text-center">
  44. <a id="service_sale_info" tag="{{ sale.id }}" name="s_{{ sale.id }}"
  45. class="btn btn-info btn-sm">{{ 'Info'|get_lang }}</a>
  46. </td>
  47. </td>
  48. </tr>
  49. {% endfor %}
  50. </tbody>
  51. </table>
  52. </div>
  53. <script>
  54. $(function () {
  55. $("td a").click(function () {
  56. var id = $(this).attr('tag');
  57. var action = $(this).attr('id');
  58. $.ajax({
  59. data: 'id=' + id,
  60. url: '{{ _p.web_plugin }}buycourses/src/buycourses.ajax.php?a=' + action,
  61. type: 'POST',
  62. beforeSend: function () {
  63. if (action == 'service_sale_info') {
  64. $('a[name=s_' + id + ']').html('<em class="fa fa-spinner fa-pulse"></em> {{ 'Loading'|get_lang }}');
  65. }
  66. },
  67. success: function (response) {
  68. $('a[name=s_' + id + ']').html('{{ 'Info'|get_lang }}');
  69. var title = "";
  70. if (action == 'service_sale_info') {
  71. title = "{{ 'ServiceSaleInfo'|get_plugin_lang('BuyCoursesPlugin') }}";
  72. }
  73. bootbox.dialog({
  74. message: response,
  75. title: title,
  76. buttons: {
  77. main: {
  78. label: "{{ 'Close'|get_lang }}",
  79. className: "btn-default"
  80. }
  81. }
  82. });
  83. }
  84. })
  85. });
  86. });
  87. </script>