Beispiel #1
0
 /**
  * [privacyFrm show privacy page]
  * @param  [integer] $id [user id]
  */
 public function privacyFrm($id)
 {
     //get user's privacy by user id
     $priv_user = new Privacy();
     $user = $priv_user->getUserPrivacy($id);
     //var_dump($user);exit;
     //get user's info by user id
     $usernhc_obj = new Usernhc();
     $usernhc = $usernhc_obj->getUsernhcById($id);
     //get data relate with agency
     $agency_data = new AgencyData();
     $rs_agency_data = $agency_data->getDataByAgency($usernhc[0]->agency_id);
     // var_dump($rs_agency_data);//exit;
     //get agency's data privacy by agency id
     $priv_data = new DataPrivacy();
     $data = $priv_data->getDataPrivacy($usernhc[0]->agency_id);
     // var_dump($data);exit;
     //get all data name
     $data_table = Data::all();
     foreach ($data_table as $key => $value) {
         $raws[$value['id']][] = $value;
     }
     // var_dump($raws);exit;
     //get all period for each data_id
     $period_data = RetainData::all();
     //var_dump($period_data);exit;
     $privacy_init = PrivacyInit::all()->toArray();
     $period = array(array('name' => 'ระยะเก็บรักษาข้อมูล 1 วัน', 'value' => '1:day'), array('name' => 'ระยะเก็บรักษาข้อมูล 1 เดือน', 'value' => '1:month'), array('name' => 'ระยะเก็บรักษาข้อมูล 3 เดือน', 'value' => '3:month'), array('name' => 'ระยะเก็บรักษาข้อมูล 6 เดือน', 'value' => '6:month'), array('name' => 'ระยะเก็บรักษาข้อมูล 1 ปี', 'value' => '1:year'), array('name' => 'ระยะเก็บรักษาข้อมูล 3 ปี', 'value' => '3:year'), array('name' => 'ระยะเก็บรักษาข้อมูล 5 ปี', 'value' => '5:year'), array('name' => 'ระยะเก็บรักษาข้อมูล 7 ปี', 'value' => '7:year'), array('name' => 'ระยะเก็บรักษาข้อมูล 10 ปี', 'value' => '10:year'));
     $rt = new RetainData();
     $rs = $rt->listRetain();
     //var_dump($period_data->toArray());exit;
     return View::make('privacy.privacy')->with('priv_user', $user[0])->with('priv_data', $data)->with('user_info', $usernhc[0])->with('src_table', $raws)->with('period', $period)->with('period_data', $period_data)->with('active_status', $this->active_status)->with('privacy_init', $privacy_init)->with('retain_data', $rs)->with('period_text', $this->period_text)->with('agency_data', $rs_agency_data);
 }
Beispiel #2
0
 public function logoutAction()
 {
     // Log out
     if (Auth::User()) {
         $user = new Usernhc();
         $user_id = Auth::User()->id;
         $user_info = $user->getUsernhcById($user_id);
         $logs = new Logs();
         $logs->ip = Request::getClientIp();
         $logs->host = Request::root();
         $logs->lastpage = '';
         $logs->last_visit = date('Y-m-d H:i:s');
         $logs->role_id = $user_info[0]->role_id;
         $logs->data_id = rand(1, 11);
         $logs->userid = $user_id;
         $logs->save();
     }
     // Redirect to homepage
     if (Auth::logout()) {
         Auth::logout();
         return Redirect::to('login')->with('success', 'ออกจากระบบสำเร็จ');
     } else {
         return Redirect::to('login')->with('success', 'ออกจากระบบสำเร็จ');
     }
 }
Beispiel #3
0
 /**
  * [userSecurityFrm description]
  * @param  [type] $id [description]
  * @return [type]     [description]
  */
 public function userSecurityFrm($id)
 {
     $agency = Agency::all();
     $nhcuser = new Usernhc();
     $datas = $nhcuser->getUsernhcById($id);
     return View::make('userlist.security')->with('agency', $agency)->with('userinfo', $datas[0]);
 }
 /**
  * [userPeerPrivacy show informatioin of user by user's privacy in modal]
  * @param  [integer] $id [user id]
  * @return [type]     [description]
  */
 public function userPeerPrivacy($id)
 {
     $user_info = new Usernhc();
     $rs_userinfo = $user_info->getUsernhcById($id);
     //var_dump($rs_userinfo);
     $privacy = new Privacy();
     $user_privacy = $privacy->getUserPrivacy($id);
     return View::make('peer.ajax_userprivacy')->with('user_info', $rs_userinfo[0])->with('user_privacy', $user_privacy[0]);
 }