index.blade.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. @extends('layouts.main')
  2. @section('content')
  3. <!-- CONTENT HEADER -->
  4. <section class="content-header">
  5. <div class="container-fluid">
  6. <div class="row mb-2">
  7. <div class="col-sm-6">
  8. <h1>Store</h1>
  9. </div>
  10. <div class="col-sm-6">
  11. <ol class="breadcrumb float-sm-right">
  12. <li class="breadcrumb-item"><a href="{{route('home')}}">Dashboard</a></li>
  13. <li class="breadcrumb-item"><a class="text-muted"
  14. href="{{route('admin.store.index')}}">Store</a></li>
  15. </ol>
  16. </div>
  17. </div>
  18. </div>
  19. </section>
  20. <!-- END CONTENT HEADER -->
  21. <!-- MAIN CONTENT -->
  22. <section class="content">
  23. <div class="container-fluid">
  24. <div class="row">
  25. <div class="col-lg-4">
  26. @if($isPaypalSetup == false)
  27. <div class="callout callout-danger">
  28. <h4>Paypal is not configured.</h4>
  29. <p>To configure PayPal, head to the .env and add your PayPal’s client id and secret.</p>
  30. </div>
  31. @endif
  32. </div>
  33. </div>
  34. <div class="card">
  35. <div class="card-header">
  36. <div class="d-flex justify-content-between">
  37. <h5 class="card-title"><i class="fas fa-sliders-h mr-2"></i>Store</h5>
  38. <a href="{{route('admin.store.create')}}" class="btn btn-sm btn-primary"><i
  39. class="fas fa-plus mr-1"></i>Create new</a>
  40. </div>
  41. </div>
  42. <div class="card-body table-responsive">
  43. <table id="datatable" class="table table-striped">
  44. <thead>
  45. <tr>
  46. <th>Active</th>
  47. <th>Type</th>
  48. <th>Price</th>
  49. <th>Display</th>
  50. <th>Description</th>
  51. <th>Created at</th>
  52. <th></th>
  53. </tr>
  54. </thead>
  55. <tbody>
  56. </tbody>
  57. </table>
  58. </div>
  59. </div>
  60. </div>
  61. <!-- END CUSTOM CONTENT -->
  62. </section>
  63. <!-- END CONTENT -->
  64. <script>
  65. function submitResult() {
  66. return confirm("Are you sure you wish to delete?") !== false;
  67. }
  68. document.addEventListener("DOMContentLoaded", function () {
  69. $('#datatable').DataTable({
  70. processing: true,
  71. serverSide: true,
  72. stateSave: true,
  73. ajax: "{{route('admin.store.datatable')}}",
  74. order: [[ 2, "desc" ]],
  75. columns: [
  76. {data: 'disabled'},
  77. {data: 'type'},
  78. {data: 'price'},
  79. {data: 'display'},
  80. {data: 'description'},
  81. {data: 'created_at'},
  82. {data: 'actions', sortable: false},
  83. ],
  84. fnDrawCallback: function( oSettings ) {
  85. $('[data-toggle="popover"]').popover();
  86. }
  87. });
  88. });
  89. </script>
  90. @endsection