コード例 #1
0
ファイル: Controller.php プロジェクト: lmkhang/mcntw
 /**
  * @author: lmkhang - skype
  * @date: 2016-01-10
  * Get Session of User
  */
 protected function getSessionUser()
 {
     if ($this->isLogged()) {
         $this->_user_id = $this->getSession('site_user_id');
         $this->_registration_system = $this->getSession('site_registration_system');
         $this->_email = $this->getSession('site_email');
         $user = new \App\User();
         $this->_user = $user->getAccount($this->_user_id);
     }
 }
コード例 #2
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')]);
 }
コード例 #3
0
ファイル: AdminController.php プロジェクト: lmkhang/mcntw
 /**
  * @author: lmkhang - skype
  * @date: 2016-02-02
  * Send mail after paying
  */
 protected function sendmailPayment($user_id, $amount, $original_amount, $net_amount_word_info, $date, $reason)
 {
     //get User
     $user_get = new \App\User();
     $user = $user_get->getAccount($user_id);
     //Payment information
     $info = $this->createPaymentInfo($user);
     $sender_info = config('constant.send_income_expenditure');
     $to_address = $user->payment_email;
     $to_name = $user->full_name ? $user->full_name : $user->first_name . ' ' . $user->last_name;
     $from_address = $sender_info['email'];
     $from_name = $sender_info['name'];
     $subject = str_replace(array('{mm-YYYY}'), array(date('F Y', strtotime($date))), $sender_info['subject']);
     $reason = str_replace(array('{mm-YYYY}'), array(date('F Y', strtotime($date))), $reason);
     $content = str_replace(array('{full_name}', '{dd-mm-YYYY}', '{info}', '{full_name_info}', '{gross_amount_info}', '{net_amount_word_info}', '{net_amount_info}', '{reason}', '{mm-YYYY}'), array($to_name, date('jS \\of F Y', time()), $info['info'], $info['full_name_info'], $original_amount, $net_amount_word_info, $amount, $reason, date('F Y', strtotime($date))), $sender_info['content']);
     try {
         Mail::send('emails.contact', array('subject' => $subject, 'message' => $content), function ($message) use($to_address, $to_name, $from_address, $from_name, $subject, $content) {
             // note: if you don't set this, it will use the defaults from config/mail.php
             $message->from($from_address, $from_name);
             $message->to($to_address, $to_name)->cc('*****@*****.**', 'Archive Mail')->subject($subject)->setBody($content);
         });
     } catch (\Exception $e) {
     }
 }