public function handleBankStatement() { $account = Account::findOrFail(Input::get('account')); if (Input::get('bank_statement') == 1) { $account->bank_statement = Input::get('bank_statement'); // store bank statement; $account->save(); //update information to Valid table $member_id = $account->membership_id; //submit money to date $toDate = $account->to; //return $date; //converting date to srting $date = AppHelper::dateToString($toDate); //validateion upto date $upToDate = AppHelper::addThreeYear($toDate); //converting date to srting $upToDate = AppHelper::dateToString($upToDate); $currentDate = AppHelper::currentDate(); //update valid database DB::update('update valids set valid=1,toDate =' . $date . ',upToDate=' . $upToDate . ' where membership_id=' . $member_id); if ($currentDate < $upToDate) { DB::update('update members set status=1 where membership_id=' . $member_id); } return Redirect::action('AdminAccountController@index')->with('flash_edit_success', 'Congratulation,You have submitted a bank statement'); } else { return Redirect::action('AdminAccountController@index')->with('flash_dlt_success', 'Sorry, You do not submitted any bank statement.'); } }