text:
<repo_name>suhyun94/webProject<file_sep>/src/main/java/cinema/cloud/com/pty/movietrailerService.java
package cinema.cloud.com.pty;

import java.util.List;

import cinema.cloud.com.dto.movieVO;

public interface movietrailerService {
	//글 등록
	void insertMovieTrailer(movieVO vo);

	//글 수정
	void updateMovieTrailer(movieVO vo);

	//글 삭제
	void deleteMovieTrailer(movieVO vo);

	//글 상세 조회
	movieVO getMovieTrailer(movieVO vo);

	//글 목록 조회
	List<movieVO> getMovieTrailerList(movieVO vo);
}
<file_sep>/src/main/webapp/resources/js/moviescore2.js
/**
 *  무비스코어 3D 큐브 스위퍼
 */

    var swiper = new Swiper('.swiper-container2', {
      effect: 'cube',
      grabCursor: true,
      cubeEffect: {
        shadow: true,
        slideShadows: true,
        shadowOffset: 20,
        shadowScale: 0.94,
      },
      pagination: {
        el: '.swiper-pagination2',
      },
    });
    <file_sep>/src/main/webapp/WEB-INF/views/TRASH/moviechart.jsp
<%@page import="java.util.List"%>
<%@page import="cinema.cloud.com.dao.movieDAO"%>
<%@page import="cinema.cloud.com.dto.movieVO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%-- <%@ include file="header.jsp" %> --%>

<!DOCTYPE html>

<meta charset="utf-8">

<link rel="stylesheet" type="text/css" href="resources/css/main.css">
<link rel="stylesheet" type="text/css" href="resources/css/swiper.min.css">

<title>MainPage</title>

무비차트

<%-- <%@ include file="footer.jsp" %> --%>

<file_sep>/src/main/java/cinema/cloud/com/dto/TicketChooseVO.java
package cinema.cloud.com.dto;

public class TicketChooseVO {
	private int s_code,m_code,th_code,c_code,s_seat_rest,m_runningtime,th_row,th_col,th_num;
	private String s_date,s_start_time,c_name,m_title;

	public int getS_code() {
		return s_code;
	}
	public void setS_code(int s_code) {
		this.s_code = s_code;
	}
	public int getM_code() {
		return m_code;
	}
	public void setM_code(int m_code) {
		this.m_code = m_code;
	}
	public int getTh_code() {
		return th_code;
	}
	public void setTh_code(int th_code) {
		this.th_code = th_code;
	}
	public int getC_code() {
		return c_code;
	}
	public void setC_code(int c_code) {
		this.c_code = c_code;
	}
	public int getS_seat_rest() {
		return s_seat_rest;
	}
	public void setS_seat_rest(int s_seat_rest) {
		this.s_seat_rest = s_seat_rest;
	}
	public int getM_runningtime() {
		return m_runningtime;
	}
	public void setM_runningtime(int m_runningtime) {
		this.m_runningtime = m_runningtime;
	}
	public String getS_date() {
		return s_date;
	}
	public void setS_date(String s_date) {
		this.s_date = s_date;
	}
	public String getS_start_time() {
		return s_start_time;
	}
	public void setS_start_time(String s_start_time) {
		this.s_start_time = s_start_time;
	}
	public String getC_name() {
		return c_name;
	}
	public void setC_name(String c_name) {
		this.c_name = c_name;
	}
	public String getM_title() {
		return m_title;
	}
	public void setM_title(String m_title) {
		this.m_title = m_title;
	}
	public int getTh_row() {
		return th_row;
	}
	public void setTh_row(int th_row) {
		this.th_row = th_row;
	}
	public int getTh_col() {
		return th_col;
	}
	public void setTh_col(int th_col) {
		this.th_col = th_col;
	}
	public int getTh_num() {
		return th_num;
	}
	public void setTh_num(int th_num) {
		this.th_num = th_num;
	}

}
<file_sep>/src/main/java/cinema/cloud/com/dto/CloudBoardVO.java
package cinema.cloud.com.dto;

public class CloudBoardVO {
	private int cb_CODE, u_CODE, m_CODE,cb_directorscore,cb_storyscore,cb_actorscore,cb_goodscore;
	private String cb_content, cb_date;

	// user id 출력용
	private String u_id;

	public String getU_id() {
		return u_id;
	}
	public void setU_id(String u_id) {
		this.u_id = u_id;
	}
	public int getCb_directorscore() {
		return cb_directorscore;
	}
	public void setCb_directorscore(int cb_directorscore) {
		this.cb_directorscore = cb_directorscore;
	}
	public int getCb_storyscore() {
		return cb_storyscore;
	}
	public void setCb_storyscore(int cb_storyscore) {
		this.cb_storyscore = cb_storyscore;
	}
	public int getCb_actorscore() {
		return cb_actorscore;
	}
	public void setCb_actorscore(int cb_actorscore) {
		this.cb_actorscore = cb_actorscore;
	}
	public int getCb_goodscore() {
		return cb_goodscore;
	}
	public void setCb_goodscore(int cb_goodscore) {
		this.cb_goodscore = cb_goodscore;
	}
	public int getCb_CODE() {
		return cb_CODE;
	}
	public void setCb_CODE(int cb_CODE) {
		this.cb_CODE = cb_CODE;
	}
	public int getU_CODE() {
		return u_CODE;
	}
	public void setU_CODE(int u_CODE) {
		this.u_CODE = u_CODE;
	}
	public int getM_CODE() {
		return m_CODE;
	}
	public void setM_CODE(int m_CODE) {
		this.m_CODE = m_CODE;
	}
	public String getCb_content() {
		return cb_content;
	}
	public void setCb_content(String cb_content) {
		this.cb_content = cb_content;
	}
	public String getCb_date() {
		return cb_date;
	}
	public void setCb_date(String cb_date) {
		this.cb_date = cb_date;
	}

}
<file_sep>/src/main/webapp/resources/js/register.js
/* 회원가입  */
function registerCheck(){
	var id = $('#u_id').val();

	$.ajax({
		type:'POST',
		url:'idCheck',
		data:{u_id:id},
		success:function(result){
			if(result==1){
				$('#checkMessage').html('사용할 수 없는 아이디입니다.');
				$('#checkType').attr('class','modal-content panel-success');
			}else{
				$('#checkMessage').html('사용할 수 있는 아이디입니다.');
				$('#checkType').attr('class','modal-content panel-warning');

			}
			$('#checkModal').modal("show");
		}
	});

}<file_sep>/src/main/webapp/WEB-INF/views/store/store3.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../setting.jsp" %>
<%@ include file="../header.jsp" %>
<!DOCTYPE html>

<meta charset="utf-8">

<title>Store</title>

	전체

	팝콘

	음료

	티켓

	<c:forEach var="store" items="${store}">

						${store.p_name}

       		   			${store.p_content}

               			${store.p_price }

	</c:forEach>

<%@ include file="../footer.jsp" %>

<file_sep>/src/main/java/cinema/cloud/com/controller/movietrailerController.java
package cinema.cloud.com.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;

import cinema.cloud.com.dto.movieVO;
import cinema.cloud.com.pty.movietrailerService;

@Controller
@SessionAttributes("movietrailer")
public class movietrailerController {
	@Autowired
	private movietrailerService movietrailerService;

	@RequestMapping("/movietrailer") // 무비트레일러로 이동
	public String gomovie(movieVO vo,Model model) {
		System.out.println("무비트레일러로이동");
		return "movietrailer";
	}

}
<file_sep>/src/main/webapp/WEB-INF/views/TRASH/headergood.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="resources/css/main.css">
<title>header</title>

CINEMA CLOUD

영화

무비차트

트레일러

평점

영화관

시네마관

클라우드관

무비포스트

무비포스트메뉴1

무비포스트메뉴2

스토어

스토어메뉴1

스토어메뉴2

이벤트

스토어메뉴3

스토어메뉴3

<file_sep>/src/main/java/cinema/cloud/com/controller/CinemaController.java
package cinema.cloud.com.controller;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;

import cinema.cloud.com.dto.CinemaVO;
import cinema.cloud.com.khc.CinemaService;

@Controller
@SessionAttributes("cinema")
public class CinemaController {

	@Autowired
	private CinemaService cinemaService;

/*	public void setMoviepostService(moviepostService moviepostService) {
		this.moviepostService = moviepostService;
	}*/

	@RequestMapping("/cinema") // 영화관 페이지로 이동
	public String goCinema(CinemaVO vo,Model model,HttpSession s) {
		System.out.println("시네마 이동");
		s.setAttribute("cinemalist", cinemaService.getCinemaList(vo));
		//model.addAttribute("cinemalist",cinemaService.getCinemaList(vo));
		return "cinema/cinema";
	}

	@RequestMapping("/cinema2") // 영화관 페이지로 이동
	public String goCinema1(CinemaVO vo,Model model,HttpSession s) {
		System.out.println("시네마 이동");
		s.setAttribute("theaterlist", cinemaService.getTheaterList(vo));
		//model.addAttribute("cinemalist",cinemaService.getCinemaList(vo));
		return "cinema/cinema2";
	}

	@RequestMapping("/cinema3") // 영화관 페이지로 이동
	public String goCinema2(CinemaVO vo,Model model,HttpSession s) {
		System.out.println("시네마 이동");
		s.setAttribute("cinemainfolist", cinemaService.getCinemaInfoList(vo));
		//model.addAttribute("cinemalist",cinemaService.getCinemaList(vo));
		return "cinema/cinema3";
	}
}
<file_sep>/src/main/webapp/resources/js/store.js
/**
 *  스토어
 */

$(document).ready(function(){
    $(".menu1").click(function(){
        $(".store").hide(500);
        $(".menu1").click(function() {
			$(".store").show(500);
		})
    });
});

$(document).ready(function(){
    $(".menu2").click(function(){
        $(".store").hide(500);
        $(".menu2").click(function() {
			$(".store").show(500);
		})
    });
});

$(document).ready(function(){
    $(".menu3").click(function(){
        $(".store").hide(500);
        $(".menu3").click(function() {
			$(".store").show(500);
		})
    });
});<file_sep>/src/main/java/cinema/cloud/com/hsh/UsersService.java
package cinema.cloud.com.hsh;

import java.util.List;

import cinema.cloud.com.dto.UsersVO;

public interface UsersService {
	//아이디체크
	int idCheck(UsersVO vo);
	//로그인
	int loginCheck(UsersVO vo);
	//회원가입
	void insertUser(UsersVO vo);
	//아이디찾기
	String idFind(UsersVO vo);
	//아이디 이메일 비교
	int pwFind(UsersVO vo);
	//비밀번호 변경
	void updatePw(String u_pw);
	//회원수정
	void updateUser(UsersVO vo);
	//회원삭제
	void deleteUser(UsersVO vo);
	//회원상세목록
	UsersVO getUser(UsersVO vo);
	//회원목록
	List<UsersVO> getUserList(UsersVO vo);
}
<file_sep>/src/main/java/cinema/cloud/com/pty/moviechartServiceimpl.java
package cinema.cloud.com.pty;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cinema.cloud.com.dao.movieDAO;
import cinema.cloud.com.dto.movieVO;

//테스트
@Service("moviechartService")
public class moviechartServiceimpl implements moviechartService {

	@Autowired
	private movieDAO movieDAO;

	public void setMovieChartDAO(movieDAO movieDAO) {
		this.movieDAO = movieDAO;
	}

	@Override
	public void insertMovieChart(movieVO vo) {
		//구현중..
	}

	@Override
	public void updateMovieChart(movieVO vo) {
		// 구현중..
	}

	@Override
	public void deleteMovieChart(movieVO vo) {
		// 구현중..
	}

	@Override
	public movieVO getMovieChart(movieVO vo) {
		return movieDAO.getMovie(vo);
	}

	@Override
	public List<movieVO> getMovieChartList(movieVO vo) {
		//무비 DB 가져오는거
		return movieDAO.getMovieList(vo);
	}

	@Override
	public List<movieVO> getAllMovie(movieVO vo) {
		return movieDAO.getAllMovie(vo);
	}

}
<file_sep>/src/main/webapp/resources/js/q.js
/**
 * 퀵 메뉴 구현
 */

/*
 * $(document).ready(function(){ alert('ㅎㅇ'); $(window).scroll(function () { var
 * quickHeight=$(document).scrollTop(); if (0 < quickHeight ) {
 * $('.bms-quick-banner').stop().animate({top:'0px'}, 500); }else if(
 * quickHeight == 0){ $('.bms-quick-banner').stop().animate({top:'151px'}, 500); }
 * }); });
 */

