Add files via upload

This commit is contained in:
sungsuhub
2024-01-16 00:15:10 +09:00
committed by GitHub
parent 8f37779890
commit c79906db7d
4 changed files with 898 additions and 898 deletions

View File

@@ -1,253 +1,253 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>거래처 생성</title>
<style>
.body {
text-align: center;
}
.col-centered {
margin: 0 auto;
float: none;
}
.col-margin-left-32 {
margin-left: 32%;
}
</style>
</head>
<body>
<div class="mt-5 mb-5 text-center">
<h1>거래처 생성</h1>
</div>
<hr>
<div class="container" style="text-align: center">
<form id="createForm">
<div class="ulTag">
<div class="row">
<div class="col-12">
<%-- 세션 만들어지고 value 수정--%>
<input type='hidden' id="managerId" value="15b68e54-b0f0-11ee-935d-0242ac110006"/>
<input type='hidden' id="activation" value="1">
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon1">업체명</span>
<input type="text" name="name" id="name" class="form-control"
placeholder="업체명을 입력하세요" aria-label="업체명" value="${dto.name }"
aria-describedby="basic-addon1">
</div>
<!-- 설명만 있는 입력 -->
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon2">대표자명</span>
<input type="text" name="presidentName" id="presidentName" class="form-control"
placeholder="대표자명을 입력하세요" aria-label="대표자명" value="${dto.presidentName }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon3">주소</span>
<input type="text" name="address" id="address" class="form-control"
placeholder="주소를 입력하세요" aria-label="주소" value="${dto.address }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon4">사업자등록번호</span>
<input type="text" name="registrationNumber" id="registrationNumber" class="form-control"
placeholder="사업자등록번호를 입력하세요" aria-label="사업자등록번호" value="${dto.registrationNumber }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon5">email</span>
<input type="text" name="email" id="email" class="form-control"
placeholder="Email주소를 입력하세요" aria-label="email" value="${dto.email }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon6">대표번호</span>
<input type="text" name="presidentTelephone" id="presidentTelephone" class="form-control"
placeholder="대표번호를 입력하세요" aria-label="대표번호" value="${dto.presidentTelephone }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon7">거래처 담당자 이름</span>
<input type="text" name="vendorManager" id="vendorManager" class="form-control"
placeholder="거래처 담당자 이름을 입력하세요" aria-label="거래처 담당자 이름" value="${dto.vendorManager }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon8">거래처 담당자 연락 번호</span>
<input type="text" name="vendorManagerTelephone" id="vendorManagerTelephone" class="form-control"
placeholder="거래처 담당자 연락 번호를 입력하세요" aria-label="거래처 담당자 연락 번호" value="${dto.vendorManagerTelephone }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon9">주요품목</span>
<input type="text" name="mainProduct" id="mainProduct" class="form-control"
placeholder="주요품목을 입력하세요" aria-label="주요품목" value="${dto.mainProduct }"
aria-describedby="basic-addon1">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12 ">
<div class="w-40 col-centered" style="text-align: right">
<button type="button" class="btn btn-success" id="submitBtn">생성</button>
<button type="button" class="btn btn-secondary" id="cancelBtn">취소</button>
</div>
</div>
</div>
</form>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function () {
$("#submitBtn").on("click", function () {
var managerId = $("#managerId").val();
var name = $("#name").val();
var presidentName = $("#presidentName").val();
var address = $("#address").val();
var registrationNumber = $("#registrationNumber").val();
var email = $("#email").val();
var presidentTelephone = $("#presidentTelephone").val();
var vendorManager = $("#vendorManager").val();
var vendorManagerTelephone = $("#vendorManagerTelephone").val();
var mainProduct = $("#mainProduct").val();
var activation = $("#activation").val();
if (!name) {
alert("업체명을 입력해야 합니다.");
$("#name").focus();
return false;
}
if (!presidentName) {
alert("대표자명을 입력해야 합니다.");
$("#presidentName").focus();
return false;
}
if (!address) {
alert("주소를 입력해야 합니다.");
$("#address").focus();
return false;
}
if (!registrationNumber) {
alert("사업자등록번호를 입력해야 합니다.");
$("#registrationNumber").focus();
return false;
}
if (!email) {
alert("Email을 입력해야 합니다.");
$("#email").focus();
return false;
}
if (!presidentTelephone) {
alert("대표번호를 입력해야 합니다.");
$("#presidentTelephone").focus();
return false;
}
if (!vendorManager) {
alert("거래처 담당자 이름을 입력해야 합니다.");
$("#vendorManager").focus();
return false;
}
if (!vendorManagerTelephone) {
alert("거래처 담당자 연락 번호를 입력해야 합니다.");
$("#vendorManagerTelephone").focus();
return false;
}
if (!mainProduct) {
alert("주요품목을 입력해야 합니다.");
$("#mainProduct").focus();
return false;
}
$.ajax({
url: "/vendor/create_process",
type: "post",
data: {
"managerId": managerId,
"name": name,
"presidentName": presidentName,
"address": address,
"registrationNumber": registrationNumber,
"email": email,
"presidentTelephone": presidentTelephone,
"vendorManager": vendorManager,
"vendorManagerTelephone": vendorManagerTelephone,
"mainProduct": mainProduct,
"activation" : activation
},
datatype: "json"
}).done(function (data) {
if (data == true) {
alert("거래처가 생성되었습니다.");
var form = document.createElement("form");
form.action = "/vendor/read";
form.method = "POST";
document.body.appendChild(form);
var input = document.createElement("input");
input.type = "hidden";
input.name = "name";
input.value = name;
form.appendChild(input);
form.submit();
window.location.href = "/vendor/list";
} else {
alert("거래처 생성에 실패하였습니다.");
}
}).fail(function () {
alert("오류가 발생했습니다.");
}).always(function () {
//
});
})
$("#cancelBtn").on("click", function () {
$(location).attr("href", "/vendor/list");
})
});
</script>
</div>
</body>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>거래처 생성</title>
<style>
.body {
text-align: center;
}
.col-centered {
margin: 0 auto;
float: none;
}
.col-margin-left-32 {
margin-left: 32%;
}
</style>
</head>
<body>
<div class="mt-5 mb-5 text-center">
<h1>거래처 생성</h1>
</div>
<hr>
<div class="container" style="text-align: center">
<form id="createForm">
<div class="ulTag">
<div class="row">
<div class="col-12">
<%-- 세션 만들어지고 value 수정--%>
<input type='hidden' id="manager_id" value="15b68e54-b0f0-11ee-935d-0242ac110006"/>
<input type='hidden' id="activation" value="1">
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon1">업체명</span>
<input type="text" name="name" id="name" class="form-control"
placeholder="업체명을 입력하세요" aria-label="업체명" value="${dto.name }"
aria-describedby="basic-addon1">
</div>
<!-- 설명만 있는 입력 -->
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon2">대표자명</span>
<input type="text" name="president_name" id="president_name" class="form-control"
placeholder="대표자명을 입력하세요" aria-label="대표자명" value="${dto.president_name }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon3">주소</span>
<input type="text" name="address" id="address" class="form-control"
placeholder="주소를 입력하세요" aria-label="주소" value="${dto.address }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon4">사업자등록번호</span>
<input type="text" name="registration_number" id="registration_number" class="form-control"
placeholder="사업자등록번호를 입력하세요" aria-label="사업자등록번호" value="${dto.registration_number }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon5">email</span>
<input type="text" name="email" id="email" class="form-control"
placeholder="Email주소를 입력하세요" aria-label="email" value="${dto.email }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon6">대표번호</span>
<input type="text" name="president_telephone" id="president_telephone" class="form-control"
placeholder="대표번호를 입력하세요" aria-label="대표번호" value="${dto.president_telephone }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon7">거래처 담당자 이름</span>
<input type="text" name="vendor_manager" id="vendor_manager" class="form-control"
placeholder="거래처 담당자 이름을 입력하세요" aria-label="거래처 담당자 이름" value="${dto.vendor_manager }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon8">거래처 담당자 연락 번호</span>
<input type="text" name="vendor_manager_telephone" id="vendor_manager_telephone" class="form-control"
placeholder="거래처 담당자 연락 번호를 입력하세요" aria-label="거래처 담당자 연락 번호" value="${dto.vendor_manager_telephone }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon9">주요품목</span>
<input type="text" name="main_product" id="main_product" class="form-control"
placeholder="주요품목을 입력하세요" aria-label="주요품목" value="${dto.main_product }"
aria-describedby="basic-addon1">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12 ">
<div class="w-40 col-centered" style="text-align: right">
<button type="button" class="btn btn-success" id="submitBtn">생성</button>
<button type="button" class="btn btn-secondary" id="cancelBtn">취소</button>
</div>
</div>
</div>
</form>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function () {
$("#submitBtn").on("click", function () {
var managerId = $("#manager_id").val();
var name = $("#name").val();
var president_name = $("#president_name").val();
var address = $("#address").val();
var registration_number = $("#registration_number").val();
var email = $("#email").val();
var president_telephone = $("#president_telephone").val();
var vendor_manager = $("#vendor_manager").val();
var vendor_manager_telephone = $("#vendor_manager_telephone").val();
var main_product = $("#main_product").val();
var activation = $("#activation").val();
if (!name) {
alert("업체명을 입력해야 합니다.");
$("#name").focus();
return false;
}
if (!presidentName) {
alert("대표자명을 입력해야 합니다.");
$("#president_name").focus();
return false;
}
if (!address) {
alert("주소를 입력해야 합니다.");
$("#address").focus();
return false;
}
if (!registrationNumber) {
alert("사업자등록번호를 입력해야 합니다.");
$("#registration_number").focus();
return false;
}
if (!email) {
alert("Email을 입력해야 합니다.");
$("#email").focus();
return false;
}
if (!presidentTelephone) {
alert("대표번호를 입력해야 합니다.");
$("#president_telephone").focus();
return false;
}
if (!vendorManager) {
alert("거래처 담당자 이름을 입력해야 합니다.");
$("#vendor_manager").focus();
return false;
}
if (!vendorManagerTelephone) {
alert("거래처 담당자 연락 번호를 입력해야 합니다.");
$("#vendor_manager_telephone").focus();
return false;
}
if (!mainProduct) {
alert("주요품목을 입력해야 합니다.");
$("#main_product").focus();
return false;
}
$.ajax({
url: "/vendor/create_process",
type: "post",
data: {
"manager_id": manager_id,
"name": name,
"president_name": president_name,
"address": address,
"registration_number": registration_number,
"email": email,
"president_telephone": president_telephone,
"vendor_manager": vendor_manager,
"vendor_manager_telephone": vendor_manager_telephone,
"main_product": main_product,
"activation" : activation
},
datatype: "json"
}).done(function (data) {
if (data == true) {
alert("거래처가 생성되었습니다.");
var form = document.createElement("form");
form.action = "/vendor/read";
form.method = "POST";
document.body.appendChild(form);
var input = document.createElement("input");
input.type = "hidden";
input.name = "name";
input.value = name;
form.appendChild(input);
form.submit();
window.location.href = "/vendor/list";
} else {
alert("거래처 생성에 실패하였습니다.");
}
}).fail(function () {
alert("오류가 발생했습니다.");
}).always(function () {
//
});
})
$("#cancelBtn").on("click", function () {
$(location).attr("href", "/vendor/list");
})
});
</script>
</div>
</body>
</html>

