Ejemplo n.º 1
0
 /**
  * Run the database seeds.
  * Run at terminal:
  * $  php artisan db:seed --class=ReservationDummySeeder
  *
  * @return void
  */
 public function run()
 {
     \App\Schedule::create(['clinic_id' => 1, 'doctor_id' => 1, 'schedule_start' => '08:00:00', 'schedule_end' => '18:00:00', 'date' => date("Y-m-d", strtotime("+2 day")), 'quota' => 0, 'status_batal' => 0]);
     \App\Schedule::create(['clinic_id' => 2, 'doctor_id' => 1, 'schedule_start' => '08:00:00', 'schedule_end' => '18:00:00', 'date' => date("Y-m-d"), 'quota' => 10, 'status_batal' => 0]);
     \App\Schedule::create(['clinic_id' => 1, 'doctor_id' => 1, 'schedule_start' => '08:00:00', 'schedule_end' => '10:00:00', 'date' => date("Y-m-d", strtotime("+1 day")), 'quota' => 2, 'status_batal' => 1]);
     \App\Schedule::create(['clinic_id' => 1, 'doctor_id' => 1, 'schedule_start' => '13:00:00', 'schedule_end' => '18:00:00', 'date' => date("Y-m-d", strtotime("+1 day")), 'quota' => 5, 'status_batal' => 0]);
     \App\Clinic::create(['city_id' => 1, 'name' => 'RSU Haji', 'address' => 'Sukolilo', 'latitude' => '-7.265757', 'longitude' => '112.734146', 'telephone' => '081234567890', 'email' => '5345678']);
     \App\Clinic::create(['city_id' => 1, 'name' => 'RSAL', 'address' => 'Mayjend Sungkono', 'latitude' => '-7.265757', 'longitude' => '112.734146', 'telephone' => '081234567890', 'email' => '5345678']);
 }
Ejemplo n.º 2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //
     $data = \App\User::create(['first_name' => 'Super', 'last_name' => 'Administrator', 'gender' => 'L', 'email' => '*****@*****.**', 'password' => Hash::make('1234'), 'enabled' => '1', 'verified' => '1', 'mobile' => '0812345', 'telephone' => '0312345']);
     $data->roles()->attach(1);
     $data = \App\User::create(['first_name' => 'Joko', 'last_name' => 'Lianto', 'gender' => 'L', 'email' => '*****@*****.**', 'password' => Hash::make('1234'), 'enabled' => '1', 'verified' => '1', 'mobile' => '0812345', 'telephone' => '0312345']);
     $data->roles()->attach(3);
     $data = \App\User::create(['email' => '*****@*****.**', 'password' => Hash::make('1234'), 'enabled' => '1', 'verified' => '1', 'telephone' => '0315998314']);
     \App\Clinic::create(['user_id' => $data->id, 'city_id' => 1, 'name' => 'Medical Center ITS', 'address' => 'Kompleks Poliklinik Kampus ITS Jl. Arif Rahman Hakim Surabaya', 'latitude' => '-7.2902946', 'longitude' => '112.7928178', 'telephone' => $data->telephone, 'email' => $data->email, 'password' => $data->password]);
     $data->roles()->attach(4);
     $data = \App\User::create(['email' => '*****@*****.**', 'password' => Hash::make('1234'), 'enabled' => '1', 'verified' => '1', 'telephone' => '0315998314']);
     $doctor = \App\Doctor::create(['user_id' => $data->id, 'city_id' => 1, 'specialization_id' => '1', 'name' => 'dr. Joko Lianto', 'address' => 'Kompleks Poliklinik Kampus ITS Jl. Arif Rahman Hakim Surabaya', 'latitude' => '-7.2902946', 'longitude' => '112.7928178', 'telephone' => $data->telephone]);
     $data->roles()->attach(2);
     $doctor->clinics()->attach(1);
     \App\DoctorEducation::create(['doctor_id' => $doctor->id, 'year' => '2016', 'name' => 'S1 Teknik Informatika ITS']);
 }
Ejemplo n.º 3
0
 public function post_register(ClinicRegisterRequest $request)
 {
     $input = $request->all();
     $password = bcrypt($request->input('password'));
     $input['password'] = $password;
     $input['activation_code'] = str_random(10) . $request->input('email');
     $register = \App\User::create($input);
     $register->password = $password;
     $register->save();
     $register->roles()->attach(2);
     $clinic = \App\Clinic::create(['user_id' => $register->id, 'name' => $input['name'], 'city_id' => $input['city_id']]);
     Session::flash('success', "Jika dalam kurun waktu 24 jam Anda tidak menerima email dari kami, Anda dapat menghubungi kami melalui email di <a href='mailto:support@dokternet.com'>support@dokternet.com</a>");
     return redirect()->route('clinic.register');
 }
Ejemplo n.º 4
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     //
     $data = \App\Clinic::find($id);
     //$data->users()->detach();
     $data->delete();
     Session::flash('success', "Data berhasil dihapus");
     return redirect()->route('admin.clinic.index');
 }