ticket_notification.blade.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <div class="single_radius_item" style="@if($notification->read_at == null) background: #f5f4fd; @else background: #fff; @endif">
  2. <i class="fa fa-ticket"></i>
  3. @if(Auth::guard('agent')->user())
  4. <span>
  5. <a href="{{url('/agent/token-details',$notification['data']['ticket']['id'])}}" onclick="markAsRead('{{$notification->id}}');" class="link_hover">
  6. Token:
  7. @if($notification['data']['action_type'] =='Open')
  8. #{{$notification['data']['ticket']['ticket_number']}}
  9. @endif
  10. @if($notification['data']['action_type'] =='Start')
  11. #{{$notification['data']['ticket']['ticket_number']}}
  12. @endif
  13. @if($notification['data']['action_type'] =='Finish')
  14. #{{$notification['data']['ticket']['ticket_number']}}
  15. @endif
  16. @if($notification['data']['action_type'] =='Close')
  17. #{{$notification['data']['ticket']['ticket_number']}}
  18. @endif
  19. @if($notification['data']['action_type']=='Reopen')
  20. #{{$notification['data']['ticket']['ticket_number']}}
  21. @endif
  22. @if($notification['data']['action_type']=="Comment")
  23. #{{$notification['data']['ticket']['ticket_number']}}
  24. @endif
  25. </a>
  26. <br>
  27. @if($notification['data']['action_type'] =='Open')
  28. Your token has been created by SAMS GLOBAL.
  29. @endif
  30. @if($notification['data']['action_type'] =='Start')
  31. Your token has started.
  32. @endif
  33. @if($notification['data']['action_type'] =='Finish')
  34. Your token has fixed.
  35. @endif
  36. @if($notification['data']['action_type'] =='Close')
  37. Your token has close.
  38. @endif
  39. @if($notification['data']['action_type']=='Reopen')
  40. Your token has reopen.
  41. @endif
  42. @if($notification['data']['action_type']=="Comment")
  43. A comment in this token.
  44. @endif
  45. <br>
  46. <small>{{ date('d M Y',strtotime($notification->created_at)) }}, {{ date('H:i A',strtotime($notification->created_at)) }}</small>
  47. </span>
  48. @elseif(Auth::guard('franchise')->user())
  49. <span>
  50. <a href="{{url('/franchise/token-details',$notification['data']['ticket']['id'])}}" onclick="markAsRead('{{$notification->id}}');" class="link_hover">
  51. Token:
  52. @if($notification['data']['action_type'] =='Start')
  53. #{{$notification['data']['ticket']['ticket_number']}}
  54. @endif
  55. @if($notification['data']['action_type'] =='Finish')
  56. #{{$notification['data']['ticket']['ticket_number']}}
  57. @endif
  58. @if($notification['data']['action_type'] =='Close')
  59. #{{$notification['data']['ticket']['ticket_number']}}
  60. @endif
  61. @if($notification['data']['action_type']=='Reopen')
  62. #{{$notification['data']['ticket']['ticket_number']}}
  63. @endif
  64. @if($notification['data']['action_type']=="Comment")
  65. #{{$notification['data']['ticket']['ticket_number']}}
  66. @endif
  67. </a>
  68. <br>
  69. @if($notification['data']['action_type'] =='Start')
  70. Your token has started.
  71. @endif
  72. @if($notification['data']['action_type'] =='Finish')
  73. Your token has fixed.
  74. @endif
  75. @if($notification['data']['action_type'] =='Close')
  76. Your token has close.
  77. @endif
  78. @if($notification['data']['action_type']=='Reopen')
  79. Your token has reopen.
  80. @endif
  81. @if($notification['data']['action_type']=="Comment")
  82. A comment in this token.
  83. @endif
  84. <br>
  85. <small>{{ date('d M Y',strtotime($notification->created_at)) }}, {{ date('H:i A',strtotime($notification->created_at)) }}</small>
  86. </span>
  87. @elseif(Auth::guard('admin')->user())
  88. <span>
  89. <a href="{{url('/admin/manage-tickets/ticket-details',$notification['data']['ticket']['id'])}}" onclick="markAsRead('{{$notification->id}}');" class="link_hover">
  90. Token: #{{$notification['data']['ticket']['ticket_number']}}
  91. </a>
  92. <br>
  93. @if($notification['data']['action_type'] =='Open' && $notification['data']['ticket']['creator_franchise_id'] !='')
  94. @php
  95. $company_name = model('Company')::where('id',$notification['data']['ticket']['company_id'])->select('name')->first();
  96. @endphp
  97. @if($company_name)
  98. <b>{{ $notification['data']['addedBy']['name'] }}</b> created this token for {{ $company_name['name'] }}.
  99. @endif
  100. @elseif($notification['data']['action_type'] =='Open')
  101. @php
  102. $company_name = model('Company')::where('id',$notification['data']['ticket']['company_id'])->select('name')->first();
  103. @endphp
  104. @if($company_name)
  105. <b>{{ $notification['data']['addedBy']['name'] }}</b> from {{ $company_name['name'] }} has been created this token.</b>
  106. @else
  107. <b>{{ $notification['data']['addedBy']['name'] }}</b> has been created this token.
  108. @endif
  109. @endif
  110. @if($notification['data']['action_type'] =='Assigned')
  111. <b>{{ $notification['data']['addedBy']['name'] }}</b> assigned you in this token.</b>
  112. @endif
  113. @if($notification['data']['action_type'] =='Start')
  114. <b>{{ $notification['data']['addedBy']['name'] }}</b> started this token.</b>
  115. @endif
  116. @if($notification['data']['action_type'] =='Finish')
  117. <b>{{ $notification['data']['addedBy']['name'] }}</b> fixed this token.</b>
  118. @endif
  119. @if($notification['data']['action_type'] =='Close')
  120. <b>{{ $notification['data']['addedBy']['name'] }}</b> closed this token.</b>
  121. @endif
  122. @if($notification['data']['action_type']=="Reopen")
  123. <b>{{ $notification['data']['addedBy']['name'] }}</b> reopened this token.</b>
  124. @endif
  125. @if($notification['data']['action_type']=="Comment")
  126. <b>{{ $notification['data']['addedBy']['name'] }}</b> commented on this token.</b>
  127. @endif
  128. <br>
  129. <small>{{ date('d M Y',strtotime($notification->created_at)) }}, {{ date('H:i A',strtotime($notification->created_at)) }}</small>
  130. </span>
  131. @endif
  132. </div>
  133. <script type="text/javascript">
  134. function markAsRead(id) {
  135. $.post('{{url('')}}/agent/notification/mark-as-read', {'_token': '{{ csrf_token() }}','id': id}, function (data) {
  136. data.success ? (window.location.href = targetHref) : false;
  137. }, 'json');
  138. return false;
  139. }
  140. function markAdminAsRead(id) {
  141. $.post('{{url('')}}/admin/notification/mark-as-read', {'_token': '{{ csrf_token() }}','id': id}, function (data) {
  142. data.success ? (window.location.href = targetHref) : false;
  143. }, 'json');
  144. return false;
  145. }
  146. </script>