window.onload = function() {

	$(document).ready(function() {

		  $(".zeta-menu li").hover(function(){
			    $('ul:first',this).show();
			  }, function(){
			    $('ul:first',this).hide();
			  });
			  $(".zeta-menu>li:has(ul)>a").each( function() {
			    $(this).html( $(this).html()+' ∨' );
			  });
			  $(".zeta-menu ul li:has(ul)")
			    .find("a:first")
			    .append("
▸
");

			$(window).scroll(function() {
			var quickHeight = $(document).scrollTop();
			if (0 < quickHeight) {
				$('.bms-quick-banner').stop().animate({
					top : '0px'
				}, 500);
			} else if (quickHeight == 0) {
				$('.bms-quick-banner').stop().animate({
					top : '151px'
				}, 500);
			}
		});
	});

}
<file_sep>/src/main/java/cinema/cloud/com/dto/ScreeninfoVO.java
package cinema.cloud.com.dto;

public class ScreeninfoVO {
	//상영정보
	private int s_code, s_seat_rest, m_code, th_code;
	private String s_date, s_start_time;

	public int getS_code() {
		return s_code;
	}
	public void setS_code(int s_code) {
		this.s_code = s_code;
	}
	public int getS_seat_rest() {
		return s_seat_rest;
	}
	public void setS_seat_rest(int s_seat_rest) {
		this.s_seat_rest = s_seat_rest;
	}
	public int getM_code() {
		return m_code;
	}
	public void setM_code(int m_code) {
		this.m_code = m_code;
	}
	public int getTh_code() {
		return th_code;
	}
	public void setTh_code(int th_code) {
		this.th_code = th_code;
	}
	public String getS_date() {
		return s_date;
	}
	public void setS_date(String s_date) {
		this.s_date = s_date;
	}
	public String getS_start_time() {
		return s_start_time;
	}
	public void setS_start_time(String s_start_time) {
		this.s_start_time = s_start_time;
	}

}
<file_sep>/src/main/webapp/WEB-INF/views/index.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="setting.jsp" %>
<%@ include file="header.jsp" %>

<!DOCTYPE html>

<meta charset="utf-8">

<title>MainPage</title>

<%@ include file="footer.jsp" %>

<file_sep>/src/main/java/cinema/cloud/com/controller/moviepostController.java
package cinema.cloud.com.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;

import cinema.cloud.com.dto.MprVO;
import cinema.cloud.com.dto.UsersVO;
import cinema.cloud.com.dto.moviepostVO;
import cinema.cloud.com.ndj.moviepostService;

@Controller
@SessionAttributes("moviepost")
public class moviepostController {

	@Autowired
	private moviepostService moviepostService;

	//검색조건 목록 설정하기
	@ModelAttribute("conditionMap")
	public Map<String, String> searchConditionMap(){
		Map<String, String> conditionMap = new HashMap<String, String>();
		conditionMap.put("내용", "MP_CONTENT");
		conditionMap.put("제목", "MP_TITLE");

		return conditionMap;
	}

	@RequestMapping("/moviepost") // 무비포스트이동
	public String gomoviepost(moviepostVO vo,Model model,HttpSession s) {
		System.out.println("테스트");
		if(vo.getSearchCondition() == null) vo.setSearchCondition("MP_TITLE");
		if(vo.getSearchKeyword() == null) vo.setSearchKeyword("");
		//s.setAttribute("moviepostlist", moviepostService.getMoviepostList(vo));
		model.addAttribute("moviepostlist",moviepostService.getMoviepostList(vo));

		return "moviepost/moviepost";
	}

	@RequestMapping("/getmoviepost") // 상세보기
	public String getmoviepost(moviepostVO vo,MprVO mvo,Model model, HttpServletRequest re) {
		System.out.println("무비포스트 창 확인중..");
		model.addAttribute("movielist", moviepostService.getMoviepost(vo));

		String mp_code =re.getParameter("MP_CODE");
		mvo.setMp_code(Integer.parseInt(mp_code));

		model.addAttribute("reply", moviepostService.getreplyList(mvo));
		return "moviepost/getmoviepost";
		}

	@RequestMapping("/write") // 글작성 창 여는거
	public String write(moviepostVO vo,Model model,HttpSession h,UsersVO uvo) {
		System.out.println("무비포스트 창 확인중..");
		//감히 로그인도 안하고 글적어?
		if(h.getAttribute("u_id") == null) {
			//model.addAttribute("logincheck", "1");
			return "redirect:moviepost/moviepost";
		}else if(h.getAttribute("u_id") != null) {
			//model.addAttribute("logincheck", "2");
			return "moviepost/getmoviepost";
		}
		return "moviepost/getmoviepost";

		}

	@RequestMapping("/insertmoviepost") //글작성 처리
	public String insertmoviepost(moviepostVO vo,HttpServletRequest re,Model model) {
		String title = re.getParameter("MP_TITLE");
		String content = re.getParameter("MP_CONTENT");

		vo.setMP_TITLE(title);
		vo.setMP_CONTENT(content);

		/*
		model.addAttribute("MP_TITLE",title);
		model.addAttribute("MP_CONTENT",content);
		*/

		moviepostService.insertMoviepost(vo);
		return "redirect:moviepost";
	}

	@RequestMapping("/updatemoviepost") // 글 수정
	public String updatemovielist(moviepostVO vo) {
		moviepostService.updateMoviepost(vo);
		return "moviepost/moviepost";
	}

	@RequestMapping("/likeclick") // 조항요~
	public String likeup(moviepostVO vo,Model model,HttpSession h) {
		//로그인 해놔야 좋아요누를ㄹ수이따
		if(h.getAttribute("u_id") == null) {
			//model.addAttribute("logincheck", "1");
			return "redirect:moviepost";
		}else {
			moviepostService.like(vo);
			return "redirect:moviepost";
		}
	}

}
<file_sep>/src/main/webapp/WEB-INF/views/TRASH/bigmp.jsp
<%@page import="cinema.cloud.com.dto.moviepostVO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%

	//세션에 저장된 게시글 정보를 꺼낸다
	System.out.println("무비포스트 클릭 화면");
	moviepostVO mp = (moviepostVO) session.getAttribute("moviepost");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>글 상세</title>

글 상세

	Log_out

	<form action="updatemoviepost" method="post">
		<input name="MP_CODE" type="hidden" value="${mp.mP_CODE }"/>

				제목
				<input name="MP_TITLE" type="text" value="${mp.mP_TITLE }"/>

				내용
				<textarea name="MP_TITlE" cols="40" rows="10">${mp.mP_CONTENT }</textarea>

				등록일
				${mp.mP_DATE}

					<input type="submit" value="글 수정"/>

	</form>

	글등록
<%-- 	글삭제
	글목록 --%>

<file_sep>/src/main/webapp/WEB-INF/views/csCenter/getlaf.jsp
<%@page import="cinema.cloud.com.dto.noticeVO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ include file="../setting.jsp" %>
<%@ include file="../header.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>글 상세</title>

글 상세

	Log_out

	<form action="#">
		<input name="l_number" type="hidden" value=""/>

				분류
				${laf.l_kind}

				제목
				<input name="n.title" type="text" value="${laf.l_title }"/>

				내용
				<textarea name="q_content" cols="40" rows="10">${laf.l_content}</textarea>

				등록일
				${laf.l_regdate }

	</form>

	글등록
	글삭제
	글목록

<%@ include file="../footer.jsp" %>

<file_sep>/src/main/webapp/WEB-INF/views/moviechart/getmoviechart.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../header.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>무비차트 상세</title>
<link rel="stylesheet" type="text/css" href="resources/css/getmoviechart.css">

   영화 상세

${movie.m_TITLE}

누적관객수 ${movie.m_VIEWER_NUM} 평점

감독 ${movie.m_DIRECTOR}  출연 ${movie.m_ACTOR} 상영시간 ${movie.m_RUNNINGTIME}

장르 ${movie.m_GENRE}  등급

			개봉 ${movie.m_START_DATE}

줄거리

	${movie.m_CONTENT}

<file_sep>/src/main/java/cinema/cloud/com/ndj/noticeService.java
package cinema.cloud.com.ndj;

import java.util.List;

import cinema.cloud.com.dto.noticeVO;

public interface noticeService {
	//글 등록
	void insertNotice(noticeVO vo);

	//글 수정
	void updateNotice(noticeVO vo);

	//글 삭제
	void deleteNotice(noticeVO vo);

	//글 상세 조회
	noticeVO getNotice(noticeVO vo);

	//글 목록 조회
	List<noticeVO> getNoticeList(noticeVO vo);
}
<file_sep>/src/main/java/cinema/cloud/com/ndj/productServiceImpl.java
package cinema.cloud.com.ndj;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cinema.cloud.com.dao.productDAO;
import cinema.cloud.com.dto.productVO;

@Service("productService")
public class productServiceImpl implements productService {

	@Autowired
	private productDAO productDAO;

	@Override
	public void insertProduct(productVO vo) {
		// 구현중

	}

	@Override
	public void updateProduct(productVO vo) {
		// 구현중

	}

	@Override
	public void deleteProduct(productVO vo) {
		// 구현중

	}

	@Override
	public productVO getProduct(productVO vo) {
		return productDAO.getProduct(vo);
	}

	@Override
	public List<productVO> getProductList(productVO vo) {
	// product DB 리스트 가져오자
		return productDAO.getProductList(vo);
	}

	@Override
	public List<productVO> getProductListC(productVO vo) {

		return productDAO.getProductListC(vo);
	}

	@Override
	public List<productVO> getProductListA(productVO vo) {
		return productDAO.getProductListA(vo);
	}

	@Override
	public List<productVO> getProductListB(productVO vo) {
		return productDAO.getProductListB(vo);
	}

}
<file_sep>/src/main/java/cinema/cloud/com/hsh/TicketingService.java
package cinema.cloud.com.hsh;

import java.util.List;

import cinema.cloud.com.dto.CinemaVO;
import cinema.cloud.com.dto.SeatVO;
import cinema.cloud.com.dto.TicketChooseVO;
import cinema.cloud.com.dto.TicketingVO;

public interface TicketingService {
	List<TicketChooseVO> ticketChoose(TicketChooseVO vo);
	List<CinemaVO> ticketLoc(CinemaVO vo);
	//좌석가져오기
	String getStNum(SeatVO vo);
	//예매 추가
	void insertTicket(TicketingVO vo);
	//상영정보테이블에 예매좌석 업데이트
	void updateScreenInfo(SeatVO vo);
}
<file_sep>/src/main/java/cinema/cloud/com/controller/AdminController.java
package cinema.cloud.com.controller;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import cinema.cloud.com.dto.UsersVO;
import cinema.cloud.com.hsh.UsersService;

@Controller
public class AdminController {
	@Autowired
	private UsersService usersService;

	@RequestMapping("/admin")
	public String admin(HttpSession se,UsersVO vo, Model model) {
		String id = (String) se.getAttribute("u_id");
		vo.setU_id(id);
		model.addAttribute("users", usersService.getUser(vo));
		return "admin/admin";
	}
}
<file_sep>/src/main/java/cinema/cloud/com/dto/QaVO.java
package cinema.cloud.com.dto;

import java.sql.Date;

public class QaVO {
	private int q_code;
	private String q_title;
	private String q_content,mg_id,u_code;
	private Date q_regdate;
	private String q_question;
	private String q_answer;
	private String q_kind;

	public int getQ_code() {
		return q_code;
	}
	public void setQ_code(int q_code) {
		this.q_code = q_code;
	}
	public String getQ_title() {
		return q_title;
	}
	public void setQ_title(String q_title) {
		this.q_title = q_title;
	}
	public String getQ_content() {
		return q_content;
	}
	public void setQ_content(String q_content) {
		this.q_content = q_content;
	}
	public String getMg_id() {
		return mg_id;
	}
	public void setMg_id(String mg_id) {
		this.mg_id = mg_id;
	}
	public String getU_code() {
		return u_code;
	}
	public void setU_code(String u_code) {
		this.u_code = u_code;
	}
	public Date getQ_regdate() {
		return q_regdate;
	}
	public void setQ_regdate(Date q_regdate) {
		this.q_regdate = q_regdate;
	}
	public String getQ_question() {
		return q_question;
	}
	public void setQ_question(String q_question) {
		this.q_question = q_question;
	}
	public String getQ_answer() {
		return q_answer;
	}
	public void setQ_answer(String q_answer) {
		this.q_answer = q_answer;
	}
	public String getQ_kind() {
		return q_kind;
	}
	public void setQ_kind(String q_kind) {
		this.q_kind = q_kind;
	}

}
<file_sep>/src/main/java/cinema/cloud/com/controller/moviechartController.java
package cinema.cloud.com.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;

import cinema.cloud.com.dto.movieVO;
import cinema.cloud.com.pty.moviechartService;

@Controller
@SessionAttributes("moviechart")
public class moviechartController {

	@Autowired
	private moviechartService moviechartService;

	//검색조건 목록 설정하기
	@ModelAttribute("conditionMap")
	public Map<String, String> searchConditionMap(){
		Map<String, String> conditionMap = new HashMap<String, String>();
		conditionMap.put("제목", "m_TITLE");
		return conditionMap;
	}

	@RequestMapping("/moviechart") // 무비차트로이동
	public String gomovie(movieVO vo,Model model,HttpSession s) {
		System.out.println("테스트");
		if(vo.getSearchCondition() == null) vo.setSearchCondition("m_TITLE");
		if(vo.getSearchKeyword() == null) vo.setSearchKeyword("");
		s.setAttribute("moviechartlist", moviechartService.getMovieChartList(vo));
//		model.addAttribute("moviechartlist",moviechartService.getMovieChartList(vo));
		return "moviechart/moviechart";
	}

	@RequestMapping("/getmoviechart")
	public String getmoviechart(movieVO vo,Model model) {
		System.out.println("무비차트 창 확인중..");
		model.addAttribute("movie", moviechartService.getMovieChart(vo));
		return "moviechart/getmoviechart";
	}

}
<file_sep>/src/main/java/cinema/cloud/com/dto/movieVO.java
package cinema.cloud.com.dto;

import java.util.Date;

public class movieVO {

	private String m_CODE,m_TITLE,m_GRADE,m_ACTOR,m_DIRECTOR,m_GENRE,m_RUNNINGTIME,
	m_VIEWER_NUM,m_CONTENT,m_IMAGE,m_TRAILER;
	private Date m_START_DATE;
	private String searchCondition,searchKeyword; // 검색용

	public String getSearchCondition() {
		return searchCondition;
	}
	public void setSearchCondition(String searchCondition) {
		this.searchCondition = searchCondition;
	}
	public String getSearchKeyword() {
		return searchKeyword;
	}
	public void setSearchKeyword(String searchKeyword) {
		this.searchKeyword = searchKeyword;
	}
	public String getM_TRAILER() {
		return m_TRAILER;
	}
	public void setM_TRAILER(String m_TRAILER) {
		this.m_TRAILER = m_TRAILER;
	}

	public String getM_CODE() {
		return m_CODE;
	}
	public void setM_CODE(String m_CODE) {
		this.m_CODE = m_CODE;
	}

	public String getM_TITLE() {
		return m_TITLE;
	}

	public void setM_TITLE(String m_TITLE) {
		this.m_TITLE = m_TITLE;
	}
	public String getM_GRADE() {
		return m_GRADE;
	}

	public void setM_GRADE(String m_GRADE) {
		this.m_GRADE = m_GRADE;
	}
	public String getM_ACTOR() {
		return m_ACTOR;
	}
	public void setM_ACTOR(String m_ACTOR) {
		this.m_ACTOR = m_ACTOR;
	}
	public String getM_DIRECTOR() {
		return m_DIRECTOR;
	}
	public void setM_DIRECTOR(String m_DIRECTOR) {
		this.m_DIRECTOR = m_DIRECTOR;
	}
	public String getM_GENRE() {
		return m_GENRE;
	}
	public void setM_GENRE(String m_GENRE) {
		this.m_GENRE = m_GENRE;
	}
	public Date getM_START_DATE() {
		return m_START_DATE;
	}
	public void setM_START_DATE(Date m_START_DATE) {
		this.m_START_DATE = m_START_DATE;
	}
	public String getM_RUNNINGTIME() {
		return m_RUNNINGTIME;
	}

	public void setM_RUNNINGTIME(String m_RUNNINGTIME) {
		this.m_RUNNINGTIME = m_RUNNINGTIME;
	}
	public String getM_VIEWER_NUM() {
		return m_VIEWER_NUM;
	}
	public void setM_VIEWER_NUM(String m_VIEWER_NUM) {
		this.m_VIEWER_NUM = m_VIEWER_NUM;
	}
	public String getM_CONTENT() {
		return m_CONTENT;
	}
	public void setM_CONTENT(String m_CONTENT) {
		this.m_CONTENT = m_CONTENT;
	}
	public String getM_IMAGE() {
		return m_IMAGE;
	}
	public void setM_IMAGE(String m_IMAGE) {
		this.m_IMAGE = m_IMAGE;
	}

	@Override
	public String toString() {
		return "제목: " + m_TITLE +"영화사진: "+m_IMAGE;
	}

}
<file_sep>/src/main/java/cinema/cloud/com/controller/moviescoreController.java
package cinema.cloud.com.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;

import cinema.cloud.com.dto.CloudBoardVO;
import cinema.cloud.com.dto.CloudVO;
import cinema.cloud.com.pty.CloudService;

@Controller
@SessionAttributes("moviescores")
public class moviescoreController {

	@Autowired
	private CloudService CloudService;

	@RequestMapping("/moviescore") // 무비스코어로이동
	public String gomoviescore(CloudVO vo,CloudBoardVO cbvo,Model model) {
		System.out.println("무비스코어로이동");
		model.addAttribute("score", CloudService.getCloudList2(vo));
		model.addAttribute("reply", CloudService.getreply(cbvo));
		return "moviescore/moviescore";
	}

	@RequestMapping("/cloudBoardForm")
	public String cloudBoardForm(HttpServletRequest re) {

		System.out.println("평점폼");

		return "moviescore/writemoviescore";
	}

	@RequestMapping("/insertCloudBoard") //글작성 처리
	public String insertCloudBoard(CloudBoardVO vo, HttpServletRequest re) {
		System.out.println("마음의 준비...");

		String content = re.getParameter("cb_content");
		vo.setCb_content(content);

		//System.out.println(m_code);

		/*
		model.addAttribute("MP_TITLE",title);
		model.addAttribute("MP_CONTENT",content);
		*/

		CloudService.insertCloudBoard(vo);
		return "redirect:moviescore";
	}
}
<file_sep>/src/main/java/cinema/cloud/com/khc/testClient.java
package cinema.cloud.com.khc;

import java.util.List;

import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;

import cinema.cloud.com.dto.CinemaVO;
import cinema.cloud.com.dto.moviepostVO;
import cinema.cloud.com.dto.productVO;

public class testClient {
// 무비포스트 DB연결 작동 및 값 가져오기 테스트
	public static void main(String[] args) {
		AbstractApplicationContext c =
		new GenericXmlApplicationContext("applicationContext.xml");

		CinemaService ms =
		(CinemaService) c.getBean("CinemaService");

		CinemaVO vo = new CinemaVO();
		ms.selectCinema(vo);

		// 4. 글 목록 검색 기능 테스트

	List<CinemaVO> cinema = ms.getCinemaList(vo); // 여기서 select 하거
	//System.out.println(movie);

	for (CinemaVO ma : cinema) {
		System.out.println("---> " + ma.toString());
	}

	List<CinemaVO> theater = ms.getTheaterList(vo); // 여기서 select 하거
	System.out.println("=================================");
	//System.out.println(movie);
	//vo.setC_LOC("서울");
	for (CinemaVO ma : theater) {
		System.out.println("---> " + ma.toString());
	}

	c.close();

}

}
<file_sep>/src/main/java/cinema/cloud/com/pty/moviechartService.java
package cinema.cloud.com.pty;

import java.util.List;

import cinema.cloud.com.dto.movieVO;

public interface moviechartService {
	//글 등록
	void insertMovieChart(movieVO vo);

	//글 수정
	void updateMovieChart(movieVO vo);

	//글 삭제
	void deleteMovieChart(movieVO vo);

	//글 상세 조회
	movieVO getMovieChart(movieVO vo);

	//글 목록 조회
	List<movieVO> getMovieChartList(movieVO vo);

	List<movieVO> getAllMovie(movieVO vo);
}<file_sep>/src/main/java/cinema/cloud/com/khc/CinemaService.java
package cinema.cloud.com.khc;

import java.util.List;

import cinema.cloud.com.dto.CinemaVO;

public interface CinemaService {
	//지역 선택 (서울 , 경기 , 인천 , 대구 , 부산)
	void selectLocation(CinemaVO vo);

	//영화관 선택
	void selectCinema(CinemaVO vo);

	//영화 예약
	void reserveMovie(CinemaVO vo);

//	CinemaVO getCinema(CinemaVO vo);

	//글 목록 조회
	List<CinemaVO> getCinemaList(CinemaVO vo);

	List<CinemaVO> getTheaterList(CinemaVO vo);

	List<CinemaVO> getCinemaInfoList(CinemaVO vo);

	//지역 불러오기(중복없이)
	List<CinemaVO> getCinemaLoc(CinemaVO vo);

}
<file_sep>/src/main/java/cinema/cloud/com/dao/CloudDAO.java
package cinema.cloud.com.dao;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import cinema.cloud.com.dto.CloudBoardVO;
import cinema.cloud.com.dto.CloudVO;

@Repository("cloudDAO")
public class CloudDAO {

	@Autowired
	private SqlSessionTemplate mybatis;

	public void insertcloud(CloudBoardVO vo) { // 작동확인
		System.out.println("cloud 글 작성 처리");
		mybatis.insert("CloudDAO.insertcloud",vo);
		System.out.println("cloud 글 작성 완료");
	}

	public void updatecloud(CloudBoardVO vo) {
		System.out.println("cloud 글 수정  처리");
		mybatis.update("CloudDAO.updateCloudBoard", vo);
		System.out.println("cloud 글 수정 완료");
	}

/*	public void like(CloudBoardVO vo) {
		System.out.println("cloud 좋아요+");
		mybatis.update("CloudDAO.likeup",vo);
		System.out.println("cloud 좋아요 확인");
	}*/

	public List<CloudBoardVO> getreply(CloudBoardVO vo) { // 글목록 다 작동확인
		System.out.println("===> 평점 목록 가져오는중");
		return mybatis.selectList("CloudDAO.getreplylist", vo);
	}

	/////////////////////////////////////////////////////////////////////////
	public void deletecloud(CloudBoardVO vo) { // 작동확인
		System.out.println("cloud 글 삭제 처리");
		mybatis.delete("CloudDAO.deleteCloudBoard",vo);
		System.out.println("cloud 글 삭제 완료");
	}

	public List<CloudVO> getCloudList(CloudVO vo) { // 글목록 다 작동확인
		System.out.println("===> 평점 목록 가져오는중");
		return mybatis.selectList("CloudDAO.getCloudList", vo);
	}

	public List<CloudVO> getAllCloud(CloudVO vo) { // 글목록 다 작동확인
		System.out.println("===> 평점 목록 가져오는중");
		return mybatis.selectList("CloudDAO.getCloudMovieList", vo);
	}

}
<file_sep>/src/main/webapp/WEB-INF/views/TRASH/movietrailer.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%-- <%@ include file="header.jsp" %> --%>
<!DOCTYPE html>

<meta charset="utf-8">

<link rel="stylesheet" type="text/css" href="resources/css/main.css">
<link rel="stylesheet" type="text/css" href="resources/css/swiper.min.css">

<title>MainPage</title>

<%-- <%@ include file="footer.jsp" %> --%>

<file_sep>/target/classes/sql/CinemaCLoudDB.sql

DROP TABLE QA;
DROP TABLE EVENT;
DROP TABLE NOTICE;
DROP TABLE CLOUDBOARD;
DROP TABLE CLOUD;
DROP TABLE mp_reply;
DROP TABLE MOVIEPOST;
DROP TABLE PRODUCT;
DROP TABLE SEAT;
DROP TABLE TICKETING;
DROP TABLE SCREENINFO;
DROP TABLE THEATER;
DROP TABLE CINEMA;
DROP TABLE MOVIE;
DROP TABLE USERS;

drop user cinemacloud cascade;

create user cinemacloud IDENTIFIED by cinemacloud DEFAULT tablespace users
TEMPORARY tablespace temp
profile default;

grant connect, resource to cinemacloud;
grant create view, create synonym to cinemacloud;

drop table users;
--회원 테이블
CREATE TABLE users(
	u_code               NUMBER(10) PRIMARY KEY ,
	u_id                 VARCHAR2(30) UNIQUE ,
	u_pw                 VARCHAR2(50) NOT NULL ,
	u_name               VARCHAR2(20) NOT NULL ,
	u_phone              VARCHAR2(50) NOT NULL ,
	u_email              VARCHAR2(50) NOT NULL ,
	u_birth              DATE NOT NULL ,
	u_grade              CHAR(10) DEFAULT 'C' ,
    u_grade_cnt   NUMBER DEFAULT 1,
    u_date  TIMESTAMP DEFAULT SYSDATE
);
create sequence u_code_seq
	start with 0
    MINVALUE 0
	increment by 1
	nocache;

insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'host','host','cinemacloud','01000000000','<EMAIL>','670920','A');

insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_1','M1','매니저1','01016464831','M_<EMAIL>','840321','B');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_2','M2','매니저2','01075571244','<EMAIL>','860611','B');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_3','M3','매니저3','01064993357','<EMAIL>','901201','B');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_4','M4','매니저4','01099438214','<EMAIL>','840321','B');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_5','M5','매니저5','01033578831','<EMAIL>','860611','B');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_6','M6','매니저6','01086249914','<EMAIL>','901201','B');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_7','M7','매니저7','01098773144','<EMAIL>','840321','B');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_8','M8','매니저8','01078963157','<EMAIL>','860611','B');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_9','M9','매니저9','01098754489','<EMAIL>','901201','B');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_10','M10','매니저10','01096595531','<EMAIL>','840321','B');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_11','M11','매니저11','01041654564','<EMAIL>','840321','B');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_12','M12','매니저12','01091342584','<EMAIL>','860611','B');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_13','M13','매니저13','01024787864','<EMAIL>','901201','B');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_14','M14','매니저14','01037869797','<EMAIL>','840321','B');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_15','M15','매니저15','01043786786','<EMAIL>','860611','B');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_16','M16','매니저16','01037869797','<EMAIL>','840321','B');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'M_17','M17','매니저17','01043786786','<EMAIL>','860611','B');
--코드 :: 2~18 매니저17명

insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'u_1','u1','회원1','01025504472','<EMAIL>','940330','C');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'u_2','u2','회원2','01033871588','<EMAIL>','950511','C');
insert into users(u_code,u_id,u_pw,u_name,u_phone,u_email,u_birth,u_grade) values(U_CODE_SEQ.NEXTVAL, 'u_3','u3','회원3','01034786678','<EMAIL>','700201','C');

select * from users;
commit;

--영화관 테이블
drop table cinema;

CREATE TABLE cinema(
	c_code               NUMBER(10) PRIMARY KEY,
	c_name               VARCHAR2(50) NULL ,
    c_loc                VARCHAR2(20) NULL,
	c_adr                VARCHAR2(200) NULL ,
	c_info               VARCHAR2(300) NULL ,
	c_pic                VARCHAR2(150) NULL ,
    u_code                NUMBER(10) NOT NULL,
    c_mapx                VARCHAR2(50) NULL ,
    c_mapy                VARCHAR2(50) NULL ,
    c_trans              VARCHAR2(800) NULL ,
    FOREIGN KEY (u_code) REFERENCES users (u_code) ON DELETE CASCADE
);

create sequence c_code_seq
	start with 0
    MINVALUE 0
	increment by 1
	nocache;

insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'화곡점','서울','서울특별시 강서구 화곡로 142 클라우드 스퀘어 4층','화곡점 정보','resources/images/cinema/1.jpg',2,'37.54141','126.8413656','604번, 606번, 650번,652번, 653번, 661번, 673번
7700번
5호선 화곡역 6번출구 도보 3분(300m)');
insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'김포점','경기','경기도 김포시 걸포로 6 걸포동, 미도프라자 7층,8층 / 전화번호 1544-0070','부천점 정보','resources/images/cinema/2.jpg',3,'37.6456686','126.7063888','3000, 9008, 8600
20, 33, 60-3, 81-1');
insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'일산점','경기','경기도 고양시 일산서구 덕이로 20 / 전화번호 1544-0070','일산점 정보','resources/images/cinema/3.jpg',4,'37.681997','126.7678513','2번, 5번, 8번, 567번, 706번, 7733번
76번, 770번, 773번, 1500번, 2000번, 3000번, 5000번
15번');
insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'송도점','인천','인천 광역시 연수구 송도 과학로 16번길 33-4번지 트리플 스트리트 D동 2층','송도점 정보','resources/images/cinema/4.jpg',5,'37.429714','126.6522963','9번,51-1(순환),909번 → 테크노 파크역 하차
6-2번,16번,81번,91번(순환),92번(순환) → 인천 글로벌 캠퍼스 하차
6-2번,35번,81번,91번(순환),1302번 → 송도 테크노 파크 IT센터 하차
인천 지하철 1호선 테크노파크역 하차 → 지하철 2번 출구 이용 - 도보 10분. 지상 현대 프리미엄 아울렛 송도점을 지나 진입
인천 지하철 1호선 테크노파크역 하차 → 지하철 2번 출구 이용 - 도보 10분. 지하 - 현대 프리미엄 아울렛 송도점 지하 1층을 지나 미디어 터널 진입');
insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'이수점','서울','서울특별시 동작구 동작대로 89 골든 시네마타워 7층','이수점 정보','resources/images/cinema/5.jpg',6,'37.486491','126.9796873','363, 752, 540, 540(심야)
4418, 4212, 5528, 5524, 5412, 4425, 4425(심야), 11-1, 11-2, 11-5
151, 2112, 301
동작 : 06, 07, 09, 15, 16, 17, 18, 서초 : 05, 06, 16
지하철 4호선 이수역 하차 → 지하철 7번 출구 이용
지하철 7호선 이수역 하차 → 지하철 7번 출구 이용');
insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'신촌점','서울','서울특별시 서대문구 신촌역로 30 밀리오레 5층','신촌점 정보','resources/images/cinema/6.jpg',7,'37.556329','126.9379478','163번, 170번, 171번, 172번, 270번, 271번, 273번, 602번, 603번, 472번, 721번, 751번
5711번, 5712번, 5713번, 5714번, 7011번, 7712번, 7017번, 7611번, 6716번, 7024번
1000번, 1100번, 1200번, 9600번, 9602번, 9706번
서대문 03번, 서대문 04번, 서대문 05번
지하철 2호선 이대역 하차 → 지하철 1번 출구 이용
지하철 2호선 신촌역 하차 → 지하철 3번 출구 이용
경의중앙선 신촌역 하차 → 지하철 1번 출구 이용');
---------------------------
insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'강남점','서울','서울특별시 서초구 서초대로77길 3 아라타워 8층','강남점 정보','resources/images/cinema/7.jpg',8,'37.497925','127.0264784','140번, 144번, 145번, 146번, 360번, 402번, 407번, 408번, 420번, 440번, 441번, 462번, 470번, 471번
3412번, 4412번, 서초03번, 서초 09번
9404번, 9408번, 9409번, 9503번, 9711번, 9500번, 9501번, 9510번, 9800번, 9801번, 9802번, 9901번, M4403번, M7412번
지하철 2호선 , 신분당선 강남역 -> 지하철 9번(구 5번) 출구 좌측 연결통로 이용');
insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'동대문점','서울','서울특별시 중구 장충단로 247 굿모닝시티 9층','동대문점 정보','resources/images/cinema/8.jpg',9,'37.5716675','127.009031','90S투어
100번,105번,144번,152번,202번,261번, 301번, 407번, 420번, 421번, 463번, 507번,N13번(심야),N16번(심야),N30번(심야),N62번(심야)
2012번,2014번,2015번,2233번,7212번
9403번
6001번
지하철 2호선 동대문역사문화공원역 하차 → 지하철 2호선 방향 13,14번 출구 이용
지하철 4호선 동대문역사문화공원역 하차 → 지하철 2호선 방향 13,14번 출구 이용
지하철 5호선 동대문역사문화공원’ 하차 → 지하철 2호선 방향 13,14번 출구 이용');
insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'청라점','인천','인천광역시 서구 중봉대로 610(연희동) 마루힐프라자 8층 시네마클라우드 청라점','청라점 정보','resources/images/cinema/9.jpg',10,'37.5253502','126.6277769','2-1번, 3-2번, 7번, 17-1번, 40번, 42번, 42-2번, 43번, 43-2번, 46번, 70번, 72번, 83번, 202번, 222A번, 223A번, 306번, 307번
591번, 595번
7700번, 9300번
904번, 904-1번
M6118번
인천 2호선 서구청역 하차 → 42-2번, 43번, 595번 버스 이용
인천 2호선 가정역 하차 → 2-1번, 3-2번, 7번, 42번, 46번, 83번, 591번, 904번, 904-1번 버스 이용');
insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'검단점','인천','(22677) 인천광역시 서구 서곶로 788 (당하동) 홀리랜드 4층 시네마클라우드 검단','검단점 정보','resources/images/cinema/10.jpg',11,'37.5996866','126.653889','마전성당 하차 : 13, 76, 78, 81
백석고가(하이마트) 하차 :1, 7, 17, 17-1, 90, 70, 77, 308, 700, 700-1, 903
인천 2호선 독정역 하차 → 1번출구이용 완정사거리 방면 도보 5분 이내
인천 2호선 완정역 하차 → 3번출구이용 검단이마트(독정역) 방면 도보 5분 이내');
insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'논현점','인천','인천광역시 남동구 논고개로 61, 6층 시네마클라우드(논현동, 라피에스타)','논현점 정보','resources/images/cinema/11.jpg',12,'37.511206','127.0195393','6번, 6-1번, 16-1번, 21번
537번
1301번, 1302번
905번, 907번, 303-1번
수인선 인천논현역 또는 소래포구역 1번출구 도보 10분 內');
insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'동탄점','경기','경기도 화성시 동탄지성로 11(반송동) 7층 시네마클라우드 동탄점','동탄점 정보','resources/images/cinema/12.jpg',13,'37.1994712','127.0969563','1번, 13-5번, 70-2번, 92-1번, 709번
1551번, 1551B번
17-1번, 27번');
insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'수원점','경기','경기도 수원시 권선구 경수대로 270','수원점 정보','resources/images/cinema/13.jpg',14,'37.2664355','126.9985548',' 80, 82-1, 300, 300-1(버스터미널 건너편(LG플라자)
82-1,300,300-1,303(버스터미널 앞)
1, 5, 5-1, 7, 7-1, 7-2, 13-5, 64, 80, 81, 82, 88, 200, 303, 310, 900 / NC 백화점 (이마트옆)
지하철 1호선 수원역 하차 → 롯데리아 앞 버스 환승 (5, 5-1, 7,7-1,7-2, 310, 900번) 영통,오산방향
지하철 1호선 세류역 하차 → 버스터미널 방면 버스(82-1, 200번) 환승
지하철 1호선 망포역 하차 → 4번출구 차외과 앞 버스 환승 (5,5-1,7,7-1,7-2,310,900)번');
insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'분당점','경기',' 경기도 성남시 분당구 황새울로 332','분당점 정보','resources/images/cinema/14.jpg',15,'37.3849271','127.1211125','116번, 222번, 310번,380번, 110번, 111번 (AK플라자)
9413번, 9414번, 3500번, 1101번, 9400번, 9401번, 9403번, 1005번 1005-1번(서현역)
15번, 17번, 17-1번, 33번, 116-3번, 220번, 250번, 300번, 500번, 55-1번, 521번, 600번, 720-1번, 720-2번(서현역)
지하철 분당선 서현역 하차 → 지하철 4번 출구 AK플라자 GATE 2번 출구');
insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'부산본점','부산','부산 부산진구 부전동,503-15','부산본점 정보','resources/images/cinema/15.jpg',16,'35.1149818','129.0411679','· 김해공항 -> 롯데백화점 : 공항리무진(1시간 단위)
· 사상방면 -> 롯데백화점 : 107번, 108번, 62번 등
· 부산역방면 -> 롯데백화점 : 98번, 67번, 167번, 81번, 28번
· 해운대방면 -> 롯데백화점 : 141번, 40번, 31번, 5번
· 동래방면 -> 백화점 : 111번, 77번, 31번, 52번
· 서면역 1, 2호선 지하 롯데백화점과 바로 연결 (엘리베이터 이용 10층)'
);

insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'서면점','부산','부산 부산진구 전포동,668-1번지 ','서면점 정보','resources/images/cinema/16.jpg',17,'35.1577455','129.0588958','· 일반버스 : 5, 5-1, 10, 10-1, 17, 29-1, 35, 43, 52, 52-1, 57, 57-1, 67,
80, 80-1, 85, 86, 89, 98, 99, 103, 111, 111-2번
· 1, 2호선 서면역 : 8번 출구 (도보 직진 200미터 > 대각선 횡단보도 이용 > 건물 진입 후 엘리베이터 이용 6층)'
);

insert into CINEMA values(C_CODE_SEQ.NEXTVAL,'사상점','부산','부산 사상구 괘법동 533-1 부산서부버스터미널 3-5층','사상점 정보','resources/images/cinema/17.jpg',18,'35.1623571','128.9856529','· 동래 -> 롯데시네마 : 77번,110번
· 하단 -> 롯데시네마 : 138-1번,338번
· 서면 -> 롯데시네마 : 31번,33번,61번,62번,138-1번,160번,186번
· 남포동 -> 롯데시네마 : 8번,15번,61번,161번
· 부산역 -> 롯데시네마 : 59번, 61번,1004번(심야)
· 해운대 -> 롯데시네마 : 31번
· 구포 -> 롯데시네마 : 59번,128번,160번,169번,1004번(심야)
· 2호선 사상역 : 3번 출구
· 2호선 사상역 : 5번 출구 (출구 반대방향 도보 30미터 > 우측 건물 진입 > 엘리베이터 이용 3층)'
);

SELECT * FROM CINEMA;

COMMIT;

--영화 테이블
CREATE TABLE movie(
	m_code               NUMBER(10) PRIMARY KEY,
	m_title             VARCHAR2(50) NULL ,
   m_grade             VARCHAR2(300) NULL ,
    m_actor             VARCHAR2(50) NULL,
   m_director          VARCHAR2(50) NULL ,
   m_genre             VARCHAR2(20) NULL ,
   m_start_date        DATE default sysdate not null,
   m_runningtime       NUMBER NOT NULL ,
   m_viewer_num        NUMBER NULL,
    m_content           VARCHAR2(500)  null,
    m_image             VARCHAR2(300) NULL,
    m_trailer           VARCHAR2(300) null
);
create sequence m_code_seq
	start with 0
    MINVALUE 0
	increment by 1
	nocache;
SELECT * FROM MOVIE;

insert into movie values(M_CODE_SEQ.NEXTVAL,'퍼시픽림: 업라이징','resources/images/mchart/grade_15.png','예거','스티븐S.드나이트','액션,SF','2018-3-21',111,1000000,'끝나지 않은 전쟁, 진화하는 적에 맞서라!
전 세계를 초토화시켰던 전쟁 이후,
지구 종말의 위기가 다시 찾아온다.','resources/images/mchart/pr_chart.png',
'resources/videos/pr_trailer.mp4');
insert into movie values(M_CODE_SEQ.NEXTVAL,'지금 만나러 갑니다','resources/images/mchart/grade_12.png','소지섭/손예진','이장훈','로맨스/멜로','2018-3-14',132,19000,'세상을 떠난 그녀가 다시 돌아왔다.
모든 기억을 잃은 채.','resources/images/mchart/now_chart.png','');
insert into movie values(M_CODE_SEQ.NEXTVAL,'사라진 밤','resources/images/mchart/grade_15.png','김희애/김강우/김상경','이창희','스릴러','2018-3-7',101,1170000,'아내를 살해하고 완전범죄를 계획한 남편.
몇 시간 후, 국과수 사체보관실에서 그녀의 시체가 흔적도 없이 사라진다.','resources/images/mchart/mn_chart.png','');
insert into movie values(M_CODE_SEQ.NEXTVAL,'리틀 포레스트','resources/images/mchart/grade_all.png','김태리/류준열/문소리','임순례','드라마','2018-2-28',103,1395703,'“잠시 쉬어가도, 달라도, 평범해도 괜찮아!
모든 것이 괜찮은 청춘들의 아주 특별한 사계절 이야기”.','resources/images/mchart/lf_chart.png','');
insert into movie values(M_CODE_SEQ.NEXTVAL,'툼레이더','resources/images/mchart/grade_12.png','알리시아 비칸데르','로아 우다우그','액션','2018-3-8',118,532318,'역사상 가장 위험한 어드벤처의 시작 전사로 깨어난 라라의 모험에 동참하라!','resources/images/mchart/tr_chart.png','resources/videos/tr_trailer.mp4');
insert into movie values(M_CODE_SEQ.NEXTVAL,'레디플레이어원','resources/images/mchart/grade_12.png','마크 라이런스/사이먼 페그','스티븐 스필버그','액션/SF','2018-3-28',140,19000,'2045년, ‘오아시스’라는 가상현실 속에 숨겨진 보물을 찾아라.
이스터에그를 찾는 모험을 그린 최초의 가상현실 블록버스터','resources/images/mchart/rpo_chart.png','');
insert into movie values(M_CODE_SEQ.NEXTVAL,'셰이프 오브 워터','resources/images/mchart/grade_19.png','샐리 호킨스','기예르모 델 토로','드라마/판타지','2018-2-22',123,485167,'모든 것을 초월한 단 하나의 사랑
“그를 사랑하는 나도 괴물인가요?”','resources/images/mchart/sow_chart.png','');
insert into movie values(M_CODE_SEQ.NEXTVAL,'영웅본색4','resources/images/mchart/grade_15.png','왕대륙/마천우','딩성','액션/스릴러','2018-3-22',114,0,'“세상이 아무리 변해도 한 번 형제는 영원한 형제야”
밀수업으로 큰돈을 거머쥔 카이와 카이를 친형처럼 믿고 따르는 마크는
세상에 떳떳하지 못한 일을 하지만 의리와 신념만은 끈끈하다.','resources/images/mchart/h4_chart.png','');
insert into movie values(M_CODE_SEQ.NEXTVAL,'블랙팬서','resources/images/mchart/grade_12.png','채드윅 보스만','라이언 쿠글러','액션/SF','2018-2-14',135,5381937,'‘시빌 워’ 이후 와칸다의 왕위를 계승한 티찰라(채드윅 보스만)는
 와칸다에만 존재하는 최강 희귀 금속 ‘비브라늄’과
 왕좌를 노리는 숙적들의 음모가 전세계적인 위협으로 번지자
 세상을 구할 히어로 ‘블랙 팬서’로서 피할 수 없는 전쟁에 나서는데…','resources/images/mchart/bp_chart.png','resources/videos/bp_trailer.mp4');
insert into movie values(M_CODE_SEQ.NEXTVAL,'로건럭키','resources/images/mchart/grade_12.png','채닝 테이텀/아담 드라이버','스티븐 소더버그','코미디/범죄','2018-3-14',119,21731,'하루 아침에 직장에서 쫓겨난 형 지미 로건 (채닝 테이텀)
 한쪽 손을 잃고 바텐더로 하루 벌어 하루 사는 동생 클라이드 로건 (아담 드라이버)
 별 볼일 없이 살던 로건 형제가 인생을 역전시킬 한탕을 계획한다!','resources/images/mchart/roganlucky_chart.png','');
insert into movie values(M_CODE_SEQ.NEXTVAL,'소공녀','resources/images/mchart/grade_15.png','이솜/안재홍','전고운','멜로/로맨스','2018-3-22',106,42297,'집만 없을 뿐 일도 사랑도 자신만의 방식대로 살아가는
 사랑스러운 현대판 소공녀 ‘미소’의 도시 하루살이가 시작된다!','resources/images/movie/movie_sg.jpg','');
insert into movie values(M_CODE_SEQ.NEXTVAL,'7년의밤','resources/images/mchart/grade_15.png','류승룡/장동건/송새벽/고경표','추창민','스릴러','2018-3-28',123,9683,'우발적 사고
잘못된 선택
“그날 밤, 나는 살인자가 되었다”','resources/images/movie/movie_7.jpg','');

SELECT * FROM MOVIE;

 COMMIT;

--상영관 테이블
drop table theater;
CREATE TABLE theater(
	th_code               NUMBER(10) PRIMARY KEY ,
	th_num                NUMBER NULL ,
	th_open               DATE DEFAULT SYSDATE ,
	th_close              DATE DEFAULT NULL,
	th_row                NUMBER NULL ,
	th_col             NUMBER NULL,
    c_code               NUMBER(10),
    FOREIGN KEY (c_code) REFERENCES cinema (c_code) ON DELETE CASCADE
);
create sequence th_code_seq
	start with 0
    MINVALUE 0
	increment by 1
	nocache;
SELECT * FROM THEATER;

insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,10,15,1);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,2,'2018-03-26',NULL,5,10,1);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,3,'2018-03-26',NULL,10,20,1);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,10,20,2);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,2,'2018-03-26',NULL,10,15,2);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,5,10,3);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,10,20,4);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,2,'2018-03-26',NULL,10,20,4);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,10,15,5);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,2,'2018-03-26',NULL,5,10,5);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,10,20,6);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,2,'2018-03-26',NULL,10,20,6);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,3,'2018-03-26',NULL,10,15,6);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,5,10,7);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,10,20,8);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,10,20,9);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,5,10,10);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,2,'2018-03-26',NULL,10,20,10);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,3,'2018-03-26',NULL,10,20,10);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,4,'2018-03-26',NULL,10,15,10);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,5,10,11);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,10,20,12);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,2,'2018-03-26',NULL,10,20,12);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,10,15,13);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,5,10,14);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,2,'2018-03-26',NULL,10,20,14);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,5,10,15);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,10,20,16);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,2,'2018-03-26',NULL,10,20,16);
insert into THEATER values(TH_CODE_SEQ.NEXTVAL,1,'2018-03-26',NULL,10,15,17);

