public MainFrame() {
		
		month = cld.get(Calendar.MONTH)+1;
		day = cld.get(Calendar.DAY_OF_MONTH);
		if(month<10){
			date = new Integer(date+"0"+month).intValue();
		}else{
			date = new Integer(date+""+month).intValue();
		}
		if(day<10){
			date = new Integer(date+"0"+day).intValue();
		}else{
			date = new Integer(date+""+day).intValue();
		}
		
		now = date;
		
		mg = new Management();
		
		setTitle("\uD638\uD154\uAD00\uB9AC\uC2DC\uC2A4\uD15C");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 750, 600);
		
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		
		JMenu mnFile = new JMenu("File");
		menuBar.add(mnFile);
		
		JMenuItem mntmOpen = new JMenuItem("Open");
		mnFile.add(mntmOpen);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel label = new JLabel("\uD638\uD154 \uAD00\uB9AC \uC2DC\uC2A4\uD15C");
		label.setFont(new Font("", Font.PLAIN, 26));
		label.setBounds(253, 10, 200, 50);
		contentPane.add(label);
		
		JPanel panel = new JPanel();
		panel.setBorder(new LineBorder(new Color(0, 0, 0)));
		panel.setBounds(40, 90, 280, 200);
		contentPane.add(panel);
		panel.setLayout(null);
		
		JLabel lblNewLabel = new JLabel("\uACE0\uAC1D\uBA85");
		lblNewLabel.setBounds(12, 10, 42, 18);
		lblNewLabel.setFont(new Font("", Font.PLAIN, 15));
		panel.add(lblNewLabel);
		
		JLabel lblNewLabel_3 = new JLabel("\uAC1D\uC2E4");
		lblNewLabel_3.setBounds(12, 94, 28, 18);
		lblNewLabel_3.setFont(new Font("", Font.PLAIN, 15));
		panel.add(lblNewLabel_3);
		
		JLabel lblNewLabel_2 = new JLabel("\uBC15");
		lblNewLabel_2.setBounds(12, 66, 14, 18);
		lblNewLabel_2.setFont(new Font("", Font.PLAIN, 15));
		panel.add(lblNewLabel_2);
		
		JLabel lblNewLabel_1 = new JLabel("\uCCB4\uD06C\uC778");
		lblNewLabel_1.setBounds(12, 38, 42, 18);
		lblNewLabel_1.setFont(new Font("", Font.PLAIN, 15));
		panel.add(lblNewLabel_1);
		
		JButton reservationBtn = new JButton("\uC608\uC57D \uB4F1\uB85D/\uBCC0\uACBD");
		
		reservationBtn.setBounds(12, 167, 130, 23);
		panel.add(reservationBtn);
		
		JButton cancelBtn = new JButton("\uC608\uC57D \uCDE8\uC18C");
		cancelBtn.setBounds(171, 167, 97, 23);
		panel.add(cancelBtn);
		
		customerName = new JTextField();
		customerName.setBounds(66, 9, 120, 21);
		panel.add(customerName);
		customerName.setColumns(10);
		
		startDay = new JTextField();
		startDay.setBounds(66, 37, 120, 21);
		panel.add(startDay);
		startDay.setColumns(10);
		
		final JComboBox cbPeriod = new JComboBox(period);
		cbPeriod.setBounds(66, 65, 120, 21);
		panel.add(cbPeriod);
		
		final JComboBox cbRoom = new JComboBox(room);
		cbRoom.setBounds(66, 93, 120, 21);
		panel.add(cbRoom);
		
		JLabel lblNewLabel_4 = new JLabel("\uD22C\uC219 \uC608\uC57D");
		lblNewLabel_4.setFont(new Font("", Font.PLAIN, 20));
		lblNewLabel_4.setBounds(40, 56, 87, 24);
		contentPane.add(lblNewLabel_4);
		
		JPanel pReservation = new JPanel();
		pReservation.setBorder(new LineBorder(new Color(0, 0, 0)));
		pReservation.setBounds(332, 90, 350, 200);
		contentPane.add(pReservation);
		pReservation.setLayout(null);
		
		JPanel p101 = new JPanel();
		p101.setBackground(Color.WHITE);
		p101.setBorder(new LineBorder(new Color(0, 0, 0)));
		p101.setToolTipText("");
		p101.setBounds(12, 10, 55, 30);
		pReservation.add(p101);
		
		JLabel lblNewLabel_8 = new JLabel("101");
		p101.add(lblNewLabel_8);
		
		JPanel p106 = new JPanel();
		p106.setBackground(Color.WHITE);
		p106.setBorder(new LineBorder(new Color(0, 0, 0)));
		p106.setBounds(12, 50, 55, 30);
		pReservation.add(p106);
		
		JLabel label_8 = new JLabel("106");
		p106.add(label_8);
		
		JPanel p201 = new JPanel();
		p201.setBackground(Color.WHITE);
		p201.setBorder(new LineBorder(new Color(0, 0, 0)));
		p201.setBounds(12, 90, 55, 30);
		pReservation.add(p201);
		
		JLabel label_13 = new JLabel("201");
		p201.add(label_13);
		
		JPanel p206 = new JPanel();
		p206.setBackground(Color.WHITE);
		p206.setBorder(new LineBorder(new Color(0, 0, 0)));
		p206.setBounds(12, 130, 55, 30);
		pReservation.add(p206);
		
		JLabel label_22 = new JLabel("206");
		p206.add(label_22);
		
		JPanel p207 = new JPanel();
		p207.setBackground(Color.WHITE);
		p207.setBorder(new LineBorder(new Color(0, 0, 0)));
		p207.setBounds(79, 130, 55, 30);
		pReservation.add(p207);
		
		JLabel label_21 = new JLabel("207");
		p207.add(label_21);
		
		JPanel p202 = new JPanel();
		p202.setBackground(Color.WHITE);
		p202.setBorder(new LineBorder(new Color(0, 0, 0)));
		p202.setBounds(79, 90, 55, 30);
		pReservation.add(p202);
		
		JLabel label_14 = new JLabel("202");
		p202.add(label_14);
		
		JPanel p107 = new JPanel();
		p107.setBackground(Color.WHITE);
		p107.setBorder(new LineBorder(new Color(0, 0, 0)));
		p107.setBounds(79, 50, 55, 30);
		pReservation.add(p107);
		
		JLabel label_9 = new JLabel("107");
		p107.add(label_9);
		
		JPanel p102 = new JPanel();
		p102.setBackground(Color.WHITE);
		p102.setBorder(new LineBorder(new Color(0, 0, 0)));
		p102.setBounds(79, 10, 55, 30);
		pReservation.add(p102);
		
		JLabel label_4 = new JLabel("102");
		p102.add(label_4);
		
		JPanel p103 = new JPanel();
		p103.setBackground(Color.WHITE);
		p103.setBorder(new LineBorder(new Color(0, 0, 0)));
		p103.setBounds(146, 10, 55, 30);
		pReservation.add(p103);
		
		JLabel label_5 = new JLabel("103");
		p103.add(label_5);
		
		JPanel p108 = new JPanel();
		p108.setBackground(Color.WHITE);
		p108.setBorder(new LineBorder(new Color(0, 0, 0)));
		p108.setBounds(146, 50, 55, 30);
		pReservation.add(p108);
		
		JLabel label_10 = new JLabel("108");
		p108.add(label_10);
		
		JPanel p203 = new JPanel();
		p203.setBackground(Color.WHITE);
		p203.setBorder(new LineBorder(new Color(0, 0, 0)));
		p203.setBounds(146, 90, 55, 30);
		pReservation.add(p203);
		
		JLabel label_15 = new JLabel("203");
		p203.add(label_15);
		
		JPanel p208 = new JPanel();
		p208.setBackground(Color.WHITE);
		p208.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));
		p208.setBounds(146, 130, 55, 30);
		pReservation.add(p208);
		
		JLabel label_20 = new JLabel("208");
		p208.add(label_20);
		
		JPanel p209 = new JPanel();
		p209.setBackground(Color.WHITE);
		p209.setBorder(new LineBorder(new Color(0, 0, 0)));
		p209.setBounds(213, 130, 55, 30);
		pReservation.add(p209);
		
		JLabel label_19 = new JLabel("209");
		p209.add(label_19);
		
		JPanel p204 = new JPanel();
		p204.setBackground(Color.WHITE);
		p204.setBorder(new LineBorder(new Color(0, 0, 0)));
		p204.setBounds(213, 90, 55, 30);
		pReservation.add(p204);
		
		JLabel label_16 = new JLabel("204");
		p204.add(label_16);
		
		JPanel p109 = new JPanel();
		p109.setBackground(Color.WHITE);
		p109.setBorder(new LineBorder(new Color(0, 0, 0)));
		p109.setBounds(213, 50, 55, 30);
		pReservation.add(p109);
		
		JLabel label_11 = new JLabel("109");
		p109.add(label_11);
		
		JPanel p104 = new JPanel();
		p104.setBackground(Color.WHITE);
		p104.setBorder(new LineBorder(new Color(0, 0, 0)));
		p104.setBounds(213, 10, 55, 30);
		pReservation.add(p104);
		
		JLabel label_6 = new JLabel("104");
		p104.add(label_6);
		
		JPanel p210 = new JPanel();
		p210.setBackground(Color.WHITE);
		p210.setBorder(new LineBorder(new Color(0, 0, 0)));
		p210.setBounds(280, 130, 55, 30);
		pReservation.add(p210);
		
		JLabel label_18 = new JLabel("210");
		p210.add(label_18);
		
		JPanel p205 = new JPanel();
		p205.setBackground(Color.WHITE);
		p205.setBorder(new LineBorder(new Color(0, 0, 0)));
		p205.setBounds(280, 90, 55, 30);
		pReservation.add(p205);
		
		JLabel label_17 = new JLabel("205");
		p205.add(label_17);
		
		JPanel p110 = new JPanel();
		p110.setBackground(Color.WHITE);
		p110.setBorder(new LineBorder(new Color(0, 0, 0)));
		p110.setBounds(280, 50, 55, 30);
		pReservation.add(p110);
		
		JLabel label_12 = new JLabel("110");
		p110.add(label_12);
		
		JPanel p105 = new JPanel();
		p105.setBackground(Color.WHITE);
		p105.setBorder(new LineBorder(new Color(0, 0, 0)));
		p105.setBounds(280, 10, 55, 30);
		pReservation.add(p105);
		
		JLabel label_7 = new JLabel("105");
		p105.add(label_7);
		
		final JPanel[] pArray = {p101,p102,p103,p104,p105,p106,p107,p108,p109,p110,p201,p202,p203,p204,p205,p206,p207,p208,p209,p210};
		
		JLabel label_1 = new JLabel("\uC608\uC57D \uD604\uD669");
		label_1.setFont(new Font("", Font.PLAIN, 20));
		label_1.setBounds(332, 56, 87, 24);
		contentPane.add(label_1);
		
		final JLabel todayLabel = new JLabel("");
		todayLabel.setFont(new Font("", Font.PLAIN, 20));
		todayLabel.setBounds(552, 56, 130, 24);
		contentPane.add(todayLabel);
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane.setBorder(new LineBorder(new Color(0, 0, 0)));
		tabbedPane.setBounds(40, 347, 642, 183);
		contentPane.add(tabbedPane);
		
		JPanel tCustomer = new JPanel();
		tCustomer.setToolTipText("");
		tabbedPane.addTab("\uACE0\uAC1D", null, tCustomer, null);
		tCustomer.setLayout(null);
		
		JLabel lblNewLabel_5 = new JLabel("\uACE0\uAC1D\uBA85");
		lblNewLabel_5.setBounds(12, 30, 57, 15);
		tCustomer.add(lblNewLabel_5);
		
		customerName2 = new JTextField();
		customerName2.setBounds(81, 27, 116, 21);
		tCustomer.add(customerName2);
		customerName2.setColumns(10);
		
		JButton joinBtn = new JButton("\uD68C\uC6D0\uAC00\uC785");
		joinBtn.setBounds(12, 90, 97, 23);
		tCustomer.add(joinBtn);
		
		JButton identifyCustomerBtn = new JButton("\uC870\uD68C");
		identifyCustomerBtn.setBounds(121, 90, 97, 23);
		tCustomer.add(identifyCustomerBtn);
		
		final JTextPane customerInfoField = new JTextPane();
		customerInfoField.setBounds(250, 10, 375, 134);
		tCustomer.add(customerInfoField);
		
		JPanel tRoom = new JPanel();
		tabbedPane.addTab("\uAC1D\uC2E4", null, tRoom, null);
		tRoom.setLayout(null);
		
		JLabel lblNewLabel_6 = new JLabel("\uAC1D\uC2E4");
		lblNewLabel_6.setBounds(12, 40, 57, 15);
		tRoom.add(lblNewLabel_6);
		
		final JComboBox cbRoom2 = new JComboBox(room);
		cbRoom2.setBounds(81, 37, 60, 21);
		tRoom.add(cbRoom2);
		
		final JTextPane roomInfoField = new JTextPane();
		roomInfoField.setBounds(250, 10, 375, 134);
		tRoom.add(roomInfoField);
		
		JPanel tStaff = new JPanel();
		tabbedPane.addTab("\uC9C1\uC6D0", null, tStaff, null);
		tStaff.setLayout(null);
		
		JLabel lblNewLabel_7 = new JLabel("\uC9C1\uC6D0\uBA85");
		lblNewLabel_7.setBounds(12, 30, 57, 15);
		tStaff.add(lblNewLabel_7);
		
		staffName = new JTextField();
		staffName.setBounds(100, 27, 116, 21);
		tStaff.add(staffName);
		staffName.setColumns(10);
		
		JButton joinStaffBtn = new JButton("\uC9C1\uC6D0 \uB4F1\uB85D");
		joinStaffBtn.setBounds(12, 80, 97, 23);
		tStaff.add(joinStaffBtn);
		
		JButton identifyStaffBtn = new JButton("\uC870\uD68C");
		identifyStaffBtn.setBounds(121, 80, 97, 23);
		tStaff.add(identifyStaffBtn);
		
		final JTextPane staffInfoField = new JTextPane();
		staffInfoField.setBounds(300, 10, 325, 134);
		tStaff.add(staffInfoField);
		
		JLabel label_3 = new JLabel("\uB4F1\uB85D/\uC870\uD68C");
		label_3.setFont(new Font("", Font.PLAIN, 20));
		label_3.setBounds(40, 313, 100, 24);
		contentPane.add(label_3);
		
		reservationBtn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				String name = customerName.getText();
				String start_day = startDay.getText();
				todayLabel.setText(start_day);
				String[] date = new String[3];
				
				if(name.equals("") || name.length()>=4){
					JOptionPane.showMessageDialog(null, "̸ ");
				}else{
					if(!start_day.equals("")){
						StringTokenizer st = new StringTokenizer(start_day,"/");
						int i=0;
						while(st.hasMoreTokens()){
							date[i] = st.nextToken();
							i++;
						}
						if(now>new Integer(date[0]+""+date[1]+""+date[2])){
							JOptionPane.showMessageDialog(null, " ¥  ¥   ϴ");
						}else{
							if(date[0] != null && date[1] != null && date[2] != null){
									start_day = start_day.replaceAll("/", "");
//									System.out.println(start_day);
									String[] info = {cbRoom.getSelectedItem().toString(),customerName.getText(),"",startDay.getText(),cbPeriod.getSelectedItem().toString()};
									int result = mg.updateReservation(info);
									if(result == 0){
										JOptionPane.showMessageDialog(null, " ");
									}else if(result == 1){
										JOptionPane.showMessageDialog(null, " ¥  ¥   ϴ");
									}else if(result == 2){
										JOptionPane.showMessageDialog(null, "̹ Ǿ ֽϴ");
									}else if(result == -1){
										JOptionPane.showMessageDialog(null, " ");
									}
							}else{
								JOptionPane.showMessageDialog(null, "ùٸ  ¥ ");
							}
						}
						
						String[] bookedRoom = mg.confirmReservation(start_day);
						if(bookedRoom.length>0){
							for(int j=0;j<20;j++){
								for(int k=0;k<bookedRoom.length;k++){
									if(room[j].equals(bookedRoom[k].toString())){
										pArray[j].setBackground(Color.YELLOW);
									}
								}
							}
						}
					}else{
						JOptionPane.showMessageDialog(null, "¥");
					}
				}
			}
		});
		cancelBtn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				mg.cancelReservation(customerName.getText(), startDay.getText());
			}
		});
		mntmOpen.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				mg.insertData();
			}
		});
		joinBtn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				JoinCustomerFrame jcf = new JoinCustomerFrame(mg);
				jcf.setVisible(true);
			}
		});
		identifyCustomerBtn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				String name=customerName2.getText();
				if(name.equals("") || name.length()>=4){
					JOptionPane.showMessageDialog(null, "߸ ̸Դϴ");
				}else{
					customerInfo = mg.identifyCustomer(name);
					if(customerInfo[0]==null){
						customerInfoField.setText("˻  ");
					}else{
						for(int i=0;i<customerInfo.length;i++){
							if(customerInfo[i] == null){
								customerInfo[i] = " ";
							}
						}
						String result = ":"+customerInfo[0]+"\n:"+customerInfo[1]+"\nּ:"+customerInfo[2]+"\nó:"+customerInfo[3]+"\n Ⱓ:"+customerInfo[4]+"\nֱ :"+customerInfo[5]+"\n(ִ):"+customerInfo[6];
						customerInfoField.setText(result);
					}
				}
			}
		});
		joinStaffBtn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				
			}
		});
		identifyStaffBtn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				String name = staffName.getText();
				if(name.equals("") || name.length()>=4){
					JOptionPane.showMessageDialog(null, "߸ ̸Դϴ");
				}else{
					staffInfo = mg.identifyStaff(name);
					if(staffInfo[0] == null){
						staffInfoField.setText("˻  ");
					}else{
						for(int i=0;i<staffInfo.length;i++){
							if(staffInfo[i] == null){
								staffInfo[i] = "˻  ";
							}
						}
						String result = ":"+staffInfo[0]+"\n:"+staffInfo[1]+"\nּ:"+staffInfo[2]+"\nó:"+staffInfo[3]+"\n (ִ):"+staffInfo[4]+"\n (ִ):"+staffInfo[5];
						staffInfoField.setText(result);
					}
				}
			}
		});
		cbRoom2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				roomInfo = mg.getRoomInfo(new Integer(cbRoom2.getSelectedItem().toString()).intValue());
				for(int i=0;i<roomInfo.length;i++){
					if(roomInfo[i] == null){
						roomInfo[i] = " ";
					}
				}
				String result = "ȣ:"+roomInfo[0]+"\n ο:"+roomInfo[1]+"\nŸ:"+roomInfo[2]+"\n:"+roomInfo[3]+"\n(ִ):"+roomInfo[4]+"\n(ִ)"+roomInfo[5];
				roomInfoField.setText(result);
			}
		});
	}