payout_report.html.twig 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. {% autoescape false %}
  2. {{ form }}
  3. <div class="table-responsive">
  4. <table class="table table-striped table-hover">
  5. <thead>
  6. <tr>
  7. <th class="text-center">{{ 'OrderReference'| get_plugin_lang('BuyCoursesPlugin') }}</th>
  8. <th class="text-center">{{ 'PayoutDate'| get_plugin_lang('BuyCoursesPlugin') }}</th>
  9. <th class="text-right">{{ 'Commission'| get_plugin_lang('BuyCoursesPlugin') }}</th>
  10. <th class="text-right">{{ 'Names'| get_lang }}</th>
  11. <th class="text-right">{{ 'PayPalAccount'| get_plugin_lang('BuyCoursesPlugin') }}</th>
  12. </tr>
  13. </thead>
  14. <tbody>
  15. {% for payout in payout_list %}
  16. <tr>
  17. <td class="text-center" style="vertical-align:middle"><a id="{{ payout.sale_id }}" class="saleInfo" data-toggle="modal" data-target="#saleInfo" href="#">{{ payout.reference }}</a></td>
  18. <td class="text-center" style="vertical-align:middle">{{ payout.payout_date }}</td>
  19. <td class="text-right" style="vertical-align:middle">{{ payout.currency ~ ' ' ~ payout.commission }}</td>
  20. <td class="text-right" style="vertical-align:middle">{{ payout.beneficiary }}</td>
  21. {% if payout.paypal_account %}
  22. <td class="text-right" style="vertical-align:middle">{{ payout.paypal_account }}</td>
  23. {% else %}
  24. <td class="text-right" style="vertical-align:middle">{{ 'NoPayPalAccountDetected'| get_plugin_lang('BuyCoursesPlugin') }}</td>
  25. {% endif %}
  26. </tr>
  27. {% endfor %}
  28. </tbody>
  29. </table>
  30. <div id="saleInfo" class="modal fade" role="dialog">
  31. <div class="modal-dialog modal-lg">
  32. <div class="modal-content">
  33. <div class="modal-header">
  34. <h4 class="modal-title">{{ 'SaleInfo'| get_plugin_lang('BuyCoursesPlugin') }}</h4>
  35. </div>
  36. <div class="modal-body" id="contentSale">
  37. </div>
  38. <div class="modal-footer">
  39. <button type="button" class="btn btn-default" data-dismiss="modal">{{ 'Close' | get_lang }}</button>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. <div id="reportStats" class="modal fade" role="dialog">
  45. <div class="modal-dialog">
  46. <div class="modal-content">
  47. <div class="modal-header">
  48. <h4 class="modal-title">{{ 'Stats'| get_plugin_lang('BuyCoursesPlugin') }}</h4>
  49. </div>
  50. <div class="modal-body" id="contentStats">
  51. </div>
  52. <div class="modal-footer">
  53. <button type="button" class="btn btn-default" data-dismiss="modal">{{ 'Close' | get_lang }}</button>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. <div>
  60. <button id="stats" type="button" class="btn btn-primary fa fa-line-chart" data-toggle="modal" data-target="#reportStats">
  61. {{ 'Stats'|get_plugin_lang('BuyCoursesPlugin') }}
  62. </button>
  63. </div>
  64. <script>
  65. $(document).ready(function() {
  66. $(".saleInfo").click(function() {
  67. var id = this.id;
  68. $.ajax({
  69. data: 'id='+id,
  70. url: '{{ url('legacy_plugin', {'name' :'buycourses/src/buycourses.ajax.php', 'a': 'saleInfo' }) }}',
  71. type: 'POST',
  72. success: function(response) {
  73. $("#contentSale").html(response);
  74. }
  75. });
  76. });
  77. $("#stats").click(function() {
  78. var id = this.id;
  79. $.ajax({
  80. data: 'id='+id,
  81. url: '{{ url('legacy_plugin', {'name' :'buycourses/src/buycourses.ajax.php', 'a': 'stats' }) }}',
  82. type: 'POST',
  83. success: function(response) {
  84. $("#contentStats").html(response);
  85. }
  86. });
  87. });
  88. });
  89. </script>
  90. {% endautoescape %}