COMMIT;

--상영정보 테이블
CREATE TABLE screeninfo(
	s_code               NUMBER(10) PRIMARY KEY,
	s_date               DATE NOT NULL ,
	s_start_time         VARCHAR2(30) NOT NULL ,
	s_seat_rest          NUMBER NULL ,
    m_code               NUMBER(10) NOT NULL,
	th_code              NUMBER(10) NOT NULL,
    FOREIGN KEY (m_code) REFERENCES movie (m_code) ON DELETE CASCADE,
    FOREIGN KEY (th_code) REFERENCES theater (th_code) ON DELETE CASCADE
);
create sequence s_code_seq
	start with 0
    MINVALUE 0
	increment by 1
	nocache;
SELECT * FROM SCREENINFO;
--더추가해야함
INSERT INTO SCREENINFO VALUES(S_CODE_SEQ.NEXTVAL,'2018-04-05','15:20',3,1,1);
INSERT INTO SCREENINFO VALUES(S_CODE_SEQ.NEXTVAL,'2018-04-05','20:20',5,1,2);
INSERT INTO SCREENINFO VALUES(S_CODE_SEQ.NEXTVAL,'2018-04-05','15:20',8,2,3);
INSERT INTO SCREENINFO VALUES(S_CODE_SEQ.NEXTVAL,'2018-04-05','15:20',11,2,2);
INSERT INTO SCREENINFO VALUES(S_CODE_SEQ.NEXTVAL,'2018-04-05','15:20',14,1,4);

COMMIT;

--예매 테이블
CREATE TABLE ticketing(
   t_code               NUMBER(10) PRIMARY KEY,
   t_date                TIMESTAMP DEFAULT SYSDATE,
   t_num               VARCHAR2(50) NOT NULL,
   t_price                NUMBER NOT NULL,
   t_type       VARCHAR2(20) DEFAULT 'CARD',
   s_code               NUMBER(10) NOT NULL,
   u_code               NUMBER(10) NOT NULL,
   FOREIGN KEY (s_code) REFERENCES SCREENINFO(s_code) ON DELETE CASCADE,
   FOREIGN KEY (u_code) REFERENCES users(u_code) ON DELETE CASCADE
);
create sequence t_code_seq
	start with 0
    MINVALUE 0
	increment by 1
	nocache;
SELECT * FROM ticketing;
INSERT INTO ticketing VALUES(T_CODE_SEQ.NEXTVAL,SYSDATE,'A1,D5',20000,'CARD',1,21);

COMMIT;

--좌석 테이블
CREATE TABLE seat(
    st_code NUMBER(10) PRIMARY KEY,
    st_num VARCHAR2(1000) DEFAULT NULL,
    st_delDate DATE,
    s_code NUMBER(10) REFERENCES SCREENINFO(s_code)
);
create sequence st_code_seq
	start with 0
    MINVALUE 0
	increment by 1
	nocache;
select * from seat;
INSERT INTO seat VALUES(ST_CODE_SEQ.NEXTVAL,'A1/D5',SYSDATE,1);

--무비포스트 테이블
CREATE TABLE moviepost(
   mp_code              NUMBER(10) PRIMARY KEY ,
   mp_title             VARCHAR2(50) NULL ,
   mp_date              DATE NULL ,
   mp_content   VARCHAR2(200),
   mp_like              NUMBER DEFAULT 0 ,
   mp_pic               VARCHAR2(300) NULL ,
   m_code               NUMBER(10) NOT NULL,
   u_code               NUMBER(10) NOT NULL,
    FOREIGN KEY (u_code) REFERENCES users (u_code) ON DELETE CASCADE,
    FOREIGN KEY (m_code) REFERENCES movie (m_code) ON DELETE CASCADE
);
create sequence mp_code_seq
	start with 0
    MINVALUE 0
	increment by 1
	nocache;
select * from MOVIEPOST;

insert into MOVIEPOST values(MP_CODE_SEQ.NEXTVAL,'지금만나로갑니다','2018-03-20','안봄','14','resources/images/movie/movie_now.jpg',2,19);
insert into MOVIEPOST values(MP_CODE_SEQ.NEXTVAL,'사라진밤','2018-03-20','꿀잼','2','resources/images/movie/movie1.jpg',3,19);
insert into MOVIEPOST values(MP_CODE_SEQ.NEXTVAL,'퍼시픽림','2018-03-20','노잼','3','resources/images/movie/movie_pr.jpg',1,19);
insert into MOVIEPOST values(MP_CODE_SEQ.NEXTVAL,'치즈인더트랩','2018-03-20','보고싶다','48','resources/images/movie/movie_ct.jpg',10,19);
insert into MOVIEPOST values(MP_CODE_SEQ.NEXTVAL,'리틀포레스트','2018-03-20','보고싶어요','59','resources/images/movie/movie_lf.jpg',4,19);
insert into MOVIEPOST values(MP_CODE_SEQ.NEXTVAL,'소공녀','2018-03-28','보고싶어요','59','resources/images/movie/movie_sg.jpg',11,20);
insert into MOVIEPOST values(MP_CODE_SEQ.NEXTVAL,'블랙팬서','2018-03-20','보고싶어요','50','resources/images/mchart/bp_chart.png',9,20);
insert into MOVIEPOST values(MP_CODE_SEQ.NEXTVAL,'7년의밤','2018-03-20','보고싶어요','6','resources/images/movie/movie_7.jpg',12,20);
insert into MOVIEPOST values(MP_CODE_SEQ.NEXTVAL,'7년의밤','2018-03-29','이거 꿀잼이에요 근데 아직 안봤어요.','3','resources/images/movie/movie_7.jpg',12,21);
insert into MOVIEPOST values(MP_CODE_SEQ.NEXTVAL,'사라진밤','2018-03-28','보면서 팝콘 날라감 팝콘 주워먹는거 꿀잼','2','resources/images/movie/movie1.jpg',3,21);
insert into MOVIEPOST values(MP_CODE_SEQ.NEXTVAL,'치즈인더트랩','2018-03-29','진짜 실망했어요','0','resources/images/movie/movie_ct.jpg',10,21);
insert into MOVIEPOST values(MP_CODE_SEQ.NEXTVAL,'블랙팬서','2018-03-18','집가서 블랙팬서 놀이해야지~','1','resources/images/mchart/bp_chart.png',9,21);
commit;

--스토어 테이블
CREATE TABLE product(
   p_code               NUMBER(10) PRIMARY KEY ,
   p_name               VARCHAR2(30) NULL ,
   p_content            VARCHAR2(100) NULL ,
   p_price              NUMBER NULL ,
   p_type               CHAR(5) NULL ,
   p_validate           DATE DEFAULT SYSDATE
);
create sequence p_code_seq
	start with 0
    MINVALUE 0
	increment by 1
	nocache;
select * from product;

insert into product values(P_CODE_SEQ.NEXTVAL,'팝콘','맛있는 팝콘',1000,'A','2017-08-31');
insert into product values(P_CODE_SEQ.NEXTVAL,'콜라','맛있다',1500,'A','2017-08-31');
insert into product values(P_CODE_SEQ.NEXTVAL,'버터오징어','맛있다',2000,'A',sysdate);
insert into product values(P_CODE_SEQ.NEXTVAL,'콜라','맛있다',2000,'B',sysdate);
insert into product values(P_CODE_SEQ.NEXTVAL,'레몬에이드','맛있다',2000,'B',sysdate);
insert into product values(P_CODE_SEQ.NEXTVAL,'커피','맛있다',2000,'B',sysdate);
insert into product values(P_CODE_SEQ.NEXTVAL,'싱글패키지','ㅠㅠ',9000,'C',sysdate);
insert into product values(P_CODE_SEQ.NEXTVAL,'커플패키지','우왕',17000,'C',sysdate);
insert into product values(P_CODE_SEQ.NEXTVAL,'패밀리패키지','와우!',32000,'C',sysdate);

commit;

--이벤트 테이블
CREATE TABLE event(
   e_code               NUMBER(10) PRIMARY KEY ,
   e_name               VARCHAR2(50) NULL ,
   e_type               CHAR(10) NULL ,
   e_img                VARCHAR2(300) NULL,
   e_start_date         DATE default sysdate not null,
   e_end_date           DATE null,
   u_code               NUMBER(10) NOT NULL,
   FOREIGN KEY (u_code) REFERENCES users (u_code) ON DELETE CASCADE
);

drop sequence e_code_seq;
create sequence e_code_seq
	start with 0
    MINVALUE 0
	increment by 1
	nocache;

insert into event values(E_CODE_SEQ.NEXTVAL,'발렌타인데이','이벤트','resources/images/event/event1.png','2018-02-11','2018-02-16',17);
insert into event values(E_CODE_SEQ.NEXTVAL,'클라우드멤버십','멤버십','resources/images/event/event2.png','2018-03-01','2018-04-11',16);
insert into event values(E_CODE_SEQ.NEXTVAL,'봄맞이쿠폰','쿠폰','resources/images/event/event3.png','2018-04-01','2018-04-15',15);
insert into event values(E_CODE_SEQ.NEXTVAL,'HAPPY 무비데이','이벤트','resources/images/event/event4.png','2018-03-01','2018-04-30',14);
insert into event values(E_CODE_SEQ.NEXTVAL,'KT멤버십','멤버십','resources/images/event/event5.png','2018-03-01','2018-04-30',13);
insert into event values(E_CODE_SEQ.NEXTVAL,'예매경품','이벤트','resources/images/event/event6.png','2018-03-23','2018-04-08',12);
insert into event values(E_CODE_SEQ.NEXTVAL,'동네영화관','이벤트','resources/images/event/event7.png','2018-04-02','2018-04-30',11);
insert into event values(E_CODE_SEQ.NEXTVAL,'L.pay 페이백','멤버십','resources/images/event/event8.png','2018-04-01','2018-04-30',10);

commit;

--무비스코어 전문가 평점 테이블
CREATE TABLE cloud
(
	cl_code              NUMBER  primary key ,
	cl_reply             VARCHAR2(200) NULL ,
	cl_directorscore     VARCHAR2(200) NULL ,
	cl_storyscore        VARCHAR2(200) NULL ,
	cl_actorscore        VARCHAR2(200) NULL ,
	cl_goodscore         VARCHAR2(200) NULL ,
	cl_pic               VARCHAR2(200) NULL ,
	cl_like              NUMBER NULL ,
	u_code               NUMBER(10) NULL ,
	m_code               NUMBER(10) NOT NULL,
    FOREIGN KEY (m_code) REFERENCES movie (m_code) ON DELETE CASCADE,
    FOREIGN KEY (u_code) REFERENCES users (u_code) ON DELETE CASCADE
);

select * from movie;
select * from users;

create sequence cl_code_seq start with 0 MINVALUE 0 increment by 1 nocache;

insert into cloud values(cl_code_seq.nextval,'핵꿀잼',100,100,100,100,'test',177,5,3);
insert into cloud values(cl_code_seq.nextval,'허니잼',100,100,100,100,'test',102,6,2);
insert into cloud values(cl_code_seq.nextval,'잼',100,100,100,100,'test',88,7,4);
insert into cloud values(cl_code_seq.nextval,'노잼',100,100,100,100,'test',17,5,5);

commit;

select * from cloud;

--무비스코어 회원 평점 테이블
create table cloudboard(
    cb_code number primary key,
    cb_content varchar2(50) not null,
    cb_date DATE DEFAULT sysdate NULL,
    u_code number,
    m_code number,
    cb_directorscore     NUMBER NULL ,
	cb_storyscore        NUMBER NULL ,
	cb_actorscore        NUMBER NULL ,
	cb_goodscore         NUMBER NULL ,

    FOREIGN KEY (m_code) REFERENCES movie (m_code) ON DELETE CASCADE,
    FOREIGN KEY (u_code) REFERENCES users (u_code) ON DELETE CASCADE
);
select * from cloudboard;
select * from cloud;

create sequence cb_code_seq
	start with 0
    MINVALUE 0
	increment by 1
	nocache;
select * from cloudboard;

insert into cloudboard values(cb_code_seq.nextval,'우와 재밌다',sysdate,21,2,80,90,80,80);
insert into cloudboard values(cb_code_seq.nextval,'우와 재밌다',sysdate,20,2,80,90,80,80);
insert into cloudboard values(cb_code_seq.nextval,'우와 재밌다',sysdate,19,1,80,90,80,80);

commit;

