Md.Mostafijur Rahman 1 year ago
parent
commit
b7e8ce0fbf

+ 7 - 6
app/Http/Controllers/TeacherHomeController.php

@@ -40,12 +40,13 @@ class TeacherHomeController extends Controller
     }
 
     public function student_proposal_details($hash){
+
         $user = Auth::guard('teacher')->user();
         $hashids=new \Hashids\Hashids('application', 25);
         $hash_ids=$hashids->decode($hash);
         if(empty($hash_ids[0])) abort(404);
-         
-        $proposal_details = StudentProposal::find($hash_ids);
+
+        $proposal_details = StudentProposal::find($hash_ids[0]);
         $education_history =Institution::where(
             'student_id',$proposal_details->student_id
         )->orderBy('id','desc')->get();
@@ -95,14 +96,14 @@ class TeacherHomeController extends Controller
         }
 
         if($request->submitted_date){
-            $date_array = explode("to",$request->submitted_date); 
+            $date_array = explode("to",$request->submitted_date);
 
             $from_date = date('d-m-Y', strtotime($date_array[0]));
-            $to_date = date('d-m-Y', strtotime($date_array[1])); 
+            $to_date = date('d-m-Y', strtotime($date_array[1]));
 
             $start_date=$carbon->parse($from_date)->toDateString();
             $end_date=$carbon->parse($to_date)->toDateString();
-             
+
 
             $students->whereRaw("DATE(submitted_date) >= ? AND DATE(submitted_date) <= ?", [$start_date, $end_date]);
         }
@@ -112,7 +113,7 @@ class TeacherHomeController extends Controller
 
             $from_month_year = date('m-Y', strtotime($date_array[0])); //01-06-2023
             $to_month_year = date('m-Y', strtotime($date_array[1]));//31-07-2023
-            
+
             $start_date=$carbon->parse('01-'.$from_month_year)->toDateString();
             $end_date=$carbon->parse('01-'.$to_month_year)->toDateString();
 

+ 12 - 9
resources/views/teacher/load_application.blade.php

@@ -70,27 +70,30 @@
                                 </span>
                             </div>
                         </td>
-                        <td style="font-size: 11px; text-align:center;"> 
+                        <td style="font-size: 11px; text-align:center;">
                             <div style="font-size: 11px; display:block;">
                                 <div style="font-size: 11px; color: black;"> Pu :
-                                    @if($row->student_details->is_publication==1) 
+                                    @if($row->student_details->is_publication==1)
                                         <span class="label_badge_work"> yes</span>
                                     @else
                                         <span class="label_badge_no"> No</span>
                                     @endif
                                 </div>
                                 <div class="mt-1" style="font-size: 11px; color: black;"> Con :
-                                    @if($row->student_details->is_attended_conference==1) 
+                                    @if($row->student_details->is_attended_conference==1)
                                         <span class="label_badge_work"> yes</span>
                                     @else
                                         <span class="label_badge_no"> No</span>
                                     @endif
-                                </div>  
+                                </div>
                             </div>
                         </td>
                         <td style="font-size: 11px;">
+                            @php
+                                $hashids = new \Hashids\Hashids('application', 25);
+                            @endphp
                             <div class="inner_right">
-                                <a href="{{ url('supervisor/applications') }}/{{$row->id}}"><strong style="font-size:11px; color:black;">{{cn($row,'proposal.title','')}}</strong></a></br>
+                                <a href="{{ url('supervisor/application/'.$hashids->encode($row->id)) }}"><strong style="font-size:11px; color:black;">{{cn($row,'proposal.title','')}}</strong></a></br>
                                 <span style="color:black;">{{cn($row,'proposal.methology','')}}</span>
                                 @php
                                     $proposal =\DB::table('proposal')->where(
@@ -101,12 +104,12 @@
                                         $department =\DB::table('departments')->where(
                                             'id',$proposal->department
                                         )->first();
-                                    } 
+                                    }
                                 @endphp
                                 @if(isset($department))
                                 <span>.</span>
-                                <span style="color:black;"> 
-                                    {{ $department->name }} 
+                                <span style="color:black;">
+                                    {{ $department->name }}
                                 </span>
                                 @endif
                                 <span>.</span>
@@ -134,7 +137,7 @@
 
                                 @if($row->proposal_status_date)
                                     <br>
-                                    <span style="font-size:11px; font-weight: bold;"> 
+                                    <span style="font-size:11px; font-weight: bold;">
                                     {{utc_to_ltz($row->proposal_status_date, 'd M Y g:i A', local_tz($user))}}
                                 </span>
 

+ 2 - 2
routes/web.php

@@ -98,7 +98,7 @@ Route::post('teacher-logout', [App\Http\Controllers\TeacherAuth\LoginController:
 
 Route::group(['middleware' => ['teacher']], function() {
     Route::get('/teacher_profile', [App\Http\Controllers\TeacherHomeController::class,'teacher_profile'])->name('teacher_profile');
-    Route::get('supervisor/student-proposal-details/{hash}', [App\Http\Controllers\TeacherHomeController::class,'student_proposal_details']);
+    Route::get('supervisor/application/{hash}', [App\Http\Controllers\TeacherHomeController::class,'student_proposal_details']);
     Route::get('teacher_profile/application/search', [App\Http\Controllers\TeacherHomeController::class,'search']);
 
 
@@ -141,7 +141,7 @@ Route::get(
     'sub-content/{name}', [App\Http\Controllers\Admin\SubContentController::class, 'get']
 )->name('sub-content');
 
- 
+