public function handleSearch() { $getDate = Input::get('searchVoter'); //echo $getDate; $getDate = AppHelper::dateToString($getDate); $results = DB::select('select membership_id FROM "valids" WHERE "valid"=1 and "upToDate" between 0 and ' . $getDate); return $results; }
public static function currentDate() { $currentDate = date('d-m-Y'); $currentDate = AppHelper::dateToString($currentDate); return $currentDate; }
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.'); } }