service_sales_report.tpl 5.7 KB

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