Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. @extends('layouts.app')
  2. @section('title','Promotion')
  3. @section('content')
  4.  
  5. <h1>Promotion</h1>
  6. <div class="container">
  7. @if (session('delete'))
  8. <div class="alert alert-success">
  9. <p>{{ "Promotion ".session('delete')." has deleted." }}</p>
  10. </div>
  11. @elseif(session('fail'))
  12. <div class="alert alert-success">
  13. <p>{{ "fail :".session('fail') }}</p>
  14. </div>
  15. @elseif(session('success'))
  16. <div class="alert alert-success">
  17. <p>{{ session('success') }}</p>
  18. </div>
  19. @endif
  20.  
  21. @if (session('code'))
  22. <div class="alert alert-success">
  23. <p>{{ "Your code is ".session('code') }}</p>
  24. </div>
  25. @endif
  26.  
  27.  
  28. @if (auth()->user()->isAdmin())
  29. <a class="btn btn-success pull-right" href="/promotion/add">Add</a>
  30. @endif
  31. <table class="table table-striped table-dark">
  32. <thead>
  33. <tr>
  34. <th scope="col">Name</th>
  35. <th scope="col">description</th>
  36. <th scope="col">number</th>
  37. <th scope="col">Min Money</th>
  38. <th scope="col">Percent</th>
  39. <th scope="col">Discount</th>
  40. <th scope="col">Point</th>
  41. <th scope="col">Picture</th>
  42. @if (auth()->user()->isAdmin())
  43. <th scope="col">Edit</th>
  44. <th scope="col">Delete</th>
  45. @else
  46. <th scope="col">Buy</th>
  47. @endif
  48.  
  49. </tr>
  50. </thead>
  51. <tbody>
  52. @foreach($promotion as $row)
  53. @if($row['now_number'] !== $row['number'])
  54. <tr>
  55. <th scope="row">{{$row['name']}}</th>
  56. <td>{{$row['description']}}</td>
  57. <td>{{$row['now_number']."/".$row['number']}}</td>
  58. <td>{{$row['min_money']}}</td>
  59. <td>{{$row['percent']}}</td>
  60. <td>{{$row['discount']}}</td>
  61. <td>{{$row['point']}}</td>
  62. <td>
  63. <img src="{{ url( 'picture/promotion/'.$row['picture'] ) }}" class="img-rounded " alt="{{$row['picture']}}" width="100px">
  64. </td>
  65. @if (auth()->user()->isAdmin())
  66. <td>
  67. <a class="btn btn-warning" href="{{ url( 'promotion/edit' , $row['id'] ) }}">Edit</a>
  68. </td>
  69. <td>
  70. <a class="btn btn-danger" href="{{ url( 'promotion/delete' , $row['id'] ) }}">Delete</a>
  71. </td>
  72. @else
  73. <td>
  74. <a class="btn btn-success" href="{{ url( 'coupon/store' ,$row['id'] ) }}">Buy</a>
  75. </td>
  76. @endif
  77. </tr>
  78. @endif
  79. @endforeach
  80. </tbody>
  81. </table>
  82. </div>
  83.  
  84. @endsection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement