/** * @before _secure, _vendor */ public function index() { $this->seo(array("title" => "Schedule Your Appointments", "view" => $this->getLayoutView())); $this->getLayoutView()->set("cal", true); $view = $this->getActionView(); if (RequestMethods::post("appointment_id")) { if (RequestMethods::post("job_id", "")) { $job = Job::first(array("appointment_id = ?" => RequestMethods::post("appointment_id"))); $job->user_id = RequestMethods::post("user_id"); } else { $job = new Job(array("user_id" => RequestMethods::post("user_id"), "muser_id" => RequestMethods::post("muser_id"), "puser_id" => RequestMethods::post("puser_id"), "appointment_id" => RequestMethods::post("appointment_id"), "location_id" => RequestMethods::post("location_id"), "centre_id" => RequestMethods::post("centre_id"), "organization_id" => RequestMethods::post("organization_id"))); } $job->save(); $view->set("message", "Runner Assigned Successfully"); } if (RequestMethods::post("action") == "capacity") { foreach (RequestMethods::post("slot") as $key => $value) { $slot = Slot::first(array("organization_id = ?" => $this->member->organization_id, "day = ?" => $key)); if (isset($slot)) { $slot->start = $value["start"]; $slot->day = $key; $slot->end = $value["end"]; $slot->capacity = $value["hlimit"]; } else { $slot = new Slot(array("user_id" => $this->user->id, "organization_id" => $this->member->organization_id, "day" => $key, "start" => $value["start"], "end" => $value["end"], "capacity" => $value["hlimit"])); } $slot->save(); } $view->set("message", "Slots Saved Successfully"); } $runners = Member::all(array("organization_id = ?" => $this->member->organization_id, "designation = ?" => "runner"), array("user_id", "id")); $view->set("runners", $runners); $view->set("day", array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")); $view->set("slots", Slot::all(array("organization_id = ?" => $this->member->organization_id), array("start", "end", "capacity", "day"))); }
/** * Display a listing of the resource. * * @return Response */ public function index() { //var_dump("quang"); $members = Member::all(); //var_dump($members); return View::make('backend.members.index')->with('members', $members); }
Route::get('loans/show/{id}', 'LoanaccountsController@show'); Route::post('loans/amend/{id}', 'LoanaccountsController@amend'); Route::get('loans/reject/{id}', 'LoanaccountsController@reject'); Route::post('loans/reject/{id}', 'LoanaccountsController@rejectapplication'); Route::get('loanaccounts/topup/{id}', 'LoanaccountsController@gettopup'); Route::post('loanaccounts/topup/{id}', 'LoanaccountsController@topup'); Route::get('memloans/{id}', 'LoanaccountsController@show2'); Route::resource('loanrepayments', 'LoanrepaymentsController'); Route::get('loanrepayments/create/{id}', 'LoanrepaymentsController@create'); Route::get('loanrepayments/offset/{id}', 'LoanrepaymentsController@offset'); Route::post('loanrepayments/offsetloan', 'LoanrepaymentsController@offsetloan'); Route::get('reports', function () { return View::make('members.reports'); }); Route::get('reports/combined', function () { $members = Member::all(); return View::make('members.combined', compact('members')); }); Route::get('loanreports', function () { $loanproducts = Loanproduct::all(); return View::make('loanaccounts.reports', compact('loanproducts')); }); Route::get('savingreports', function () { $savingproducts = Savingproduct::all(); return View::make('savingaccounts.reports', compact('savingproducts')); }); Route::get('financialreports', function () { return View::make('pdf.financials.reports'); }); Route::get('reports/listing', 'ReportsController@members'); Route::get('reports/remittance', 'ReportsController@remittance');
Route::post('members/create', 'MembersController@create_post'); Route::get('members/update/{id}', 'MembersController@update'); Route::post('members/update/{id}', 'MembersController@update_post'); Route::get('members/packages/{id}', 'MembersController@packages'); Route::post('members/packages/{id}', 'MembersController@packages_post'); Route::get('members/packages/{id}/create', 'MembersController@create'); Route::post('members/packages/{id}/create', 'MembersController@create_post'); Route::get('members/packages/{id}/update/{package_id}', 'MembersController@update'); Route::post('members/packages/{id}/update/{package_id}', 'MembersController@update_post'); Route::get('members/packages/{id}/delete/{package_id}', 'MembersController@delete'); Route::get('members/packages/{id}/attach', 'MembersController@attach'); Route::post('members/packages/{id}/attach', 'MembersController@attach_post'); Route::post('members/packages/{id}/delete', 'MembersController@delete_package'); Route::post('members/packages/{id}/extend', 'MembersController@extend'); Route::post('members/packages/{id}/suspend', 'MembersController@suspend'); Route::post('members/search', 'MembersController@search'); Route::get('members/login/{id}', 'MembersController@login'); Route::post('members/delete', 'MembersController@delete'); Route::get('members/request', function () { $per_page = 4; $page = Input::get('page', 0); $rows = Member::all(); $total_pages = ceil($rows->count() / $per_page); $offset = $page == 0 ? null : ($page - 1) * $per_page; $data = Member::orderBy('last_name')->take($per_page)->skip($offset)->get(); $array = array('page' => $page, 'total_items' => $rows->count(), 'total_pages' => $total_pages, 'total_showing' => count($data), 'members' => $data->toArray()); $response = Response::make(json_encode($array, JSON_NUMERIC_CHECK), 200); $response->header('Content-Type', 'text/json'); return $response; }); });
/** * @before _secure, _vendor */ public function manage($param = null) { $this->seo(array("title" => "Manage Runner Profile", "view" => $this->getLayoutView())); $view = $this->getActionView(); $page = RequestMethods::get("page", 1); $limit = RequestMethods::get("limit", 10); $where = array("organization_id = ?" => $this->member->organization_id, "designation = ?" => "runner", "live = ?" => 1); $runners = Member::all($where, array("DISTINCT user_id"), "created", "desc", $limit, $page); $count = Member::count($where); $view->set("runners", $runners); $view->set("page", $page); $view->set("count", $count); $view->set("limit", $limit); }
public function remittance() { //$members = DB::table('members')->where('is_active', '=', '1')->get(); $members = Member::all(); $organization = Organization::find(1); $savingproducts = Savingproduct::all(); $loanproducts = Loanproduct::all(); $pdf = PDF::loadView('pdf.remittance', compact('members', 'organization', 'loanproducts', 'savingproducts'))->setPaper('a4')->setOrientation('landscape'); return $pdf->stream('Remittance.pdf'); }
<?php /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It is a breeze. Simply tell Lumen the URIs it should respond to | and give it the Closure to call when that URI is requested. | */ class Member extends Illuminate\Database\Eloquent\Model { } $app->get('/', function () use($app) { return $app->welcome(); }); $app->get('/members', 'MemberController@index'); $app->get('/list', function () { return Member::all(); });
}); App::after(function ($request, $response) { // }); Event::listen('audit', function ($entity, $action, $description) { $audit = new Audit(); $audit->date = date('Y-m-d'); $audit->description = $description; $audit->user = Confide::user()->username; $audit->entity = $entity; $audit->action = $action; $audit->save(); }); Route::filter('limit', function () { $organization = Organization::find(1); $members = count(Member::all()); if ($organization->licensed <= $members) { return View::make('members.memberlimit'); } }); Route::filter('license', function () { $organization = Organization::find(1); $string = $organization->name; $license_key = $organization->license_key; $license_code = $organization->license_code; $validate = $organization->license_key_validator($license_key, $license_code, $string); if ($validate) { return View::make('activate', compact('organization'))->withErrors('License activation failed. License Key not valid'); } }); /*
/** * This function responses to the * post request of the /admin/member/action * then checked which button are pressed in the * form of member.view.blade.php of the * route /admin/member */ public function postAction() { // Holding checked row value from member table $id = Input::get('checked'); /** * Redirected route if Edit button is pressed */ if (Input::has('Edit')) { return Redirect::route('member-edit-get', $id); } /** * Redirected route if Details button is pressed */ if (Input::has('Details')) { return Redirect::route('member-details-get', $id); } /** * Redirected route if Print button is pressed */ if (Input::has('Print')) { $parameterr = array(); $parameter['members'] = Member::all(); $pdf = PDF::loadView('reports.member.getAllMembers', $parameter)->setPaper('a4')->setOrientation(config::$MEMBER_REPORT_ORIENTATION)->setWarnings(false); return $pdf->stream('members.pdf'); } /** * If Delete button button is pressed * destroy function finds member by id * and deletes the member from member table */ if (Input::has('Delete')) { foreach ($id as $memberId) { $member = Member::find($memberId); $member->userDelete($member->id); $member->delete(); } return Redirect::route('member-get', 1); } }
/** * Display a listing of members * * @return Response */ public function index() { $members = Member::all(); return View::make('members.index', compact('members')); }
/** * Member list * * @path /member/list/token/limit/offset * * @param string token * @param integer limit * @param integer offset * * @return json */ $app->get('/list/{token}[/{limit:[0-9]+}/{offset:[0-9]+}]', function ($request, $response, $args) { $limit = isset($args['limit']) ? $args['limit'] : 10; $offset = isset($args['offset']) ? $args['offset'] : 0; $options = array('limit' => $limit, 'offset' => $offset); $datas = Member::all($options); // convert into array $datas = toArray($datas); $res = array(); foreach ($datas as $data) { $res[] = array('id' => $data['member_id'], 'name' => $data['member_name']); } return $response->getBody()->write(json_encode($res)); }); /** * Member detile * * @path /member/id/token * * @param string id * @param string token
public function index() { $members = Member::all()->all(); return ['view' => 'member/index', 'data' => ['page' => 'Roster', 'members' => $members]]; }
/** * 회원정보를 가져온다. */ public function getMember() { $data = Member::all(); return Utils::result($data); }