update ver1.0.5.6

This commit is contained in:
sujitprasad
2016-02-02 18:07:15 +05:30
parent 6586867557
commit 8c8c42b581
5 changed files with 36 additions and 26 deletions

View File

@@ -9,6 +9,7 @@ use App\User;
use App\Model\helpdesk\Settings\System;
use App\Model\helpdesk\Form\Form_details;
use App\Model\helpdesk\Utility\Date_time_format;
use App\Model\helpdesk\Utility\Timezones;
// classes
use App;
use Artisan;
@@ -103,19 +104,22 @@ class InstallerApiController extends Controller {
Artisan::call('migrate', array('--force' => true));
Artisan::call('db:seed', array('--force' => true));
// var_dump($datetime);
// $date_time_format = Date_time_format::where('format','=',$datetime)->first();
// // dd($date_time_format->id);
// if($date_time_format->id){
// $date_time = 1;
// } else {
// return 'date time format not supported';
// }
// Creating minum settings
$system = System::where('id','=','1')->first();
$system->time_zone = 1;
$system->date_time_format = 1;
// 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'];
}
// checking requested date time format for the admin and system
$date_time_format = Date_time_format::where('format','=',$datetime)->first();
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 user