diff --git a/app/Http/Controllers/TestSessionsController.php b/app/Http/Controllers/TestSessionsController.php index 3b01fee..f675950 100644 --- a/app/Http/Controllers/TestSessionsController.php +++ b/app/Http/Controllers/TestSessionsController.php @@ -7,6 +7,22 @@ class TestSessionsController extends Controller { + public function getScreen(Request $request) { + $data = TestSessionsModel::where('id_test_sessions', $request->id_test_sessions)->first(); + + if($data != null) { + return response()->json([ + 'status' => true, + 'screen_w' => $data->screen_w, + 'screen_h' => $data->screen_h + ]); + } else { + return response()->json([ + 'status' => false, + 'msg' => 'Data tidak ditemukan!' + ]); + } + } /** * Display a listing of the resource. */ @@ -36,6 +52,8 @@ public function store(Request $request) 'id_booking' => $request->id_booking, 'status_session' => '0', 'is_active' => '0', + 'screen_w' => $request->screen_w, + 'screen_h' => $request->screen_h ]); return redirect()->route('tutorial-tes.index')->with([ diff --git a/app/Models/TestSessionsModel.php b/app/Models/TestSessionsModel.php index d5c0cdf..6b3ec8e 100644 --- a/app/Models/TestSessionsModel.php +++ b/app/Models/TestSessionsModel.php @@ -21,6 +21,8 @@ class TestSessionsModel extends Model 'unix_start_time', 'is_active', 'unix_end_time', + 'screen_w', + 'screen_h' ]; protected $casts = [ diff --git a/database/migrations/2026_05_19_150903_add_column_in_test_sessions_table.php b/database/migrations/2026_05_19_150903_add_column_in_test_sessions_table.php new file mode 100644 index 0000000..56aeb80 --- /dev/null +++ b/database/migrations/2026_05_19_150903_add_column_in_test_sessions_table.php @@ -0,0 +1,30 @@ +char('screen_w', 20)->after('unix_end_time'); + $table->char('screen_h', 20)->after('screen_w'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('test_sessions', function (Blueprint $table) { + $table->dropColumn('screen_w'); + $table->dropColumn('screen_h'); + }); + } +}; diff --git a/resources/views/user/pages/cek_status/index.blade.php b/resources/views/user/pages/cek_status/index.blade.php index 39f667b..d9985dd 100644 --- a/resources/views/user/pages/cek_status/index.blade.php +++ b/resources/views/user/pages/cek_status/index.blade.php @@ -85,6 +85,8 @@