--무비포스트 댓글 테이블
create table mp_reply(
	mpr_code number primary key,
	mpr_content varchar2(150) not null,
	u_code   number(10) NOT NULL,
	mp_code  NUMBER(10) not null,

	FOREIGN KEY (mp_code) REFERENCES moviepost (mp_code) ON DELETE CASCADE,
    FOREIGN KEY (u_code) REFERENCES users (u_code) ON DELETE CASCADE
);

create sequence mpr_code_seq start with 0 MINVALUE 0 increment by 1 nocache;

insert into mp_reply values(mpr_code_seq.NEXTVAL,'test',19,6);

-- 분실물 테이블
CREATE TABLE LAF
(
	l_number             INTEGER NOT NULL ,
	l_title              VARCHAR2(20) NULL ,
	l_content            VARCHAR2(200) NULL ,
	mg_id                VARCHAR2(20) NOT NULL ,
	u_code               number(10) NOT NULL ,
	l_regdate            DATE DEFAULT sysdate NULL ,
	l_question           VARCHAR2(20) NULL ,
	l_answer             VARCHAR2(20) NULL ,
	l_kind               VARCHAR2(20) NULL ,
    FOREIGN KEY (u_code) REFERENCES users(u_code) ON DELETE CASCADE
);

create sequence l_number_seq start with 0 MINVALUE 0 increment by 1 nocache;

insert into laf values(L_NUMBER_SEQ.NEXTVAL,'지갑분실','프라다 사피아노 장지갑(하늘색)','1',20,sysdate,'1','1','분실신고');
insert into laf values(L_NUMBER_SEQ.NEXTVAL,'지갑습득','하늘색 장지갑','2',21,sysdate,'2','2','습득신고');
insert into laf values(L_NUMBER_SEQ.NEXTVAL,'핸드폰분실','갤럭시S9핸드폰','3',19,sysdate,'3','3','분실신고');
insert into laf values(L_NUMBER_SEQ.NEXTVAL,'가방분실','샘소나이트 백팩','4',21,sysdate,'4','4','분실신고');
insert into laf values(L_NUMBER_SEQ.NEXTVAL,'가방습득','가방','5',19,sysdate,'5','5','습득신고');
commit;

select * from LAF;

--공지사항 테이블
CREATE TABLE notice(
	n_code               number(10) PRIMARY KEY ,
    n_title              VARCHAR2(100) NULL ,
    n_content            VARCHAR2(300) NULL ,
	n_regdate            DATE DEFAULT sysdate,
	n_view               NUMBER DEFAULT 0 ,
    n_img                VARCHAR2(400) NULL
);
create sequence n_code_seq
	start with 0
    MINVALUE 0
	increment by 1
	nocache;

SELECT * FROM NOTICE;

insert into notice values(N_CODE_SEQ.NEXTVAL,'테스트1','내용1','2018-03-23',1,'이미지경로');
insert into notice values(N_CODE_SEQ.NEXTVAL,'테스트2','내용2','2018-03-23',1,'이미지경로');
insert into notice values(N_CODE_SEQ.NEXTVAL,'테스트3','내용3','2018-03-23',1,'이미지경로');
--Q/A게시판 테이블
CREATE TABLE QA(
	q_code             NUMBER(10) PRIMARY KEY,
	q_question              VARCHAR2(100),
	q_content            VARCHAR2(200),
    q_answer             VARCHAR2(200) NULL ,
    q_kind               CHAR(10),
    q_regdate            DATE DEFAULT sysdate ,
	u_code               NUMBER(10) NOT NULL ,
	FOREIGN KEY (u_code) REFERENCES users(u_code) ON DELETE CASCADE
);
create sequence q_code_seq
	start with 0
    MINVALUE 0
	increment by 1
	nocache;
SELECT * FROM QA;

insert into QA values(Q_CODE_SEQ.NEXTVAL,'질문1','내용1','답변1','A','2018-03-23',17);

<file_sep>/src/main/java/cinema/cloud/com/dto/LafVO.java
package cinema.cloud.com.dto;

import java.sql.Date;

public class LafVO {
	private int l_number;
	private String l_title;
	private String l_content,mg_id,u_code;
	private Date l_regdate;
	private String l_question;
	private String l_answer;
	private String l_kind;
	public int getL_number() {
		return l_number;
	}
	public void setL_number(int l_number) {
		this.l_number = l_number;
	}
	public String getL_title() {
		return l_title;
	}
	public void setL_title(String l_title) {
		this.l_title = l_title;
	}
	public String getL_content() {
		return l_content;
	}
	public void setL_content(String l_content) {
		this.l_content = l_content;
	}
	public String getMg_id() {
		return mg_id;
	}
	public void setMg_id(String mg_id) {
		this.mg_id = mg_id;
	}
	public String getU_code() {
		return u_code;
	}
	public void setU_code(String u_code) {
		this.u_code = u_code;
	}
	public Date getL_regdate() {
		return l_regdate;
	}
	public void setL_regdate(Date l_regdate) {
		this.l_regdate = l_regdate;
	}
	public String getL_question() {
		return l_question;
	}
	public void setL_question(String l_question) {
		this.l_question = l_question;
	}
	public String getL_answer() {
		return l_answer;
	}
	public void setL_answer(String l_answer) {
		this.l_answer = l_answer;
	}
	public String getL_kind() {
		return l_kind;
	}
	public void setL_kind(String l_kind) {
		this.l_kind = l_kind;
	}

	@Override
	public String toString() {
		return l_number+","+l_title+","+l_content+","+mg_id+","+u_code+","+l_regdate+","+l_question+","+l_answer+","+l_kind;
	}

}
<file_sep>/src/main/webapp/WEB-INF/views/header.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="setting.jsp" %>
<!DOCTYPE html>

<meta charset="utf-8">
<title>header</title>

		<c:choose>
		<c:when test="${empty u_id }">

LOGIN

빠른예매

고객센터

		</c:when>
		<c:when test="${not empty u_id}">
			<c:if test = "${u_id ne 'host'}">

LOGOUT

 MY PAGE

빠른예매

고객센터

			</c:if>
			<c:if test = "${u_id eq 'host'}">

LOGOUT

 ADMIN

			</c:if>
		</c:when>
		</c:choose>

영화

무비차트

트레일러

평점

영화관

무비포스트

스토어

이벤트

<file_sep>/src/main/java/cinema/cloud/com/khc/LafServiceImpl.java
package cinema.cloud.com.khc;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cinema.cloud.com.dao.LafDAO;
import cinema.cloud.com.dto.LafVO;
import cinema.cloud.com.khc.LafService;

@Service("LafService")
public class LafServiceImpl implements LafService {
	@Autowired
	private LafDAO LafDAO;
	@Override
	public void selectLaf(LafVO vo) {
		// TODO Auto-generated method stub

	}

	@Override
	public void updateLaf(LafVO vo) {
		// TODO Auto-generated method stub

	}

	@Override
	public void deleteLaf(LafVO vo) {
		// TODO Auto-generated method stub

	}

	@Override
	public LafVO getLaf(LafVO vo) {
		return LafDAO.getLaf(vo);
	}

	@Override
	public List<LafVO> getLafList(LafVO vo) {

		return LafDAO.getLafList(vo);
	}

}
<file_sep>/src/main/java/cinema/cloud/com/dao/movieDAO.java
package cinema.cloud.com.dao;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import cinema.cloud.com.dto.movieVO;

@Repository("movieDAO")
public class movieDAO {

	@Autowired
	private SqlSessionTemplate mybatis;

	public movieVO getMovie(movieVO vo) { // 글목록 중 하나 작동확인
		System.out.println("===> Mybatis로 getMoviepost 수행");
		return (movieVO) mybatis.selectOne("movieDAO.getBoard", vo);
	}

	public List<movieVO> getMovieList(movieVO vo) {
		System.out.println("===> movieDAO getMovieList 수행");
		return mybatis.selectList("movieDAO.getBoardList", vo);
	}

	public List<movieVO> getAllMovie(movieVO vo) {
		System.out.println("===>  movieDAO 영화목록불러오는중..");
		return mybatis.selectList("movieDAO.getAllMovie", vo);
	}

}
<file_sep>/src/main/java/cinema/cloud/com/ndj/moviepostServiceimpl.java
package cinema.cloud.com.ndj;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cinema.cloud.com.dao.moviepostDAO;
import cinema.cloud.com.dto.MprVO;
import cinema.cloud.com.dto.moviepostVO;
//테스트
@Service("moviepostService")
//@Configuration
public class moviepostServiceimpl implements moviepostService {

	@Autowired
	private moviepostDAO moviepostDAO;

	@Override
	public void insertMoviepost(moviepostVO vo) {
		// 무포글작성
		moviepostDAO.insertmoviepost(vo);
	}

	@Override
	public void updateMoviepost(moviepostVO vo) {
		// 무포글수정
		moviepostDAO.updatemoviepost(vo);

	}

	@Override
	public void deleteMoviepost(moviepostVO vo) {
		// 무비포스트 글 삭제
		moviepostDAO.deletemoviepost(vo);
	}

	@Override
	public moviepostVO getMoviepost(moviepostVO vo) {
		// 무비포스트 목록 중 한개!
		return moviepostDAO.getMoviepost(vo);
	}

	@Override
	public List<moviepostVO> getMoviepostList(moviepostVO vo) {
		// 무비포스트 DB 목록 가져오자
		return moviepostDAO.getMoviepostList(vo);

	}

	@Override
	public void like(moviepostVO vo) {
		//좋아요
		moviepostDAO.like(vo);

	}

	@Override
	public List<MprVO> getreplyList(MprVO vo) {
		//댓글 불러오기
		return moviepostDAO.getreplyList(vo);
	}

}
<file_sep>/src/main/java/cinema/cloud/com/dto/productVO.java
package cinema.cloud.com.dto;
// 상품 VO
public class productVO {

	private int p_code,p_price;
	private String p_name,p_content,p_type,p_validate;
	                                       // 나중에 날짜 형식으로 바꿀지 안바꿀지?

	public int getP_code() {
		return p_code;
	}
	public void setP_code(int p_code) {
		this.p_code = p_code;
	}
	public String getP_name() {
		return p_name;
	}
	public void setP_name(String p_name) {
		this.p_name = p_name;
	}
	public String getP_content() {
		return p_content;
	}
	public void setP_content(String p_content) {
		this.p_content = p_content;
	}
	public int getP_price() {
		return p_price;
	}
	public void setP_price(int p_price) {
		this.p_price = p_price;
	}
	public String getP_type() {
		return p_type;
	}
	public void setP_type(String p_type) {
		this.p_type = p_type;
	}
	public String getP_validate() {
		return p_validate;
	}
	public void setP_validate(String p_validate) {
		this.p_validate = p_validate;
	}

	@Override
	public String toString() {

		return "p_code = " + p_code + "p_name = " + p_name  + " p_type= " + p_type;
	}

}
<file_sep>/src/main/java/cinema/cloud/com/controller/centerController.java
package cinema.cloud.com.controller;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;

import cinema.cloud.com.dto.LafVO;
import cinema.cloud.com.dto.QaVO;
import cinema.cloud.com.dto.noticeVO;
import cinema.cloud.com.khc.LafService;
import cinema.cloud.com.ndj.QaService;
import cinema.cloud.com.ndj.noticeService;

@Controller
@SessionAttributes("center")
public class centerController {

	@Autowired
	private noticeService noticeService;
	@Autowired
	private QaService QaService;
	@Autowired
	private LafService LafService;

	@RequestMapping("/center")
	public String gocenter(noticeVO vo,QaVO vo2,LafVO vo3,Model model,HttpSession h) {
		System.out.println("고객 센터 이동");
		//model.addAttribute("center", noticeService.getNoticeList(vo)); // 공지사항 불러오기
		h.setAttribute("notice", noticeService.getNoticeList(vo));
		h.setAttribute("Qa", QaService.getQaList(vo2));
		h.setAttribute("Laf", LafService.getLafList(vo3));
		System.out.println("고객 센터 값 불러오기 완료");
		return "csCenter/center";
	}

	@RequestMapping("/getnotice")
	public String getnotice(noticeVO vo,Model model,HttpSession h) {
		System.out.println("공지사항 클릭");
		model.addAttribute("notice", noticeService.getNotice(vo));
		System.out.println("공지사항 상세보기");
		return "csCenter/getnotice";
	}

	@RequestMapping("/getqa")
	public String getqa(QaVO vo,Model model,HttpSession h) {
		System.out.println("Q/A 클릭");
		model.addAttribute("qa", QaService.getQa(vo));
		System.out.println("Q&A 상세보기");
		return "csCenter/getqa";
	}

	@RequestMapping("/getlaf")
	public String getLaf(LafVO vo,Model model,HttpSession h) {
		System.out.println("분실물센터 클릭");
		model.addAttribute("laf", LafService.getLaf(vo));
		System.out.println("분실물센터 상세보기");
		return "csCenter/getlaf";
	}
}

branch_name: refs/heads/master

languages:
Java
JavaScript
Java Server Pages
PLSQL

repo_language: Java


text:
<file_sep><?php
class Jackhole {
  public $redir = 'https://www.google.com/';
  public $hash;
  public $marker;
  public $source;
  public $requests = [];

  function __construct() {
    if ($this->load()) {
      $pass = '';
      if (isset($_COOKIE['pass'])) {
        $pass = $_COOKIE['pass'];
      } else if (isset($_REQUEST['pass'])) {
        $pass = $_REQUEST['pass'];
      }

      if (sha1($pass) === $this->hash) {
        $this->pass = $pass;
        $this->admin();
      } else {
        array_unshift($this->requests, $this->info());
        header("Access-Control-Allow-Origin: " . $_SERVER['HTTP_ORIGIN']);
        //header("Location: $this->redir", true);
        echo "";
      }
    } else {
      setcookie('pass', $this->pass);
      header('Location: ' . $_SERVER['PHP_SELF']);
    }

    $this->save();
    exit();
  }

  public function info() {
    $headers = getallheaders();
    $cookies = [];
    if (isset($headers['Cookie'])) {
      foreach(explode(';', $headers['Cookie']) as $cookie) {
        list($key, $value) = explode('=', trim($cookie));
        $cookies[$key] = $value;
      }
      unset($headers['Cookie']);
    }
    $request = [
      'client' => [
        'ip' => $_SERVER['REMOTE_ADDR'],
        'port' => $_SERVER['REMOTE_PORT']
      ],
      'uri' => (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]",
      'method' => $_SERVER['REQUEST_METHOD'],
      'headers' => $headers,
      'cookies' => $cookies,
      'params' => $_GET,
      'body' => array_merge($_POST, $_FILES),
      'time' => $_SERVER['REQUEST_TIME_FLOAT']
    ];

    if (!count($request['body'])) {
      $request['body'] = file_get_contents('php://input');
    }

    return $request;
  }

