예제 #1
0
파일: Members.php 프로젝트: lmkhang/mcntw
 /**
  * @author: lmkhang - skype
  * @date: 2016-01-15
  * Member detail
  */
 public function detail($user_id)
 {
     //set Title for PAGE
     $this->_page_title = 'Members';
     //check user id existed
     $user_get = new \App\User();
     $user = $user_get->getAccount($user_id);
     if (!$user) {
         //set Flash Message
         $this->setFlash('message', 'The user is not existed!');
         return Redirect::intended($this->_page_url)->with('message', 'The user is not existed!');
     }
     //Get income-expenditure list
     $user_in_ex_get = new \App\UserIncomeExpenditure();
     $number_pagination = \App\Config::where(['prefix' => 'site', 'name' => 'pagination', 'del_flg' => 1])->get()[0]['value'];
     $user_in_ex = $user_in_ex_get->getAllPaging(['user_income_expenditure.user_id' => $user_id, 'user_income_expenditure.status' => 1], $number_pagination);
     return view('admin.members.detail', ['admin' => $this->_admin, 'name' => $user['full_name'] ? $user['full_name'] : $user['first_name'] . ' ' . $user['last_name'], 'page_title' => $this->_page_title, 'active' => $this->_active, 'number_pagination' => $number_pagination, 'user' => $user, 'user_in_ex' => $user_in_ex, 'in_expen_type' => config('constant.in_expen_type'), 'in_exp_action' => config('constant.in_exp_action')]);
 }
예제 #2
0
파일: Home.php 프로젝트: lmkhang/mcntw
 /**
  * @author: lmkhang - skype
  * @date: 2016-01-09
  * DASHBOARD HOME
  */
 public function index()
 {
     //Check Status
     if ($this->_stop) {
         return Redirect::intended(url($this->_redirectTo));
     }
     //set Title for PAGE
     $this->_page_title = 'Home';
     //Get income-expenditure list
     $user_in_ex_get = new \App\UserIncomeExpenditure();
     $number_pagination = \App\Config::where(['prefix' => 'site', 'name' => 'pagination', 'del_flg' => 1])->get()[0]['value'];
     $user_in_ex = $user_in_ex_get->getAllPaging(['user_id' => $this->_user_id, 'status' => 1], $number_pagination);
     //get money
     $user_stats_get = new \App\UserStats();
     $user_stats = $user_stats_get->getAccount($this->_user_id);
     //min PAY
     $minpay = \App\Config::where(['prefix' => 'payment', 'name' => 'minpay', 'del_flg' => 1])->get()[0]['value'];
     return view('dashboard.home.index', ['user' => $this->_user, 'name' => $this->getName(), 'page_title' => $this->_page_title, 'active' => $this->_active, 'user_stats' => $user_stats, 'number_pagination' => $number_pagination, 'user_in_ex' => $user_in_ex, 'in_expen_type' => config('constant.in_expen_type'), 'in_exp_action' => config('constant.in_exp_action'), 'minpay' => $minpay]);
 }
예제 #3
0
파일: Stats.php 프로젝트: lmkhang/mcntw
 /**
  * @author: lmkhang - skype
  * @date: 2016-02-15
  *
  */
 public function detail(Request $request)
 {
     //set Title for PAGE
     $this->_page_title = 'Receipts and Expenses';
     //get
     $gets = $request->all();
     $gets = $this->trim_all($gets);
     $filter = isset($gets['filter']) ? $gets['filter'] : [];
     //unset if dont choose
     $filter_temp = $filter;
     foreach ($filter_temp as $k => $v) {
         if (!$v) {
             unset($filter[$k]);
         }
     }
     //get user list
     $user_get = new \App\User();
     $users = $user_get->getAllPaging(['status' => 1, 'del_flg' => 1, 'sign_contract' => 1]);
     //get all receipts and expenses
     $number_pagination = \App\Config::where(['prefix' => 'site', 'name' => 'pagination', 'del_flg' => 1])->get()[0]['value'];
     $receipt_expense_get = new \App\UserIncomeExpenditure();
     $receipt_expense = $receipt_expense_get->getAllPaging($filter, $number_pagination);
     return view('admin.stats.detail', ['admin' => $this->_admin, 'name' => $this->getName(), 'page_title' => $this->_page_title, 'active' => $this->_active, 'users' => $users, 'filter' => $filter, 'number_pagination' => $number_pagination, 'receipt_expense' => $receipt_expense, 'in_expen_type' => config('constant.in_expen_type'), 'in_expen_status' => config('constant.in_expen_status'), 'in_exp_action' => config('constant.in_exp_action')]);
 }