sales_report.tpl 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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"
  5. role="tab">{{ 'CourseSessionBlock'|get_lang }}</a>
  6. </li>
  7. {% if services_are_included %}
  8. <li id="buy-services-tab" class="{{ showing_services ? '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. {% endif %}
  13. </ul>
  14. <br />
  15. <br />
  16. {{ form }}
  17. <div class="table-responsive">
  18. <table class="table table-striped table-hover">
  19. <thead>
  20. <tr>
  21. <th class="text-center">{{ 'OrderReference'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  22. <th class="text-center">{{ 'OrderStatus'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  23. <th class="text-center">{{ 'OrderDate'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  24. <th class="text-center">{{ 'PaymentMethod'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  25. <th class="text-center">{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  26. <th class="text-center">{{ 'ProductType'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  27. <th>{{ 'Name'|get_lang }}</th>
  28. <th>{{ 'UserName'|get_lang }}</th>
  29. {% if invoicing_enable %}
  30. <th class="text-center">{{ 'Invoice'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  31. {% endif %}
  32. <th class="text-center">{{ 'Options'|get_lang }}</th>
  33. </tr>
  34. </thead>
  35. <tbody>
  36. {% for sale in sale_list %}
  37. <tr {{ sale.id == selected_sale ? 'class="warning"' : '' }}>
  38. <td class="text-center">{{ sale.reference }}</td>
  39. <td class="text-center">
  40. {% if sale.status == sale_status_canceled %}
  41. {{ 'SaleStatusCanceled'|get_plugin_lang('BuyCoursesPlugin') }}
  42. {% elseif sale.status == sale_status_pending %}
  43. {{ 'SaleStatusPending'|get_plugin_lang('BuyCoursesPlugin') }}
  44. {% elseif sale.status == sale_status_completed %}
  45. {{ 'SaleStatusCompleted'|get_plugin_lang('BuyCoursesPlugin') }}
  46. {% endif %}
  47. </td>
  48. <td class="text-center">{{ sale.date | api_get_local_time }}</td>
  49. <td class="text-center">{{ sale.payment_type }}</td>
  50. <td class="text-right">{{ sale.total_price }}</td>
  51. <td class="text-center">{{ sale.product_type }}</td>
  52. <td>{{ sale.product_name }}</td>
  53. <td>{{ sale.complete_user_name }}</td>
  54. {% if invoicing_enable %}
  55. <td class="text-center">
  56. {% if sale.invoice == 1 %}
  57. <a href="{{ _p.web_plugin ~ 'buycourses/src/invoice.php?' ~ {'invoice': sale.id, 'is_service': 0}|url_encode() }}" title="{{ 'InvoiceView'|get_plugin_lang('BuyCoursesPlugin') }}" >
  58. <img src="{{ _p.web_img }}/icons/32/default.png" alt="{{ 'InvoiceView'|get_plugin_lang('BuyCoursesPlugin') }}" />
  59. <br/>{{ sale.num_invoice }}
  60. </a>
  61. {% endif %}
  62. </td>
  63. {% endif %}
  64. <td class="text-center">
  65. {% if sale.status == sale_status_pending %}
  66. <a href="{{ _p.web_self ~ '?' ~ {'order': sale.id, 'action': 'confirm'}|url_encode() }}"
  67. class="btn btn-success btn-sm">
  68. <em class="fa fa-user-plus fa-fw"></em> {{ 'SubscribeUser'|get_plugin_lang('BuyCoursesPlugin') }}
  69. </a>
  70. <a href="{{ _p.web_self ~ '?' ~ {'order': sale.id, 'action': 'cancel'}|url_encode() }}"
  71. class="btn btn-danger btn-sm">
  72. <em class="fa fa-times fa-fw"></em> {{ 'DeleteOrder'|get_plugin_lang('BuyCoursesPlugin') }}
  73. </a>
  74. {% endif %}
  75. </td>
  76. </tr>
  77. {% endfor %}
  78. </tbody>
  79. </table>
  80. </div>
  81. <script>
  82. $(function () {
  83. $('[name="filter_type"]').on('change', function () {
  84. var self = $(this);
  85. if (self.val() === '0') {
  86. $('#report-by-user').hide();
  87. $('#report-by-status').show();
  88. } else {
  89. $('#report-by-status').hide();
  90. $('#report-by-user').show();
  91. }
  92. });
  93. });
  94. </script>