  public function render($data, $output = 'json', $pretty = true) {
    if ($output == 'json') {
      $rendered = json_encode(json_decode($data), JSON_PRETTY_PRINT);
    } else {
      ob_start();
      var_export($data);
      $rendered = ob_get_clean();
    }

    $rendered = '' . htmlentities($rendered) . '';

    if ($pretty) {
      $rendered = '
' . $rendered . '
';
    }

    return $rendered;
  }

  public function admin() {
    $url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[PHP_SELF]";

    if (isset($_REQUEST['action'])) {
      $id = null;
      if (isset($_REQUEST['id']) && is_numeric($_REQUEST['id'])) {
        $id = intval($_REQUEST['id']);
      }
      switch ($_REQUEST['action']) {
        case 'dump':
          if (count($this->requests) == 0) break;
          header('Content-Type: application/json');
          header("Content-Transfer-Encoding: Binary");
          header('Content-disposition: attachment; filename="' . date('Y.m.d_h.i.s') . '-http_bin.json"');

          if (is_null($id)) {
            header('Content-disposition: attachment; filename="' . date('Y.m.d_h.i.s') . '-http_bin.json"');
            echo json_encode($this->requests, JSON_PRETTY_PRINT);
          } else {
            header('Content-disposition: attachment; filename="' . date('Y.m.d_h.i.s') . '-' . $id . 'http_bin.json"');
            echo json_encode($this->requests[$id], JSON_PRETTY_PRINT);
          }
          exit();
        break;

        case 'delete':
          if (!is_null($id)) {
            array_splice($this->requests, intval($id), 1);
          }
        break;

        case 'clear':
          $this->init();
          $this->requests = [];
          setcookie('pass', $this->pass);
        break;

        case 'exit':
          header('Location: /');
          unlink(__FILE__);
          exit();
        break;
      }

      header('Location: ' . $url);

      return;
    }
?>

    <title>Jackhole</title>
    <link rel="stylesheet" href="https://unpkg.com/chota@latest">
    <link rel="icon" href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0<KEY>3d3dy53<KEY>>

    <a class="brand" href="<?= $url ?>">🕳 Jackhole

    <a class="button success" href="<?= $url . "?action=dump" ?>">💾 Dump
    <a class="button outline" href="<?= $url . "?action=clear" ?>">↻ Clear
    <a class="button error"
      onclick="return confirm('You sure ? This file will be deleted.')"
      href="<?= $url . "?action=exit" ?>">🌩 Exit

    <input type="text" value="<?= $url ?>" onfocus="this.select()">

Requests

<?php
    if (count($this->requests) == 0) {
      echo 'No requests ...';
    } else {
      foreach ($this->requests as $i => $request) {
        $cls = '';
        $colors = [
          'POST' => 'bd-success',
          'PUT' => 'bd-success',
          'GET' => 'bd-orange',
          'OPTIONS' => 'bd-purple',
          'TRACE' => 'bd-purple',
          'DELETE' => 'bd-error',
        ];
        if (key_exists($request['method'], $colors)) {
          $cls = ' ' . $colors[$request['method']];
        }
?>
        <input type="checkbox" class="toggle" id="req_<?= $i ?>">
        <label class="request" for="req_<?= $i ?>">

              <?= date('m/d h:i:s', intval($request['time'])) ?>
              –
              <?= $request['client']['ip'] ?>

              <span class="tag <?= $cls ?>">
                <?= $request['method'] ?>

              <?= $request['uri'] ?>

              <a href="<?= $url . '?action=delete&id=' . $i ?>" class="button outline bd-error pull-right text-error">❌
              <a href="<?= $url . '?action=dump&id=' . $i ?>" class="button outline bd-success pull-right text-success">💾

              Headers

<?php
        foreach ($request['headers'] as $key => $value)
          echo "
$key	$value
";

        $args = ['cookies', 'params', 'body'];
        foreach ($args as $arg) {
          if (count($request[$arg])) {
            echo '
'.
              ''.
                ucfirst($arg).
              '	'.
            '
';
            if (is_array($request[$arg])) {
              foreach ($request[$arg] as $key => $value) {
                echo '
'.
                  "$key	".
                  '' . $this->render($value) . '	'.
                "
";
              }
            } else {
              echo '
'.
                $this->render($request[$arg]).
              '
';
            }
          }
        }
?>

<?php
      }
?>

<?php
    }
?>

<?php
  }

  public function load() {
    $this->marker = base64_decode('PT09PT0K');
    $this->source = file_get_contents(__FILE__);

    $pos = strpos($this->source, $this->marker);

    $init = $pos === false;
    if ($init) {
      $this->init();
      $this->pos = mb_strlen($this->source);
    } else {
      $this->pos = $pos;
      $data = substr($this->source, $this->pos + mb_strlen($this->marker));
      $decoded = json_decode(base64_decode($data), true);

      $this->source = substr($this->source, 0, $this->pos - 1);
      $this->hash = $decoded['hash'];
      $this->requests = $decoded['requests'];
    }

    return !$init;
  }

  public function init() {
    $this->pass = <PASSWORD>(random_<PASSWORD>(32));
    $this->hash = sha1($this->pass);
  }

  public function save() {
    $data = [
      'hash' => $this->hash,
      'requests' => $this->requests
    ];

    $source = $this->source;
    $source .= "\n" . $this->marker;
    $source .= base64_encode(json_encode($data));

    if (file_put_contents(__FILE__, $source) === false) {
      header_remove('Location');
    }
  }
}

new Jackhole();
?>
<file_sep># Jackh*le
## A one-file HTTP bin written in PHP
This script uses it's own file to store HTTP requests it receives. The requests can then be analysed by using a key generated randomly the first time the script gets executed. This key is stored in a cookie.

## Installation
1) Drop the script somewhere in the webserver's document root
2) Access it once to initialize the script

A random password is generated on first access. It gives access to the
admin page. However, nothing is encrypted ! All data is appended at the
end of the script file, base64 encoded.

Despite it's self-writing/reading behavior, this script is packable
(ie. eval(base64_decode("..."))) but `__FILE__` superglobal has to be
parsed manually because it's different from the value returned in
`eval()`'d context.
```php
eval(str_replace('__FILE__', "'".__FILE__."'", "..."));
```

## To do
- `Share` button
- Settings
- Custom redirection
- Handle $_FILES
- Packer

languages: Markdown PHP

repo_language: Markdown

repo_name: ZanyMonk/Jackhole


text:
<repo_name>pawelbus/8.6.zadanie<file_sep>/js/script.js
var a = 3,
    b = 3,
    value = (a * a) - (2 * a * b) - (b * b);

console.log('Zmienna a to: ' + a + ', zmienna b to: ' + b + '.');
console.log('Wynik działania (a * a) - (2 * a * b) - (b * b) to: ' + value);

if (value > 0) {
  console.log('Wynik jest dodatni.');
} else if (value < 0) {
  console.log('Wynik jest ujemny');
} else {
  console.log('Wynik jest równy 0');
}<file_sep>/README.md
# 8.6.zadanie
Instrukcje warunkowe w praktyce
https://pawelbus.github.io/8.6.zadanie/

languages: Markdown JavaScript


text:
<repo_name>brreex/SPH2<file_sep>/src/main/java/cs544/hap2/StudentDAO.java
package cs544.hap2;

import org.hibernate.SessionFactory;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

public class StudentDAO {
	private SessionFactory sessionFactory;

	public StudentDAO() {
	}

	@Transactional(readOnly=true)
	public Student load(long studentid) {
		return sessionFactory.getCurrentSession().get(Student.class, studentid);
	}

	@Transactional(propagation=Propagation.MANDATORY)
	public void create(Student student){
		sessionFactory.getCurrentSession().persist(student);
	}

	@Transactional(propagation=Propagation.MANDATORY)
	public void update (Student student){
		sessionFactory.getCurrentSession().merge(student);
	}

	@Transactional(propagation=Propagation.MANDATORY)
	public void delete(Student student){
		sessionFactory.getCurrentSession().delete(student);
	}

	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

}
<file_sep>/src/main/java/cs544/hap2/StudentService.java
package cs544.hap2;

import org.hibernate.Hibernate;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

public class StudentService {
	private StudentDAO studentdao;

	public StudentService() {
	}

	@Transactional(propagation=Propagation.REQUIRES_NEW)
	public void addStudent(Student student){
		studentdao.create(student);
	}
	@Transactional(readOnly=true)
	public Student getStudent(long studentid) {
		Student student = studentdao.load(studentid);
		Hibernate.initialize(student.getCourselist());
		return student;

	}

	public void setStudentdao(StudentDAO studentdao) {
		this.studentdao = studentdao;
	}

}


text:
<repo_name>fakhar-ud-din/Django-Regex-Evaluator<file_sep>/regexdetector/regex/views.py
import re

from django.shortcuts import render
from django.views import View
from django.http import JsonResponse
from .forms import RegexForm

# WILL BE CALLED ONCE THE SUBMIT BUTTON IS CLICKED
class RegexView(View):
    template_name = 'regex/regex_home.html'

    def get(self, request, *args, **kwargs):
        form = RegexForm()
        return render(request, self.template_name, {"form": form})

    def post(self, request, *args, **kwargs):
        form = RegexForm(request.POST)
        if form.is_valid():
            data = form.cleaned_data

            user_re, text = data['user_regex'], data['test_text']
            matched_result = re.findall(user_re, text)

            context = {'form': form}

            if matched_result:
                return render(request, self.template_name, {**context, "result": matched_result[0]})

        return render(request, self.template_name, {'form': form})

# WILL BE CALLED USING AJAX
def evaluate_regex(request):
    if request.method == "GET":
        user_re = request.GET.get('user_re', None)
        test_txt = request.GET.get('test_txt', None)

        data = {'alert': 'danger'}
        matched_result = re.findall(user_re, test_txt)

        if matched_result:
            data['alert'] = 'success'
            data['result'] = matched_result[0]

        return JsonResponse(data)

<file_sep>/regexdetector/regex/urls.py
from django.urls import path
from regex.views import RegexView, evaluate_regex

urlpatterns = [
    path('regex/', RegexView.as_view(), name='regex_home'),
    path('evaluate_regex/', evaluate_regex, name='evaluate_regex'),
]<file_sep>/regexdetector/regex/forms.py
from django import forms

class RegexForm(forms.Form):
    user_regex = forms.CharField(label="Regex")
    test_text = forms.CharField(label="Text",
                                widget=forms.Textarea(
                                        attrs={'placeholder': 'Enter the text you want the regex to be tested upon here..'}))

repo_language: Python

repo_name: fakhar-ud-din/Django-Regex-Evaluator


text:
<repo_name>santessoca/parIDF<file_sep>/README.md
# parIDF
Parametric simulation in EnergyPlus from the sampling technique of the Monte Carlo
This project was supported by grant #2016/17691-4 and 2017/04660-6, São Paulo Research Foundation (FAPESP)

repo_name: santessoca/parIDF


text:
<file_sep># 68Party
68活动网


text:
<repo_name>mhdkhadafi/livelike-assignment<file_sep>/Assets/SpinDice.cs
using UnityEngine;
using System.Collections;

public class SpinDice : MonoBehaviour {

	private bool spinning = false;
	void OnEnable()
	{
		Crosshair.OnClick += Spin;
		Crosshair.OnHover += GlowOn;
		Crosshair.OffHover += GlowOff;
	}

	void OnDisable()
	{
		Crosshair.OnClick -= Spin;
		Crosshair.OnHover -= GlowOn;
		Crosshair.OffHover -= GlowOff;
	}

	// I use different behavior (vs DeflateBall) here to show the robustness of using event
	void Spin(GameObject go)
	{
		if (this.name == go.name) {
			spinning = !spinning;
			Behaviour halo = (Behaviour)GetComponent("Halo");
			halo.enabled = false;
		}
	}

	void GlowOn(GameObject go) {
		if (this.name == go.name) {
			Behaviour halo = (Behaviour)GetComponent ("Halo");
			halo.enabled = true;
		}
	}

	void GlowOff(GameObject go) {
		Behaviour halo = (Behaviour)GetComponent("Halo");
		halo.enabled = false;
	}

	void Update() {
		if (spinning) transform.rotation = Random.rotation;
	}
}
<file_sep>/Assets/DeflateBall.cs
using UnityEngine;
using System.Collections;

public class DeflateBall : MonoBehaviour {

	private int state = 4;
	void OnEnable()
	{
		Crosshair.OnClick += Deflate;
		Crosshair.OnHover += GlowOn;
		Crosshair.OffHover += GlowOff;
	}

	void OnDisable()
	{
		Crosshair.OnClick -= Deflate;
		Crosshair.OnHover -= GlowOn;
		Crosshair.OffHover -= GlowOff;
	}

	// I use different behavior here (vs SpinDice) to show the robustness of using event
	void Deflate(GameObject go)
	{
		if (this.name == go.name) {
			if (state > 1) {
				transform.localScale = new Vector3 (transform.localScale.x * (2f / 3), transform.localScale.y * (2f / 3), transform.localScale.z * (2f / 3));
				state--;
			} else {
				transform.localScale = new Vector3 (0.05f, 0.05f, 0.05f);
				state = 4;
			}
		}
	}

	void GlowOn(GameObject go) {
		if (this.name == go.name) {
			Behaviour halo = (Behaviour)GetComponent ("Halo");
			halo.enabled = true;
		}
	}

	void GlowOff(GameObject go) {
		Behaviour halo = (Behaviour)GetComponent("Halo");
		halo.enabled = false;
	}
}
<file_sep>/Assets/Crosshair.cs
using UnityEngine;
using System.Collections;

public class Crosshair : MonoBehaviour {

	// Event Handlers for mouse hover and click
	public delegate void MouseAction(GameObject go);
	public static event MouseAction OnHover;
	public static event MouseAction OffHover;
	public static event MouseAction OnClick;

	private GameObject colHit = null;
	public bool dynamicCrosshair;

