service_sales_report.tpl 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 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.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.buy_date | api_get_local_time}}</td>
  51. <td class="text-right">{{ sale.service.total_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">
  65. {{ 'Info'|get_lang }}
  66. </a>
  67. </td>
  68. </tr>
  69. {% endfor %}
  70. </tbody>
  71. </table>
  72. </div>
  73. </div>
  74. </div>
  75. <script>
  76. $(function () {
  77. $("td a").click(function () {
  78. var id = $(this).attr('tag');
  79. var action = $(this).attr('id');
  80. $.ajax({
  81. data: 'id=' + id,
  82. url: '{{ _p.web_plugin }}buycourses/src/buycourses.ajax.php?a=' + action,
  83. type: 'POST',
  84. beforeSend: function () {
  85. if (action == 'renewable_info') {
  86. $('a[name=r_' + id + ']').html('<em class="fa fa-spinner fa-pulse"></em> {{ 'Loading'|get_lang }}');
  87. } else if (action == 'service_sale_info') {
  88. $('a[name=s_' + id + ']').html('<em class="fa fa-spinner fa-pulse"></em> {{ 'Loading'|get_lang }}');
  89. }
  90. },
  91. success: function (response) {
  92. $('a[name=r_' + id + ']').html('{{ 'Info'|get_lang }}');
  93. $('a[name=s_' + id + ']').html('{{ 'Info'|get_lang }}');
  94. var title = "";
  95. if (action == "renewable_info") {
  96. title = "{{ 'RecurringPaymentProfilePaypalInformation'|get_plugin_lang('BuyCoursesPlugin') }}";
  97. } else if (action == 'service_sale_info') {
  98. title = "{{ 'ServiceSaleInfo'|get_plugin_lang('BuyCoursesPlugin') }}";
  99. }
  100. bootbox.dialog({
  101. message: response,
  102. title: title,
  103. buttons: {
  104. main: {
  105. label: "{{ 'Close'|get_lang }}",
  106. className: "btn-default"
  107. }
  108. }
  109. });
  110. }
  111. })
  112. });
  113. });
  114. </script>