contactus-custom-list.blade.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. @extends('views.layouts.master')
  2. @section('content')
  3. @php
  4. //var_dump($contactUsCustomItems);
  5. @endphp
  6. <div class="sub inquiry_list">
  7. <div class="container">
  8. <div class="navi">
  9. <a href="/"><i class="fa-solid fa-house"></i> 홈</a> > 매매상담 > 상담내역
  10. </div>
  11. <div class="title">
  12. <h2>상담내역</h2>
  13. </div>
  14. </div>
  15. <div class="container">
  16. <ul class="list card_list">
  17. @forelse($contactUsCustomItems['Page'] ?? [] as $contactUsCustom)
  18. @php
  19. if($contactUsCustom['Pc7'] === '상담접수'){
  20. $statusClass = 'apply';
  21. $msg = '상담이 접수되었습니다.';
  22. } else {
  23. $statusClass = 'done';
  24. $msg = '완료';
  25. }
  26. @endphp
  27. <li>
  28. <a href="#" class="open-modal" data-toggle="modal" data-id="{{ $contactUsCustom['Id'] }}">
  29. <div class="info">
  30. <div class="status {{ $statusClass }}">{{ $contactUsCustom['Pc7'] }}</div>
  31. <div class="date">{{ $contactUsCustom['date'] }}</div>
  32. </div>
  33. <h4 class="ellipsis">{{ $contactUsCustom['maskedName'] }}님 상담내역</h4>
  34. @if($contactUsCustom['Pc7'] === '상담접수')
  35. <p class="ellipsis">[{{ $contactUsCustom['Pc5'] }}] {{ $contactUsCustom['Pc3'] }} 신청</p>
  36. <span>{{ $msg }}</span>
  37. @else
  38. <p class="ellipsis">[{{ $contactUsCustom['Pc5'] }}] {{ $contactUsCustom['Pc3'] }} 완료</p>
  39. @endif
  40. </a>
  41. </li>
  42. @empty
  43. <li>
  44. <td>등록된 상담내역이 존재하지 않습니다</td>
  45. </li>
  46. @endforelse
  47. <!--페이지네이션 시작 -->
  48. <div class="bottom-paginate">
  49. <div class="col-lg-12">
  50. {{ $contactUsCustomItems['Page']->appends(['limit' => request('limit'), 'sort' => request('sort')])->links() }}
  51. </div>
  52. </div>
  53. <!--// 페이지네이션 끝 -->
  54. </div>
  55. </div>
  56. <!-- Modal -->
  57. <div class="modal fade inquiry_view" id="inquiry_view_{{ $contactUsCustom['Id'] }}" tabindex="-1" role="dialog" aria-labelledby="inquiry_view" aria-hidden="true">
  58. <div class="modal-dialog modal-dialog-centered" role="document">
  59. <div class="modal-content">
  60. <div class="modal-body">
  61. <div class="info">
  62. <div class="status done"></div>
  63. <div class="date"></div>
  64. </div>
  65. <table>
  66. <tr>
  67. <th>거래구분</th>
  68. <td id="transaction_type"></td>
  69. </tr>
  70. <tr>
  71. <th>회원권명</th>
  72. <td id="membership_name"></td>
  73. </tr>
  74. <tr>
  75. <th>안내</th>
  76. <td id="message"></td>
  77. </tr>
  78. </table>
  79. </div>
  80. <div class="modal-footer">
  81. <button type="button" class="btn btn_dark" data-dismiss="modal">Close</button>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. <script>
  87. $(document).ready(function() {
  88. const contactUsCustomList = {!! json_encode($contactUsCustomList['Page']) !!}; // JavaScript에서 PHP 배열을 변환하여 변수에 할당
  89. $('.open-modal').click(function(e) {
  90. e.preventDefault();
  91. var contactUsCustomId = $(this).data('id');
  92. var contactUsCustom = contactUsCustomList.find(function(item) {
  93. return item['Id'] === contactUsCustomId;
  94. });
  95. //console.log('contactUsCustom : ', contactUsCustom);
  96. if (contactUsCustom) {
  97. var status = contactUsCustom['Pc7'] === '상담접수' ? { class: 'apply', text: '상담접수' } : { class: 'done', text: '상담완료' };
  98. $('.modal-body .info .status').removeClass('done apply').addClass(status.class).text(status.text);
  99. $('.modal-body .info .date').text(contactUsCustom['date']);
  100. $('#transaction_type').text(contactUsCustom['Pc5']);
  101. $('#membership_name').text(contactUsCustom['Pc3']);
  102. $('#message').text(contactUsCustom['Pc7'] === '상담접수' ? '상담이 접수되었습니다.' : '완료');
  103. }
  104. $("#inquiry_view_{{ $contactUsCustom['Id'] }}").modal('show');
  105. });
  106. if($('div').hasClass('chatbot') == true) {
  107. $('.main-footer').addClass('chatbot');
  108. }
  109. });
  110. </script>
  111. @endsection