Dumy data clean up
This commit is contained in:
@@ -1069,6 +1069,20 @@ class SettingsController extends Controller
|
|||||||
return redirect()->route('error404')->with('fails', Lang::get('lang.no-dummy-data'));
|
return redirect()->route('error404')->with('fails', Lang::get('lang.no-dummy-data'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @category function to handle clean dummy data ajax request
|
||||||
|
* @param null
|
||||||
|
* @return json
|
||||||
|
*/
|
||||||
|
public function postCleanDummyData(Request $request) {
|
||||||
|
$result = 'failed';
|
||||||
|
$system_check = CommonSettings::select('status')->where('option_name', '=', 'dummy_data_installation')->first();
|
||||||
|
if ($system_check->status == 1 || $system_check->status == '1') {
|
||||||
|
$result = Self::cleanDatabase();
|
||||||
|
}
|
||||||
|
return response()->json(compact('result'));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @category function to clean dummy database and reseed tables with default options
|
* @category function to clean dummy database and reseed tables with default options
|
||||||
*
|
*
|
||||||
@@ -1118,12 +1132,6 @@ class SettingsController extends Controller
|
|||||||
$system2->time_zone = $system->time_zone;
|
$system2->time_zone = $system->time_zone;
|
||||||
$system2->date_time_format = $system->date_time_format;
|
$system2->date_time_format = $system->date_time_format;
|
||||||
$system2->save();
|
$system2->save();
|
||||||
|
|
||||||
// updating business hours
|
|
||||||
$bhours = BusinessHours::where('id', '=', 1)->first();
|
|
||||||
$bhours->timezone = $system2->time_zone;
|
|
||||||
$bhours->save();
|
|
||||||
|
|
||||||
$response = 'success';
|
$response = 'success';
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
|
@@ -70,12 +70,11 @@ class="active"
|
|||||||
@stop
|
@stop
|
||||||
@section('FooterInclude')
|
@section('FooterInclude')
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$('#clean-confirm').click(function() {
|
$('#clean-confirm').on('ifChecked', function () {
|
||||||
if($(this). prop("checked") == true){
|
document.getElementById("clean-btn").disabled = false;
|
||||||
document.getElementById("clean-btn").disabled = false;
|
});
|
||||||
} else {
|
$('#clean-confirm').on('ifUnchecked', function () {
|
||||||
document.getElementById("clean-btn").disabled = true;
|
document.getElementById("clean-btn").disabled = true;
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#clean-btn').on('click', function(){
|
$('#clean-btn').on('click', function(){
|
||||||
|
Reference in New Issue
Block a user