일반 사용자
호스트 사용자
관리자
CREATE TABLE "SPACE"."NOTICE"
( "N_NO" NUMBER(10,0),
"N_TITLE" VARCHAR2(2000 BYTE),
"N_CONTENT" VARCHAR2(2000 BYTE),
"N_IMG" VARCHAR2(500 BYTE),
"N_MSTATUS" NUMBER(1,0) DEFAULT 1,
"N_DATE" DATE,
"N_STATUS" NUMBER(1,0) DEFAULT 1,
"N_HID" VARCHAR2(20 BYTE)
)
CREATE TABLE "SPACE"."PAY"
( "P_NO" NUMBER(10,0),
"P_RENAME" VARCHAR2(50 BYTE),
"P_REPHONE" VARCHAR2(50 BYTE),
"P_REEMAIL" VARCHAR2(100 BYTE),
"P_REDATE" VARCHAR2(50 BYTE),
"P_REPEOPLE" NUMBER(10,0),
"P_PURPOSE" VARCHAR2(100 BYTE),
"P_REQUEST" VARCHAR2(500 BYTE),
"P_WAY" NUMBER(1,0),
"P_DATE" DATE,
"P_MID" VARCHAR2(20 BYTE),
"P_SNO" NUMBER(10,0),
"P_STATUS" NUMBER(1,0) DEFAULT 0,
"P_WSTATUS" NUMBER(1,0) DEFAULT 1,
"P_WDATE" DATE
)
CREATE TABLE "SPACE"."REVIEW"
( "R_NO" NUMBER(10,0),
"R_TITLE" VARCHAR2(2000 BYTE),
"R_CONTENT" VARCHAR2(2000 BYTE),
"R_IMG" VARCHAR2(500 BYTE),
"R_STATUS" NUMBER(1,0) DEFAULT 1,
"R_STAR" VARCHAR2(500 BYTE),
"R_RSTATUS" NUMBER(1,0) DEFAULT 1,
"R_DATE" DATE,
"R_SNO" NUMBER(10,0),
"R_MID" VARCHAR2(20 BYTE),
"R_PNO" NUMBER(10,0),
"R_COUNT" NUMBER(10,0)
)
CREATE TABLE "SPACE"."HOST"
( "H_ID" VARCHAR2(20 BYTE),
"H_PW" VARCHAR2(200 BYTE),
"H_NAME" VARCHAR2(50 BYTE),
"H_EMAIL" VARCHAR2(100 BYTE),
"H_PHONE" VARCHAR2(50 BYTE),
"H_STATUS" NUMBER(1,0) DEFAULT 1,
"H_SPACENAME" VARCHAR2(200 BYTE),
"H_CEONAME" VARCHAR2(50 BYTE),
"H_NUM" VARCHAR2(100 BYTE),
"H_ACCOUNT" VARCHAR2(100 BYTE),
"H_BANK" VARCHAR2(50 BYTE),
"H_ACCOUNTNAME" VARCHAR2(50 BYTE)
)
CREATE TABLE "SPACE"."MEMBER"
( "M_ID" VARCHAR2(20 BYTE),
"M_PW" VARCHAR2(200 BYTE),
"M_NAME" VARCHAR2(50 BYTE),
"M_EMAIL" VARCHAR2(100 BYTE),
"M_PHONE" VARCHAR2(50 BYTE),
"M_STATUS" NUMBER(1,0)
)
CREATE TABLE "SPACE"."QUESTIONANSWER"
( "QA_NO" NUMBER(10,0),
"QA_CONTENT" VARCHAR2(500 BYTE),
"QA_STATUS" NUMBER(1,0) DEFAULT 1,
"QA_DATE" DATE,
"QA_STATUS2" NUMBER(1,0) DEFAULT 1,
"QA_QNO" NUMBER(10,0)
)
CREATE TABLE "SPACE"."REVIEWANSWER"
( "A_NO" NUMBER(10,0),
"A_CONTENT" VARCHAR2(500 BYTE),
"A_STATUS" NUMBER(1,0) DEFAULT 1,
"A_DATE" DATE,
"A_STATUS2" NUMBER(1,0) DEFAULT 1,
"A_RNO" NUMBER(10,0),
"Key" VARCHAR2(255 BYTE),
"Key2" VARCHAR2(255 BYTE),
"Field" VARCHAR2(255 BYTE)
)
CREATE TABLE "SPACE"."QUESTION"
( "Q_NO" NUMBER(10,0) DEFAULT 1,
"Q_TITLE" VARCHAR2(2000 BYTE),
"Q_CONTENT" VARCHAR2(2000 BYTE),
"Q_IMG" VARCHAR2(500 BYTE),
"Q_STATUS" NUMBER(1,0) DEFAULT 1,
"Q_DATE" DATE,
"Q_MSTATUS" NUMBER(1,0) DEFAULT 1,
"Q_MID" VARCHAR2(20 BYTE),
"Q_HID" VARCHAR2(20 BYTE),
"Q_SNO" NUMBER(10,0),
"Q_COUNT" NUMBER(10,0)
)
CREATE TABLE "SPACE"."SPACE"
( "S_NO" NUMBER(10,0),
"S_NAME" VARCHAR2(100 BYTE),
"S_PRICE" VARCHAR2(20 BYTE),
"S_CATE" VARCHAR2(50 BYTE),
"S_INFO" VARCHAR2(500 BYTE),
"S_TAG" VARCHAR2(50 BYTE),
"S_GUIDE" VARCHAR2(500 BYTE),
"S_PERSON" NUMBER(10,0),
"S_NOTICE" VARCHAR2(500 BYTE),
"S_IMG" VARCHAR2(1000 BYTE),
"S_IMG2" VARCHAR2(1000 BYTE),
"S_MAP" VARCHAR2(500 BYTE),
"S_DETAIL_MAP" VARCHAR2(500 BYTE),
"S_LOCATION" VARCHAR2(500 BYTE),
"S_PARKING" NUMBER(1,0),
"S_ELEVATOR" VARCHAR2(20 BYTE),
"S_REFUND" VARCHAR2(500 BYTE),
"S_HEART" NUMBER(10,0),
"S_PSTATUS" NUMBER(1,0) DEFAULT 1,
"S_DATE" DATE,
"S_PDATE" VARCHAR2(20 BYTE),
"S_HID" VARCHAR2(20 BYTE)
)
CREATE TABLE "SPACE"."FAQ"
( "F_NO" NUMBER(10,0),
"F_TITLE" VARCHAR2(2000 BYTE),
"F_CONTENT" VARCHAR2(2000 BYTE),
"F_STATUS" NUMBER(1,0) DEFAULT 1,
"F_DATE" DATE,
"F_MSTATUS" NUMBER(1,0) DEFAULT 1,
"F_HID" VARCHAR2(20 BYTE)
)
package xyz.itwill.dto;
import lombok.Data;
/*
이름 널? 유형
--------- -------- --------------
F_NO NOT NULL NUMBER(10) //번호
F_TITLE NOT NULL VARCHAR2(2000) //제목
F_CONTENT NOT NULL VARCHAR2(2000) //내용
F_STATUS NOT NULL NUMBER(1) //상태 (0:삭제,1:일반)
F_DATE NOT NULL DATE //작성일자
F_MSTATUS NOT NULL NUMBER(1) //대상자 (0: 호스트, 1: 사용자)
F_HID NOT NULL VARCHAR2(20) //호스트아이디 (작성자)
*/
//create sequence faq_seq;
@Data
public class Faq {
private int fNo;
private String fTitle;
private String fContent;
private int fStatus;
private String fDate;
private int fMstatus;
private String fHid;
private int rn; //정렬 시 순번을 저장하기 위한 필드
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="xyz.itwill.mapper.FaqMapper">
<!-- faq 게시글 삽입 -->
<insert id="insertfaq">
<selectKey resultType="int" keyProperty="fNo" order="BEFORE">
select faq_seq.nextval from dual
</selectKey>
insert into faq values (#{fNo},#{fTitle},#{fContent},1 , sysdate ,#{fMstatus},#{fHid})
</insert>
<!-- faq 게시글 변경 (변경값이 있을 경우에만 변경) -->
<update id="updateFaq">
update faq
<set>
<if test="fTitle!=null and fTitle!=''">
f_Title=#{fTitle},
</if>
<if test="fContent!=null and fContent!=''">
f_Content=#{fContent},
</if>
<if test="fMstatus==0 or fMstatus==1">
f_Mstatus=#{fMstatus},
</if>
<if test="fStatus==0 or fStatus==1">
f_status=#{fStatus}
</if>
</set>
where f_No=#{fNo}
</update>
<!-- 글번호를 전달받아 faq 게시글 삭제 -->
<delete id="deleteFaq">
delete from faq where f_No=#{fNo}
</delete>
<!-- faq 게시글 총개수 -->
<select id="selectFaqCount" resultType="int">
select count(*) from faq
</select>
<!-- 글번호를 전달받아 faq 게시글 검색 -->
<select id="selectFaq" resultType="Faq">
select * from faq where f_No=#{fNo}
</select>
<!-- 최신글순으로 정렬하여 원하는 글범위의 faq list 검색 -->
<select id="selectFaqList" resultType="Faq">
select * from (select rownum rn, faqboard.* from (select * from faq order by f_no desc) faqboard) where rn between #{startRow} and #{endRow}
</select>
<!-- faq 상태별 list 출력 -->
<select id="selectstatusFaqList" resultType="Faq">
select * from (select rownum rn, faqboard.* from (select * from faq order by f_no desc) faqboard) where rn between #{startRow} and #{endRow} and f_Mstatus=#{fMstatus} and f_Status=#{fStatus}
</select>
<!-- faq 상태별 list 출력 -->
<select id="selectorstatusFaqList" resultType="Faq">
select * from (select rownum rn, faqboard.* from (select * from faq order by f_no desc) faqboard) where rn between #{startRow} and #{endRow} and f_Mstatus=#{fMstatus} or f_Status=#{fStatus}
</select>
</mapper>
package xyz.itwill.mapper;
import java.util.List;
import java.util.Map;
import xyz.itwill.dto.Faq;
public interface FaqMapper {
int insertfaq(Faq faq);
int updateFaq(Faq faq);
int deleteFaq(int fNo);
int selectFaqCount();
Faq selectFaq(int fNo);
List<Faq> selectFaqList(Map<String, Object> map);
List<Faq> selectstatusFaqList(Map<String, Object> map);
List<Faq> selectorstatusFaqList(Map<String, Object> map);
}
package xyz.itwill.dao;
import java.util.List;
import java.util.Map;
import xyz.itwill.dto.Faq;
public interface FaqDAO {
int insertFaq(Faq faq);
int updateFaq(Faq faq);
int deleteFaq(int fNo);
int selectFaqCount();
Faq selectFaq(int fNo);
List<Faq> selectFaqList(Map<String, Object> map);
List<Faq> selectstatusFaqList(Map<String, Object> map);
List<Faq> selectorstatusFaqList(Map<String, Object> map);
}
package xyz.itwill.dao;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;
import lombok.RequiredArgsConstructor;
import xyz.itwill.dto.Faq;
import xyz.itwill.mapper.FaqMapper;
@Repository
@RequiredArgsConstructor
public class FaqDAOImpl implements FaqDAO {
private final SqlSession sqlSession;
@Override
public int insertFaq(Faq faq) {
return sqlSession.getMapper(FaqMapper.class).insertfaq(faq);
}
@Override
public int updateFaq(Faq faq) {
return sqlSession.getMapper(FaqMapper.class).updateFaq(faq);
}
@Override
public int deleteFaq(int fNo) {
return sqlSession.getMapper(FaqMapper.class).deleteFaq(fNo);
}
@Override
public int selectFaqCount() {
return sqlSession.getMapper(FaqMapper.class).selectFaqCount();
}
@Override
public Faq selectFaq(int fNo) {
return sqlSession.getMapper(FaqMapper.class).selectFaq(fNo);
}
@Override
public List<Faq> selectFaqList(Map<String, Object> map) {
return sqlSession.getMapper(FaqMapper.class).selectFaqList(map);
}
@Override
public List<Faq> selectstatusFaqList(Map<String, Object> map) {
return sqlSession.getMapper(FaqMapper.class).selectstatusFaqList(map);
}
@Override
public List<Faq> selectorstatusFaqList(Map<String, Object> map) {
return sqlSession.getMapper(FaqMapper.class).selectorstatusFaqList(map);
}
}
package xyz.itwill.dto;
import lombok.Data;
/*
이름 널? 유형
------------- -------- -------------
H_ID NOT NULL VARCHAR2(20)
H_PW NOT NULL VARCHAR2(200)
H_NAME NOT NULL VARCHAR2(50)
H_EMAIL NOT NULL VARCHAR2(100)
H_PHONE NOT NULL VARCHAR2(50)
H_STATUS NOT NULL NUMBER(1) //0:탈퇴호스트 1:일반호스트,9:관리자
H_SPACENAME VARCHAR2(200) //상호명
H_CEONAME VARCHAR2(50) //대표자명
H_NUM VARCHAR2(100) //사업자 등록 번호
H_ACCOUNT VARCHAR2(100) //계좌번호
H_BANK VARCHAR2(50) //은행명
H_ACCOUNTNAME VARCHAR2(50) //예금주
<select class="form-control" id="hBank" name="hBank" required>
<option value="bank1">농협은행</option>
<option value="bank2">신한은행</option>
<option value="bank3">카카오뱅크</option>
<option value="bank4">케이뱅크</option>
<option value="bank5">우리은행</option>
</select>
*/
//create sequence host_seq;
//호스트 테이블
@Data
public class Host {
private String hId;
private String hPw;
private String hName;
private String hEmail;
private String hPhone;
private int hStatus;
private String hSpacename;
private String hCeoname;
private String hNum;
private String hAccount;
private String hBank;
private String hAccountname;
private int rn;
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="xyz.itwill.mapper.HostMapper">
<!-- 호스트 정보를 전달받아 HOST 테이블에 삽입 -->
<insert id="insertHost">
insert into host (h_id, h_pw, h_name, h_email, h_phone, h_status,
<trim suffixOverrides=",">
<if test="hSpacename!=null">h_spacename,</if>
<if test="hCeoname!=null">h_ceoname,</if>
<if test="hNum!=null">h_num,</if>
<if test="hAccount!=null">h_account,</if>
<if test="hBank!=null">h_bank,</if>
<if test="hAccountname!=null">h_accountname,</if>
</trim>
) values (#{hId},#{hPw},#{hName},#{hEmail},#{hPhone},1,
<trim suffixOverrides=",">
<if test="hSpacename!=null">#{hSpacename},</if>
<if test="hCeoname!=null">#{hCeoname},</if>
<if test="hNum!=null">#{hNum},</if>
<if test="hAccount!=null">#{hAccount},</if>
<if test="hBank!=null">#{hBank},</if>
<if test="hAccountname!=null">#{hAccountname},</if>
</trim>
)
</insert>
<!-- 호스트 정보를 전달받아 HOST 테이블에 저장된 회원정보 변경 -->
<update id="updateHost">
update host
<set>
<if test="hPw!=null and hPw!=''">
h_pw=#{hPw},
</if>
<if test="hName!=null and hName!=''">
h_name=#{hName},
</if>
<if test="hEmail!=null and hEmail!=''">
h_email=#{hEmail},
</if>
<if test="hPhone!=null and hPhone!=''">
h_phone=#{hPhone},
</if>
<if test="hStatus==0 or hStatus==1 or hStatus==9">
h_status=#{hStatus},
</if>
<if test="hSpacename!=null and hSpacename!=''">
h_spacename=#{hSpacename},
</if>
<if test="hCeoname!=null and hCeoname!=''">
h_ceoname=#{hCeoname},
</if>
<if test="hNum!=null and hNum!=''">
h_num=#{hNum},
</if>
<if test="hAccount!=null and hAccount!=''">
h_account=#{hAccount},
</if>
<if test="hBank!=null and hBank!=''">
h_bank=#{hBank},
</if>
<if test="hAccountname!=null and hAccountname!=''">
h_accountname=#{hAccountname}
</if>
</set>
where h_id=#{hId}
</update>
<!-- 탈퇴 처리 -->
<update id="removeHost">
update host
<set>
m_status==0
</set>
where s_hid=#{sHid}
</update>
<!-- 아이디를 전달받아 HOST 테이블에 저장된 해당 아이디의 회원정보 검색 -->
<select id="selectHost" resultType="Host">
select * from host where h_id=#{hId}
</select>
<!-- host 총 명수 -->
<select id="selectHostCount" resultType="int">
select count(*) from host
</select>
<!-- host정보 list 출력 -->
<select id="selectHostList" resultType="Host">
select * from (select rownum rn, hostlist.* from (select * from host order by h_id) hostlist) where rn between #{startRow} and #{endRow}
</select>
<!-- host 상태별 list 출력 -->
<select id="selectstatusHostList" resultType="Host">
select * from (select rownum rn, hostlist.* from (select * from host order by h_id) hostlist) where rn between #{startRow} and #{endRow} and h_status=#{hStatus}
</select>
<!-- id를 전달받아 hostinfo 삭제 -->
<delete id="deleteHost">
delete from host where h_id=#{hId}
</delete>
</mapper>
package xyz.itwill.mapper;
import java.util.List;
import java.util.Map;
import xyz.itwill.dto.Host;
public interface HostMapper {
int insertHost(Host host);
int updateHost(Host host);
Host selectHost(String hId);
int selectHostCount();
List<Host> selectHostList(Map<String, Object> map);
List<Host> selectstatusHostList(Map<String, Object> map);
int deleteHost(String hId);
int removeHost(String hId);
}
package xyz.itwill.dao;
import java.util.List;
import java.util.Map;
import xyz.itwill.dto.Host;
public interface HostDAO {
int insertHost(Host host);
int updateHost(Host host);
Host selectHost(String hId);
int selectHostCount();
List<Host> selectHostList(Map<String, Object> map);
List<Host> selectstatusHostList(Map<String, Object> map);
int deleteHost(String hId);
int removeHost(String hId);
}
package xyz.itwill.dao;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;
import lombok.RequiredArgsConstructor;
import xyz.itwill.dto.Host;
import xyz.itwill.mapper.HostMapper;
@Repository
@RequiredArgsConstructor
public class HostDAOImpl implements HostDAO {
private final SqlSession sqlSession;
@Override
public int insertHost(Host host) {
return sqlSession.getMapper(HostMapper.class).insertHost(host);
}
@Override
public int updateHost(Host host) {
return sqlSession.getMapper(HostMapper.class).updateHost(host);
}
@Override
public Host selectHost(String hId) {
return sqlSession.getMapper(HostMapper.class).selectHost(hId);
}
@Override
public int selectHostCount() {
return sqlSession.getMapper(HostMapper.class).selectHostCount();
}
@Override
public List<Host> selectHostList(Map<String, Object> map) {
return sqlSession.getMapper(HostMapper.class).selectHostList(map);
}
@Override
public int deleteHost(String hId) {
return sqlSession.getMapper(HostMapper.class).deleteHost(hId);
}
@Override
public List<Host> selectstatusHostList(Map<String, Object> map) {
return sqlSession.getMapper(HostMapper.class).selectstatusHostList(map);
}
@Override
public int removeHost(String hId) {
return sqlSession.getMapper(HostMapper.class).removeHost(hId);
}
}
package xyz.itwill.dto;
import lombok.Data;
/*
이름 널? 유형
--------- -------- --------------
N_NO NOT NULL NUMBER(10) //번호
N_TITLE NOT NULL VARCHAR2(2000) //제목
N_CONTENT NOT NULL VARCHAR2(2000) //내용
N_IMG VARCHAR2(500) //사진
N_MSTATUS NOT NULL NUMBER(1) //대상자 (0:호스트, 1:사용자)
N_DATE NOT NULL DATE //작성일자
N_STATUS NOT NULL NUMBER(1) //상태 (0:삭제,1:일반)
N_HID NOT NULL VARCHAR2(20) //호스트아이디 (작성자)
*/
@Data
public class Notice {
private int nno;
private String ntitle;
private String ncontent;
private String nimg;
private int nmstatus;
private String ndate;
private int nstatus;
private String nhid;
private int rn;
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="xyz.itwill.mapper.NoticeMapper">
<!-- notice 게시글 삽입 -->
<insert id="insertNotice">
<selectKey resultType="int" keyProperty="nno" order="BEFORE">
select notice_seq.nextval from dual
</selectKey>
insert into notice values(#{nno},#{ntitle},#{ncontent},#{nimg},#{nmstatus}, sysdate ,1,#{nhid})
</insert>
<!-- notice 게시글 변경 (변경값이 있을 경우에만 변경) -->
<update id="updateNotice">
update notice
<set>
<if test="ntitle!=null and ntitle!=''">
n_title=#{ntitle},
</if>
<if test="ncontent!=null and ncontent!=''">
n_content=#{ncontent},
</if>
<if test="nstatus==0 or nstatus==1">
n_status=#{nstatus},
</if>
<if test="nimg!=null and nimg!=''">
n_img=#{nimg},
</if>
<if test="nmstatus==0 or nmstatus==1">
n_mstatus=#{nmstatus}
</if>
</set>
where n_no=#{nno}
</update>
<!-- 글번호를 전달받아 notice 게시글 삭제 -->
<delete id="deleteNotice">
delete from notice where n_no=#{nno}
</delete>
<!-- notice 게시글 총개수 -->
<select id="selectNoticeCount" resultType="int">
select count(*) from notice
</select>
<!-- 글번호를 전달받아 notice 게시글 검색 -->
<select id="selectNotice" resultType="Notice">
select * from notice where n_no=#{nno}
</select>
<!-- 최신글순으로 정렬하여 원하는 글범위의 notice list 검색 -->
<select id="selectNoticeList" resultType="Notice">
select * from (select rownum rn, noticeboard.* from (select * from Notice order by n_no desc) noticeboard) where rn between #{startRow} and #{endRow}
</select>
<!-- 공지사항 상태별 list 출력 -->
<select id="selectstatusNoticeList" resultType="Notice">
select * from (select rownum rn, noticeboard.* from (select * from Notice order by n_no desc) noticeboard) where rn between #{startRow} and #{endRow} and n_mstatus=#{nmstatus} and n_status=#{nstatus}
</select>
<!-- 공지사항 상태별 list 출력 -->
<select id="selectorstatusNoticeList" resultType="Notice">
select * from (select rownum rn, noticeboard.* from (select * from Notice order by n_no desc) noticeboard) where rn between #{startRow} and #{endRow} and n_mstatus=#{nmstatus} or n_status=#{nstatus}
</select>
</mapper>
package xyz.itwill.mapper;
import java.util.List;
import java.util.Map;
import xyz.itwill.dto.Notice;
public interface NoticeMapper {
int insertNotice(Notice notice);
int updateNotice(Notice notice);
int deleteNotice(int nNo);
int selectNoticeCount();
Notice selectNotice(int nNo);
List<Notice> selectNoticeList(Map<String, Object> map);
List<Notice> selectstatusNoticeList(Map<String, Object> map);
List<Notice> selectorstatusNoticeList(Map<String, Object> map);
}
package xyz.itwill.dao;
import java.util.List;
import java.util.Map;
import xyz.itwill.dto.Notice;
public interface NoticeDAO {
int insertNotice(Notice notice);
int updateNotice(Notice notice);
int deleteNotice(int nNo);
int selectNoticeCount();
Notice selectNotice(int nNo);
List<Notice> selectNoticeList(Map<String, Object> map);
List<Notice> selectstatusNoticeList(Map<String, Object> map);
List<Notice> selectorstatusNoticeList(Map<String, Object> map);
}
package xyz.itwill.dao;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;
import lombok.RequiredArgsConstructor;
import xyz.itwill.dto.Notice;
import xyz.itwill.mapper.NoticeMapper;
@Repository
@RequiredArgsConstructor
public class NoticeDAOImpl implements NoticeDAO {
private final SqlSession sqlSession;
@Override
public int insertNotice(Notice notice) {
return sqlSession.getMapper(NoticeMapper.class).insertNotice(notice);
}
@Override
public int updateNotice(Notice notice) {
return sqlSession.getMapper(NoticeMapper.class).updateNotice(notice);
}
@Override
public int deleteNotice(int nNo) {
return sqlSession.getMapper(NoticeMapper.class).deleteNotice(nNo);
}
@Override
public int selectNoticeCount() {
return sqlSession.getMapper(NoticeMapper.class).selectNoticeCount();
}
@Override
public Notice selectNotice(int nNo) {
return sqlSession.getMapper(NoticeMapper.class).selectNotice(nNo);
}
@Override
public List<Notice> selectNoticeList(Map<String, Object> map) {
return sqlSession.getMapper(NoticeMapper.class).selectNoticeList(map);
}
@Override
public List<Notice> selectstatusNoticeList(Map<String, Object> map) {
return sqlSession.getMapper(NoticeMapper.class).selectstatusNoticeList(map);
}
@Override
public List<Notice> selectorstatusNoticeList(Map<String, Object> map) {
return sqlSession.getMapper(NoticeMapper.class).selectorstatusNoticeList(map);
}
}
package xyz.itwill.dto;
import lombok.Data;
/*
이름 널? 유형
---------- -------- -------------
P_NO NOT NULL NUMBER(10) - 결제 번호 (식별자)
P_RENAME NOT NULL VARCHAR2(50) - 결제한 예약자 이름
P_REPHONE NOT NULL VARCHAR2(50) - 결제한 예약자 연락처
P_REEMAIL NOT NULL VARCHAR2(100) - 결제한 예약자 이메일
P_REDATE NOT NULL VARCHAR2(50) - 결제한 공간의 예약날짜
P_REPEOPLE NOT NULL NUMBER(10) - 결제한 공간의 예약인원
P_PURPOSE NOT NULL VARCHAR2(100) - 결제한 공간의 사용목적
P_REQUEST NOT NULL VARCHAR2(500) - 결제한 공간의 요청사항
P_WAY NUMBER(1) - 결제 방식 (신용카드, 계좌이체)
P_DATE NOT NULL DATE - SYSDATE - 결제 날짜
P_MID NOT NULL VARCHAR2(20) - MEMBER 테이블의 식별자
P_SNO NOT NULL NUMBER(10) - SPACE 테이블의 식별자
P_STATUS NOT NULL NUMBER(1) - 결제 상태 (0:결제 - 기본값) (1:환불)
P_WSTATUS NUMBER - 정산 상태 (1:미완료 - 기본값) (0:호스트정산처리, 9 관리자승인완료 )
P_WDATE DATE - 정산 날짜
*/
//create sequence pay_seq;
//결제 테이블
@Data
public class Pay {
private int pNo; //자동 시퀀스값
private String pRename; //결제페이지에서 입력값
private String pRephone; //결제페이지에서 입력값
private String pReemail; //결제페이지에서 입력값
private String pRedate; //상세에서 받아옴 hidden으로
private int pRepeople; //상세에서 받아옴 hidden으로
private String pPurpose;//결제페이지에서 입력값
private String pRequest;//결제페이지에서 입력값
private int pWay; //결제페이지에서 입렵값
private String pDate; //결제한 sysdate
private int pSno; //상세에서 받아옴 hidden이나 요청 URL주소..?
private String pMid; //세션에 저장된 loginMember객체 저장
private int pstatus; //insert 되면 일단 결제상태 0 저장됨
private int pWstatus; //insert 되면 일단 정산상태 1 저장됨
private int pWno; //insert 되면 일단 null 저장 후, pWstatus가 0으로 변경되면 pWno에 wNo 저장
private String pWdate; //insert 되면 일단 null 저장 후, pWsatus가 0으로 변경되면 pWDate에 sysdate 저장
}
package xyz.itwill.dto;
import lombok.Data;
@Data
public class SpacePayHost {
private Pay pay;
private Space space;
private int rn;
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="xyz.itwill.mapper.AdminMapper">
<!-- 정산 미완료 건수 -->
<select id="selectnonpayCount" resultType="int">
select count(*) from pay where p_wstatus=0
</select>
<!-- 정산상태 변경 -->
<update id="updateadminPay">
update pay
<set>
<if test="pWstatus==0 or pWstatus==9">
p_wstatus=#{pWstatus},
</if>
</set>
where p_no=#{pNo}
</update>
<resultMap type="SpacePayHost" id="spacePayHostResultMap">
<result column="rn" property="rn"/>
<result column="keyword" property="keyword"/>
<association property="pay" javaType="Pay">
<id column="p_no" property="pNo"/>
<result column="p_sno" property="pSno"/>
<result column="p_wdate" property="pWdate"/>
<result column="p_wstatus" property="pWstatus"/>
</association>
<association property="space" javaType="Space">
<id column="s_no" property="sNo"/>
<result column="s_hid" property="sHid"/>
<result column="s_price" property="sPrice"/>
</association>
</resultMap>
<!-- 정산 list 출력2 -->
<select id="selectadminPayspaceList" resultMap="spacePayHostResultMap">
select * from (select rownum rn, paylist.* from (select p_no,p_sno,p_wdate,p_wstatus,s_no,s_hid,s_price from pay join space on p_sno=s_no order by p_no) paylist) where rn between #{startRow} and #{endRow}
</select>
<!-- 정산 상태별 list 출력2 -->
<select id="selectstatusPayspaceList" resultMap="spacePayHostResultMap">
select * from (select rownum rn, paylist.* from (select p_no,p_sno,p_wdate,p_wstatus,s_no,s_hid,s_price from pay join space on p_sno=s_no order by p_no) paylist) where rn between #{startRow} and #{endRow} and p_wstatus=#{pWstatus}
</select>
<select id="selectSearchList" parameterType="map" resultMap="spacePayHostResultMap">
<bind name="keyword" value="'%'+keyword+'%'"/>
select * from (select rownum rn, paylist.* from (select p_no,p_sno,p_wdate,p_wstatus,s_no,s_hid,s_price from pay join space on p_sno=s_no order by p_no) paylist) where rn between #{startRow} and #{endRow} and p_wstatus=#{pWstatus}
and s_hid=${keyword}
</select>
</mapper>
package xyz.itwill.mapper;
import java.util.List;
import java.util.Map;
import xyz.itwill.dto.Host;
import xyz.itwill.dto.Pay;
import xyz.itwill.dto.SpacePayHost;
public interface AdminMapper {
int selectnonpayCount();
Host selectadminHostspace(int sNo);
int updateadminPay(Pay pay);
List<SpacePayHost> selectadminPayspaceList(Map<String, Object> map);
List<SpacePayHost> selectstatusPayspaceList(Map<String, Object> map);
List<SpacePayHost> selectSearchList(Map<String, Object> map);
}
package xyz.itwill.dao;
import java.util.List;
import java.util.Map;
import xyz.itwill.dto.Host;
import xyz.itwill.dto.Pay;
import xyz.itwill.dto.SpacePayHost;
public interface AdminDAO {
int selectnonpayCount();
Host selectadminHostspace(int sNo);
int updateadminPay(Pay pay);
List<SpacePayHost> selectadminPayspaceList(Map<String, Object> map);
List<SpacePayHost> selectstatusPayspaceList(Map<String, Object> map);
List<SpacePayHost> selectSearchList(Map<String, Object> map);
}
package xyz.itwill.dao;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;
import lombok.RequiredArgsConstructor;
import xyz.itwill.dto.Host;
import xyz.itwill.dto.Pay;
import xyz.itwill.dto.SpacePayHost;
import xyz.itwill.mapper.AdminMapper;
@Repository
@RequiredArgsConstructor
public class AdminDAOImpl implements AdminDAO {
private final SqlSession sqlSession;
@Override
public int selectnonpayCount() {
return sqlSession.getMapper(AdminMapper.class).selectnonpayCount();
}
@Override
public Host selectadminHostspace(int sNo) {
return sqlSession.getMapper(AdminMapper.class).selectadminHostspace(sNo);
}
@Override
public int updateadminPay(Pay pay) {
return sqlSession.getMapper(AdminMapper.class).updateadminPay(pay);
}
@Override
public List<SpacePayHost> selectadminPayspaceList(Map<String, Object> map) {
return sqlSession.getMapper(AdminMapper.class).selectadminPayspaceList(map);
}
@Override
public List<SpacePayHost> selectstatusPayspaceList(Map<String, Object> map) {
return sqlSession.getMapper(AdminMapper.class).selectstatusPayspaceList(map);
}
@Override
public List<SpacePayHost> selectSearchList(Map<String, Object> map) {
return sqlSession.getMapper(AdminMapper.class).selectSearchList(map);
}
}
package xyz.itwill.service;
import java.util.List;
import java.util.Map;
import xyz.itwill.dto.Faq;
import xyz.itwill.dto.Host;
import xyz.itwill.dto.Notice;
import xyz.itwill.dto.Pay;
import xyz.itwill.dto.SpacePayHost;
import xyz.itwill.exception.BoardNotFoundException;
public interface AdminService {
//faq
void addFaq(Faq faq);
void modifyFaq(Faq faq) throws BoardNotFoundException;
void removeFaq(int fNo) throws BoardNotFoundException;
int getFaqCount();
Faq getFaq(int fNo) throws BoardNotFoundException;
List<Faq> getFaqList(Map<String, Object> map);
List<Faq> getstatusFaqList(Map<String, Object> map);
List<Faq> getorstatusFaqList(Map<String, Object> map);
//notice
void addNotice(Notice notice);
void modifyNotice(Notice notice) throws BoardNotFoundException;
void removeNotice(int nNo) throws BoardNotFoundException;
int getNoticeCount();
Notice getNotice(int nNo) throws BoardNotFoundException;
List<Notice> getNoticeList(Map<String, Object> map);
List<Notice> getstatusNoticeList(Map<String, Object> map);
List<Notice> getorstatusNoticeList(Map<String, Object> map);
//pay
int getnonpayCount();
Host getadminHostspace(int sNo);
int modifyadminPay(Pay pay);
List<SpacePayHost> getadminPaySpaceList(Map<String, Object> map);
List<SpacePayHost> getstatusPaySpaceList(Map<String, Object> map);
List<SpacePayHost> getSearchList(Map<String, Object> map);
}
package xyz.itwill.service;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import lombok.RequiredArgsConstructor;
import xyz.itwill.dao.AdminDAO;
import xyz.itwill.dao.FaqDAO;
import xyz.itwill.dao.NoticeDAO;
import xyz.itwill.dto.Faq;
import xyz.itwill.dto.Host;
import xyz.itwill.dto.Notice;
import xyz.itwill.dto.Pay;
import xyz.itwill.dto.SpacePayHost;
import xyz.itwill.exception.BoardNotFoundException;
@Service
@RequiredArgsConstructor
public class AdminServiceImpl implements AdminService {
private final FaqDAO faqDAO;
private final NoticeDAO noticeDAO;
private final AdminDAO adminDAO;
//faq
@Transactional
@Override
public void addFaq(Faq faq) {
faqDAO.insertFaq(faq);
}
@Transactional
@Override
public void modifyFaq(Faq faq) throws BoardNotFoundException {
if(faqDAO.selectFaq(faq.getFNo())==null) {
throw new BoardNotFoundException("해당 게시글을 찾을 수 없습니다.");
}
faqDAO.updateFaq(faq);
}
@Transactional
@Override
public void removeFaq(int fNo) throws BoardNotFoundException {
if(faqDAO.selectFaq(fNo)==null) {
throw new BoardNotFoundException("해당 게시글을 찾을 수 없습니다.");
}
faqDAO.deleteFaq(fNo);
}
@Override
public int getFaqCount() {
return faqDAO.selectFaqCount();
}
@Override
public Faq getFaq(int fNo) throws BoardNotFoundException {
if(faqDAO.selectFaq(fNo)==null) {
throw new BoardNotFoundException("해당 게시글을 찾을 수 없습니다.");
}
return faqDAO.selectFaq(fNo);
}
@Override
public List<Faq> getFaqList(Map<String, Object> map) {
return faqDAO.selectFaqList(map);
}
//notice
@Transactional
@Override
public void addNotice(Notice notice) {
noticeDAO.insertNotice(notice);
}
@Transactional
@Override
public void modifyNotice(Notice notice) throws BoardNotFoundException {
if(noticeDAO.selectNotice(notice.getNno()) ==null) {
throw new BoardNotFoundException("해당 게시글을 찾을 수 없습니다.");
}
noticeDAO.updateNotice(notice);
}
@Transactional
@Override
public void removeNotice(int nNo) throws BoardNotFoundException {
if(noticeDAO.selectNotice(nNo)==null) {
throw new BoardNotFoundException("해당 게시글을 찾을 수 없습니다.");
}
noticeDAO.deleteNotice(nNo);
}
@Override
public int getNoticeCount() {
return noticeDAO.selectNoticeCount();
}
@Override
public Notice getNotice(int nNo) throws BoardNotFoundException {
if(noticeDAO.selectNotice(nNo)==null) {
throw new BoardNotFoundException("해당 게시글을 찾을 수 없습니다.");
}
return noticeDAO.selectNotice(nNo);
}
@Override
public List<Notice> getNoticeList(Map<String, Object> map) {
return noticeDAO.selectNoticeList(map);
}
@Override
public List<Faq> getstatusFaqList(Map<String, Object> map) {
return faqDAO.selectstatusFaqList(map);
}
@Override
public List<Notice> getstatusNoticeList(Map<String, Object> map) {
return noticeDAO.selectstatusNoticeList(map);
}
@Override
public List<Faq> getorstatusFaqList(Map<String, Object> map) {
return faqDAO.selectorstatusFaqList(map);
}
@Override
public List<Notice> getorstatusNoticeList(Map<String, Object> map) {
return noticeDAO.selectorstatusNoticeList(map);
}
@Override
public int getnonpayCount() {
return adminDAO.selectnonpayCount();
}
@Override
public Host getadminHostspace(int sNo) {
return adminDAO.selectadminHostspace(sNo);
}
@Override
public int modifyadminPay(Pay pay) {
return adminDAO.updateadminPay(pay);
}
@Override
public List<SpacePayHost> getadminPaySpaceList(Map<String, Object> map) {
return adminDAO.selectadminPayspaceList(map);
}
@Override
public List<SpacePayHost> getstatusPaySpaceList(Map<String, Object> map) {
return adminDAO.selectstatusPayspaceList(map);
}
@Override
public List<SpacePayHost> getSearchList(Map<String, Object> map) {
return adminDAO.selectSearchList(map);
}
}
package xyz.itwill.service;
import java.util.List;
import java.util.Map;
import xyz.itwill.dto.Host;
import xyz.itwill.exception.ExistsHostException;
import xyz.itwill.exception.HostNotFoundException;
import xyz.itwill.exception.LoginAuthFailException;
public interface HostService {
void addHost(Host host) throws ExistsHostException;
void modifyHost(Host host) throws HostNotFoundException;
Host getHost(String hId) throws HostNotFoundException;
Host loginAuth(Host host) throws LoginAuthFailException;
int getHostCount();
List<Host> getHostList(Map<String, Object> map);
List<Host> getHoststatusList(Map<String, Object> map);
void removehost(String hId) throws HostNotFoundException;
void deleteHost(String hId) throws HostNotFoundException;
}
package xyz.itwill.service;
import java.util.List;
import java.util.Map;
import org.mindrot.jbcrypt.BCrypt;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import lombok.RequiredArgsConstructor;
import xyz.itwill.dao.HostDAO;
import xyz.itwill.dto.Host;
import xyz.itwill.exception.ExistsHostException;
import xyz.itwill.exception.HostNotFoundException;
import xyz.itwill.exception.LoginAuthFailException;
@Service
@RequiredArgsConstructor
public class HostServiceImpl implements HostService {
private final HostDAO hostDAO;
@Transactional
@Override
public void addHost(Host host) throws ExistsHostException {
if(hostDAO.selectHost(host.getHId())!=null){
throw new ExistsHostException("이미 사용 중인 호스트 아이디를 입력 하였습니다.", host);
}
host.setHPw(BCrypt.hashpw(host.getHPw(),BCrypt.gensalt()));
//삽입처리
hostDAO.insertHost(host);
}
@Transactional
@Override
public void modifyHost(Host host) throws HostNotFoundException {
if(hostDAO.selectHost(host.getHId())==null) {
throw new HostNotFoundException("호스트 아이디의 회원정보가 존재하지 않습니다.");
}
if(host.getHPw()!=null && !host.getHPw().equals("")) {
host.setHPw(BCrypt.hashpw(host.getHPw(),BCrypt.gensalt()));
}
if(host.getHName()!=null && !host.getHName().equals("")) {
host.setHName(host.getHName());
}
if(host.getHEmail()!=null && !host.getHEmail().equals("")) {
host.setHEmail(host.getHEmail());
}
if(host.getHPhone()!=null && !host.getHPhone().equals("")) {
host.setHPhone(host.getHPhone());
}
if(host.getHStatus()==0 || host.getHStatus()==1 || host.getHStatus()==9) {
host.setHStatus(host.getHStatus());
}
if(host.getHSpacename()!=null && !host.getHSpacename().equals("")) {
host.setHSpacename(host.getHSpacename());
}
if(host.getHCeoname()!=null && !host.getHCeoname().equals("")) {
host.setHCeoname(host.getHCeoname());
}
if(host.getHNum()!=null && !host.getHNum().equals("")) {
host.setHNum(host.getHNum());
}
if(host.getHAccount()!=null && !host.getHAccount().equals("")) {
host.setHAccount(host.getHAccount());
}
if(host.getHBank()!=null && !host.getHBank().equals("")) {
host.setHBank(host.getHPhone());
}
if(host.getHAccountname()!=null && !host.getHAccountname().equals("")) {
host.setHAccountname(host.getHAccountname());
}
//변경처리
hostDAO.updateHost(host);
}
@Override
public Host getHost(String hId) throws HostNotFoundException {
Host host=hostDAO.selectHost(hId);
if(host==null) {
throw new HostNotFoundException("호스트 아이디의 회원정보가 존재하지 않습니다.");
}
return host;
}
@Override
public Host loginAuth(Host host) throws LoginAuthFailException {
Host loginHost=hostDAO.selectHost(host.getHId());
if(loginHost==null || loginHost.getHId().equals("")) {
throw new LoginAuthFailException("호스트 아이디의 회원정보가 존재하지 않습니다.", host.getHId());
}
if(!BCrypt.checkpw(host.getHPw(), loginHost.getHPw())) {
throw new LoginAuthFailException("호스트의 비밀번호가 맞지 않습니다.", host.getHId());
}
return loginHost;
}
@Override
public int getHostCount() {
return hostDAO.selectHostCount();
}
@Override
public List<Host> getHostList(Map<String, Object> map) {
return hostDAO.selectHostList(map);
}
@Override
public void removehost(String hId) throws HostNotFoundException {
if(hostDAO.selectHost(hId)==null) {
throw new HostNotFoundException("호스트 아이디의 회원정보가 존재하지 않습니다.");
}
hostDAO.deleteHost(hId);
}
@Override
public List<Host> getHoststatusList(Map<String, Object> map) {
return hostDAO.selectstatusHostList(map);
}
@Override
public void deleteHost(String hId) throws HostNotFoundException {
Host host=hostDAO.selectHost(hId);
if(host==null) {
throw new HostNotFoundException("호스트 아이디의 회원정보가 존재하지 않습니다.");
}
}
}
package xyz.itwill.controller;
import java.io.File;
import java.io.IOException;
//모든 페이지 관리자 권한 설정
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.multipart.MultipartFile;
import lombok.RequiredArgsConstructor;
import xyz.itwill.dto.Faq;
import xyz.itwill.dto.Host;
import xyz.itwill.dto.Notice;
import xyz.itwill.dto.Pay;
import xyz.itwill.dto.SpacePayHost;
import xyz.itwill.exception.BoardNotFoundException;
import xyz.itwill.exception.HostNotFoundException;
import xyz.itwill.exception.PayNotFoundException;
import xyz.itwill.exception.SpaceNotFoundException;
import xyz.itwill.service.AdminService;
import xyz.itwill.service.HostService;
import xyz.itwill.service.OrderService;
import xyz.itwill.util.Pager;
@Controller
@RequestMapping("/admin/")
@RequiredArgsConstructor
public class AdminController {
private final AdminService adminService;
private final HostService hostService;
private final WebApplicationContext context;
private final OrderService orderService;
//관리자페이지의 faq 클릭했을경우 faq전체 리스트 출력
@RequestMapping(value = "faq")
public String faq(Model model, @RequestParam int fmstatus, @RequestParam int fstatus) {
model.addAttribute("totalFaqCount", adminService.getFaqCount());
model.addAttribute("fmstatus", fmstatus);
model.addAttribute("fstatus", fstatus);
return "admin/admin_faq";
}
//faq전체 리스트 출력 시 페이징 처리를 위해 Json형식의 text로 Map객체 전달, 상태별 게시글 필터링
@RequestMapping(value = "faqList", method = RequestMethod.GET)
@ResponseBody
public Map<String, Object> faqlist(@RequestParam(defaultValue = "1") int pageNum, @RequestParam int fmstatus, @RequestParam int fstatus) {
int totalQuestion=adminService.getFaqCount();
int pageSize=5;
int blockSize=5;
Pager pager=new Pager(pageNum, totalQuestion, pageSize, blockSize);
Map<String, Object> pageMap=new HashMap<String, Object>();
pageMap.put("startRow", pager.getStartRow());
pageMap.put("endRow", pager.getEndRow());
pageMap.put("fMstatus", fmstatus);
pageMap.put("fStatus", fstatus);
Map<String, Object> resultMap=new HashMap<String, Object>();
if (fmstatus==1 && fstatus==0) {
List<Faq> faqList=adminService.getstatusFaqList(pageMap);
resultMap.put("faqList", faqList);
} else if(fmstatus==0 && fstatus==1) {
List<Faq> faqList=adminService.getstatusFaqList(pageMap);
resultMap.put("faqList", faqList);
} else if(fmstatus==0 && fstatus==0) {
List<Faq> faqList=adminService.getstatusFaqList(pageMap);
resultMap.put("faqList", faqList);
} else if(fmstatus==1 && fstatus==1) {
List<Faq> faqList=adminService.getstatusFaqList(pageMap);
resultMap.put("faqList", faqList);
} else if(fmstatus==1 && fstatus==2) {
List<Faq> faqList=adminService.getorstatusFaqList(pageMap);
resultMap.put("faqList", faqList);
} else if(fmstatus==0 && fstatus==2) {
List<Faq> faqList=adminService.getorstatusFaqList(pageMap);
resultMap.put("faqList", faqList);
} else if(fmstatus==2 && fstatus==1) {
List<Faq> faqList=adminService.getorstatusFaqList(pageMap);
resultMap.put("faqList", faqList);
} else if(fmstatus==2 && fstatus==0) {
List<Faq> faqList=adminService.getorstatusFaqList(pageMap);
resultMap.put("faqList", faqList);
} else {
List<Faq> faqList=adminService.getFaqList(pageMap);
resultMap.put("faqList", faqList);
}
resultMap.put("pager", pager);
return resultMap;
}
//게시글 등록 클릭했을경우 faq 등록 페이지로 이동
@RequestMapping(value = "faq/write", method = RequestMethod.GET)
public String faqwrite(HttpSession session, Model model) {
Host loginHost = (Host)session.getAttribute("loginHost");
model.addAttribute("loginHost",loginHost);
return "admin/admin_faq_write";
}
//입력값 작성 후 게시글 등록 클릭했을경우 삽입 후 faq페이지로 이동
@RequestMapping(value = "faq/write", method = RequestMethod.POST)
public String faqwrite(@ModelAttribute Faq faq) {
adminService.addFaq(faq);
return "redirect:/admin/faq?fmstatus=2&fstatus=2";
}
//게시글을 전달받아 수정하고 처리결과를 텍스트로 응답
@RequestMapping(value ="faq/modify/{fno}", method = {RequestMethod.PUT, RequestMethod.PATCH})
@ResponseBody
public String faqmodify(@PathVariable int fno, @RequestBody Faq faq) throws BoardNotFoundException {
Faq modifyfaq=adminService.getFaq(fno);
modifyfaq.setFTitle(faq.getFTitle());
modifyfaq.setFContent(faq.getFContent());
modifyfaq.setFMstatus(faq.getFMstatus());
modifyfaq.setFStatus(faq.getFStatus());
adminService.modifyFaq(modifyfaq);
return "success";
}
//선택된 게시글을 전달받아 해당 게시글을 삭제 처리
@RequestMapping(value ="faqremove" , method = RequestMethod.POST)
@ResponseBody
public String faqremove(@RequestParam(value = "fno[]") List<Integer> fno) throws BoardNotFoundException {
for(int i=0; i<fno.size();i++) {
adminService.removeFaq(fno.get(i));
}
return "success";
}
//관리자페이지의 공지사항 클릭했을경우 공지사항 리스트 출력
@RequestMapping(value = "notice")
public String notice(Model model, @RequestParam int nmstatus, @RequestParam int nstatus) {
model.addAttribute("totalNoticeCount", adminService.getNoticeCount());
model.addAttribute("nmstatus", nmstatus);
model.addAttribute("nstatus", nstatus);
return "admin/admin_notice";
}
//notice 전체 리스트 출력 시 페이징 처리를 위해 Json형식의 text로 Map객체 전달, 상태별 게시글 필터링
@RequestMapping(value = "noticeList", method = RequestMethod.GET)
@ResponseBody
public Map<String, Object> noticelist(@RequestParam(defaultValue = "1") int pageNum, @RequestParam int nmstatus, @RequestParam int nstatus) {
int totalQuestion=adminService.getNoticeCount();
int pageSize=10;
int blockSize=5;
Pager pager=new Pager(pageNum, totalQuestion, pageSize, blockSize);
Map<String, Object> pageMap=new HashMap<String, Object>();
pageMap.put("startRow", pager.getStartRow());
pageMap.put("endRow", pager.getEndRow());
pageMap.put("nmstatus", nmstatus);
pageMap.put("nstatus", nstatus);
Map<String, Object> resultMap=new HashMap<String, Object>();
if (nmstatus==1 && nstatus==0) {
List<Notice> noticeList=adminService.getstatusNoticeList(pageMap);
resultMap.put("noticeList", noticeList);
} else if(nmstatus==0 && nstatus==1) {
List<Notice> noticeList=adminService.getstatusNoticeList(pageMap);
resultMap.put("noticeList", noticeList);
} else if(nmstatus==0 && nstatus==0) {
List<Notice> noticeList=adminService.getstatusNoticeList(pageMap);
resultMap.put("noticeList", noticeList);
} else if(nmstatus==1 && nstatus==1) {
List<Notice> noticeList=adminService.getstatusNoticeList(pageMap);
resultMap.put("noticeList", noticeList);
} else if(nmstatus==1 && nstatus==2) {
List<Notice> noticeList=adminService.getorstatusNoticeList(pageMap);
resultMap.put("noticeList", noticeList);
} else if(nmstatus==0 && nstatus==2) {
List<Notice> noticeList=adminService.getorstatusNoticeList(pageMap);
resultMap.put("noticeList", noticeList);
} else if(nmstatus==2 && nstatus==1) {
List<Notice> noticeList=adminService.getorstatusNoticeList(pageMap);
resultMap.put("noticeList", noticeList);
} else if(nmstatus==2 && nstatus==0) {
List<Notice> noticeList=adminService.getorstatusNoticeList(pageMap);
resultMap.put("noticeList", noticeList);
} else {
List<Notice> noticeList=adminService.getNoticeList(pageMap);
resultMap.put("noticeList", noticeList);
}
resultMap.put("pager", pager);
return resultMap;
}
//공지사항 게시글 작성시 파일 업로드하여 삽입 후 업로드 이름으로 이미지 이름 변경
@RequestMapping(value = "upload", method = RequestMethod.POST)
public String upload(@RequestParam MultipartFile uploadFile, Model model, @ModelAttribute Notice notice ) throws IOException, BoardNotFoundException {
if(uploadFile.isEmpty()) {
return "admin/upload_fail";
}
String uploadDirectory=context.getServletContext().getRealPath("/resources/images/notice");
String originalFilename=uploadFile.getOriginalFilename();
File file=new File(uploadDirectory, originalFilename);
String uploadFilename=originalFilename;
int i=0;
while(file.exists()) {
i++;
int index=originalFilename.lastIndexOf(".");
uploadFilename=originalFilename.substring(0, index)+"_"+i+originalFilename.substring(index);
file=new File(uploadDirectory, uploadFilename);
}
uploadFile.transferTo(file);
model.addAttribute("originalFilename", originalFilename);
model.addAttribute("uploadFilename", uploadFilename);
adminService.addNotice(notice);
Notice noticeinfo= adminService.getNotice(notice.getNno());
noticeinfo.setNimg(uploadFilename);
adminService.modifyNotice(noticeinfo);
return "redirect:/admin/notice?nmstatus=2&nstatus=2";
}
//게시글 등록 클릭했을경우 notice 등록 페이지로 이동
@RequestMapping(value = "notice/write", method = RequestMethod.GET)
public String noticewrite(HttpSession session, Model model) {
Host loginHost = (Host)session.getAttribute("loginHost");
model.addAttribute("loginHost",loginHost);
return "admin/admin_notice_write";
}
//글번호를 전달받아 해당 글번호의 게시글을 검색하여 출력
@RequestMapping(value ="notice/view", method = RequestMethod.GET)
public String noticeView(@RequestParam int nno, Model model) throws BoardNotFoundException {
model.addAttribute("noticeview", adminService.getNotice(nno));
return "admin/admin_notice_view";
}
//게시글 변경을 클릭하면 게시글을 변경페이지로 이동
@RequestMapping(value = "notice/modify", method = RequestMethod.GET)
public String noticeModify(@RequestParam int nno, Model model) throws BoardNotFoundException {
model.addAttribute("noticeinfo", adminService.getNotice(nno));
return "admin/admin_notice_modify";
}
//게시글 변경 옵션을 변경시킬경우 수정 후 리스트 출력
@RequestMapping(value ="notice/modifystatus/{nno}", method = {RequestMethod.PUT, RequestMethod.PATCH})
@ResponseBody
public String noticemodifystatus(@PathVariable int nno, @RequestBody Notice notice) throws BoardNotFoundException {
Notice modifynoticestatus=adminService.getNotice(nno);
modifynoticestatus.setNmstatus(notice.getNmstatus());
modifynoticestatus.setNstatus(notice.getNstatus());
adminService.modifyNotice(modifynoticestatus);
return "success";
}
//게시글을 전달받아 게시글을 변경하고 처리결과를 일반 텍스트로 응답
@RequestMapping(value = "notice/modify", method = RequestMethod.POST)
public String noticeModify(@ModelAttribute Notice notice) throws BoardNotFoundException {
adminService.modifyNotice(notice);
return "redirect:/admin/notice/view?nno="+notice.getNno();
}
//선택된 게시글을 전달받아 해당 게시글 삭제 처리
@RequestMapping(value ="noticeremove" , method = RequestMethod.POST)
@ResponseBody
public String noticeremove(@RequestParam(value = "notice[]") List<Integer> nno) throws BoardNotFoundException {
for(int i=0; i<nno.size();i++) {
adminService.removeNotice(nno.get(i));
}
return "success";
}
//관리자페이지의 host 클릭했을경우 host전체 리스트 출력
@RequestMapping(value = "host")
public String host(Model model, @RequestParam int hstatus) {
model.addAttribute("totalHostCount", hostService.getHostCount());
model.addAttribute("hstatus", hstatus);
return "admin/admin_host";
}
//host전체 리스트 출력 시 페이징 처리를 위해 Json형식의 text로 Map객체 전달
@RequestMapping(value = "hostList", method = RequestMethod.GET)
@ResponseBody
public Map<String, Object> hostlist(@RequestParam(defaultValue = "1") int pageNum, @RequestParam int hstatus) {
int totalQuestion=hostService.getHostCount();
int pageSize=10;
int blockSize=5;
Pager pager=new Pager(pageNum, totalQuestion, pageSize, blockSize);
Map<String, Object> pageMap=new HashMap<String, Object>();
pageMap.put("startRow", pager.getStartRow());
pageMap.put("endRow", pager.getEndRow());
pageMap.put("hStatus", hstatus);
Map<String, Object> resultMap=new HashMap<String, Object>();
if(hstatus==1) {
List<Host> hostList=hostService.getHoststatusList(pageMap);
resultMap.put("hostList",hostList );
} else if(hstatus==0) {
List<Host> hostList=hostService.getHoststatusList(pageMap);
resultMap.put("hostList",hostList );
} else if(hstatus==9) {
List<Host> hostList=hostService.getHoststatusList(pageMap);
resultMap.put("hostList",hostList );
} else {
List<Host> hostList=hostService.getHostList(pageMap);
resultMap.put("hostList",hostList );
}
resultMap.put("pager", pager);
return resultMap;
}
//호스트아이디를 전달받아 상태수정하고 처리결과를 텍스트로 응답
@RequestMapping(value ="host/modifystatus/{hid}", method = {RequestMethod.PUT, RequestMethod.PATCH})
@ResponseBody
public String hostmodify(@PathVariable String hid, @RequestBody Host host) throws HostNotFoundException {
Host modifyhost=hostService.getHost(hid);
modifyhost.setHStatus(host.getHStatus());
hostService.modifyHost(modifyhost);
return "success";
}
//선택된 호스트아이디를 전달받아 해당 호스트 정보를 삭제 처리
@RequestMapping(value ="hostremove" , method = RequestMethod.POST)
@ResponseBody
public String hostremove(@RequestParam(value = "host[]") List<String> hid) throws HostNotFoundException {
for(int i=0; i<hid.size();i++) {
hostService.removehost(hid.get(i));
}
return "success";
}
//관리자페이지의 정산하기 클릭했을경우 정산리스트 출력
@RequestMapping("pay")
public String pay(Model model, @RequestParam int pwstatus) {
model.addAttribute("totalnonpayCount", adminService.getnonpayCount());
model.addAttribute("pwstatus", pwstatus);
return "admin/admin_pay";
}
//정산리스트 출력 시 페이징 처리를 위해 Json형식의 text로 Map객체 전달
@RequestMapping(value = "payList", method = RequestMethod.GET)
@ResponseBody
public Map<String, Object> payList(@RequestParam(defaultValue = "1") int pageNum, @RequestParam int pwstatus) throws PayNotFoundException, SpaceNotFoundException {
int totalQuestion=orderService.getPayCount();
int pageSize=15;
int blockSize=5;
Pager pager=new Pager(pageNum, totalQuestion, pageSize, blockSize);
Map<String, Object> pageMap=new HashMap<String, Object>();
pageMap.put("startRow", pager.getStartRow());
pageMap.put("endRow", pager.getEndRow());
pageMap.put("pWstatus", pwstatus);
Map<String, Object> resultMap=new HashMap<String, Object>();
if(pwstatus==0) {
List<SpacePayHost> payList=adminService.getstatusPaySpaceList(pageMap);
resultMap.put("payList",payList );
} else if(pwstatus==9) {
List<SpacePayHost> payList=adminService.getstatusPaySpaceList(pageMap);
resultMap.put("payList",payList );
} else {
List<SpacePayHost> payList=adminService.getadminPaySpaceList(pageMap);
resultMap.put("payList",payList );
}
resultMap.put("pager", pager);
return resultMap;
}
//결제번호를 전달받아 상태수정하고 처리결과를 텍스트로 응답
@RequestMapping(value ="pay/modifystatus/{pno}", method = {RequestMethod.PUT, RequestMethod.PATCH})
@ResponseBody
public String paymodify(@PathVariable int pno, @RequestBody Pay pay) throws PayNotFoundException {
Pay modifypay=orderService.getPay(pno);
modifypay.setPWstatus(pay.getPWstatus());
adminService.modifyadminPay(modifypay);
return "success";
}
//해당 게시물을 찾을 수 없을경우 에러페이지로 이동
@ExceptionHandler(BoardNotFoundException.class)
public String userinfoExceptionHandler(BoardNotFoundException exception) {
return "exception/exception_error";
}
//관리자 인증 실패시 호스트 로그인 페이지로 이동
@RequestMapping(value = "/login/host",method = RequestMethod.GET)
public String adminLogin() {
return "host/host_login";
}
}
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>SpaceCloud</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="HTML5 Landing Template" />
<meta name="keywords" content="Landing, Multipurpose, Application, Clean, Saas, Dashboard, Bootstrap4" />
<meta content="Uniquecrewdesign" name="author" />
<meta content="uniquecrewdesign@gmail.com" name="Email" />
<meta content="http://shreethemes.in/" name="Website" />
<!-- favicon -->
<link rel="shortcut icon" href="${pageContext.request.contextPath }/images/favicon.ico">
<!-- Bootstrap css -->
<link href="${pageContext.request.contextPath }/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<!-- Icons -->
<link href="${pageContext.request.contextPath }/css/materialdesignicons.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="https://unicons.iconscout.com/release/v2.1.11/css/unicons.css">
<!-- Main css File -->
<link href="${pageContext.request.contextPath }/css/style.css" rel="stylesheet" type="text/css" />
<script src="${pageContext.request.contextPath }/js/jquery-3.5.1.min.js"></script>
<script src="${pageContext.request.contextPath }/js/bootstrap.bundle.min.js"></script>
<script src="${pageContext.request.contextPath }/js/jquery.easing.min.js"></script>
<script src="${pageContext.request.contextPath }/js/scrollspy.min.js"></script>
<!-- Icon -->
<script src="${pageContext.request.contextPath }/js/feather.min.js"></script>
<!-- Main Js -->
<script src="${pageContext.request.contextPath }/js/app.js"></script>
<script src="https://unicons.iconscout.com/release/v2.1.11/script/monochrome/bundle.js"></script>
<title>SPRING</title>
<style type="text/css">
#header{
height: 100px;
margin: 10px;
padding: 10px;
text-align: center;
}
#content{
min-height: 300px;
margin: 10px;
padding: 10px;
text-align: center;
}
</style>
</head>
<body>
<div id="header">
<tiles:insertAttribute name="header"/>
</div>
<div id="content">
<tiles:insertAttribute name="content"/>
</div>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<!-- Navbar STart -->
<header id="topnav" class="defaultscroll sticky">
<div class="container">
<!-- Logo container-->
<a class="logo" href="${pageContext.request.contextPath }/admin">
<div class="media align-items-center">
<span class="text-primary">space Moon</span>
</div>
</a>
<!-- End Logo container-->
<div class="buy-button" >
<c:choose>
<c:when test="${not empty loginHost}">
<!-- 로그인한 경우 -->
<a href="${pageContext.request.contextPath}/logout/admin" class="btn btn-primary scroll-down">
<span>로그아웃</span>
</a>
</c:when>
<c:otherwise>
<!-- 로그인하지 않은 경우 -->
<a href="${pageContext.request.contextPath}/host/login/host" class="btn btn-primary scroll-down">
<span>로그인</span>
</a>
</c:otherwise>
</c:choose>
</div>
<!--end logout button-->
<!-- Navigation Menu-->
<div id="navigation">
<ul class="navigation-menu">
<li>
<a href="${pageContext.request.contextPath }/admin/host?hstatus=2">호스트 관리</a>
</li>
<li>
<a href="${pageContext.request.contextPath }/admin/notice?nmstatus=2&nstatus=2">공지사항</a>
</li>
<li>
<a href="${pageContext.request.contextPath }/admin/faq?fmstatus=2&fstatus=2">FAQ</a>
</li>
<li>
<a href="${pageContext.request.contextPath }/admin/pay?pwstatus=1">정산 관리</a>
</li>
</ul>
</div><!--end navigation-->
</div><!--end container-->
</header><!--end header-->
<!-- Navbar End -->
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<!-- Hero Start -->
<div class="container px-0 px-md-3 mt-5 pt-md-4">
<div class="slider single-item">
<div class="bg-half-170" style="background: url('images/home/bg1.jpg') center center; height: 700px;">
<div class="bg-overlay"></div>
<div class="container">
<div class="row justify-content-center">
<div class="col-12">
<div class="title-heading text-center">
<h1 class="heading text-white mb-4">지금 이 순간에도 성장중 ❤</h1>
<p class="para-desc mx-auto text-white-50">대한민국 No.1 공유공간 플랫폼, Space Moon!❤
<br>어제보다 멋진 오늘, 그리고 오늘보다 멋진 내일이 기적처럼 다가올 것입니다.</p>
<div class="mt-4 pt-2">
<a href="${pageContext.request.contextPath }/" class="btn btn-primary">SpaceMoon HomePage<a>
</div>
</div>
</div><!--end col-->
</div><!--end row-->
</div>
</div><!--end slide-->
</div><!--end slider-->
</div><!--end container-->
<!-- Hero End -->
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Space Moon</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
<div class="content" style="width: 1300px; margin: 0 auto; position: relative; text-align: center;" >
<br>
<h3>FAQ 관리</h3>
<br>
<br>
<p class="d-flex justify-content-between">
<span style="font-weight: 600;">전체 게시글 : ${totalFaqCount } 개</span>
<span style=""><input type="text"> <button type="button" class="btn btn-primary btn-sm">검색</button></span>
</p>
<div>
<div class="accordion" id="accordionExample2" style="text-align: left;"></div>
<div id="pageNumDiv"></div>
</div>
</div>
<script type="text/javascript">
var page=1;
faqListDisplay(page);
function faqListDisplay(pageNum) {
page=pageNum;
$.ajax({
type: "get",
url: "${pageContext.request.contextPath}/admin/faqList?pageNum="+pageNum+"&fmstatus="+${fmstatus}+"&fstatus="+${fstatus},
dataType: "json",
success: function (result) {
if(result.faqList.length==0){
var html="<table class='table'>";
html+="<tr>";
html+="<th colspan='6'>작성된 게시글이 없습니다.</th>";
html+="</tr>";
html+="</table>";
$("#accordionExample2").html(html);
return;
}
var html="<form class='row gx-3 gy-2 align-items-center'>";
html="<table class='table table-hover' >";
html+="<thead>";
html+="<tr>";
html+="<th><input type='checkbox' id='allCheck' name='allCheck' class='check'></th>";
html+="<th scope='col'>No</th>";
html+="<th scope='col'>";
html+="<select class='form-select' id='fmstatusfilter' style='width: 100px; height: 25px; border-radius: 5px; font-weight: bold; text-align: center;'>";
html+="<option selected='selected'>FAQ 대상</option>";
html+="<option value='1' >사용자</option>";
html+="<option value='0' >호스트</option>";
html+="<option value='2' >전체선택</option>";
html+="</select>";
html+="</th>";
html+="<th scope='col' style='width: 600px; text-align: center;'>제목</th>";
html+="<th scope='col'>작성일자</th>";
html+="<th scope='col'>";
html+="<select class='form-select' id='fstatusfilter' style='height: 25px; border-radius: 5px; font-weight: bold;'>";
html+="<option selected='selected'>상태</option>";
html+="<option value='1' >일반글</option>";
html+="<option value='0' >삭제글</option>";
html+="<option value='2' >전체선택</option>";
html+="</select>";
html+="</th>";
html+="<th scope='col'>수정</th>";
html+="</tr>";
html+="</thead>";
html+="<tbody>";
$(result.faqList).each(function() {
html+="<tr>";
html+="<td><input type='checkbox' name='checkId' id='"+this.fno+"' class='check'></td>";
html+="<td scope='row'>"+this.rn+"</td>";
html+="<td>";
html+="<select class='selectfmstatus' id='selectfmstatus_"+this.fno+"' name='"+this.fno+"' style=' border-radius: 5px; width: 100px; text-align: center;'>";
if(this.fmstatus==1){
html+="<option value='1' selected>사용자</option>";
html+="<option value='0' >호스트</option>";
} else {
html+="<option value='1' >사용자</option>";
html+="<option value='0' selected>호스트</option>";
}
html+="</select>";
html+="</td>";
html+="<td style='text-align: left;'>";
html+="<div class='card border rounded mb-2'>";
html+="<a data-toggle='collapse' href='#a"+this.rn+"' class='faq position-relative' aria-expanded='true' aria-controls='a"+this.rn+"'>";
html+="<div class='card-header border-0 bg-light p-3 pr-5' id='"+this.rn+"'>";
html+="<input type='text' value=\""+this.ftitle+"\" id='board_title_"+this.fno+"' style='width: 600px; height: 40px'>";
html+="</div>";
html+="</a>";
html+="<div id='a"+this.rn+"' class='collapse' aria-labelledby=\""+this.rn+"\" data-parent='#accordionExample2'>";
html+="<div class='card-body'>";
html+="<textarea rows='3' cols='60' name='content' id='board_content_"+this.fno+"' style='width: 600px;' wrap='soft'>"+this.fcontent+"</textarea>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="</td>";
html+="<td scope='row'>"+(this.fdate).substring(0,10) +"</td>";
html+="<td>";
html+="<select class='selectfstatus' name='"+this.fno+"' id='selectfstatus_"+this.fno+"' style=' border-radius: 5px;'>";
if(this.fstatus==1){
html+="<option value='1' selected='selected'>일반글</option>";
html+="<option value='0' >삭제글</option>";
} else {
html+="<option value='1' >일반글</option>";
html+="<option value='0' selected='selected'>삭제글</option>";
}
html+="</select>";
html+="</td>";
html+="<td scope='row'><button type='button' id='faq_modify_btn' onClick='modify("+this.fno+");' style='border: 2px solid black; border-radius: 5px;'>수정</button> </td>";
html+="</tr>";
});
html+="</tbody>";
html+="</table>";
html+="</form>";
html+="<div style='text-align: center'>";
html+="<p><button onclick='location.href=\"${pageContext.request.contextPath }/admin/faq/write\";' type='button' id='writeBtn' class='btn btn-primary btn-sm'>게시글등록</button>";
html+=" "+"<button type='button' onclick='remove();' id='removeBtn' class='btn btn-primary btn-sm'>선택 게시글삭제</button></p>";
html+="</div>";
$("#accordionExample2").html(html);
pageNumDisplay(result.pager)
//전체선택
$("#allCheck").change(function() {
if ($(this).is(":checked")) {
$(".check").prop("checked", true);
} else {
$(".check").prop("checked", false);
}
});
//faq대상상태 변경처리
$(".selectfmstatus").change(function() {
var fno=$(this).attr("name");
var fmstatus=$(this).val();
modify(fno);
});
//faq 게시글 상태 변경처리
$(".selectfstatus").change(function() {
var fno=$(this).attr("name");
var fstatus=$(this).val();
modify(fno);
});
//전체 리스트에 대한 상태변경시 필터링하여 검색 (공지대상)
const selectElement = document.querySelector("#fmstatusfilter");
selectElement.addEventListener('change', () => {
const selectedValue = selectElement.value;
const searchQuery = new URLSearchParams(window.location.search);
searchQuery.set('fmstatus', selectedValue);
window.location.search = searchQuery.toString();
});
//전체 리스트에 대한 상태변경시 필터링하여 검색 (게시글상태)
const mselectElement = document.querySelector("#fstatusfilter");
mselectElement.addEventListener('change', () => {
const mselectedValue = mselectElement.value;
const msearchQuery = new URLSearchParams(window.location.search);
msearchQuery.set('fstatus', mselectedValue);
window.location.search = msearchQuery.toString();
});
},
error: function(xhr) {
alert("에러코드(게시글 목록 검색) = "+xhr.status)
}
});
}
function pageNumDisplay(pager) {
var html="";
if(pager.startPage > pager.blockSize) {
html+="<a href='javascript:faqListDisplay("+pager.prevPage+")'>[이전]</a>";
}
for(i=pager.startPage;i<=pager.endPage;i++) {
if(pager.pageNum!=i) {
html+="<a href='javascript:faqListDisplay("+i+")'>[ "+i+" ]</a>";
} else {
html+="[ "+i+" ] ";
}
}
if(pager.endPage != pager.totalPage) {
html+="<a href='javascript:faqListDisplay("+pager.nextPage+")'>[다음]</a>";
}
$("#pageNumDiv").html(html);
}
function modify(fno) {
var fno=fno;
var ftitle=$("#board_title_"+fno).val();
var fcontent=$("#board_content_"+fno).val();
var fmstatus=$("#selectfmstatus_"+fno).val();
var fstatus=$("#selectfstatus_"+fno).val();
if(ftitle==""){
alert("제목을 입력해 주세요.")
return false;
}
if(fcontent==""){
alert("내용을 입력해 주세요.")
return false;
}
$.ajax({
type: "put",
url: "${pageContext.request.contextPath}/admin/faq/modify/"+fno,
contentType: "application/json",
data : JSON.stringify({"ftitle":ftitle, "fcontent":fcontent, "fmstatus":fmstatus,"fstatus":fstatus }),
dataType: "text",
success: function (result) {
if(result=="success"){
faqListDisplay(page);
}
},
error: function(xhr) {
alert("에러코드(게시글 변경) = "+xhr.status)
}
});
}
function remove() {
var count=$("input[name='checkId']:checked").length;
var removearray= new Array();
$("input[name='checkId']:checked").each(function () {
removearray.push($(this).attr('id'));
});
if(count==0){
alert("선택된 게시글이 없습니다.");
} else{
if(confirm("게시글을 삭제 하시겠습니까?")) {
$.ajax({
type: "post",
url: "${pageContext.request.contextPath}/admin/faqremove",
data: {fno : removearray},
dataType: "text",
success: function(result) {
if(result=="success") {
faqListDisplay(page);
}
},
error: function(xhr) {
alert("에러코드(게시글 삭제) = "+xhr.status)
}
});
}
}
}
</script>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
td {
text-align: left;
}
</style>
<title>Space Moon</title>
</head>
<body>
<div class="content" style="width: 930px; margin: 0 auto; position: relative; text-align: center;" >
<br>
<h3>FAQ 등록</h3>
<br>
<br>
<div>
<form class="row gx-3 gy-2 align-items-center" name="f" method="post">
<input type="hidden" name="fHid" value="${loginHost.getHId() }">
<table class="table table-bordered">
<tr>
<th>공지 대상</th>
<td>
<select name="fMstatus" style="width: 120px; height: 30px; border-radius: 5px; text-align: center;">
<option value="1" <c:if test="${faq.fMstatus==1}">selected</c:if>>사용자</option>
<option value="0" <c:if test="${faq.fMstatus==0}">selected</c:if>>호스트</option>
</select>
</td>
</tr>
<tr>
<th>제목</th>
<td>
<input type="text" name="fTitle" id="fTitle" style="width: 800px;">
</td>
</tr>
<tr>
<th>내용</th>
<td>
<textarea rows="5" cols="91" name="fContent" id="fContent"></textarea>
</td>
</tr>
</table>
</form>
<div style="text-align: center;">
<br>
<p><button onclick="faqAdd();" type="button" id="writeBtn" class="btn btn-primary btn-sm">게시글등록</button>
<button type="button" id="resetBtn" class="btn btn-primary btn-sm" onclick="reset();">다시작성</button></p>
</div>
</div>
</div>
</body>
<script language="JavaScript">
function faqAdd() {
if ( f.fTitle.value == "" ) {
alert("제목을 입력해주세요.");
f.fTitle.focus();
return;
}
if ( f.fContent.value == "" ) {
alert("내용을 입력해주세요.");
f.fContent.focus();
return;
}
f.action = "<c:url value="/admin/faq/write"/>";
f.submit();
}
function reset() {
document.getElementById("fContent").value = "";
document.getElementById("fTitle").value = "";
}
</script>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Space Moon</title>
</head>
<body>
<div class="content w-75" style="margin: 0 auto; position: relative; text-align: center;" >
<br>
<h3>호스트 관리</h3>
<br>
<br>
<p class="d-flex justify-content-between">
<span style="font-weight: 600;">전체 호스트 : ${totalHostCount } 명</span>
<span style=""><input type="text"> <button type="button" class="btn btn-primary btn-sm">검색</button></span>
</p>
<div id="hostlisttable"></div>
<div id="pageNumDiv"></div>
<input type="hidden" name="hstatus" value="${hstatus}">
<script type="text/javascript">
var page=1;
hostListDisplay(page);
function hostListDisplay(pageNum) {
page=pageNum;
$.ajax({
type: "get",
url: "${pageContext.request.contextPath}/admin/hostList?pageNum="+pageNum+"&hstatus="+${hstatus},
dataType: "json",
success: function (result) {
if(result.hostList.length==0){
var html="<table class='table'>";
html+="<tr>";
html+="<th colspan='13'>등록된 호스트가 없습니다.</th>";
html+="</tr>";
html+="</table>";
$("#hostlisttable").html(html);
return;
}
var html="<form class='row gx-3 gy-2 align-items-center'>";
html="<table class='table table-hover'>";
html+="<thead>";
html+="<tr>";
html+="<th><input type='checkbox' id='allCheck' name='allCheck' class='check'></th>";
html+="<th scope='col'>No</th>";
html+="<th scope='col'>ID</th>";
html+="<th scope='col'>이름</th>";
html+="<th scope='col'>이메일</th>";
html+="<th scope='col'>전화번호</th>";
html+="<th scope='col'>상호명</th>";
html+="<th scope='col'>대표자명</th>";
html+="<th scope='col'>사업자 등록번호</th>";
html+="<th scope='col'>계좌번호</th>";
html+="<th scope='col'>은행명</th>";
html+="<th scope='col'>예금주</th>";
html+="<th scope='col'>";
html+="<select class='statusfilter' id='statusfilter' style='height: 25px; border-radius: 5px; font-weight: bold;'>";
html+="<option selected='selected' id='allselect' value='2'>상태</option>";
html+="<option value='1' >일반호스트</option>";
html+="<option value='0' >탈퇴호스트</option>";
html+="<option value='9' >관리자</option>";
html+="<option value='3' >전체선택</option>";
html+="</select>";
html+="</th>";
html+="</tr>";
html+="</thead>";
html+="<tbody>";
$(result.hostList).each(function() {
html+="<tr>";
html+="<td><input type='checkbox' name='checkId' id='"+this.hid+"' class='check'></td>";
html+="<td scope='row'>"+this.rn+"</td>";
html+="<td>"+this.hid+"</td>";
html+="<td>"+this.hname+"</td>";
html+="<td>"+this.hemail+"</td>";
html+="<td>"+this.hphone+"</td>";
if(this.hspacename==null){ this.hspacename="";}
else { this.hspacename=this.hspacename;}
html+="<td>"+this.hspacename+"</td>";
if(this.hceoname==null){ this.hceoname="";}
else { this.hceoname=this.hceoname;}
html+="<td>"+this.hceoname+"</td>";
if(this.hnum==null){ this.hnum="";}
else { this.hnum=this.hnum;}
html+="<td>"+this.hnum+"</td>";
if(this.haccount==null){ this.haccount="";}
else { this.haccount=this.haccount;}
html+="<td>"+this.haccount+"</td>";
if(this.hbank==null){ this.hbank="";}
else { this.hbank=this.hbank;}
html+="<td>"+this.hbank+"</td>";
if(this.haccountname==null){ this.haccountname="";}
else { this.haccountname=this.haccountname;}
html+="<td>"+this.haccountname+"</td>";
html+="<td>";
html+="<select class='hstatus' id='hstatus_"+this.hid+"' name='"+this.hid+"' style='border-radius: 5px;'>";
if(this.hstatus==1){
html+="<option value='1' selected='selected'>일반호스트</option>";
html+="<option value='0'>탈퇴호스트</option>";
html+="<option value='9'>관리자</option>";
}
if(this.hstatus==0){
html+="<option value='1'>일반호스트</option>";
html+="<option value='0' selected='selected'>탈퇴호스트</option>";
html+="<option value='9'>관리자</option>";
}
if(this.hstatus==9){
html+="<option value='1' >일반호스트</option>";
html+="<option value='0' >탈퇴호스트</option>";
html+="<option value='9' selected='selected'>관리자</option>";
}
html+="</select>";
html+="</td>";
html+="</tr>";
});
html+="</tbody>";
html+="</table>";
html+="</form>";
html+="<div style='text-align: center;'>";
html+="<br>";
html+="<p><button type='button' id='removeBtn' class='btn btn-primary btn-sm' onclick='remove();'>선택회원삭제</button></p>";
html+="</div>";
$("#hostlisttable").html(html);
pageNumDisplay(result.pager)
//전체선택
$("#allCheck").change(function() {
if ($(this).is(":checked")) {
$(".check").prop("checked", true);
} else {
$(".check").prop("checked", false);
}
});
//회원상태변경
$(".hstatus").change(function() {
var hid=$(this).attr("name");
var hstatus=$(this).val();
modify(hid);
});
//전체 리스트에 대한 상태변경시 필터링하여 검색
const selectElement = document.querySelector("#statusfilter");
selectElement.addEventListener('change', () => {
const selectedValue = selectElement.value;
const searchQuery = new URLSearchParams(window.location.search);
searchQuery.set('hstatus', selectedValue);
window.location.search = searchQuery.toString();
});
},
error: function(xhr) {
alert("에러코드(호스트 정보 목록 검색) = "+xhr.status)
}
});
}
function pageNumDisplay(pager) {
var html="";
if(pager.startPage > pager.blockSize) {
html+="<a href='javascript:hostListDisplay("+pager.prevPage+")'>[이전]</a>";
}
for(i=pager.startPage;i<=pager.endPage;i++) {
if(pager.pageNum!=i) {
html+="<a href='javascript:hostListDisplay("+i+")'>[ "+i+" ]</a>";
} else {
html+="[ "+i+" ] ";
}
}
if(pager.endPage != pager.totalPage) {
html+="<a href='javascript:hostListDisplay("+pager.nextPage+")'>[다음]</a>";
}
$("#pageNumDiv").html(html);
}
//호스트상태정보 수정
function modify(hid) {
var hid=hid;
var hstatus=$("#hstatus_"+hid).val();
$.ajax({
type: "put",
url: "${pageContext.request.contextPath}/admin/host/modifystatus/"+hid,
contentType: "application/json",
data : JSON.stringify({"hstatus":hstatus}),
dataType: "text",
success: function (result) {
if(result=="success"){
hostListDisplay(page);
}
},
error: function(xhr) {
alert("에러코드(호스트 상태 변경) = "+xhr.status)
}
});
}
//호스트정보 삭제
function remove() {
var count=$("input[name='checkId']:checked").length;
var removearray= new Array();
$("input[name='checkId']:checked").each(function () {
removearray.push($(this).attr('id'));
});
if(count==0){
alert("선택된 호스트가 없습니다.");
} else{
if(confirm("호스트 정보를 삭제 하시겠습니까?")) {
$.ajax({
type: "post",
url: "${pageContext.request.contextPath}/admin/hostremove",
data: {host : removearray},
dataType: "text",
success: function(result) {
if(result=="success") {
hostListDisplay(page);
}
},
error: function(xhr) {
alert("에러코드(호스트회원 정보 삭제) = "+xhr.status)
}
});
}
}
}
</script>
</div>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Space Moon</title>
</head>
<body>
<div class="content" style="width: 1300px; margin: 0 auto; position: relative; text-align: center;" >
<br>
<h3>공지사항 관리</h3>
<br>
<br>
<p class="d-flex justify-content-between">
<span style="font-weight: 600;">전체 게시글 : ${totalNoticeCount } 개</span>
<span style=""><input type="text"> <button type="button" class="btn btn-primary btn-sm">검색</button></span>
</p>
<div>
<form class="row gx-3 gy-2 align-items-center">
<div id="noticetable" class="w-100" style="margin: 0 auto;"></div>
</form>
<div style="text-align: center;">
<br>
<p><button onclick="location.href='${pageContext.request.contextPath }/admin/notice/write';" type="button" id="writeBtn" class="btn btn-primary btn-sm">게시글등록</button>
<button type="button" id="removeBtn" class="btn btn-primary btn-sm" onclick='remove();'>선택게시글삭제</button></p>
</div>
</div>
</div>
<div id="pageNumDiv"></div>
<script type="text/javascript">
var page=1;
noticeListDisplay(page);
function noticeListDisplay(pageNum) {
page=pageNum;
$.ajax({
type: "get",
url: "${pageContext.request.contextPath}/admin/noticeList?pageNum="+pageNum+"&nmstatus="+${nmstatus}+"&nstatus="+${nstatus},
dataType: "json",
success: function (result) {
if(result.noticeList.length==0){
var html="<table>";
html+="<tr>";
html+="<th colspan='6'>작성된 게시글이 없습니다.</th>";
html+="</tr>";
html+="</table>";
$("#noticetable").html(html);
return;
}
var html="<table class='table table-hover' >";
html+="<thead>";
html+="<tr>";
html+="<th><input type='checkbox' id='allCheck' name='allCheck' class='check'></th>";
html+="<th scope='col'>No</th>";
html+="<th scope='col'>";
html+="<select class='form-select' id='nmstatusfilter' style='width: 100px; height: 25px; border-radius: 5px; font-weight: bold; text-align: center;'>";
html+="<option value='2' selected='selected'>공지 대상</option>";
html+="<option value='1' >사용자</option>";
html+="<option value='0' >호스트</option>";
html+="<option value='2' >전체선택</option>";
html+="</select>";
html+="</th>";
html+="<th scope='col'>제목</th>";
html+="<th scope='col'>작성일자</th>";
html+="<th scope='col'>";
html+="<select class='form-select' id='nstatusfilter' style='height: 25px; border-radius: 5px; font-weight: bold;'>";
html+="<option selected='selected'>상태</option>" ;
html+="<option value='1' >일반글</option>";
html+="<option value='0' >삭제글</option>";
html+="<option value='2' >전체선택</option>";
html+="</select>";
html+="</th>";
html+="</tr>";
html+="</thead>";
html+="<tbody>";
$(result.noticeList).each(function() {
html+="<tr>";
html+="<td><input type='checkbox' name='checkId' id='"+this.nno+"' class='check'></td>";
html+="<td scope='row'>"+this.rn+"</td>";
html+="<td>";
html+="<select class='selectnmstatus' id='selectnmstatus_"+this.nno+"' name='"+this.nno+"' style='border-radius: 5px; width: 100px; text-align: center;'>";
if(this.nmstatus==1){
html+="<option value='1' selected='selected'>사용자</option>";
html+="<option value='0' >호스트</option>";
} else {
html+="<option value='1' >사용자</option>";
html+="<option value='0' selected='selected'>호스트</option>";
}
html+="</select>";
html+="</td>";
html+="<td style='text-align: left;'><a href='${pageContext.request.contextPath }/admin/notice/view?nno="+this.nno+"';>"+this.ntitle+"</a></td>";
html+="<td scope='row'>"+(this.ndate).substring(0,10) +"</td>";
html+="<td>";
html+="<select class='selectnstatus' id='selectnstatus_"+this.nno+"' name='"+this.nno+"' style=' border-radius: 5px;'>";
if(this.nstatus==1){
html+="<option value='1' selected='selected'>일반글</option>";
html+="<option value='0' >삭제글</option>";
} else {
html+="<option value='1'>일반글</option>";
html+="<option value='0' selected='selected'>삭제글</option>";
}
html+="</select>";
html+="</td>";
html+="</tr>";
});
html+="</tbody>";
html+="</table>";
$("#noticetable").html(html);
pageNumDisplay(result.pager)
//전체선택
$("#allCheck").change(function() {
if ($(this).is(":checked")) {
$(".check").prop("checked", true);
} else {
$(".check").prop("checked", false);
}
});
//공지대상상태 변경처리
$(".selectnmstatus").change(function() {
var nno=$(this).attr("name");
var nmstatus=$(this).val();
modify(nno);
});
//공지글 상태 변경처리
$(".selectnstatus").change(function() {
var nno=$(this).attr("name");
var nstatus=$(this).val();
modify(nno);
});
//전체 리스트에 대한 상태변경시 필터링하여 검색 (공지대상)
const selectElement = document.querySelector("#nmstatusfilter");
selectElement.addEventListener('change', () => {
const selectedValue = selectElement.value;
const searchQuery = new URLSearchParams(window.location.search);
searchQuery.set('nmstatus', selectedValue);
window.location.search = searchQuery.toString();
});
//전체 리스트에 대한 상태변경시 필터링하여 검색 (게시글상태)
const mselectElement = document.querySelector("#nstatusfilter");
mselectElement.addEventListener('change', () => {
const mselectedValue = mselectElement.value;
const msearchQuery = new URLSearchParams(window.location.search);
msearchQuery.set('nstatus', mselectedValue);
window.location.search = msearchQuery.toString();
});
},
error: function(xhr) {
alert("에러코드(게시글 목록 검색) = "+xhr.status)
}
});
}
function pageNumDisplay(pager) {
var html="";
if(pager.startPage > pager.blockSize) {
html+="<a href='javascript:noticeListDisplay("+pager.prevPage+")'>[이전]</a>";
}
for(i=pager.startPage;i<=pager.endPage;i++) {
if(pager.pageNum!=i) {
html+="<a href='javascript:noticeListDisplay("+i+")'>[ "+i+" ]</a>";
} else {
html+="[ "+i+" ] ";
}
}
if(pager.endPage != pager.totalPage) {
html+="<a href='javascript:noticeListDisplay("+pager.nextPage+")'>[다음]</a>";
}
$("#pageNumDiv").html(html);
}
function modify(nno) {
var nno=nno;
var nmstatus=$("#selectnmstatus_"+nno).val();
var nstatus=$("#selectnstatus_"+nno).val();
$.ajax({
type: "put",
url: "${pageContext.request.contextPath}/admin/notice/modifystatus/"+nno,
contentType: "application/json",
data : JSON.stringify({"nmstatus":nmstatus,"nstatus":nstatus }),
dataType: "text",
success: function (result) {
if(result=="success"){
noticeListDisplay(page);
}
},
error: function(xhr) {
alert("에러코드(게시글 변경) = "+xhr.status)
}
});
}
function remove() {
var count=$("input[name='checkId']:checked").length;
var removearray= new Array();
$("input[name='checkId']:checked").each(function () {
removearray.push($(this).attr('id'));
});
if(count==0){
alert("선택된 게시글이 없습니다.");
} else{
if(confirm("게시글을 삭제 하시겠습니까?")) {
$.ajax({
type: "post",
url: "${pageContext.request.contextPath}/admin/noticeremove",
data: {notice : removearray},
dataType: "text",
success: function(result) {
if(result=="success") {
noticeListDisplay(page);
}
},
error: function(xhr) {
alert("에러코드(게시글 삭제) = "+xhr.status)
}
});
}
}
}
</script>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
td {
text-align: left;
}
</style>
<title>Space Moon</title>
</head>
<body>
<div class="content" style="width: 1300px; margin: 0 auto; position: relative; text-align: center;" >
<br>
<h3>공지사항 등록</h3>
<br>
<br>
<div>
<form class="row gx-3 gy-2 align-items-center" name="f" method="post" enctype="multipart/form-data">
<input type="hidden" name="nhid" value="${loginHost.getHId()}">
<table class="table table-bordered">
<tr>
<th>공지 대상</th>
<td>
<select name="nmstatus" style="width: 120px; height: 30px; border-radius: 5px; text-align: center;">
<option value="1" <c:if test="${ notice.nmstatus==1}"> selected</c:if> >사용자</option>
<option value="0" <c:if test="${ notice.nmstatus==0}"> selected</c:if> >호스트</option>
</select>
</td>
</tr>
<tr>
<th>제목</th>
<td>
<input type="text" name="ntitle" id="ntitle" style="width: 1150px;">
</td>
</tr>
<tr>
<th>첨부이미지</th>
<td>
<input type="file" name="uploadFile" id="nimg">
</td>
</tr>
<tr>
<th>내용</th>
<td>
<textarea rows="18" cols="131" name="ncontent" id="ncontent"></textarea>
</td>
</tr>
</table>
</form>
<div style="text-align: center;">
<br>
<p><button onclick="noticeAdd();" type="button" id="writeBtn" class="btn btn-primary btn-sm">게시글등록</button>
<button type="button" id="resetBtn" class="btn btn-primary btn-sm" onclick="reset();">다시작성</button>
<button type="button" id="listBtn" class="btn btn-primary btn-sm" onclick="location.href='${pageContext.request.contextPath }/admin/notice?nmstatus=2&nstatus=2';">게시글목록</button></p>
</div>
</div>
</div>
</body>
<script type="text/javascript">
function noticeAdd() {
if ( f.ntitle.value == "" ) {
alert("제목을 입력해주세요.");
f.ntitle.focus();
return;
}
if ( f.ncontent.value == "" ) {
alert("내용을 입력해주세요.");
f.ncontent.focus();
return;
}
f.action = "<c:url value="/admin/upload"/>"
f.submit();
}
function reset() {
document.getElementById("ncontent").value = "";
document.getElementById("ntitle").value = "";
}
</script>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style type="text/css">
td {
text-align: left;
}
</style>
<title>Space Moon</title>
</head>
<body>
<div class="content" style="width: 1300px; margin: 0 auto; position: relative; text-align: center;" >
<br>
<h3>공지사항</h3>
<br>
<br>
<div>
<form class="row gx-3 gy-2 align-items-center">
<table class="table table-bordered">
<tr>
<th>제목</th>
<td style="font-weight: bold;">${noticeview.ntitle}</td>
</tr>
<tr>
<th style="width: 150px">공지 대상</th>
<c:if test="${noticeview.nmstatus==1 }"><td>사용자</td></c:if>
<c:if test="${noticeview.nmstatus==0 }"><td>호스트</td></c:if>
</tr>
<tr>
<th>첨부이미지</th>
<td>
<img src="${pageContext.request.contextPath}/images/notice/${noticeview.nimg}">
</td>
</tr>
<tr>
<th>내용</th>
<td>${noticeview.ncontent}</td>
</tr>
<tr>
<th>작성일자</th>
<td>${noticeview.ndate}</td>
</tr>
<tr>
<th>게시글 상태</th>
<c:if test="${noticeview.nstatus==1 }"><td>일반글</td></c:if>
<c:if test="${noticeview.nstatus==0 }"><td>삭제글</td></c:if>
</tr>
</table>
</form>
<div style="text-align: center;">
<br>
<p><button onclick="location.href='${pageContext.request.contextPath }/admin/notice/modify?nno=${noticeview.nno }';" type="button" class="btn btn-primary btn-sm" >게시글변경</button>
<button onclick="location.href='${pageContext.request.contextPath }/admin/notice?nmstatus=2&nstatus=2';" type="button" class="btn btn-primary btn-sm">게시글목록</button></p>
</div>
</div>
</div>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style type="text/css">
td {
text-align: left;
}
</style>
<title>Space Moon</title>
</head>
<body>
<div class="content" style="width: 1300px; margin: 0 auto; position: relative; text-align: center;" >
<br>
<h3>공지사항 변경</h3>
<br>
<br>
<div>
<form class="row gx-3 gy-2 align-items-center" name="f" method="post">
<input type="hidden" name="nno" value="${noticeinfo.nno }">
<table class="table table-bordered">
<tr>
<th>공지 대상</th>
<td>
<select name="nmstatus" style="width: 120px; height: 30px; border-radius: 5px; text-align: center;">
<c:if test="${noticeinfo.nmstatus==1 }">
<option value="1" selected="selected">사용자</option>
<option value="0" >호스트</option>
</c:if>
<c:if test="${noticeinfo.nmstatus==0 }">
<option value="1" >사용자</option>
<option value="0" selected="selected">호스트</option>
</c:if>
</select>
</td>
</tr>
<tr>
<th>제목</th>
<td>
<input type="text" name="ntitle" id="ntitle" style="width: 1150px;" value="${noticeinfo.ntitle }">
</td>
</tr>
<tr>
<th>첨부이미지</th>
<td>
<input type="file" name="nimg" id="nimg" value="${noticeinfo.nimg }">
</td>
</tr>
<tr>
<th>내용</th>
<td>
<textarea rows="18" cols="131" id="ncontent" name="ncontent">${noticeinfo.ncontent }</textarea>
</td>
</tr>
<tr>
<th>게시글 상태</th>
<td>
<select class="nstatus" name="nstatus" style="width: 120px; height: 30px; border-radius: 5px; text-align: center;">
<c:if test="${noticeinfo.nstatus==1 }">
<option value="1" selected="selected">일반글</option>
<option value="0">삭제글</option>
</c:if>
<c:if test="${noticeinfo.nstatus==0 }">
<option value="1">일반글</option>
<option value="0" selected="selected">삭제글</option>
</c:if>
</select>
</td>
</tr>
</table>
</form>
<div style="text-align: center;">
<br>
<p><button onclick="noticeModify();" type="button" id="modify" class="btn btn-primary btn-sm">게시글변경</button>
<button type="button" id="reset" class="btn btn-primary btn-sm" onclick="reset();">다시작성</button></p>
</div>
</div>
</div>
</body>
<script type="text/javascript">
function reset() {
document.getElementById("ncontent").value = "";
document.getElementById("ntitle").value = "";
}
function noticeModify() {
if ( f.ntitle.value == "" ) {
alert("제목을 입력해주세요.");
f.ntitle.focus();
return;
}
if ( f.ncontent.value == "" ) {
alert("내용을 입력해주세요.");
f.ncontent.focus();
return;
}
f.action = "<c:url value="/admin/notice/modify"/>";
f.submit();
}
</script>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>SPRING</title>
</head>
<body>
<h1>파일 업로드 실패</h1>
<hr>
<p>파일 업로드에 실패하였습니다. 다시 시도해주시기 바랍니다.</p>
</body>
</html>
<%@page import="xyz.itwill.service.AdminService"%>
<%@page import="xyz.itwill.dto.Pay"%>
<%@page import="xyz.itwill.service.SpaceService"%>
<%@page import="xyz.itwill.dto.Space"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Space Moon</title>
</head>
<body>
<div class="content" style="width: 1300px; margin: 0 auto; position: relative; text-align: center;" >
<br>
<h3>정산 관리</h3>
<br>
<br>
<div class="d-flex justify-content-between">
<span style="font-weight: 600;">정산 미완료 : ${totalnonpayCount} 건</span>
<span>
<form name="searchpayList" method="post">
호스트 ID : <input type="text" name="keyword" id="keyword">
<button type="button" onclick="payListDisplay()" class="btn btn-primary btn-sm">검색</button>
</form>
</span>
</div>
<div id="paylisttable"></div>
<div id="pageNumDiv"></div>
<script type="text/javascript">
var page=1;
payListDisplay(page);
function payListDisplay(pageNum) {
page=pageNum;
$.ajax({
type: "get",
url: "${pageContext.request.contextPath}/admin/payList?pageNum="+pageNum+"&pwstatus="+${pwstatus},
dataType: "json",
success: function (result) {
if(result.payList.length==0){
var html="<table class='table'>";
html+="<tr>";
html+="<th colspan='6'>등록된 정산내용이 없습니다.</th>";
html+="</tr>";
html+="</table>";
$("#payListDisplay").html(html);
return;
}
var html="<form class='row gx-3 gy-2 align-items-center'>";
html="<table class='table table-hover' >";
html+="<thead>";
html+="<tr>";
html+="<th scope='col'>No</th>";
html+="<th scope='col'>호스트 ID</th>";
html+="<th scope='col'>결제번호</th>";
html+="<th scope='col'>정산금액</th>";
html+="<th scope='col'>정산일자</th>";
html+="<th scope='col'>";
html+="<select class='form-select' id='statusfilter' style='height: 25px; border-radius: 5px; font-weight: bold;'>";
html+="<option value='2' selected='selected'>정산상태</option>";
html+="<option value='0' >미완료</option>";
html+="<option value='9' >완료</option>";
html+="<option value='2' >전체선택</option>";
html+="</select>";
html+="</th>";
html+="</tr>";
html+="</thead>";
html+="<tbody>";
$(result.payList).each(function() {
if(this.pay.pwstatus==0 || this.pay.pwstatus==9 ){
html+="<tr>";
html+="<td scope='row'>"+this.rn+"</td>";
html+="<td>"+this.space.shid+"</td>";
html+="<td>"+this.pay.pno+"</td>";
html+="<td>"+this.space.sprice+"</td>";
html+="<td>"+this.pay.pwdate+"</td>";
html+="<td>";
html+="<select class='pwstatus' id='pwstatus_"+this.pay.pno+"' name='"+this.pay.pno+"' style='height: 25px; border-radius: 5px;'>";
if(this.pay.pwstatus==0){
html+="<option value='0' selected > 미완료 </option>";
html+="<option value='9' >완료</option>";
}
if(this.pay.pwstatus==9){
html+="<option value='0' selected > 미완료 </option>";
html+="<option value='9' selected >완료</option>";
}
html+="</select>";
html+="</td>";
html+="</tr>";
}
});
html+="</tbody>";
html+="</table>";
html+="</form>";
$("#paylisttable").html(html);
pageNumDisplay(result.pager)
//정산상태변경
$(".pwstatus").change(function() {
var pno=$(this).attr("name");
var pwstatus=$(this).val();
modify(pno);
});
//전체 리스트에 대한 상태변경시 필터링하여 검색
const selectElement = document.querySelector("#statusfilter");
selectElement.addEventListener('change', () => {
const selectedValue = selectElement.value;
const searchQuery = new URLSearchParams(window.location.search);
searchQuery.set('pwstatus', selectedValue);
window.location.search = searchQuery.toString();
});
},
error: function(xhr) {
alert("에러코드(호스트 정보 목록 검색) = "+xhr.status)
}
});
}
function pageNumDisplay(pager) {
var html="";
if(pager.startPage > pager.blockSize) {
html+="<a href='javascript:payListDisplay("+pager.prevPage+")'>[이전]</a>";
}
for(i=pager.startPage;i<=pager.endPage;i++) {
if(pager.pageNum!=i) {
html+="<a href='javascript:payListDisplay("+i+")'>[ "+i+" ]</a>";
} else {
html+="[ "+i+" ] ";
}
}
if(pager.endPage != pager.totalPage) {
html+="<a href='javascript:payListDisplay("+pager.nextPage+")'>[다음]</a>";
}
$("#pageNumDiv").html(html);
}
//정산상태정보 수정
function modify(pno) {
var pno=pno;
var pwstatus=$("#pwstatus_"+pno).val();
$.ajax({
type: "put",
url: "${pageContext.request.contextPath}/admin/pay/modifystatus/"+pno,
contentType: "application/json",
data : JSON.stringify({"pwstatus":pwstatus}),
dataType: "text",
success: function (result) {
if(result=="success"){
payListDisplay(page);
}
},
error: function(xhr) {
alert("에러코드(호스트 상태 변경) = "+xhr.status)
}
});
}
//정산 정보 검색
/*
function searchList() {
var inputElement = document.getElementById("searchList");
var selectElement = document.getElementById("keyword");
var search = inputElement.value;
var keyword = selectElement.value;
$.ajax({
type: "get",
url: "${pageContext.request.contextPath}/admin/paysearch",
contentType: "application/json",
data : JSON.stringify({"search":search, "keyword":keyword }),
dataType: "text",
success: function (result) {
if(result=="success"){
payListDisplay(page);
}
},
error: function(xhr) {
alert("에러코드(호스트 상태 변경) = "+xhr.status)
}
});
}
*/
</script>
</div>
</body>
</html>
package xyz.itwill.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import lombok.RequiredArgsConstructor;
import xyz.itwill.dto.Faq;
import xyz.itwill.dto.Notice;
import xyz.itwill.exception.BoardNotFoundException;
import xyz.itwill.service.AdminService;
import xyz.itwill.util.Pager;
@Controller
@RequestMapping("/")
@RequiredArgsConstructor
public class BoardController {
private final AdminService boardService;
//faq전체 리스트 출력 시 페이징 처리를 위해 Json형식의 text로 Map객체 전달
@RequestMapping(value = "member_faqList", method = RequestMethod.GET)
@ResponseBody
public Map<String, Object> faqlist(@RequestParam(defaultValue = "1") int pageNum, @RequestParam int fmstatus, @RequestParam int fstatus) {
int totalFaqList=boardService.getFaqCount();
int pageSize=15;
int blockSize=5;
Pager pager=new Pager(pageNum, totalFaqList, pageSize, blockSize);
Map<String, Object> pageMap=new HashMap<String, Object>();
pageMap.put("startRow", pager.getStartRow());
pageMap.put("endRow", pager.getEndRow());
pageMap.put("fMstatus", fmstatus);
pageMap.put("fStatus", fstatus);
Map<String, Object> resultMap=new HashMap<String, Object>();
if (fmstatus==1 && fstatus==1) {
List<Faq> faqList=boardService.getstatusFaqList(pageMap);
resultMap.put("faqList", faqList);
} else if(fmstatus==0 && fstatus==1) {
List<Faq> faqList=boardService.getstatusFaqList(pageMap);
resultMap.put("faqList", faqList);
}
resultMap.put("pager", pager);
return resultMap;
}
//notice전체 리스트 출력 시 페이징 처리를 위해 Json형식의 text로 Map객체 전달
@RequestMapping(value = "member_noticeList", method = RequestMethod.GET)
@ResponseBody
public Map<String, Object> noticelist(@RequestParam(defaultValue = "1") int pageNum, @RequestParam int nmstatus, @RequestParam int nstatus) {
int totalNoticeList=boardService.getNoticeCount();
int pageSize=10;
int blockSize=5;
Pager pager=new Pager(pageNum, totalNoticeList, pageSize, blockSize);
Map<String, Object> pageMap=new HashMap<String, Object>();
pageMap.put("startRow", pager.getStartRow());
pageMap.put("endRow", pager.getEndRow());
pageMap.put("nmstatus", nmstatus);
pageMap.put("nstatus", nstatus);
Map<String, Object> resultMap=new HashMap<String, Object>();
if (nmstatus==1 && nstatus==1) {
List<Notice> noticeList=boardService.getstatusNoticeList(pageMap);
resultMap.put("noticeList", noticeList);
} else if (nmstatus==0 && nstatus==1) {
List<Notice> noticeList=boardService.getstatusNoticeList(pageMap);
resultMap.put("noticeList", noticeList);
}
resultMap.put("pager", pager);
return resultMap;
}
//글번호를 전달받아 해당 글번호의 게시글을 검색하여 출력
@RequestMapping(value ="member_notice/view", method = RequestMethod.GET)
public String noticeView(@RequestParam int nno, Model model) throws BoardNotFoundException {
model.addAttribute("noticeview", boardService.getNotice(nno));
return "board/notice_view";
}
}
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="css/style.css" rel="stylesheet" type="text/css" />
<title>faq</title>
<style type="text/css">
.select-group {
display: flex;
justify-content: center;
}
.select {
display: flex;
justify-content: center;
align-items: center;
margin-top: 20px;
padding: 5px 10px;
border-radius: 5px;
height: 50px;
width: 500px;
}
.select.text-white {
background-color: #704de4;
color: white;
}
</style>
</head>
<body>
<!-- Start -->
<div class="w-75" style="margin: 0 auto;">
<div class="container">
<h1>FAQ</h1>
<!-- faq 대상자 UI -->
<div class="row mb-4">
<div class="select-group">
<div class="select text-white" >
<a href="${pageContext.request.contextPath }/member_faq?fmstatus=1&fstatus=1">USER</a>
</div>
<div class="select" style="background-color: #ebebeb;">
<a href="${pageContext.request.contextPath }/host_faq?fmstatus=0&fstatus=1">HOST</a>
</div>
</div>
</div>
<br>
<!-- 검색어 입력-->
<div class="col-12" style="display:flex; justify-content:center; position: relative; left: 300px;">
<div class="row align-items-center">
<div class="col-lg-9 col-md-7" style="width: 450px">
<div class="subcribe-form">
<form>
<div class="form-group mb-0">
<input name="name" id="name" type="text" class="rounded-lg shadow" style="opacity: 0.8;" placeholder="검색어를 입력해주세요">
<button type="submit" class="btn btn-pills btn-primary" style="top: 2px;">Search 🔍</button>
</div>
</form>
</div>
</div><!--end col-->
</div><!--end row-->
</div><!--end col-->
<!-- 검색어 End -->
</div>
<!-- faq start -->
<div class="memberfaqlist" id="memberfaqlist"></div>
<div class="hostfaqlist" id="hostfaqlist"></div>
<div id="pageNumDiv"></div>
</div>
<script type="text/javascript">
var page=1;
faqListDisplay(page);
function faqListDisplay(pageNum) {
page=pageNum;
$.ajax({
type: "get",
url: "${pageContext.request.contextPath}/member_faqList?pageNum="+pageNum+"&fmstatus="+${fmstatus}+"&fstatus="+${fstatus},
dataType: "json",
success: function (result) {
var html="<section class='section'>";
html+=" <div class='container'>";
html+="<div class='row justify-content-center'>";
html+="<div class='col-lg-9 col-12'>";
html+="<div class='faq-content'>";
html+="<div class='accordion' id='accordionExample2' style='text-align: left;'>";
$(result.faqList).each(function() {
if(this.fmstatus==1){
html+="<div class='card border rounded mb-2'>";
html+="<a data-toggle='collapse' href='#a"+this.fno+"' class='faq position-relative collapsed' aria-expanded='false' aria-controls='a"+this.fno+"'>";
html+="<div class='card-header border-0 bg-light p-3 pr-5' id=\""+this.fcontent+"\">";
html+="<div class='media'>";
html+="<h6 class='title mb-0'> "+this.ftitle+"</h6>";
html+="</div>";
html+="</div>";
html+="</a>";
html+="<div id='a"+this.fno+"' class='collapse' aria-labelledby=\""+this.fcontent+"\" data-parent='#accordionExample2'>";
html+="<div class='card-body'>";
html+="<p class='text-muted mb-0 faq-ans'>"+this.fcontent+"</p>";
html+="</div>";
html+="</div>";
html+="</div>";
}
});
html+="</div>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="</section>";
$("#memberfaqlist").html(html);
pageNumDisplay(result.pager)
},
error: function(xhr) {
alert("에러코드(게시글 목록 검색) = "+xhr.status)
}
});
}
function pageNumDisplay(pager) {
var html="";
if(pager.startPage > pager.blockSize) {
html+="<a href='javascript:faqListDisplay("+pager.prevPage+")'>[이전]</a>";
}
for(i=pager.startPage;i<=pager.endPage;i++) {
if(pager.pageNum!=i) {
html+="<a href='javascript:faqListDisplay("+i+")'>[ "+i+" ]</a>";
} else {
html+="[ "+i+" ] ";
}
}
if(pager.endPage != pager.totalPage) {
html+="<a href='javascript:faqListDisplay("+pager.nextPage+")'>[다음]</a>";
}
$("#pageNumDiv").html(html);
}
function memberfaqList() {
$("#hostfaqlist").hide();
$("#memberfaqlist").show();
}
function hostfaqList() {
$("#hostfaqlist").show();
$("#memberfaqlist").hide();
}
</script>
<!-- contact 정보 start -->
<div class="container mt-100 mt-60">
<div class="row">
<div class="col-lg-4 col-md-6 col-12">
<div class="media feature">
<div class="icons m-0 rounded-md h2 text-primary text-center px-3">
<i class="uil uil-phone"></i>
</div>
<div class="content ml-4">
<h5>대표전화</h5>
<p class="text-muted">도움이 필요하시면 언제든지 연락주세요.</p>
<a href="tel:+152534-468-854" class="text-primary">0507-1401-8061</a>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-12 mt-5 mt-sm-0">
<div class="media feature">
<div class="icons m-0 rounded-md h2 text-primary text-center px-3">
<i class="uil uil-envelope"></i>
</div>
<div class="content ml-4">
<h5>이메일</h5>
<p class="text-muted">전화가 어렵다면 이메일로 연락주세요.</p>
<a href="mailto:contact@example.com" class="text-primary"> space@itwill.com</a>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-12 mt-5 mt-lg-0">
<div class="media feature">
<div class="icons m-0 rounded-md h2 text-primary text-center px-3">
<i class="uil uil-map-marker"></i>
</div>
<div class="content ml-4">
<h5>영업소재지</h5>
<p class="text-muted mb-0">서울특별시 강남구 테헤란로 124 4층</p>
</div>
</div>
</div>
</div>
</div>
<br>
<br>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="css/style.css" rel="stylesheet" type="text/css" />
<title>faq</title>
<style type="text/css">
.select-group {
display: flex;
justify-content: center;
}
.select {
display: flex;
justify-content: center;
align-items: center;
margin-top: 20px;
padding: 5px 10px;
border-radius: 5px;
height: 50px;
width: 500px;
}
.select.text-white {
background-color: #704de4;
color: white;
}
</style>
</head>
<body>
<!-- Start -->
<div class="w-75" style="margin: 0 auto;">
<div class="container">
<h1>FAQ</h1>
<!-- faq 대상자 UI -->
<div class="row mb-4">
<div class="select-group">
<div class="select" style="background-color: #ebebeb;">
<a href="${pageContext.request.contextPath }/member_faq?fmstatus=1&fstatus=1">USER</a>
</div>
<div class="select text-white" >
<a href="${pageContext.request.contextPath }/host_faq?fmstatus=0&fstatus=1">HOST</a>
</div>
</div>
</div>
<br>
<!-- 검색어 입력-->
<div class="col-12" style="display:flex; justify-content:center; position: relative; left: 300px;">
<div class="row align-items-center">
<div class="col-lg-9 col-md-7" style="width: 450px">
<div class="subcribe-form">
<form>
<div class="form-group mb-0">
<input name="name" id="name" type="text" class="rounded-lg shadow" style="opacity: 0.8;" placeholder="검색어를 입력해주세요">
<button type="submit" class="btn btn-pills btn-primary" style="top: 2px;">Search 🔍</button>
</div>
</form>
</div>
</div><!--end col-->
</div><!--end row-->
</div><!--end col-->
<!-- 검색어 End -->
</div>
<!-- faq start -->
<div class="memberfaqlist" id="memberfaqlist"></div>
<div class="hostfaqlist" id="hostfaqlist"></div>
<div id="pageNumDiv"></div>
</div>
<script type="text/javascript">
var page=1;
faqListDisplay(page);
function faqListDisplay(pageNum) {
page=pageNum;
$.ajax({
type: "get",
url: "${pageContext.request.contextPath}/member_faqList?pageNum="+pageNum+"&fmstatus="+${fmstatus}+"&fstatus="+${fstatus},
dataType: "json",
success: function (result) {
var html="<section class='section'>";
html+=" <div class='container'>";
html+="<div class='row justify-content-center'>";
html+="<div class='col-lg-9 col-12'>";
html+="<div class='faq-content'>";
html+="<div class='accordion' id='accordionExample2' style='text-align: left;'>";
$(result.faqList).each(function() {
if(this.fmstatus==0){
html+="<div class='card border rounded mb-2'>";
html+="<a data-toggle='collapse' href='#a"+this.fno+"' class='faq position-relative collapsed' aria-expanded='false' aria-controls='a"+this.fno+"'>";
html+="<div class='card-header border-0 bg-light p-3 pr-5' id=\""+this.fcontent+"\">";
html+="<div class='media'>";
html+="<h6 class='title mb-0'> "+this.ftitle+"</h6>";
html+="</div>";
html+="</div>";
html+="</a>";
html+="<div id='a"+this.fno+"' class='collapse' aria-labelledby=\""+this.fcontent+"\" data-parent='#accordionExample2'>";
html+="<div class='card-body'>";
html+="<p class='text-muted mb-0 faq-ans'>"+this.fcontent+"</p>";
html+="</div>";
html+="</div>";
html+="</div>";
}
});
html+="</div>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="</section>";
$("#memberfaqlist").html(html);
pageNumDisplay(result.pager)
},
error: function(xhr) {
alert("에러코드(게시글 목록 검색) = "+xhr.status)
}
});
}
function pageNumDisplay(pager) {
var html="";
if(pager.startPage > pager.blockSize) {
html+="<a href='javascript:faqListDisplay("+pager.prevPage+")'>[이전]</a>";
}
for(i=pager.startPage;i<=pager.endPage;i++) {
if(pager.pageNum!=i) {
html+="<a href='javascript:faqListDisplay("+i+")'>[ "+i+" ]</a>";
} else {
html+="[ "+i+" ] ";
}
}
if(pager.endPage != pager.totalPage) {
html+="<a href='javascript:faqListDisplay("+pager.nextPage+")'>[다음]</a>";
}
$("#pageNumDiv").html(html);
}
function memberfaqList() {
$("#hostfaqlist").hide();
$("#memberfaqlist").show();
}
function hostfaqList() {
$("#hostfaqlist").show();
$("#memberfaqlist").hide();
}
</script>
<!-- contact 정보 start -->
<div class="container mt-100 mt-60">
<div class="row">
<div class="col-lg-4 col-md-6 col-12">
<div class="media feature">
<div class="icons m-0 rounded-md h2 text-primary text-center px-3">
<i class="uil uil-phone"></i>
</div>
<div class="content ml-4">
<h5>대표전화</h5>
<p class="text-muted">도움이 필요하시면 언제든지 연락주세요.</p>
<a href="tel:+152534-468-854" class="text-primary">0507-1401-8061</a>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-12 mt-5 mt-sm-0">
<div class="media feature">
<div class="icons m-0 rounded-md h2 text-primary text-center px-3">
<i class="uil uil-envelope"></i>
</div>
<div class="content ml-4">
<h5>이메일</h5>
<p class="text-muted">전화가 어렵다면 이메일로 연락주세요.</p>
<a href="mailto:contact@example.com" class="text-primary"> space@itwill.com</a>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-12 mt-5 mt-lg-0">
<div class="media feature">
<div class="icons m-0 rounded-md h2 text-primary text-center px-3">
<i class="uil uil-map-marker"></i>
</div>
<div class="content ml-4">
<h5>영업소재지</h5>
<p class="text-muted mb-0">서울특별시 강남구 테헤란로 124 4층</p>
</div>
</div>
</div>
</div>
</div>
<br>
<br>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="css/style.css" rel="stylesheet" type="text/css" />
<title>faq</title>
<style type="text/css">
.select-group {
display: flex;
justify-content: center;
}
.select {
display: flex;
justify-content: center;
align-items: center;
margin-top: 20px;
padding: 5px 10px;
border-radius: 5px;
height: 50px;
width: 500px;
}
.select.text-white {
background-color: #704de4;
color: white;
}
</style>
</head>
<body>
<!-- Start -->
<div class="container">
<h1>공지사항</h1>
<!-- notice 대상자 UI -->
<div class="row mb-4">
<div class="select-group">
<div class="select text-white">
<a href="${pageContext.request.contextPath }/member_notice?nmstatus=1&nstatus=1">USER</a>
</div>
<div class="select" style="background-color: #ebebeb;">
<a href="${pageContext.request.contextPath }/host_notice?nmstatus=0&nstatus=1">HOST</a>
</div>
</div>
</div>
<br>
<!-- 검색어 입력-->
<div class="col-12" style="display:flex; justify-content:center; position: relative; left: 300px;">
<div class="row align-items-center">
<div class="col-lg-9 col-md-7" style="width: 450px">
<div class="subcribe-form">
<form>
<div class="form-group mb-0">
<input name="name" id="name" type="text" class="rounded-lg shadow" style="opacity: 0.8;" placeholder="검색어를 입력해주세요">
<button type="submit" class="btn btn-pills btn-primary" style="top: 2px;">Search 🔍</button>
</div>
</form>
</div>
</div><!--end col-->
</div><!--end row-->
</div><!--end col-->
<!-- 검색어 End -->
</div>
<!-- noticeList -->
<div id="membernoticeList" class="membernoticeList"></div>
<div id="pageNumDiv"></div>
<script type="text/javascript">
var page=1;
noticeListDisplay(page);
function noticeListDisplay(pageNum) {
page=pageNum;
$.ajax({
type: "get",
url: "${pageContext.request.contextPath}/member_noticeList?pageNum="+pageNum+"&nmstatus="+${nmstatus}+"&nstatus="+${nstatus},
dataType: "json",
success: function (result) {
var html=" <section class='section'>";
html+="<div class='container' style='width: 1100px;'>";
$(result.noticeList).each(function () {
if(this.nmstatus==1){
html+="<div class='card event-schedule rounded border-0 shadow' style='height: 70px'>";
html+="<div class='card-body' >";
html+="<div class='media' style='display: table;'>";
html+="<ul class='date text-center text-primary mr-3 mb-0 list-unstyled'>";
html+=" <li class='day shadow h6 font-weight-bold mb-2' style='height: 40px; line-height: 40px'>[공지]</li>";
html+="</ul>";
html+="<div class='media-body content' style='display: table-cell; vertical-align: middle;'>";
html+="<h5><a href='${pageContext.request.contextPath}/member_notice/view?nno="+this.nno+"' class='text-dark title' style='font-size: 18px'>"+this.ntitle+"</a></h5>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="</div>";
}
});
html+="</div>";
html+="</section>";
$("#membernoticeList").html(html);
pageNumDisplay(result.pager)
},
error: function(xhr) {
alert("에러코드(게시글 목록 검색) = "+xhr.status)
}
});
}
function pageNumDisplay(pager) {
var html="";
if(pager.startPage > pager.blockSize) {
html+="<a href='javascript:noticeListDisplay("+pager.prevPage+")'>[이전]</a>";
}
for(i=pager.startPage;i<=pager.endPage;i++) {
if(pager.pageNum!=i) {
html+="<a href='javascript:noticeListDisplay("+i+")'>[ "+i+" ]</a>";
} else {
html+="[ "+i+" ] ";
}
}
if(pager.endPage != pager.totalPage) {
html+="<a href='javascript:noticeListDisplay("+pager.nextPage+")'>[다음]</a>";
}
$("#pageNumDiv").html(html);
}
</script>
<!-- contact 정보 start -->
<div class="container mt-100 mt-60">
<div class="row">
<div class="col-lg-4 col-md-6 col-12">
<div class="media feature">
<div class="icons m-0 rounded-md h2 text-primary text-center px-3">
<i class="uil uil-phone"></i>
</div>
<div class="content ml-4">
<h5>대표전화</h5>
<p class="text-muted">도움이 필요하시면 언제든지 연락주세요.</p>
<a href="tel:+152534-468-854" class="text-primary">0507-1401-8061</a>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-12 mt-5 mt-sm-0">
<div class="media feature">
<div class="icons m-0 rounded-md h2 text-primary text-center px-3">
<i class="uil uil-envelope"></i>
</div>
<div class="content ml-4">
<h5>이메일</h5>
<p class="text-muted">전화가 어렵다면 이메일로 연락주세요.</p>
<a href="mailto:contact@example.com" class="text-primary"> space@itwill.com</a>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-12 mt-5 mt-lg-0">
<div class="media feature">
<div class="icons m-0 rounded-md h2 text-primary text-center px-3">
<i class="uil uil-map-marker"></i>
</div>
<div class="content ml-4">
<h5>영업소재지</h5>
<p class="text-muted mb-0">서울특별시 강남구 테헤란로 124 4층</p>
</div>
</div>
</div>
</div>
</div>
<br>
</body>
</html>
<!--contact 정보 end-->
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="css/style.css" rel="stylesheet" type="text/css" />
<title>faq</title>
<style type="text/css">
.select-group {
display: flex;
justify-content: center;
}
.select {
display: flex;
justify-content: center;
align-items: center;
margin-top: 20px;
padding: 5px 10px;
border-radius: 5px;
height: 50px;
width: 500px;
}
.select.text-white {
background-color: #704de4;
color: white;
}
</style>
</head>
<body>
<!-- Start -->
<div class="container">
<h1>공지사항</h1>
<!-- notice 대상자 UI -->
<div class="row mb-4">
<div class="select-group">
<div class="select" style="background-color: #ebebeb;">
<a href="${pageContext.request.contextPath }/member_notice?nmstatus=1&nstatus=1">USER</a>
</div>
<div class="select text-white" >
<a href="${pageContext.request.contextPath }/host_notice?nmstatus=0&nstatus=1">HOST</a>
</div>
</div>
</div>
<br>
<!-- 검색어 입력-->
<div class="col-12" style="display:flex; justify-content:center; position: relative; left: 300px;">
<div class="row align-items-center">
<div class="col-lg-9 col-md-7" style="width: 450px">
<div class="subcribe-form">
<form>
<div class="form-group mb-0">
<input name="name" id="name" type="text" class="rounded-lg shadow" style="opacity: 0.8;" placeholder="검색어를 입력해주세요">
<button type="submit" class="btn btn-pills btn-primary" style="top: 2px;">Search 🔍</button>
</div>
</form>
</div>
</div><!--end col-->
</div><!--end row-->
</div><!--end col-->
<!-- 검색어 End -->
</div>
<!-- noticeList -->
<div id="membernoticeList" class="membernoticeList"></div>
<div id="pageNumDiv"></div>
<script type="text/javascript">
var page=1;
noticeListDisplay(page);
function noticeListDisplay(pageNum) {
page=pageNum;
$.ajax({
type: "get",
url: "${pageContext.request.contextPath}/member_noticeList?pageNum="+pageNum+"&nmstatus="+${nmstatus}+"&nstatus="+${nstatus},
dataType: "json",
success: function (result) {
var html=" <section class='section'>";
html+="<div class='container' style='width: 1100px;'>";
$(result.noticeList).each(function () {
if(this.nmstatus==0){
if(this.nstatus=1){
html+="<div class='card event-schedule rounded border-0 shadow' style='height: 70px'>";
html+="<div class='card-body' >";
html+="<div class='media' style='display: table;'>";
html+="<ul class='date text-center text-primary mr-3 mb-0 list-unstyled'>";
html+=" <li class='day shadow h6 font-weight-bold mb-2' style='height: 40px; line-height: 40px'>[공지]</li>";
html+="</ul>";
html+="<div class='media-body content' style='display: table-cell; vertical-align: middle;'>";
html+="<h5><a href='${pageContext.request.contextPath}/member_notice/view?nno="+this.nno+"' class='text-dark title' style='font-size: 18px'>"+this.ntitle+"</a></h5>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="</div>";
}
}
});
html+="</div>";
html+="</section>";
$("#membernoticeList").html(html);
pageNumDisplay(result.pager)
},
error: function(xhr) {
alert("에러코드(게시글 목록 검색) = "+xhr.status)
}
});
}
function pageNumDisplay(pager) {
var html="";
if(pager.startPage > pager.blockSize) {
html+="<a href='javascript:noticeListDisplay("+pager.prevPage+")'>[이전]</a>";
}
for(i=pager.startPage;i<=pager.endPage;i++) {
if(pager.pageNum!=i) {
html+="<a href='javascript:noticeListDisplay("+i+")'>[ "+i+" ]</a>";
} else {
html+="[ "+i+" ] ";
}
}
if(pager.endPage != pager.totalPage) {
html+="<a href='javascript:noticeListDisplay("+pager.nextPage+")'>[다음]</a>";
}
$("#pageNumDiv").html(html);
}
</script>
<!-- contact 정보 start -->
<div class="container mt-100 mt-60">
<div class="row">
<div class="col-lg-4 col-md-6 col-12">
<div class="media feature">
<div class="icons m-0 rounded-md h2 text-primary text-center px-3">
<i class="uil uil-phone"></i>
</div>
<div class="content ml-4">
<h5>대표전화</h5>
<p class="text-muted">도움이 필요하시면 언제든지 연락주세요.</p>
<a href="tel:+152534-468-854" class="text-primary">0507-1401-8061</a>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-12 mt-5 mt-sm-0">
<div class="media feature">
<div class="icons m-0 rounded-md h2 text-primary text-center px-3">
<i class="uil uil-envelope"></i>
</div>
<div class="content ml-4">
<h5>이메일</h5>
<p class="text-muted">전화가 어렵다면 이메일로 연락주세요.</p>
<a href="mailto:contact@example.com" class="text-primary"> space@itwill.com</a>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-12 mt-5 mt-lg-0">
<div class="media feature">
<div class="icons m-0 rounded-md h2 text-primary text-center px-3">
<i class="uil uil-map-marker"></i>
</div>
<div class="content ml-4">
<h5>영업소재지</h5>
<p class="text-muted mb-0">서울특별시 강남구 테헤란로 124 4층</p>
</div>
</div>
</div>
</div>
</div>
<br>
</body>
</html>
<!--contact 정보 end-->
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
<style type="text/css">
td {
text-align: left;
}
body {
font-family:'Nanum Gothic', sans-serif;
font-size: 18px;
letter-spacing: 0.1em;
}
</style>
<title>Space Moon</title>
</head>
<body>
<div class="content w-50" style="margin: 0 auto; position: relative; text-align: center;" >
<br>
<h3>공지사항</h3>
<br>
<br>
<div>
<form class="row gx-3 gy-2 align-items-center">
<table class="table table-bordered border-primary">
<tr>
<td style="font-weight: bold; background-color: #D6DCEC;">제목 : ${noticeview.ntitle }</td>
</tr>
<tr>
<td style="line-height: 3; font-weight: 500;">
<br>
<div style="text-align: center;">
<img src="${pageContext.request.contextPath}/images/notice/${noticeview.nimg}" style="align-items: center;">
</div>
<br>
${noticeview.ncontent}
</td>
</tr>
<tr>
<td>게시일자 : ${fn:substring(noticeview.ndate,0,10) } </td>
</tr>
</table>
</form>
<div style="text-align: center;">
<br>
<p><button onclick="location.href='${pageContext.request.contextPath }/member_notice';" type="button" class="btn btn-primary">게시글목록</button></p>
</div>
</div>
</div>
</body>
</html>