public function postGeneral($id) { $id = Crypt::decrypt($id); $request = RRequest::find($id); if (Input::has('save')) { if (Input::get('employee') == 0 || Input::get('organization') == 0 || Input::get('r_plan') == 0 || Input::get('specialist') == 0 || strlen(Input::get('title')) < 2 || strlen(Input::get('description')) < 2) { Session::flash('sms_warn', trans('sta.require_field')); } else { $request->request_by_id = Input::get('employee'); $request->for_organization_id = Input::get('organization'); $request->for_planning_id = Input::get('r_plan'); $request->to_department_id = Input::get('specialist'); $request->request_title = Input::get('title'); $request->description = Input::get('description'); $request->request_date = date('Y-m-d'); $request->created_by = Auth::user()->employee_id; if ($request->save()) { Session::flash('sms_success', trans('sta.save_data_success')); //return Redirect::to('branch_request/general/' . Crypt::encrypt($request->id)); } } } $organizations = $this->array_list(Organization::list_item()); $employees = $this->array_list(Employee::list_item()); $department = $this->array_list(Department::list_item()); $r_plans = $this->array_list(Rplan::list_item()); return View::make('branch_request.edit_general', array('id' => $id, 'organizations' => $organizations, 'employees' => $employees, 'specialist' => $department, 'r_plans' => $r_plans, 'request' => $request)); }
public function postIndex() { $organize_list = $this->array_list(Organization::list_item()); $department_list = $this->array_list(Department::list_item()); $user_roll = $this->array_list(UserRoll::list_item()); $organization = Input::get('organization'); $condition = ""; if (Input::has('em_name')) { $condition .= " and em.en like '%" . Input::get('em_name') . "%'"; } if (Input::has('em_name_kh')) { $condition .= " and em.kh like '%" . Input::get('em_name_kh') . "%'"; } if (Input::has('em_id')) { $condition .= " and em.code='" . Input::get('em_id') . "'"; } if (Input::get('organization') > 0) { $condition .= " and org.id=" . Input::get('organization'); } if (Input::get('department') > 0) { $condition .= " and de.id=" . Input::get('department'); } if (Input::get('user_roll') > 0) { $condition .= " and ur.id=" . Input::get('user_roll'); } $user_list = User::user_list($condition); return View::make('user.user', array('organize_list' => $organize_list, 'department_list' => $department_list, 'organization' => $organization, 'user_list' => $user_list, 'user_roll' => $user_roll)); }