service_sales_report.tpl 4.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <link rel="stylesheet" type="text/css" href="../resources/css/style.css"/>
  2. <script type="text/javascript" src="../resources/js/modals.js"></script>
  3. <ul class="nav nav-tabs buy-courses-sessions-tabs" role="tablist">
  4. <li id="buy-courses-sessions-tab" class="" role="presentation">
  5. <a href="sales_report.php" aria-controls="buy-courses_sessions" role="tab">{{ 'CourseSessionBlock'|get_lang }}</a>
  6. </li>
  7. <li id="buy-services-tab" class="active" role="presentation">
  8. <a href="service_sales_report.php" aria-controls="buy-services" role="tab">{{ 'Services'|get_plugin_lang('BuyCoursesPlugin') }}</a>
  9. </li>
  10. </ul>
  11. </br>
  12. </br>
  13. <div class="row">
  14. <div class="col-md-3 col-sm-12 col-xs-12">
  15. <h4><b>{{ 'Filter' | get_lang }}</b></h4>
  16. {{ form }}
  17. </div>
  18. <div class="col-md-9 col-sm-12 col-xs-12">
  19. <div class="table-responsive">
  20. <table class="table table-striped table-hover">
  21. <thead>
  22. <tr>
  23. <th class="text-center">{{ 'ServiceName'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  24. <th class="text-center">{{ 'OrderReference'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  25. <th class="text-center">{{ 'OrderStatus'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  26. <th class="text-center">{{ 'OrderDate'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  27. <th class="text-right">{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  28. <th class="text-center">{{ 'ServiceSaleInfo'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  29. </tr>
  30. </thead>
  31. <tbody>
  32. {% for sale in sale_list %}
  33. <tr>
  34. <td class="text-center">{{ sale.service_name }}</td>
  35. <td class="text-center">{{ sale.reference }}</td>
  36. <td class="text-center">
  37. {% if sale.status == sale_status_cancelled %}
  38. {{ 'SaleStatusCancelled'|get_plugin_lang('BuyCoursesPlugin') }}
  39. {% elseif sale.status == sale_status_pending %}
  40. {{ 'SaleStatusPending'|get_plugin_lang('BuyCoursesPlugin') }}
  41. {% elseif sale.status == sale_status_completed %}
  42. {{ 'SaleStatusCompleted'|get_plugin_lang('BuyCoursesPlugin') }}
  43. {% endif %}
  44. </td>
  45. <td class="text-center">{{ sale.date }}</td>
  46. <td class="text-right">{{ sale.currency ~ ' ' ~ sale.price }}</td>
  47. <td class="text-center">
  48. <a id="service_sale_info" tag="{{ sale.id }}" name="s_{{ sale.id }}" class="btn btn-info btn-sm">{{ 'Info' | get_lang }}</a>
  49. </td>
  50. </tr>
  51. {% endfor %}
  52. </tbody>
  53. </table>
  54. </div>
  55. </div>
  56. </div>
  57. <script>
  58. $(document).on('ready', function () {
  59. $("td a").click(function() {
  60. var id = $(this).attr('tag');
  61. var action = $(this).attr('id');
  62. $.ajax({
  63. data: 'id='+id,
  64. url: '{{ _p.web_plugin }}buycourses/src/buycourses.ajax.php?a='+action,
  65. type: 'POST',
  66. beforeSend: function() {
  67. if (action == 'renewable_info') {
  68. $('a[name=r_'+id+']').html('<em class="fa fa-spinner fa-pulse"></em> {{ 'Loading' | get_lang }}');
  69. } else if (action == 'service_sale_info') {
  70. $('a[name=s_'+id+']').html('<em class="fa fa-spinner fa-pulse"></em> {{ 'Loading' | get_lang }}');
  71. }
  72. },
  73. success: function(response) {
  74. $('a[name=r_'+id+']').html('{{ 'Info' | get_lang }}');
  75. $('a[name=s_'+id+']').html('{{ 'Info' | get_lang }}');
  76. var title = "";
  77. if (action == "renewable_info") {
  78. title = "{{ 'RecurringPaymentProfilePaypalInformation' | get_plugin_lang('BuyCoursesPlugin') }}";
  79. } else if (action == 'service_sale_info') {
  80. title = "{{ 'ServiceSaleInfo' | get_plugin_lang('BuyCoursesPlugin') }}";
  81. }
  82. bootbox.dialog({
  83. message: response,
  84. title: title,
  85. buttons: {
  86. main: {
  87. label: "{{ 'Close' | get_lang }}",
  88. className: "btn-default"
  89. }
  90. }
  91. });
  92. }
  93. })
  94. });
  95. });
  96. </script>