	// Update is called once per frame
	void Update () {
		// Make the crosshair follow the mouse location
		Cursor.visible = false;
		var mousePos = Input.mousePosition;
		mousePos.z = 15;
		Vector3 p = Camera.main.ScreenToWorldPoint(mousePos);
		transform.position = p;

		// Using raycasting to detect whether crosshair/mouse is over an object
		RaycastHit vHit = new RaycastHit();
		Ray vRay = Camera.main.ScreenPointToRay(Input.mousePosition);
		if (Physics.Raycast (vRay, out vHit, 1000)) {

			GameObject hitObject = vHit.collider.gameObject;
			if (dynamicCrosshair) transform.position = vHit.point;
			Collider coll = hitObject.GetComponent<Collider> ();
			Vector3 closestPoint = coll.ClosestPointOnBounds (Camera.main.transform.position);

			if (hitObject.name != "Crosshair") {
				// When the crosshair is dynamic, it will be in front of the object
				if (dynamicCrosshair){
					while (transform.position.z > closestPoint.z) {
						transform.position = Vector3.MoveTowards (transform.position, Camera.main.transform.position, (float)0.01);
					}
				}
				colHit = hitObject;
				if (OnHover != null)
					OnHover (hitObject);
			} else {
				colHit = null;
				if (OffHover != null)
					OffHover (hitObject);
			}
		}

		// I use this instead of OnMouseClick() because when in fixed crosshair, the crosshair will sometimes be behind object, thus wont detect onClick
		if (Input.GetMouseButtonDown(0)){
			if (colHit != null) {
				if (OnClick != null)
					OnClick (colHit);
			}
		}
	}
}
<file_sep>/Assets/EventHandler.cs
using UnityEngine;
using System.Collections;

public class EventHandler : MonoBehaviour {

//	public delegate void MouseAction(GameObject go);
//	public static event MouseAction OnHover;
//	public static event MouseAction OffHover;
//	public static event MouseAction OnClick;
//	public GameObject crosshair;

	void Update () {

//		GameObject hitObject = crosshair.GetComponent<Crosshair> ().getColHit();
//		if (hitObject != null) {
//			if (OnHover != null)
//				OnHover (hitObject);
//		} else {
//			if (OffHover != null)
//				OffHover (hitObject);
//		}
	}

	void OnMouseDown() {
//		Debug.Log ("Mouse down");
//		GameObject hitObject = crosshair.GetComponent<Crosshair> ().getColHit();
//
//		if (hitObject != null) {
//			if (OnClick != null)
//				OnClick (hitObject);
//		}
	}
}

repo_language: C#

repo_name: mhdkhadafi/livelike-assignment


text:
<file_sep># Lab-9

Simon Says Game

branch_name: refs/heads/main


text:
<file_sep>#題材B 商店データベース

## Level1(本誌 第1章~第2章)

問題1　正解
商品テーブルの全てのデータを抽出する「※」を用いないこと

解答1
SELECT 商品コード、商品名、単価、商品区分、関連商品コード FROM 商品;

問題2　正解
商品テーブルの全ての商品名を抽出する

解答2
SELECT 商品名 FROM 商品;

問題3　正解
注文テーブルの全てのデータを抽出する「※」を用いること

解答3
SELECT * FROM 注文;

問題4　正解
注文テーブルの注文番号、注文枝番、商品コードを抽出する「※」を用いること

解答4
SELECT 注文番号 注文枝番 商品コード FROM 注文;

問題5　正解
商品テーブルに次のデータを追加する

商品コード　W0461
商品名　冬のあったかコート
単価 12800
商品区分 1

解答5
INSERT INTO 商品(商品コード, 商品名, 単価, 商品区分) VALUES (W0461, 冬のあったかコート, 12800, 1);

## Level2(本誌 第3章)
問題6　正解
商品テーブルから商品コードが「W1252」のデータを抽出する

解答6
SELECT * FROM 商品 WHERE 商品コード = 'W1252';

問題7　正解
商品コードが「S0023」の商品について、商品テーブルの単価を500円に変更する

解答7
UPDATE 商品 SET 単価 = 500 WHERE 商品コード = ’S0023’;

問題8　正解
商品テーブルから、単価が1,000円以下の商品データを抽出する

解答8
SELECT * FROM 商品 WHERE 単価 <= 1000;

問題9　正解
商品テーブルから、単価が50,000円以上の商品データを抽出する

解答9
SELECT * FROM 商品 WHERE 単価 >= 50000;

問題10　正解
注文テーブルから、2018年以降の注文データを抽出する

解答10
SELECT * FROM 注文 WHERE 注文日 >= '2018-01-01';

問題11　正解
注文テーブルから、2017年11月以前の注文データを抽出する

解答11
SELECT * FROM 注文 WHERE 注文日 < '2017-12-01';

問題12　正解
商品テーブルから、「衣類」でない商品データを抽出する

解答12
SELECT * FROM 商品 WHERE 商品区分 <> '1';

問題13　正解
注文テーブルから、クーポン割引を利用していない注文データを抽出する

解答13
SELECT * FROM 注文 WHERE クーポン割引料 IS NULL;

問題14　正解
商品テーブルから、商品コードが「N」で始まる商品を削除する

解答14
DELETE FROM 商品 WHERE 商品コード LIKE 'N%';

問題15　正解
商品テーブルから、商品名に「コート」が含まれる商品について、商品コード、商品名、単価を抽出する

解答15
SELECT 商品コード, 商品名, 単価 FROM 商品 WHERE 商品名 LIKE '%コート%';

問題16　不正解
「靴」または「雑貨」もしくは「未分類」の商品について、商品コード、商品区分を抽出する。記述する条件式は1つであること

解答16
SELECT 商品コード, 商品区分 FROM 商品 WHERE 商品区分 = '2' OR 商品区分 = '3' OR 商品区分 = '9';

SELECT 商品コード, 商品区分 FROM 商品 WHERE 商品区分 IN ('2','3','9');

問題17　正解
商品テーブルから、商品コードが「A0100」~「A0500」に当てはまる商品データを抽出する。記述する条件式は1つであること。

解答17
SELECT * FROM 商品 WHERE 商品コード BETWEEN 'A0100' AND 'A0500';

問題18　正解
注文テーブルから、商品コードが「N0501」「N1021」「N0223」のいずれかを注文した注文データを抽出する

解答18
SELECT * FROM 注文 WHERE 商品コード IN ('N0501','N1021', 'N0223');

問題19　正解
商品テーブルから、「雑貨」で商品名に「水玉」が含まれる商品データを抽出する

解答19
SELECT * FROM 商品 WHERE 商品区分 = '3' AND 商品名 LIKE '%水玉%';

問題20　正解
商品テーブルから、商品名に「軽い」または「ゆるふわ」のどちらかが含まれる商品データを抽出する

解答20
SELECT * FROM 商品 WHERE 商品名 LIKE '%軽い%' OR 商品名 LIKE '%ゆるふわ%';

問題21　正解
商品テーブルから、「衣類」で単価が3,000円以下、または「雑貨」で単価が10,000円以上の商品データを抽出する

解答21
SELECT * FROM 商品 WHERE (商品区分 = '1' AND 単価 <= 3000) OR (商品区分 = '3' AND 単価 >= 10000);

問題22　正解
注文テーブルから、2018年3月中に、一度の注文で数量3個以上の注文があった商品コードを抽出する。

解答22
SELECT * FROM 注文 WHERE 注文日 >= '2018-03-01' AND 注文日 <= '2018-03-31' AND 数量 >= 3;

問題23　正解
注文テーブルから、一度の注文で数量10個以上を注文したか、クーポン割引を利用した注文データを抽出する。

解答23
SELECT * FROM 注文 WHERE 数量 >= 10 OR クーポン割引量 IS NOT NULL;

問題24　正解
商品テーブルと注文テーブルそれぞれについて、主キーの役割を果たしている列名を日本語で解答する。

解答24
商品データ：商品コード
注文データ：注文日、注文番号、注文枝番

問題25　正解
商品区分「衣類」の商品について、商品コードの降順に商品コードと商品名の一覧を取得する。

解答25
SELECT 商品コード、商品名 FROM 商品 WHERE 商品区分 = '1' ORDER BY 商品コード DESC;

問題26　正解
注文テーブルから、主キーの昇順に2018年3月以降の注文一覧を取得する。取得する項目は、注文日、注文番号、注文枝番、商品コード、数量とする。

解答26
SELECT 注文日、注文番号、注文枝番、商品コード, 数量 FROM 注文 WHERE 注文日 >= '2018-03-01' ORDER BY 注文日、注文番号、注文枝番;

問題27　正解
注文テーブルから、これまでに注文のあった商品コードを抽出する。重複は除外し、商品コードの昇順に抽出すること。

解答27
SELECT DISTINCT 商品コード FROM 注文 ORDER BY 商品コード;

問題28　不正解
注文テーブルから、注文のあった日付を新しい順に10行抽出する(同一行が複数回登場しても良い)

解答28
SELECT 注文日 FROM 注文 ORDER BY 注文日 DESC;
SELECT 注文日 FROM 注文 ORDER BY 注文日 DESC OFFSET 0 FETCH FIRST 10 ROW　ONLY;

問題29　正解
商品テーブルから、単価の低い順に並べて6〜20行目に当たる商品データを抽出する。同一単価の場合は、商品区分、商品コードの昇順に抽出する。

解答29
SELECT * FROM 商品 ORDER BY 単価, 商品区分, 商品コード OFFSET 5 FETCH FIRST 15 ROWS ONLY;

問題30　不正解
廃番商品テーブルから、2016年12月に廃番されたものと、売上個数が100を超えるものを併せて抽出する。一覧は、売上個数の多い順に並べること。

解答30
SELECT * FROM 廃藩商品 WHERE 廃番日 >= '2016-12-01' AND 廃番日 <= '2016-12-31' AND 売上個数 > 100 ORDER BY 売上個数 DESC;

SELECT * FROM 廃藩商品 WHERE 廃番日 >= '2016-12-01' AND 廃番日 <= '2016-12-31' UNION SELECT * FROM 廃番商品 WHERE 売上個数 > 100 ORDER BY 6 DESC;

問題31　正解
廃番商品テーブルから、2016年12月に廃番されたものと、売上個数が100を超えるものを併せて抽出する。一覧は、売上個数の多い順に並べること。

解答31
SELECT 商品コード FROM EXCEPT SELECT 商品コード FROM 注文 ORDER BY 商品コード;

問題32
商品テーブルから、これまでに注文された実績のある商品コードを商品コードの降順に抽出する

解答32
SELECT 商品コード FROM INTERSECT SELECT 商品コード FROM 注文 ORDER BY 商品コード DESC;

問題33 不正解
商品区分が「未分類」で単価が1,000円以下と1万円を超える商品について、商品コード、商品名、単価を抽出する。単価の低い順に並べ、同類の場合は商品コードの昇順とする。

解答33
SELECT 商品コード, 商品名, 単価 FORM 商品 WHERE 商品区分 = '9' AND 単価 <= 1000 UNION SELECT 商品コード, 商品名, 単価 FROM 商品 WHERE 単価 > 10000 ORDER BY 商品コード;

SELECT 商品コード, 商品名, 単価 FORM 商品 WHERE 商品区分 = '9' AND 単価 <= 1000 UNION SELECT 商品コード, 商品名, 単価 FROM 商品 WHERE 商品区分 = '9' AND 単価 > 10000 ORDER BY 商品コード;

問題34　正解
商品テーブルの商品区分「未分類」の商品について、商品コード、単価、キャンペーン価格の一覧を取得する。キャンペーン価格は単価の5%引きであり、1円未満の端数は考慮しなくて良い。一覧は商品コード順に並べること。

解答34
SELECT 商品コード, 単価, 単価 * 0.95 AS キャンペーン価格 FORM 商品 WHERE 商品区分 = '9' ORDER BY 商品コード;

問題35　正解
注文日が2018年3月12~14日で、同じ商品を2個以上注文し、すでにクーポン割引を利用している注文について、さらに300円割引することになった。該当データのクーポン割引料を更新する。

解答35
UPDATE 注文 SET 割引料 = 割引料 + 300 WHERE 注文日 >= '2018-03-12' AND 注文日 <= '2018-03-14' AND 数量 = 2 AND クーポン割引料 IS NOT NULL;

問題36
注文日が2018年3月12~14日で、同じ商品を2個以上注文し、すでにクーポン割引を利用している注文について、さらに300円割引することになった。該当データのクーポン割引料を更新する。

解答36
UPDATE 注文 SET 数量 =  数量 - 1 WHERE 注文番号 = '201802250126' AND 商品コード = 'W0156';

問題37　不正解
注文テーブルから、注文番号「201710010001」〜「201710319999」の注文データを抽出する。注文番号と枝番は、「-」でつなげて1つの項目として抽出する。

解答37
SELECT 注文日 注文番号 || '-' || CAST(注文枝番 AS VARCHAR) FROM 注文 WHERE 注文番号 >= '20170010001' AND 注文番号 <= '201710319999';

問題38　正解
商品テーブルから、商品区分の一覧を取得する。見出しは「区分」と「区分名」とし、区分名には日本語名を表記する。

解答38
SELECT DISTINCT 商品区分 AS 区分, CASE 商品区分 WHEN '1' THEN '衣類' WHEN '2' THEN '靴' WHEN '3' THEN '雑貨' WHEN '9' THEN '未分類' END AS 区分名 FROM 商品;

問題39　正解
商品テーブルから、商品コード、商品名、単価、販売価格ランク、商品区分を抽出する。販売価格ランクは、3千円未満を「S」、3千円以上1万円未満を「M」、1万円以上を「L」とする。また商品区分はコードと日本語名称を「：」(コロン)で連結して表記する。一覧は、単価の昇順に並べ、同額の場合は商品コードの昇順に並べること。

解答39
SELECT 商品コード, 商品名, 単価, CASE WHEN 単価 < 3000 THEN 'S' WHEN 単価 >= 3000 AND 単価 < 10000 THEN 'M' ELSE 'L' END AS 販売価格ランク, 商品区分 || ':' || CASE 商品区分 WHEN '1' THEN '衣類' WHEN '2' THEN '靴' WHEN '3' THEN '雑貨' WHEN '9' THHEN '未分類' END AS 商品区分 ORDER BY 単価, 商品コード;

問題40
商品テーブルから、商品名が10文字を超過する商品名とその文字数を抽出する。文字数の昇順に並べること。

解答
SELECT 商品名, LENGTH(商品名) AS 文字数 FROM 商品 WHERE LENGTH(商品名) > 10 ORDER BY LENGTH(商品名);

repo_name: skfm/sql-introduction