sales_report.tpl 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <link rel="stylesheet" type="text/css" href="../resources/css/style.css"/>
  2. <ul class="nav nav-tabs buy-courses-sessions-tabs" role="tablist">
  3. <li id="buy-courses-sessions-tab" class="active" role="presentation">
  4. <a href="sales_report.php" aria-controls="buy-courses_sessions" role="tab">{{ 'CourseSessionBlock'|get_lang }}</a>
  5. </li>
  6. {% if services_are_included %}
  7. <li id="buy-services-tab" class="{{ showing_services ? '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. {% endif %}
  11. </ul>
  12. </br>
  13. </br>
  14. {{ form }}
  15. <div class="table-responsive">
  16. <table class="table table-striped table-hover">
  17. <thead>
  18. <tr>
  19. <th class="text-center">{{ 'OrderReference'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  20. <th class="text-center">{{ 'OrderStatus'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  21. <th class="text-center">{{ 'OrderDate'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  22. <th class="text-center">{{ 'PaymentMethod'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  23. <th class="text-center">{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  24. <th class="text-center">{{ 'ProductType'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  25. <th>{{ 'Name'|get_lang }}</th>
  26. <th>{{ 'UserName'|get_lang }}</th>
  27. <th class="text-center">{{ 'Options'|get_lang }}</th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. {% for sale in sale_list %}
  32. <tr {{ sale.id == selected_sale ? 'class="warning"' : '' }}>
  33. <td class="text-center">{{ sale.reference }}</td>
  34. <td class="text-center">
  35. {% if sale.status == sale_status_canceled %}
  36. {{ 'SaleStatusCanceled'|get_plugin_lang('BuyCoursesPlugin') }}
  37. {% elseif sale.status == sale_status_pending %}
  38. {{ 'SaleStatusPending'|get_plugin_lang('BuyCoursesPlugin') }}
  39. {% elseif sale.status == sale_status_completed %}
  40. {{ 'SaleStatusCompleted'|get_plugin_lang('BuyCoursesPlugin') }}
  41. {% endif %}
  42. </td>
  43. <td class="text-center">{{ sale.date }}</td>
  44. <td class="text-center">{{ sale.payment_type }}</td>
  45. <td class="text-right">{{ sale.currency ~ ' ' ~ sale.price }}</td>
  46. <td class="text-center">{{ sale.product_type }}</td>
  47. <td>{{ sale.product_name }}</td>
  48. <td>{{ sale.complete_user_name }}</td>
  49. <td class="text-center">
  50. {% if sale.status == sale_status_pending %}
  51. <a href="{{ _p.web_self ~ '?' ~ {'order': sale.id, 'action': 'confirm'}|url_encode() }}" class="btn btn-success btn-sm">
  52. <em class="fa fa-user-plus fa-fw"></em> {{ 'SubscribeUser'|get_plugin_lang('BuyCoursesPlugin') }}
  53. </a>
  54. <a href="{{ _p.web_self ~ '?' ~ {'order': sale.id, 'action': 'cancel'}|url_encode() }}" class="btn btn-danger btn-sm">
  55. <em class="fa fa-times fa-fw"></em> {{ 'DeleteOrder'|get_plugin_lang('BuyCoursesPlugin') }}
  56. </a>
  57. {% endif %}
  58. </td>
  59. </tr>
  60. {% endfor %}
  61. </tbody>
  62. </table>
  63. </div>
  64. <script>
  65. $(document).on('ready', function () {
  66. $('[name="filter_type"]').on('change', function () {
  67. var self = $(this);
  68. if (self.val() === '0') {
  69. $('#report-by-user').hide();
  70. $('#report-by-status').show();
  71. } else {
  72. $('#report-by-status').hide();
  73. $('#report-by-user').show();
  74. }
  75. });
  76. });
  77. </script>