service_panel.tpl 4.2 KB

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