public static int checkLogin(Db db, LogAc logAc, String userName, char[] password){
		int i = 0;
		while (logAc.getDoctor(i)!=null){
			if (logAc.getDoctor(i).getUserName().equals(userName)){
				if (Arrays.equals(logAc.getDoctor(i).getPassword().toCharArray(),password))
					return 1;
			}
			i++;
		}
		i = 0;
		while (logAc.getAdmin(i)!=null){
			if (logAc.getAdmin(i).getUserName().equals(userName)){
				if (Arrays.equals(logAc.getAdmin(i).getPassword().toCharArray(),password))
					return 2;
			}
			i++;
		}		
		return 0;
	}