service_sales_report.html.twig 4.6 KB

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