View File

@@ -1,203 +1,203 @@
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>거래처 관리</title>
</head>
<body>
<div class="mt-5 mb-5 text-center">
<h1>거래처 관리</h1>
</div>
<hr>
<div class="body">
<div class="container-fluid">
<div class="col-12">
<form>
<div class="input-group mb-3 w-30 col-centered">
<div class="w-25">
<select class="form-select" name="searchn" id="searchn">
<option value="0">업체명</option>
<option value="1">대표번호</option>
<option value="2">거래처 담당자</option>
<option value="3">거래처 담당자 전화번호</option>
</select>
</div>
<input type="text" id="search" name="search" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
<button class="btn btn-info" type="button" id="searchBtn">검색</button>
<!-- 페이징작업용 -->
<input type="hidden" id="searchn1" value="${searchn}">
<input type="hidden" id="search1" value="${search}">
<!-- 페이징작업용 -->
</div>
</form>
</div>
</div>
<div class="container-fluid">
<div class="row row-table">
<div class="col-12">
<table class="table">
<thead class="table-dark">
<tr>
<th>번호</th>
<th>업체명</th>
<th>대표번호</th>
<th>거래처 담당자</th>
<th>거래처 담당자 전화번호</th>
</tr>
</thead>
<tbody>
<c:forEach items="${vlist }" var="dto">
<tr class="detailTr col-5" data-id="${dto.id}" >
<td class="col-1">${start} <c:set var="start" value="${start +1 }"/></td>
<td class="col-1">${dto.name }</td>
<td class="col-1">${dto.presidentTelephone }</td>
<td class="col-1">${dto.vendorManager }</td>
<td class="col-1">${dto.vendorManagerTelephone }</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row row-buttons">
<div class="col-3 text-start">
<img width="50" height="50" src="https://img.icons8.com/color/48/ms-excel.png" alt="ms-excel"/>
<button type="button" class="btn btn-success" id="uploadExcel">업로드</button>
<button type="button" class="btn btn-success" id="download">다운로드</button>
</div>
<div class="col-6 d-flex justify-content-center">
<nav>
<ul class="pagination">
<c:if test="${begin > pageNum }">
<li class="page-item">
<a href="javascript:void(0);" class="page-link" onclick="pageingFunction(this.id)" id="${begin - 1 }">&lt;</a>
</li>
</c:if>
<c:forEach begin="${begin }" end="${end }" var="i">
<li class="page-item <c:if test="${p == i}"> active </c:if>">
<a href="javascript:void(0);" class="page-link " onclick="pageingFunction(this.id); return false;" id="${i }">${i }</a>
</li>
</c:forEach>
<c:if test="${end < totalPages }">
<li class="page-item">
<a href="javascript:void(0);" class="page-link" onclick="pageingFunction(this.id)" id="${end + 1 }">&gt;</a>
</li>
</c:if>
</ul>
</nav>
</div>
<div class="col-3 text-end">
<button type="button" class="btn btn-primary" id="createButton">생성</button>
</div>
</div><!-- row row-buttons -->
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function(){
//POST방식으로 create폼화면 출력
$("#createButton").on("click",function(){
var form = document.createElement("form");
form.action = "/vendor/create";
form.method = "POST";
document.body.appendChild(form);
form.submit();
});
$("body").on("click", ".detailTr", function(){
var id = $(this).data("id");
var form = document.createElement("form");
form.action = "/vendor/read";
form.method = "POST";
document.body.appendChild(form);
var input = document.createElement("input");
input.type = "hidden";
input.name = "id";
input.value = id;
form.appendChild(input);
form.submit();
});
//검색기능
$("#searchBtn").on("click",function(){
var searchn = $("#searchn").val();
var search = $("#search").val();
var form = document.createElement("form");
form.action = "/vendor/list";
form.method = "get";
var input1 = document.createElement("input");
input1.type = "hidden";
input1.name = "searchn";
input1.value = searchn;
form.appendChild(input1);
var input2 = document.createElement("input");
input2.type = "hidden";
input2.name = "search";
input2.value = search;
form.appendChild(input2);
var input3 = document.createElement("input");
input3.type = "hidden";
input3.name = "p";
input3.value = 1;
form.appendChild(input3);
document.body.appendChild(form);
form.submit();
});
});//ready
function pageingFunction(clickedId){
var searchn1 = $("#searchn1").val();
var search1 = $("#search1").val();
var form = document.createElement("form");
form.action = "/vendor/list";
form.method = "get";
var input1 = document.createElement("input");
input1.type = "hidden";
input1.name = "searchn";
input1.value = searchn1;
form.appendChild(input1);
var input2 = document.createElement("input");
input2.type = "hidden";
input2.name = "search";
input2.value = search1;
form.appendChild(input2);
var input3 = document.createElement("input");
input3.type = "hidden";
input3.name = "p";
input3.value = clickedId;
form.appendChild(input3);
document.body.appendChild(form);
form.submit();
}
</script>
</body>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>거래처 관리</title>
</head>
<body>
<div class="mt-5 mb-5 text-center">
<h1>거래처 관리</h1>
</div>
<hr>
<div class="body">
<div class="container-fluid">
<div class="col-12">
<form>
<div class="input-group mb-3 w-30 col-centered">
<div class="w-25">
<select class="form-select" name="searchn" id="searchn">
<option value="0">업체명</option>
<option value="1">대표번호</option>
<option value="2">거래처 담당자</option>
<option value="3">거래처 담당자 전화번호</option>
</select>
</div>
<input type="text" id="search" name="search" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
<button class="btn btn-info" type="button" id="searchBtn">검색</button>
<!-- 페이징작업용 -->
<input type="hidden" id="searchn1" value="${searchn}">
<input type="hidden" id="search1" value="${search}">
<!-- 페이징작업용 -->
</div>
</form>
</div>
</div>
<div class="container-fluid">
<div class="row row-table">
<div class="col-12">
<table class="table">
<thead class="table-dark">
<tr>
<th>번호</th>
<th>업체명</th>
<th>대표번호</th>
<th>거래처 담당자</th>
<th>거래처 담당자 전화번호</th>
</tr>
</thead>
<tbody>
<c:forEach items="${vlist }" var="dto">
<tr class="detailTr col-5" data-id="${dto.id}" >
<td class="col-1">${start} <c:set var="start" value="${start +1 }"/></td>
<td class="col-1">${dto.name }</td>
<td class="col-1">${dto.president_telephone }</td>
<td class="col-1">${dto.vendor_manager }</td>
<td class="col-1">${dto.vendor_manager_telephone }</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row row-buttons">
<div class="col-3 text-start">
<img width="50" height="50" src="https://img.icons8.com/color/48/ms-excel.png" alt="ms-excel"/>
<button type="button" class="btn btn-success" id="uploadExcel">업로드</button>
<button type="button" class="btn btn-success" id="download">다운로드</button>
</div>
<div class="col-6 d-flex justify-content-center">
<nav>
<ul class="pagination">
<c:if test="${begin > pageNum }">
<li class="page-item">
<a href="javascript:void(0);" class="page-link" onclick="pageingFunction(this.id)" id="${begin - 1 }">&lt;</a>
</li>
</c:if>
<c:forEach begin="${begin }" end="${end }" var="i">
<li class="page-item <c:if test="${p == i}"> active </c:if>">
<a href="javascript:void(0);" class="page-link " onclick="pageingFunction(this.id); return false;" id="${i }">${i }</a>
</li>
</c:forEach>
<c:if test="${end < totalPages }">
<li class="page-item">
<a href="javascript:void(0);" class="page-link" onclick="pageingFunction(this.id)" id="${end + 1 }">&gt;</a>
</li>
</c:if>
</ul>
</nav>
</div>
<div class="col-3 text-end">
<button type="button" class="btn btn-primary" id="createButton">생성</button>
</div>
</div><!-- row row-buttons -->
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function(){
//POST방식으로 create폼화면 출력
$("#createButton").on("click",function(){
var form = document.createElement("form");
form.action = "/vendor/create";
form.method = "POST";
document.body.appendChild(form);
form.submit();
});
$("body").on("click", ".detailTr", function(){
var id = $(this).data("id");
var form = document.createElement("form");
form.action = "/vendor/read";
form.method = "POST";
document.body.appendChild(form);
var input = document.createElement("input");
input.type = "hidden";
input.name = "id";
input.value = id;
form.appendChild(input);
form.submit();
});
//검색기능
$("#searchBtn").on("click",function(){
var searchn = $("#searchn").val();
var search = $("#search").val();
var form = document.createElement("form");
form.action = "/vendor/list";
form.method = "get";
var input1 = document.createElement("input");
input1.type = "hidden";
input1.name = "searchn";
input1.value = searchn;
form.appendChild(input1);
var input2 = document.createElement("input");
input2.type = "hidden";
input2.name = "search";
input2.value = search;
form.appendChild(input2);
var input3 = document.createElement("input");
input3.type = "hidden";
input3.name = "p";
input3.value = 1;
form.appendChild(input3);
document.body.appendChild(form);
form.submit();
});
});//ready
function pageingFunction(clickedId){
var searchn1 = $("#searchn1").val();
var search1 = $("#search1").val();
var form = document.createElement("form");
form.action = "/vendor/list";
form.method = "get";
var input1 = document.createElement("input");
input1.type = "hidden";
input1.name = "searchn";
input1.value = searchn1;
form.appendChild(input1);
var input2 = document.createElement("input");
input2.type = "hidden";
input2.name = "search";
input2.value = search1;
form.appendChild(input2);
var input3 = document.createElement("input");
input3.type = "hidden";
input3.name = "p";
input3.value = clickedId;
form.appendChild(input3);
document.body.appendChild(form);
form.submit();
}
</script>
</body>
</html>

