WebController.php
4.55 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<?php namespace App\Http\Controllers;
use Auth;
use Input;
use Cache;
use Crypt;
use Response;
use Redirect;
use Session;
use Config;
use App\Models\User;
use App\Jobs\KHRMSLib;
class WebController extends Controller {
public function __construct()
{
}
public function index()
{
return view("layout.module.web.index");
}
public function create()
{
//
}
public function store()
{
$action=Input::get('action');
if(strstr("GetEmpPass,Feedback,EmpRMDetails,PPtoEmpId,WorkflowSubmit,FormToMail,",$action))
{
$data=array();
$data['wakka'] = new KHRMSLib();
return view("layout.module.hr.".strtolower($action),$data);
}
if($action=="NewRecruit")
{
$data=array();
$data['wakka'] = new KHRMSLib();
return view("layout.module.record.show",$data);
}
if($action=="CandidateAdd")
{
$data=array();
$data['wakka'] = new KHRMSLib();
return view("layout.module.recruitment.".strtolower($action),$data);
}
}
public function show($id)
{
$data=array();
if($id=="conflink")
{
return view("layout.module.web.conflink",$data);
}
if($id=="android")
{
if($_SERVER['SERVER_NAME']!=Config::get("app.domain"))return Redirect::to(Config::get("app.protocol").Config::get("app.domain")."/web/android?".$_SERVER['QUERY_STRING']);
Session::put('mdevice','android');
Session::put('device',Input::get('device',''));
if(Auth::check())
{
$user=Auth::user();
$dataarr=$user->meta();
$dataarr['mobiledevice']=Input::get('device','');
$dataarr['mobiletype']=Input::get('type','');
$dataarr['mobilegcm']=Input::get('gcm','');
$dataarr['mobilequeue']=Input::get('queuemsg','');
$user->meta=json_encode($dataarr);
$user->save();
return Redirect::to('home');
}
else return Redirect::to('login');
}
if($id=="ios")
{
if($_SERVER['SERVER_NAME']!=Config::get("app.domain"))return Redirect::to(Config::get("app.protocol").Config::get("app.domain")."/web/ios?".$_SERVER['QUERY_STRING']);
Session::put('mdevice','ios');
Session::put('iosdevice',Input::get('device',''));
if(Auth::check())
{
$user=Auth::user();
$dataarr=$user->meta();
$dataarr['mobiledevice']=Input::get('device','');
$dataarr['mobiletype']=Input::get('type','');
$dataarr['mobilegcm']=Input::get('gcm','');
$dataarr['mobilequeue']=Input::get('queuemsg','');
$user->meta=json_encode($dataarr);
$user->save();
return Redirect::to('home');
}
else return Redirect::to('login');
}
if($id=="WebCV")
{
$data=array();
$data['wakka'] = new KHRMSLib();
return view("layout.module.recruitment.webcv",$data);
}
if($id=="EmpSelfService")
{
$data=array();
$data['wakka'] = new KHRMSLib();
return view("layout.module.hr.empselfservice",$data);
}
if($id=="EscalateTasks")
{
$data=array();
$data['wakka'] = new KHRMSLib();
return view("layout.module.hr.escalatetasks",$data);
}
if($id=="RecruitsList")
{
$data=array();
$data['wakka'] = new KHRMSLib();
return view("layout.module.hr.recruitslist",$data);
}
if($id=="FeedbackForm")
{
$data=array();
$data['wakka'] = new KHRMSLib();
return view("layout.module.hr.formfeedback",$data);
}
if($id=="SalarySlip")
{
$data=array();
$data['wakka'] = new KHRMSLib();
return response()->view("layout.module.hr.salaryslip",$data)->header('Content-Type', 'application/pdf');
}
if($id=="IncentiveSlip")
{
$data=array();
$data['wakka'] = new KHRMSLib();
return response()->view("layout.module.hr.incentiveslip",$data)->header('Content-Type', 'application/pdf');
}
if($id=="QR")
{
$str=explode("|",Crypt::decrypt(Input::get('str')));
if($str[0]=='EL')
{
echo "<h3>$str[1] : $str[2] : ".date('Y-m-d H:i:s',$str[3])."</h3>";
}
if($str[0]=='ID')
{
echo "<h3>$str[1] : $str[2] : ".date('Y-m-d H:i:s',$str[3])."</h3>";
}
}
if($id=="monthdashboard")
{
return view("layout.module.web.monthdashboard",$data);
}
if($id=="monthdashboardall")
{
return view("layout.module.web.monthdashboardall",$data);
}
if($id=="logincheck")
{
return view("layout.module.web.logincheck",$data);
}
}
public function edit($id)
{
//
}
public function update($id)
{
//
}
public function destroy($id)
{
}
public function dashboard()
{
//echo "OK";
}
}