diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index 748e3ec210919ef7324c9d1bbb67d671da9ef602..50d9b954f3a592cad4ab5f645dcb2ff0cc3e1dc9 100644 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -82,10 +82,10 @@ public function login(Request $request) // ดึงค่าจากตัวแปร user ชี้เข้าไปหา mem_type เพื่อใช้ค่าจาก mem_type if ($request->session()->get('mem_type') == 0) { - // User is admin (user_type = 1) + // User is admin (user_type = 0) return redirect('/Admin_home'); } else if ($request->session()->get('mem_type') == 1) { - // User is regular user (user_type = 0) + // User is regular user (user_type = 1) // return redirect('/Member_home',['name' => 'James']); // return view('mem_type', ['name' => 'James']); // return view('Member/Member_home'); diff --git a/database/migrations/2023_04_06_000001_address.php b/database/migrations/2023_04_06_000001_address.php index a0c76c8159e758bb982e91bcd51e4cad91b89b55..0bb0faa8523c1a45f1a47f4165f7dffac0b3022f 100644 --- a/database/migrations/2023_04_06_000001_address.php +++ b/database/migrations/2023_04_06_000001_address.php @@ -3,6 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use Illuminate\Support\Facades\DB; return new class extends Migration { @@ -22,6 +23,29 @@ public function up() $table->string('add_postalcode'); }); + DB::table('Address')->insert([ + [ + 'add_house_number' =>'1', + 'add_district' =>'นาเชือก', + 'add_sub_district' =>'สำโรง', + 'add_province' =>'มหาสารคาม', + 'add_postalcode' =>'44170' + ], + [ + 'add_house_number' =>'29/13', + 'add_district' =>'เมือง', + 'add_sub_district' =>'แสนสุข', + 'add_province' =>'ชลบุรี', + 'add_postalcode' =>'20130' + ], + [ + 'add_house_number' =>'26/1', + 'add_district' =>'จอมทอง', + 'add_sub_district' =>'บางขุนเทียน', + 'add_province' =>'กรุงเทพ', + 'add_postalcode' =>'10150' + ] + ]); } /** diff --git a/database/migrations/2023_04_06_033755_member.php b/database/migrations/2023_04_06_033755_member.php index 11cf3197e33471182498a0aedc3b7fb1852ad1c4..40f7ce96ce3f18981a75854e870b24deaea6eb94 100644 --- a/database/migrations/2023_04_06_033755_member.php +++ b/database/migrations/2023_04_06_033755_member.php @@ -37,16 +37,22 @@ public function up() $table->string('address_id')->nullable(); $table->timestamps(); }); + + + //mem_status 0=รออนุมัติ + // 1=อนุมัติ + // 2=ปฏิเสธ + //mem_type 0=admin + // 1=user DB::table('Member')->insert([ [ - 'mem_id_card' => '123456789', + 'mem_id_card' => '1234577981234', 'mem_prefix_th' => 'นาย', 'mem_prefix_en' => 'Mr.', - 'mem_prefix_th' => 'นาย', - 'mem_fname_th' => 'แอดมิน', - 'mem_fname_en' => 'admin', - 'mem_lname_th' => 'admin', - 'mem_lname_en' => 'admin', + 'mem_fname_th' => 'บอลซัน', + 'mem_fname_en' => 'Ballsun', + 'mem_lname_th' => 'แฮคกี้', + 'mem_lname_en' => 'hakky', 'mem_lawyer_type' => '1', 'mem_type' => '0', 'mem_status' => '1', @@ -61,17 +67,16 @@ public function up() ], [ - 'mem_id_card' => '1234567890', + 'mem_id_card' => '1234577991234', 'mem_prefix_th' => 'นาย', 'mem_prefix_en' => 'Mr.', - 'mem_prefix_th' => 'นาย', - 'mem_fname_th' => 'user', - 'mem_fname_en' => 'user', - 'mem_lname_th' => 'user', - 'mem_lname_en' => 'user', + 'mem_fname_th' => 'ซันบอล', + 'mem_fname_en' => 'sunball', + 'mem_lname_th' => 'แฮคกี้', + 'mem_lname_en' => 'hakky', 'mem_lawyer_type' => '1', - 'mem_type' => '0', - 'mem_status' => '0', + 'mem_type' => '1', + 'mem_status' => '1', 'mem_birthday' => '2023-5-1', 'mem_license' => 'aaa', 'mem_lawyer_affiliation' => 'aaaa', @@ -82,6 +87,47 @@ public function up() 'address_id' => '2' ], + [ + 'mem_id_card' => '1234578011234', + 'mem_prefix_th' => 'นาย', + 'mem_prefix_en' => 'Mr.', + 'mem_fname_th' => 'แฮคกี้', + 'mem_fname_en' => 'Hakky', + 'mem_lname_th' => 'ซันบอล', + 'mem_lname_en' => 'sunball', + 'mem_lawyer_type' => '1', + 'mem_type' => '1', + 'mem_status' => '0', + 'mem_birthday' => '2023-5-1', + 'mem_license' => 'aaa', + 'mem_lawyer_affiliation' => 'aaaa', + 'mem_lawyer_relation' => 'aaa', + 'mem_email' => 'user_1@ivsoft.com', + 'mem_phone_number' => '09999999', + 'password' => 'user', + 'address_id' => '3' + ], + [ + 'mem_id_card' => '1234578001234', + 'mem_prefix_th' => 'นาย', + 'mem_prefix_en' => 'Mr.', + 'mem_fname_th' => 'แฮคกี้', + 'mem_fname_en' => 'Hakky', + 'mem_lname_th' => 'บอลซัน', + 'mem_lname_en' => 'ballsun', + 'mem_lawyer_type' => '1', + 'mem_type' => '1', + 'mem_status' => '0', + 'mem_birthday' => '2023-5-1', + 'mem_license' => 'aaa', + 'mem_lawyer_affiliation' => 'aaaa', + 'mem_lawyer_relation' => 'aaa', + 'mem_email' => 'user_2@ivsoft.com', + 'mem_phone_number' => '09999999', + 'password' => 'user', + 'address_id' => '4' + + ], ]); } diff --git a/database/migrations/2023_04_06_075048_receipt.php b/database/migrations/2023_04_06_075048_receipt.php index 710b5298ff882c417b837545700fbbe42ee1d3a2..6903efe825183c3ab62cb1e8c72e1ad4c9919795 100644 --- a/database/migrations/2023_04_06_075048_receipt.php +++ b/database/migrations/2023_04_06_075048_receipt.php @@ -25,22 +25,25 @@ public function up() $table->integer('rec_status')->nullable(); $table->integer('mem_id')->nullable(); }); + //rec_status 0=รออนุมัติ + // 1=อนุมัติ + // 2=ปฏิเสธ DB::table('Receipt')->insert([ [ - 'rec_name' =>'user user', + 'rec_name' =>'บอลซัน แฮคกี้', 'rec_amount'=>'500', 'rec_date'=>'2023-04-09', 'rec_time'=>'15:00:00', - 'rec_img'=>'1.png', - 'rec_status'=>'2' + 'rec_img'=>'2.png', + 'rec_status'=>'0' ], [ - 'rec_name' =>'user user', + 'rec_name' =>'บอลซัน แฮคกี้', 'rec_amount'=>'500', 'rec_date'=>'2023-04-08', 'rec_time'=>'15:00:00', - 'rec_img'=>'2.png', - 'rec_status'=>'2' + 'rec_img'=>'1.png', + 'rec_status'=>'0' ], ]); }