/**
  * Post accountcheck
  * checking prerequisites
  * @param type InstallerRequest $request 
  * @return type view
  */
 public function accountcheck(InstallerRequest $request)
 {
     // migrate database
     Artisan::call('migrate', array('--force' => true));
     Artisan::call('db:seed', array('--force' => true));
     // create user
     $firstname = $request->input('firstname');
     $lastname = $request->input('Lastname');
     $email = $request->input('email');
     $username = $request->input('username');
     $password = $request->input('password');
     $language = $request->input('language');
     $timezone = $request->input('timezone');
     $date = $request->input('date');
     $datetime = $request->input('datetime');
     // $system = System::where('id','=','1')->first();
     // $system->time_zone = $timezone;
     // $system->date_time_format = $datetime;
     // $system->save();
     // creating an user
     $user = User::create(array('first_name' => $firstname, 'last_name' => $lastname, 'email' => $email, 'user_name' => $username, 'password' => Hash::make($password), 'assign_group' => 1, 'primary_dpt' => 1, 'active' => 1, 'role' => 'admin'));
     // checking if the user have been created
     if ($user) {
         Session::put('step6', 'step6');
         return Redirect::route('final');
     }
 }
 /**
  * Post accountcheck
  * checking prerequisites
  * @param type InstallerRequest $request 
  * @return type view
  */
 public function accountcheck(InstallerRequest $request)
 {
     // migrate database
     Artisan::call('migrate', array('--force' => true));
     Artisan::call('db:seed', array('--force' => true));
     // create user
     $firstname = $request->input('firstname');
     $lastname = $request->input('Lastname');
     $email = $request->input('email');
     $username = $request->input('username');
     $password = $request->input('password');
     $language = $request->input('language');
     $timezone = $request->input('timezone');
     $date = $request->input('date');
     $datetime = $request->input('datetime');
     // $system = System::where('id','=','1')->first();
     // $system->time_zone = $timezone;
     // $system->date_time_format = $datetime;
     // $system->save();
     // checking requested timezone for the admin and system
     $timezones = Timezones::where('name', '=', $timezone)->first();
     if ($timezones->id == null) {
         return ['response' => 'fail', 'reason' => 'Invalid time-zone', 'status' => '0'];
     }
     // var_dump($datetime);
     // checking requested date time format for the admin and system
     $date_time_format = Date_time_format::where('format', '=', $datetime)->first();
     // dd($date_time_format);
     if ($date_time_format->id == null) {
         return ['response' => 'fail', 'reason' => 'invalid date-time format', 'status' => '0'];
     }
     // Creating minum settings for system
     $system = new System();
     $system->status = 1;
     $system->department = 1;
     $system->date_time_format = $date_time_format->id;
     $system->time_zone = $timezones->id;
     $system->save();
     // creating an user
     $user = User::create(array('first_name' => $firstname, 'last_name' => $lastname, 'email' => $email, 'user_name' => $username, 'password' => Hash::make($password), 'assign_group' => 1, 'primary_dpt' => 1, 'active' => 1, 'role' => 'admin'));
     // checking if the user have been created
     if ($user) {
         Session::put('step6', 'step6');
         return Redirect::route('final');
     }
 }
예제 #3
0
 /**
  * Post accountcheck
  * checking prerequisites
  * @param type InstallerRequest $request 
  * @return type view
  */
 public function accountcheck(InstallerRequest $request)
 {
     // dd($request);
     // config/database.php management
     $default = $request->input('default');
     $host = $request->input('host');
     $database = $request->input('databasename');
     $dbusername = $request->input('dbusername');
     $dbpassword = $request->input('dbpassword');
     // migrate database
     Artisan::call('migrate', array('--force' => true));
     Artisan::call('db:seed', array('--force' => true));
     // create user
     $firstname = $request->input('firstname');
     $lastname = $request->input('Lastname');
     $email = $request->input('email');
     $username = $request->input('username');
     $password = $request->input('password');
     $language = $request->input('language');
     $timezone = $request->input('timezone');
     $date = $request->input('date');
     $datetime = $request->input('datetime');
     $system = System::where('id', '=', '1')->first();
     $system->time_zone = $timezone;
     $system->date_time_format = $datetime;
     $system->save();
     $form1 = new Form_details();
     $form1->label = 'Name';
     $form1->type = 'text';
     $form1->form_name_id = '1';
     $form1->save();
     $form2 = new Form_details();
     $form2->label = 'Phone';
     $form2->type = 'number';
     $form2->form_name_id = '1';
     $form2->save();
     $form3 = new Form_details();
     $form3->label = 'Email';
     $form3->type = 'text';
     $form3->form_name_id = '1';
     $form3->save();
     $form4 = new Form_details();
     $form4->label = 'Subject';
     $form4->type = 'text';
     $form4->form_name_id = '1';
     $form4->save();
     $form5 = new Form_details();
     $form5->label = 'Details';
     $form5->type = 'textarea';
     $form5->form_name_id = '1';
     $form5->save();
     $user = User::create(array('first_name' => $firstname, 'last_name' => $lastname, 'email' => $email, 'user_name' => $username, 'password' => Hash::make($password), 'active' => 1, 'role' => 'admin', 'assign_group' => 'group A', 'primary_dpt' => 'support'));
     if ($user) {
         Session::put('step6', 'step6');
         return Redirect::route('final');
     }
 }