View File

@@ -1,181 +1,181 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>거래처 상세페이지</title>
<style type="text/css">
.header {
text-align: center;
}
</style>
</head>
<body>
<div class="mt-5 mb-5 text-center">
<div class="row">
<h1>거래처 상세페이지</h1>
<div class="col-10" style="text-align: right">
<button type="button" class="btn btn-danger" id="yes_no_modal_show">삭제</button>
</div>
</div>
</div>
<hr>
<div class="container" style="text-align: center">
<form id="createForm">
<div class="ulTag">
<div class="row">
<div class="col-12">
<input type="hidden" class="form-control" aria-label="id" id="id" value="${One.id }" readonly>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon1">업체명</span>
<input type="text" class="form-control" aria-label="창고명" value="${One.name }" readonly>
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon2">대표자명</span>
<input type="text" class="form-control" aria-label="용적" value="${One.presidentName }" readonly>
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon3">주소</span>
<input type="text" class="form-control" aria-label="적재량" value="${One.address }" readonly>
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon4">사업자등록번호</span>
<input type="text" class="form-control" aria-label="적재량" value="${One.registrationNumber }"
readonly>
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon5">email</span>
<input type="text" class="form-control" aria-label="적재량" value="${One.email }" readonly>
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon6">대표번호</span>
<input type="text" class="form-control" aria-label="적재량" value="${One.presidentTelephone }"
readonly>
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon7">거래처 담당자 이름</span>
<input type="text" class="form-control" aria-label="적재량" value="${One.vendorManager }" readonly>
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon8">거래처 담당자 연락 번호</span>
<input type="text" class="form-control" aria-label="적재량" value="${One.vendorManagerTelephone }"
readonly>
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon9">주요품목</span>
<input type="text" class="form-control" aria-label="적재량" value="${One.mainProduct }" readonly>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<div>
<hr>
</div>
<div class="col-10" style="text-align: right">
<button type="button" class="btn btn-primary" id="checkBtn">확인</button>
<button type="button" class="btn btn-warning" id="modifyBtn">
수정
</button>
</div>
<div class="modal fade" id="yes_no_modal_vendor_delete" tabindex="-1" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="yesNoModalLabel">삭제 하시겠습니까?</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
<button id="modal_yes_button_vendor_delete" type="button" class="modal_yes btn btn-primary">삭제</button>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$("#checkBtn").on("click", function () {
$(location).attr("href", "/vendor/list");
})//checkBtn click
$("#modifyBtn").on("click", function () {
var id = $("#id").val();
var form = document.createElement("form");
form.action = "/vendor/update";
form.method = "POST";
document.body.appendChild(form);
var input = document.createElement("input");
input.type = "hidden";
input.name = "id";
input.value = id;
form.appendChild(input);
form.submit();
})//modifyBtn click
yesNoModal.yesFunction = deleteVendorFunction;
function deleteVendorFunction() {
var id = $("#id").val();
$.ajax({
url: "/vendor/delete",
type: "delete",
data: {
"id": id
},
datatype: "json"
}).done(function (data) {
if (data == true) {
alert("삭제되었습니다.");
$(location).attr("href", "/vendor/list");
} else {
alert("정상적으로 삭제되지 않았습니다..");
}
}).fail(function () {
alert("오류가 발생했습니다.");
}).always(function () {
//
});
}//deleteCategoryFunction
const yesNoModalBootStrap = new bootstrap.Modal("#yes_no_modal_vendor_delete");
$("#yes_no_modal_show").on("click", function () {
yesNoModalBootStrap.show();
});
$("#modal_yes_button_vendor_delete").on("click", function () {
yesNoModal.yesFunction();
yesNoModalBootStrap.hide();
});
});//ready
</script>
</body>
</html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>거래처 상세페이지</title>
<style type="text/css">
.header {
text-align: center;
}
</style>
</head>
<body>
<div class="mt-5 mb-5 text-center">
<div class="row">
<h1>거래처 상세페이지</h1>
<div class="col-10" style="text-align: right">
<button type="button" class="btn btn-danger" id="yes_no_modal_show">삭제</button>
</div>
</div>
</div>
<hr>
<div class="container" style="text-align: center">
<form id="createForm">
<div class="ulTag">
<div class="row">
<div class="col-12">
<input type="hidden" class="form-control" aria-label="id" id="id" value="${One.id }" readonly>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon1">업체명</span>
<input type="text" class="form-control" aria-label="창고명" value="${One.name }" readonly>
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon2">대표자명</span>
<input type="text" class="form-control" aria-label="용적" value="${One.president_name }" readonly>
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon3">주소</span>
<input type="text" class="form-control" aria-label="적재량" value="${One.address }" readonly>
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon4">사업자등록번호</span>
<input type="text" class="form-control" aria-label="적재량" value="${One.registration_number }"
readonly>
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon5">email</span>
<input type="text" class="form-control" aria-label="적재량" value="${One.email }" readonly>
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon6">대표번호</span>
<input type="text" class="form-control" aria-label="적재량" value="${One.president_telephone }"
readonly>
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon7">거래처 담당자 이름</span>
<input type="text" class="form-control" aria-label="적재량" value="${One.vendor_manager }" readonly>
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon8">거래처 담당자 연락 번호</span>
<input type="text" class="form-control" aria-label="적재량" value="${One.vendor_manager_telephone }"
readonly>
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon9">주요품목</span>
<input type="text" class="form-control" aria-label="적재량" value="${One.main_product }" readonly>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<div>
<hr>
</div>
<div class="col-10" style="text-align: right">
<button type="button" class="btn btn-primary" id="checkBtn">확인</button>
<button type="button" class="btn btn-warning" id="modifyBtn">
수정
</button>
</div>
<div class="modal fade" id="yes_no_modal_vendor_delete" tabindex="-1" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="yesNoModalLabel">삭제 하시겠습니까?</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
<button id="modal_yes_button_vendor_delete" type="button" class="modal_yes btn btn-primary">삭제</button>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$("#checkBtn").on("click", function () {
$(location).attr("href", "/vendor/list");
})//checkBtn click
$("#modifyBtn").on("click", function () {
var id = $("#id").val();
var form = document.createElement("form");
form.action = "/vendor/update";
form.method = "POST";
document.body.appendChild(form);
var input = document.createElement("input");
input.type = "hidden";
input.name = "id";
input.value = id;
form.appendChild(input);
form.submit();
})//modifyBtn click
yesNoModal.yesFunction = deleteVendorFunction;
function deleteVendorFunction() {
var id = $("#id").val();
$.ajax({
url: "/vendor/delete",
type: "delete",
data: {
"id": id
},
datatype: "json"
}).done(function (data) {
if (data == true) {
alert("삭제되었습니다.");
$(location).attr("href", "/vendor/list");
} else {
alert("정상적으로 삭제되지 않았습니다..");
}
}).fail(function () {
alert("오류가 발생했습니다.");
}).always(function () {
//
});
}//deleteCategoryFunction
const yesNoModalBootStrap = new bootstrap.Modal("#yes_no_modal_vendor_delete");
$("#yes_no_modal_show").on("click", function () {
yesNoModalBootStrap.show();
});
$("#modal_yes_button_vendor_delete").on("click", function () {
yesNoModal.yesFunction();
yesNoModalBootStrap.hide();
});
});//ready
</script>
</body>
</html>

