// /직원///////
  // 직원 목록 - 페이징 있는 것
  @RequestMapping(
      value = {"center", "manager", "teacher"},
      method = RequestMethod.GET)
  // @RequestParam :파라미터로 now_center_id를 보내지 않을 때 기본값을 0으로 셋팅해준다.
  public String employeeListPaging(
      Model model,
      @RequestParam(value = "now_center_id", defaultValue = "0") int now_center_id,
      @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
      @RequestParam(value = "pageSize", defaultValue = "10") int pageSize,
      HttpServletRequest request) {
    int job_code = 0;

    String myuri = request.getRequestURI();
    System.out.println("myurl:" + myuri);
    String uri = myuri.substring(myuri.lastIndexOf("/") + 1);
    System.out.println("uri:" + uri);
    if (uri.equals("center")) {
      job_code = 3;
    } else if (uri.equals("manager")) {
      job_code = 2;
    } else if (uri.equals("teacher")) {
      job_code = 1;
    }

    employeeService.getEmplList(job_code, now_center_id, model, pageNum, pageSize);
    List<EducationCenter> eduCenterList = employeeService.getEduCenterList();

    model.addAttribute("uri", uri);
    model.addAttribute("eduCenterList", eduCenterList);
    model.addAttribute("job_code", job_code);

    return "management.employee";
  }
  // 원생목록 - 페이징 처리
  @RequestMapping(value = "memberOfAcademyList/{pageSize}/{pageNum}", method = RequestMethod.GET)
  public String studentListPageing(
      Model model,
      @PathVariable int pageSize,
      @PathVariable int pageNum,
      @RequestParam(value = "c_id", required = false, defaultValue = "0") int c_id,
      @RequestParam(value = "open_course_id", required = false, defaultValue = "0")
          int open_course_id) {

    System.out.println("center_id:" + c_id);
    System.out.println("open_course_id:" + open_course_id);

    memberService.getMemberOfAcademyList(c_id, open_course_id, model, pageNum, pageSize);
    List<EducationCenter> eduCenterList = employeeService.getEduCenterList();

    model.addAttribute("eduCenterList", eduCenterList);

    if (open_course_id != 0) {
      System.out.println("open_course_id 값이 0이 아닐 때 들어오나");
      // 센터목록에 셋팅
      model.addAttribute("center_name", eduCenterList.get(c_id - 1).getLocation());
      List<OpenCourse> courseList = memberService.getCourseList(c_id);
      model.addAttribute("courseList", courseList);
      // 강좌목록에 셋팅
      String course_name = "";
      for (int i = 0; i < courseList.size(); i++) {
        if (courseList.get(i).getOpen_course_id() == open_course_id) {
          course_name = courseList.get(i).getCourse_name();
        }
      }
      model.addAttribute("course_name", course_name);
    }
    return "management.memberOfAcademyList";
  }
 // ////직원 관리//////////////////
 // 직원추가
 @RequestMapping(value = "employeeRegister", method = RequestMethod.GET)
 public String employeeManagement(Model model) {
   List<EducationCenter> eduList = employeeService.getEduCenterList();
   model.addAttribute("eduCenterList", eduList);
   return "management.employeeRegister";
 }