diff --git a/app/Http/Controllers/00bugnote b/00bugnote similarity index 54% rename from app/Http/Controllers/00bugnote rename to 00bugnote index 45169ec219a49e24dae77d3ba8e79763cbc91f0d..5467f49c6698a4893889cd03d50e52fd4ce30f79 100644 --- a/app/Http/Controllers/00bugnote +++ b/00bugnote @@ -1,8 +1,9 @@ -1. Daftar mahasiswa hrs ada kelas dulu, user ttp masuk, ga bisa dpake lagi, ga terdaftar kelas jdnya (?) -2. Daftar kelas harus ada dosen dulu 3. phone & nim ga dicek validnya ? 4. registercontroller .... if($role == User::ROLE_DOSEN),, User:: hardcoded, while input depend on html kenapa ngecek valuenya di RegisterController::registerUser - klo ad yg gagl dtgh jalan ? \ No newline at end of file + klo ad yg gagl dtgh jalan ? + +Manager: + page mahasiswa overflow \ No newline at end of file diff --git a/README.md b/README.md index 92fa8490564711e78a88caf1b9ffb4fe0008138b..5df5fda4d1f2f3cf1f5ca89aa56a3ca2797266a0 100644 --- a/README.md +++ b/README.md @@ -39,23 +39,23 @@ ## Error FAQ note: There might be ( **hopefully not** ) a lot of error you need to handle 1. **Download & installing node**:<br/> - >If you need higher node and npm + If you need higher node and npm - Solution : [Manually specify & download node version](https://websiteforstudents.com/install-the-latest-node-js-and-nmp-packages-on-ubuntu-16-04-18-04-lts/) + >Solution : [Manually specify & download node version](https://websiteforstudents.com/install-the-latest-node-js-and-nmp-packages-on-ubuntu-16-04-18-04-lts/) 2. **Step 9**:<br/> - >If npm install got stuck while downloading + If npm install got stuck while downloading - Try to check your connection, try different connection, check proxy setting. Some modules have sensitive issue to proxy. + >Try to check your connection, try different connection, check proxy setting. Some modules have sensitive issue to proxy. - >If theres some warning saying some dependencies is missing (even is warning only), try to install dependencies yourself<br/> + If there's some warning saying some dependencies is missing (even is warning only), try to install dependencies yourself<br/> i.e. error containing `requires a peer of <module>@^<version> but none is installed`<br/> - Try to `sudo npm install <module>@<version>` untill all warning gone (keep it at bare minimum)<br/> + >Try to `sudo npm install <module>@<version>` until all warning gone (keep it at bare minimum)<br/> - >`error in ./resource/assets/sass/app.scss` + If `error in ./resource/assets/sass/app.scss` show up - Solution : run `sudo npm install --save-dev --unsafe-perm node-sass` + >Solution : run `sudo npm install --save-dev --unsafe-perm node-sass` diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 8de655af14a524fc098b90b1108eca8d0204537e..d87746c7899a69f481d6e65b869dbff0f9eedab3 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -105,6 +105,23 @@ class RegisterController extends Controller // return view('auth.register'); } + + + // TESTING CODE + public function registerBatchUser($batchRegisterData) + // Handle batch registration using csv --- NOT WORKING YET + { + foreach ($batchRegisterData as $newUserData) { + $this->registerUser($newUserData); + } + + // TODO: Send the pass to where ? + // return view('auth.register'); + } + + + + private function parseBatchRegisterCSV($filename) { @@ -114,11 +131,11 @@ class RegisterController extends Controller $batchRegisterData = array(); while ($entry = fgetcsv($file, 1000, ",")) { - $newUser['name'] = $entry[0]; - $newUser['username'] = $entry[1]; - $newUser['email'] = $entry[2]; - $newUser['phone'] = $entry[3]; - $newUser['role'] = $entry[4]; + $newUser['name'] = trim($entry[0]); + $newUser['username'] = trim($entry[1]); + $newUser['email'] = trim($entry[2]); + $newUser['phone'] = trim($entry[3]); + $newUser['role'] = trim($entry[4]); $newUser['password'] = str_random(20); array_push($batchRegisterData, $newUser); @@ -187,6 +204,9 @@ class RegisterController extends Controller } else if ($role == User::ROLE_MANAJER) { Manajer::create(['id' => $user->id]); } + else{ + echo $data['role']; // RAISE ERROR + } } private function errMsgUsernameExisted() diff --git a/app/Http/Controllers/TestController.php b/app/Http/Controllers/TestController.php index cb9923ae58cc8c24f27263374285a3499620a451..ab179e475b029b8cc4e9424f497f5c01f6278e52 100644 --- a/app/Http/Controllers/TestController.php +++ b/app/Http/Controllers/TestController.php @@ -35,11 +35,11 @@ class TestController extends Controller $batchRegisterData = array(); while ($entry = fgetcsv($file, 1000, ",")) { - $newUser['name'] = $entry[0]; - $newUser['username'] = $entry[1]; - $newUser['email'] = $entry[2]; - $newUser['phone'] = $entry[3]; - $newUser['role'] = $entry[4]; + $newUser['name'] = trim($entry[0]); + $newUser['username'] = trim($entry[1]); + $newUser['email'] = trim($entry[2]); + $newUser['phone'] = trim($entry[3]); + $newUser['role'] = trim($entry[4]); $newUser['password'] = str_random(20); array_push($batchRegisterData, $newUser); diff --git a/storage/batchRegister/batchRegister.csv b/storage/batchRegister/batchRegister.csv index 5fd7523972cd8ca167926dffba438a1b0ecb9ca2..48c62b8e120a8b17ba73da0093971cd50509e4ff 100644 --- a/storage/batchRegister/batchRegister.csv +++ b/storage/batchRegister/batchRegister.csv @@ -1,6 +1,6 @@ -testStud10001, ts10001, testStud10001@batchRegister.com, 081234561, Mahasiswa -testStud10002, ts10002, testStud10002@batchRegister.com, 081234561, Mahasiswa -testStud10003, ts10003, testStud10003@batchRegister.com, 081234561, Mahasiswa -testLec10001, tl10001, testLec10001@batchRegister.com, 081234561, Dosen -testLec10002, tl10002, testLec10002@batchRegister.com, 081234561, Dosen -testLec10003, tl10003, testLec10003@batchRegister.com, 081234561, Dosen \ No newline at end of file +testStud10014, ts10014, testStud10014@batchRegister.com, 081434561, Mahasiswa +testLec10014, tl10014, testLec10014@batchRegister.com, 081434561, Dosen +testStud10015, ts10015, testStud10015@batchRegister.com, 081534561, Mahasiswa +testLec10015, tl10015, testLec10015@batchRegister.com, 081534561, Dosen +testStud10016, ts10016, testStud10016@batchRegister.com, 081634561, Mahasiswa +testLec10016, tl10016, testLec10016@batchRegister.com, 081634561, Dosen