View File

@@ -1,263 +1,263 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>창고 정보 수정페이지</title>
<style>
.body {
text-align: center;
}
.col-centered {
margin: 0 auto;
float: none;
}
.col-margin-left-32 {
margin-left: 32%;
}
</style>
</head>
<body>
<div class="mt-5 mb-5 text-center">
<h1>창고 정보 수정페이지</h1>
</div>
<hr>
<div class="container" style="text-align: center">
<form id="createForm">
<div class="ulTag">
<div class="row">
<div class="col-12" style="text-align: center;">
<input type="hidden" id="id" value="${dto.id }">
<input type='hidden' id="managerId" value="15b68e54-b0f0-11ee-935d-0242ac110006"/>
<input type='hidden' id="activation" value="1">
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon1">업체명</span>
<input type="text" name="name" id="name" class="form-control"
placeholder="업체명을 입력하세요" aria-label="업체명" value="${dto.name }"
aria-describedby="basic-addon1">
</div>
<!-- 설명만 있는 입력 -->
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon2">대표자명</span>
<input type="text" name="presidentName" id="presidentName" class="form-control"
placeholder="대표자명을 입력하세요" aria-label="대표자명" value="${dto.presidentName }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon3">주소</span>
<input type="text" name="address" id="address" class="form-control"
placeholder="주소를 입력하세요" aria-label="주소" value="${dto.address }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon4">사업자등록번호</span>
<input type="text" name="registrationNumber" id="registrationNumber" class="form-control"
placeholder="사업자등록번호를 입력하세요" aria-label="사업자등록번호" value="${dto.registrationNumber }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon5">email</span>
<input type="text" name="email" id="email" class="form-control"
placeholder="Email주소를 입력하세요" aria-label="email" value="${dto.email }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon6">대표번호</span>
<input type="text" name="presidentTelephone" id="presidentTelephone" class="form-control"
placeholder="대표번호를 입력하세요" aria-label="대표번호" value="${dto.presidentTelephone }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon7">거래처 담당자 이름</span>
<input type="text" name="vendorManager" id="vendorManager" class="form-control"
placeholder="거래처 담당자 이름을 입력하세요" aria-label="거래처 담당자 이름" value="${dto.vendorManager }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon8">거래처 담당자 연락 번호</span>
<input type="text" name="vendorManagerTelephone" id="vendorManagerTelephone" class="form-control"
placeholder="거래처 담당자 연락 번호를 입력하세요" aria-label="거래처 담당자 연락 번호" value="${dto.vendorManagerTelephone }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon9">주요품목</span>
<input type="text" name="mainProduct" id="mainProduct" class="form-control"
placeholder="주요품목을 입력하세요" aria-label="주요품목" value="${dto.mainProduct }"
aria-describedby="basic-addon1">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12 ">
<div class="w-40 col-centered" style="text-align: right">
<button type="button" class="btn btn-primary" id="updateBtn">수정 완료</button>
<button type="button" class="btn btn-secondary" id="cancelBtn">취소</button>
</div>
</div>
</div>
</form>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function () {
$("#updateBtn").on("click", function () {
var id = $("#id").val();
var managerId = $("#managerId").val();
var name = $("#name").val();
var presidentName = $("#presidentName").val();
var address = $("#address").val();
var registrationNumber = $("#registrationNumber").val();
var email = $("#email").val();
var presidentTelephone = $("#presidentTelephone").val();
var vendorManager = $("#vendorManager").val();
var vendorManagerTelephone = $("#vendorManagerTelephone").val();
var mainProduct = $("#mainProduct").val();
var activation = $("#activation").val();
if (!name) {
alert("업체명을 입력해야 합니다.");
$("#name").focus();
return false;
}
if (!presidentName) {
alert("대표자명을 입력해야 합니다.");
$("#presidentName").focus();
return false;
}
if (!address) {
alert("주소를 입력해야 합니다.");
$("#address").focus();
return false;
}
if (!registrationNumber) {
alert("사업자등록번호를 입력해야 합니다.");
$("#registrationNumber").focus();
return false;
}
if (!email) {
alert("Email을 입력해야 합니다.");
$("#email").focus();
return false;
}
if (!presidentTelephone) {
alert("대표번호를 입력해야 합니다.");
$("#presidentTelephone").focus();
return false;
}
if (!vendorManager) {
alert("거래처 담당자 이름을 입력해야 합니다.");
$("#vendorManager").focus();
return false;
}
if (!vendorManagerTelephone) {
alert("거래처 담당자 연락 번호를 입력해야 합니다.");
$("#vendorManagerTelephone").focus();
return false;
}
if (!mainProduct) {
alert("주요품목을 입력해야 합니다.");
$("#mainProduct").focus();
return false;
}
$.ajax({
url: "/vendor/update_process",
type: "put",
data: {
"id": id,
"managerId": managerId,
"name": name,
"presidentName": presidentName,
"address": address,
"registrationNumber": registrationNumber,
"email": email,
"presidentTelephone": presidentTelephone,
"vendorManager": vendorManager,
"vendorManagerTelephone": vendorManagerTelephone,
"mainProduct": mainProduct,
"activation" : activation
},
datatype: "json"
}).done(function (data) {
if (data == true) {
alert("거래처를 수정하였습니다.");
var form = document.createElement("form");
form.action = "/vendor/read";
form.method = "POST";
document.body.appendChild(form);
var input = document.createElement("input");
input.type = "hidden";
input.name = "id";
input.value = id;
form.appendChild(input);
form.submit();
} else {
alert("거래처 수정에 실패하였습니다.");
}
}).fail(function () {
alert("오류가 발생했습니다.");
}).always(function () {
//
});
});//updateBtn
$("#cancelBtn").on("click", function () {
var id = $("#id").val();
var form = document.createElement("form");
form.action = "/vendor/read";
form.method = "POST";
document.body.appendChild(form);
var input = document.createElement("input");
input.type = "hidden";
input.name = "id";
input.value = id;
form.appendChild(input);
form.submit();
})
});//ready
</script>
</body>
</html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>창고 정보 수정페이지</title>
<style>
.body {
text-align: center;
}
.col-centered {
margin: 0 auto;
float: none;
}
.col-margin-left-32 {
margin-left: 32%;
}
</style>
</head>
<body>
<div class="mt-5 mb-5 text-center">
<h1>창고 정보 수정페이지</h1>
</div>
<hr>
<div class="container" style="text-align: center">
<form id="createForm">
<div class="ulTag">
<div class="row">
<div class="col-12" style="text-align: center;">
<input type="hidden" id="id" value="${dto.id }">
<input type='hidden' id="manager_id" value="15b68e54-b0f0-11ee-935d-0242ac110006"/>
<input type='hidden' id="activation" value="1">
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon1">업체명</span>
<input type="text" name="name" id="name" class="form-control"
placeholder="업체명을 입력하세요" aria-label="업체명" value="${dto.name }"
aria-describedby="basic-addon1">
</div>
<!-- 설명만 있는 입력 -->
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon2">대표자명</span>
<input type="text" name="president_name" id="president_name" class="form-control"
placeholder="대표자명을 입력하세요" aria-label="대표자명" value="${dto.president_name }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon3">주소</span>
<input type="text" name="address" id="address" class="form-control"
placeholder="주소를 입력하세요" aria-label="주소" value="${dto.address }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon4">사업자등록번호</span>
<input type="text" name="registration_number" id="registration_number" class="form-control"
placeholder="사업자등록번호를 입력하세요" aria-label="사업자등록번호" value="${dto.registration_number }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon5">email</span>
<input type="text" name="email" id="email" class="form-control"
placeholder="Email주소를 입력하세요" aria-label="email" value="${dto.email }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon6">대표번호</span>
<input type="text" name="president_telephone" id="president_telephone" class="form-control"
placeholder="대표번호를 입력하세요" aria-label="대표번호" value="${dto.president_telephone }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon7">거래처 담당자 이름</span>
<input type="text" name="vendor_manager" id="vendor_manager" class="form-control"
placeholder="거래처 담당자 이름을 입력하세요" aria-label="거래처 담당자 이름" value="${dto.vendor_manager }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon8">거래처 담당자 연락 번호</span>
<input type="text" name="vendor_manager_telephone" id="vendor_manager_telephone" class="form-control"
placeholder="거래처 담당자 연락 번호를 입력하세요" aria-label="거래처 담당자 연락 번호" value="${dto.vendor_manager_telephone }"
aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3 w-40 col-centered">
<span class="input-group-text" id="basic-addon9">주요품목</span>
<input type="text" name="main_product" id="main_product" class="form-control"
placeholder="주요품목을 입력하세요" aria-label="주요품목" value="${dto.main_product }"
aria-describedby="basic-addon1">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12 ">
<div class="w-40 col-centered" style="text-align: right">
<button type="button" class="btn btn-primary" id="updateBtn">수정 완료</button>
<button type="button" class="btn btn-secondary" id="cancelBtn">취소</button>
</div>
</div>
</div>
</form>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function () {
$("#updateBtn").on("click", function () {
var id = $("#id").val();
var manager_id = $("#manager_id").val();
var name = $("#name").val();
var president_name = $("#president_name").val();
var address = $("#address").val();
var registration_number = $("#registration_number").val();
var email = $("#email").val();
var president_telephone = $("#president_telephone").val();
var vendor_manager = $("#vendor_manager").val();
var vendor_manager_telephone = $("#vendor_manager_telephone").val();
var main_product = $("#main_product").val();
var activation = $("#activation").val();
if (!name) {
alert("업체명을 입력해야 합니다.");
$("#name").focus();
return false;
}
if (!president_name) {
alert("대표자명을 입력해야 합니다.");
$("#president_name").focus();
return false;
}
if (!address) {
alert("주소를 입력해야 합니다.");
$("#address").focus();
return false;
}
if (!registration_number) {
alert("사업자등록번호를 입력해야 합니다.");
$("#registration_number").focus();
return false;
}
if (!email) {
alert("Email을 입력해야 합니다.");
$("#email").focus();
return false;
}
if (!president_telephone) {
alert("대표번호를 입력해야 합니다.");
$("#presidentTelephone").focus();
return false;
}
if (!vendor_manager) {
alert("거래처 담당자 이름을 입력해야 합니다.");
$("#vendor_manager").focus();
return false;
}
if (!vendor_manager_telephone) {
alert("거래처 담당자 연락 번호를 입력해야 합니다.");
$("#vendor_manager_telephone").focus();
return false;
}
if (!main_product) {
alert("주요품목을 입력해야 합니다.");
$("#main_product").focus();
return false;
}
$.ajax({
url: "/vendor/update_process",
type: "put",
data: {
"id": id,
"manager_id": manager_id,
"name": name,
"president_name": president_name,
"address": address,
"registration_number": registration_number,
"email": email,
"president_telephone": president_telephone,
"vendor_manager": vendor_manager,
"vendor_manager_telephone": vendor_manager_telephone,
"main_product": main_product,
"activation" : activation
},
datatype: "json"
}).done(function (data) {
if (data == true) {
alert("거래처를 수정하였습니다.");
var form = document.createElement("form");
form.action = "/vendor/read";
form.method = "POST";
document.body.appendChild(form);
var input = document.createElement("input");
input.type = "hidden";
input.name = "id";
input.value = id;
form.appendChild(input);
form.submit();
} else {
alert("거래처 수정에 실패하였습니다.");
}
}).fail(function () {
alert("오류가 발생했습니다.");
}).always(function () {
//
});
});//updateBtn
$("#cancelBtn").on("click", function () {
var id = $("#id").val();
var form = document.createElement("form");
form.action = "/vendor/read";
form.method = "POST";
document.body.appendChild(form);
var input = document.createElement("input");
input.type = "hidden";
input.name = "id";
input.value = id;
form.appendChild(input);
form.submit();
})
});//ready
</script>
</body>
</html>