index.blade.php 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. @extends('layouts.main')
  2. <?php use App\Models\CreditProduct; ?>
  3. @section('content')
  4. <!-- CONTENT HEADER -->
  5. <section class="content-header">
  6. <div class="container-fluid">
  7. <div class="row mb-2">
  8. <div class="col-sm-6">
  9. <h1>Store</h1>
  10. </div>
  11. <div class="col-sm-6">
  12. <ol class="breadcrumb float-sm-right">
  13. <li class="breadcrumb-item"><a class="" href="{{ route('home') }}">Dashboard</a></li>
  14. <li class="breadcrumb-item"><a class="text-muted" href="{{ route('store.index') }}">Store</a>
  15. </li>
  16. </ol>
  17. </div>
  18. </div>
  19. </div>
  20. </section>
  21. <!-- END CONTENT HEADER -->
  22. <!-- MAIN CONTENT -->
  23. <section class="content">
  24. <div class="container-fluid">
  25. <div class="text-right mb-3">
  26. <button type="button" data-toggle="modal" data-target="#redeemVoucherModal" class="btn btn-primary">
  27. <i class="fas fa-money-check-alt mr-2"></i>Redeem code
  28. </button>
  29. </div>
  30. @if ($isPaypalSetup && $products->count() > 0)
  31. <div class="card">
  32. <div class="card-header">
  33. <h5 class="card-title"><i class="fa fa-coins mr-2"></i>{{ CREDITS_DISPLAY_NAME }}</h5>
  34. </div>
  35. <div class="card-body">
  36. <table class="table table-striped table-responsive-sm">
  37. <thead>
  38. <tr>
  39. <th>Price</th>
  40. <th>Type</th>
  41. <th>Description</th>
  42. <th></th>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. <?php /** @var $product CreditProduct */
  47. ?>
  48. @foreach ($products as $product)
  49. <tr>
  50. <td>{{ $product->formatToCurrency($product->price) }}</td>
  51. <td>{{ strtolower($product->type) == 'credits' ? CREDITS_DISPLAY_NAME : $product->type }}
  52. </td>
  53. <td><i class="fa fa-coins mr-2"></i>{{ $product->display }}</td>
  54. <td><a href="{{ route('checkout', $product->id) }}"
  55. class="btn btn-info">Purchase</a>
  56. </td>
  57. </tr>
  58. @endforeach
  59. </tbody>
  60. </table>
  61. </div>
  62. </div>
  63. @else
  64. <div class="alert alert-danger alert-dismissible">
  65. <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
  66. <h4><i class="icon fa fa-ban"></i> @if ($products->count() == 0) There are no store products! @else The store is not correctly configured! @endif
  67. </h4>
  68. </div>
  69. @endif
  70. </div>
  71. </section>
  72. <!-- END CONTENT -->
  73. @endsection