14
14
</div >
15
15
</div >
16
16
</div >
17
- </x-app-layout >
18
-
17
+
18
+ <!-- جدول دروس و نمرات -->
19
+ <div class =" max-w-7xl mx-auto sm:px-6 lg:px-8 mt-8" >
20
+ <div class =" bg-white overflow-hidden shadow-sm sm:rounded-lg flex justify-end" >
21
+ <div class =" p-6 text-gray-900" >
22
+ <table class =" min-w-full divide-y divide-gray-200 mt-4" >
23
+ <thead >
24
+ <tr >
25
+ <th
26
+ class =" px-6 py-3 bg-gray-50 text-right text-xs font-medium text-gray-500 uppercase tracking-wider" >
27
+ اعتراض</th >
28
+ <th
29
+ class =" px-6 py-3 bg-gray-50 text-right text-xs font-medium text-gray-500 uppercase tracking-wider" >
30
+ نمره</th >
31
+ <th
32
+ class =" px-6 py-3 bg-gray-50 text-right text-xs font-medium text-gray-500 uppercase tracking-wider" >
33
+ درس</th >
34
+
35
+ </tr >
36
+ </thead >
37
+ <tbody >
38
+ @php
39
+ $courses = [' صدا در چند رسانه ای' , ' کاربرد های وب' , ' گرافیک متحرک' , ' تجزیه تحلیل' , ' هوش مصنوعی' , ' تصویر برداری' ];
40
+ $grades = [18 , 15 , 16 , 19 , 12 , 17 ];
41
+ @endphp
42
+ @foreach ($courses as $index => $course )
43
+ <tr class =" bg-white divide-y divide-gray-200" >
44
+ <td class =" px-6 py-4 whitespace-nowrap text-right" >
45
+ <button class =" bg-blue-500 hover:bg-blue-700 text-black font-bold py-2 px-4 rounded"
46
+ onclick =" openObjectionModal('{{ $course } } ')" >ثبت اعتراض</button >
47
+ </td >
48
+ <td class =" px-6 py-4 whitespace-nowrap text-right" >
49
+ <input type =" text" value =" {{ $grades [$index ] } }" readonly
50
+ class =" border-none bg-transparent rounded-full text-gray-500" >
51
+ </td >
52
+ <td class =" px-6 py-4 whitespace-nowrap text-right" >{{ $course } } </td >
53
+
54
+
55
+ </tr >
56
+ @endforeach
57
+ </tbody >
58
+ </table >
59
+ </div >
60
+ </div >
61
+ </div >
62
+ </div >
63
+
64
+ <!-- پاپآپ اعتراض -->
65
+ <div id =" objectionModal" class =" fixed z-10 inset-0 overflow-y-auto hidden flex justify-center items-center" >
66
+ <div class =" fixed inset-0 transition-opacity" >
67
+ <div class =" absolute inset-0 bg-gray-500 opacity-75" ></div >
68
+ </div >
69
+ <div class =" bg-white rounded-lg shadow-xl transform transition-all sm:max-w-lg w-full p-6" >
70
+ <h3 class =" text-lg leading-6 font-medium text-gray-900 mb-4" id =" modal-title" >ثبت اعتراض</h3 >
71
+ <textarea id =" objection_text" rows =" 4" class =" form-input mt-2 block w-full"
72
+ placeholder =" اعتراض خود را وارد کنید..." ></textarea >
73
+ <div class =" mt-4 flex justify-end space-x-2" >
74
+ <button onclick =" submitObjection()"
75
+ class =" inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-green-500 text-base font-semibold text-green hover:bg-green-600 focus:outline-none sm:w-auto sm:text-sm" >ثبت</button >
76
+ <button onclick =" closeObjectionModal()"
77
+ class =" inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none sm:w-auto sm:text-sm" >لغو</button >
78
+ </div >
79
+ </div >
80
+ </div >
81
+ <script >
82
+ function openObjectionModal (course ) {
83
+ document .getElementById (" objectionModal" ).classList .remove (" hidden" );
84
+ document .getElementById (" modal-title" ).innerText = ` ثبت اعتراض برای ${ course} ` ;
85
+ }
86
+
87
+ function closeObjectionModal () {
88
+ document .getElementById (" objectionModal" ).classList .add (" hidden" );
89
+ }
90
+
91
+ function submitObjection () {
92
+ closeObjectionModal ();
93
+ alert (" اعتراض شما با موفقیت ثبت شد" );
94
+ }
95
+ </script >
96
+ </x-app-layout >
0 commit comments