SettingController.php
2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php namespace App\Http\Controllers;
use Auth;
use Input;
// use Response;
// use App\Models\Group;
// use App\Models\Master;
// use App\Models\Record;
// use App\Models\CRMCall;
// use App\Models\CRMCallArchive;
// use App\Models\CRM;
// use App\Models\CRMCampaign;
// use App\Models\CRMList;
// use App\Jobs\KHRMSLib;
// use App\Models\Sipid;
// use App\Models\Dialline;
// use App\Models\UserLog;
// use App\Models\User;
// use App\Models\Kqueue;
use DB;
// use Log;
// use Session;
// $client='';
class SettingController extends Controller {
public function __construct()
{
$this->middleware('auth');
// $this->middleware('module_access');
}
public function index()
{
$data['userCurrentTheme'] = Auth::user()->theme;
return view("layout.module.setting.index",$data);
}
public function create()
{
}
public function store()
{
$action = Input::get("action");
if($action=="upload")
{
$data['wakka'] = new KHRMSLib();
return view("layout.module.data.upload",$data);
}
}
public function show($id)
{
if($id=="theme")
{
$userInput = Input::get("name");
if($userInput != ""){
$themes = explode(",",env('themes'));
if(in_array($userInput, $themes)){
DB::table('users')->where('id',Auth::user()->id)->update(['theme'=>$userInput]);
$data['response'] = ["type"=>"success","message"=>"Selected theme applied, it will load automatically in second"];
$data['userCurrentTheme'] = $userInput;
}else{
$data['response'] = ["type"=>"warning","message"=>"Selected theme not available"];
$data['userCurrentTheme'] = Auth::user()->theme;
}
}else{
$data['response'] = ["type"=>"warning","message"=>"Please select theme"];
$data['userCurrentTheme'] = Auth::user()->theme;
}
return view("layout.module.setting.theme",$data);
}
if($id=="seatcount")
{
return view("layout.module.setting.seatCount");
}
return "";
}
public function edit($id)
{
}
public function update($id)
{
}
public function destroy($id)
{
}
}