sales_report.tpl 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. {{ form }}
  2. <div class="table-responsive">
  3. <table class="table table-striped table-hover">
  4. <thead>
  5. <tr>
  6. <th class="text-center">{{ 'OrderReference'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  7. <th class="text-center">{{ 'OrderStatus'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  8. <th class="text-center">{{ 'OrderDate'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  9. <th class="text-center">{{ 'PaymentMethod'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  10. <th class="text-center">{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  11. <th class="text-center">{{ 'ProductType'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  12. <th>{{ 'Name'|get_lang }}</th>
  13. <th>{{ 'UserName'|get_lang }}</th>
  14. <th class="text-center">{{ 'Options'|get_lang }}</th>
  15. </tr>
  16. </thead>
  17. <tbody>
  18. {% for sale in sale_list %}
  19. <tr {{ sale.id == selected_sale ? 'class="warning"' : '' }}>
  20. <td class="text-center">{{ sale.reference }}</td>
  21. <td class="text-center">
  22. {% if sale.status == sale_status_canceled %}
  23. {{ 'SaleStatusCanceled'|get_plugin_lang('BuyCoursesPlugin') }}
  24. {% elseif sale.status == sale_status_pending %}
  25. {{ 'SaleStatusPending'|get_plugin_lang('BuyCoursesPlugin') }}
  26. {% elseif sale.status == sale_status_completed %}
  27. {{ 'SaleStatusCompleted'|get_plugin_lang('BuyCoursesPlugin') }}
  28. {% endif %}
  29. </td>
  30. <td class="text-center">{{ sale.date }}</td>
  31. <td class="text-center">{{ sale.payment_type }}</td>
  32. <td class="text-right">{{ sale.currency ~ ' ' ~ sale.price }}</td>
  33. <td class="text-center">{{ sale.product_type }}</td>
  34. <td>{{ sale.product_name }}</td>
  35. <td>{{ sale.complete_user_name }}</td>
  36. <td class="text-center">
  37. {% if sale.status == sale_status_pending %}
  38. <a href="{{ _p.web_self ~ '?' ~ {'order': sale.id, 'action': 'confirm'}|url_encode() }}" class="btn btn-success btn-sm">
  39. <em class="fa fa-user-plus fa-fw"></em> {{ 'SubscribeUser'|get_plugin_lang('BuyCoursesPlugin') }}
  40. </a>
  41. <a href="{{ _p.web_self ~ '?' ~ {'order': sale.id, 'action': 'cancel'}|url_encode() }}" class="btn btn-danger btn-sm">
  42. <em class="fa fa-times fa-fw"></em> {{ 'DeleteOrder'|get_plugin_lang('BuyCoursesPlugin') }}
  43. </a>
  44. {% endif %}
  45. </td>
  46. </tr>
  47. {% endfor %}
  48. </tbody>
  49. </table>
  50. </div>
  51. <script>
  52. $(document).on('ready', function () {
  53. $('[name="filter_type"]').on('change', function () {
  54. var self = $(this);
  55. if (self.val() === '0') {
  56. $('#report-by-user').hide();
  57. $('#report-by-status').show();
  58. } else {
  59. $('#report-by-status').hide();
  60. $('#report-by-user').show();
  61. }
  62. });
  63. });
  64. </script>