File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="ec" uri="/WEB-INF/tld/ecnet_tld.tld"%>
<script src="/js/dragNdropToImgs.js"></script>
<script type="text/javascript">
$(function(){
$("#firstCatagoryList").on("change", function(){
$("#secondCatagoryList option").remove();
$("#thirdCatagoryList option").remove();
catagoryChange("2", $(this).val());
});
$("#secondCatagoryList").on("change", function(){
$("#thirdCatagoryList option").remove();
catagoryChange("3", $(this).val());
});
});
// 카테고리 선택 조회
function catagoryChange(depth, code){
var categoryDepth = depth;
var categoryCode = code;
$.ajax({
type: "POST"
, url: "/web/mjon/test/kakaoApiCategoryAjax.do"
, data:{ "categoryDepth":categoryDepth, "categoryCode" : categoryCode}
, dataType:'json'
, cache: false
, async: false
, timeout: 600000
, success: function (returnData, status) {
if(status == 'success'){
if(categoryDepth == '2'){
var list = returnData.selectCatagoryList;
$("#secondCatagoryList").append("<option value=''>중 메뉴</option>");
$("#thirdCatagoryList").append("<option value=''>소 메뉴</option>");
for(var i=0; i < list.length; i++){
$("#secondCatagoryList").append("<option value='"+list[i].categoryCode+"'>"+list[i].categoryName+"</option>");
}
}else if(categoryDepth == '3'){
var list = returnData.selectCatagoryList;
$("#thirdCatagoryList").append("<option value=''>소 메뉴</option>");
for(var i=0; i < list.length; i++){
$("#thirdCatagoryList").append("<option value='"+list[i].categoryCode+"'>"+list[i].categoryName+"</option>");
}
}
} else if(status== 'fail'){
alert("저장에 실패하였습니다. !!");
}
}
,error: function (e) {
console.log("ERROR : ", e);
alert("삭제처리에 실패하였습니다.");
}
});
}
function sandTest(){
var agent = $("select[name='selectAgentCode']").val();
var bizForm = document.bizForm;
bizForm.bizUrl.value = agent;
if("/v3/kakao/profile/token" == agent){
var yellowId = $("#inputyellowId").val();
var phoneNumber = $("#inputPhoneNumber").val();
yellowId = "@"+yellowId
bizForm.yellowId.value = yellowId;
bizForm.phoneNumber.value = phoneNumber;
}
var data = new FormData(bizForm);
$.ajax({
url : "<c:url value='/web/mjon/test/kakaoApiProfileTokenSendAjax.do'/>"
, type : 'POST'
, data : data
, dataType:'json'
, async: false
, processData: false
, contentType: false
, cache: false
, success: function (returnData, status) {
if(returnData.result == "success") {//차단 발신번호인 경우 등록 불가
alert(returnData.kakaoInfo.bizReturnMsg);
var test = JSON.parse(returnData.kakaoInfo.bizReturnMsg)
}
}
,error : function(request , status, error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
});
}
function linkPage(pageNo){
var listForm = document.listForm ;
listForm.pageIndex.value = pageNo ;
listForm.searchCondition.value = $('#searchCondition').val();
if($('#searchConditionSite').length != 0){
listForm.searchConditionSite.value = $('#searchConditionSite').val();
}
listForm.searchKeyword.value = $('#searchKeyword').val();
listForm.action = "/uss/umt/user/EgovGnrlUserManage.do";
listForm.submit();
}
// 첨부파일 등록 시작 ---------------
function selectAddFile(id){
$('#'+id).click();
}
// 첨부파일 등록
var _fileIdx = 0;
var _fileForm2 = new Array();
function tempFile(files){
var fd = new FormData();
fd.append('file', files[0]);
var tmpObj = new Object();
tmpObj.name = "file_" + _fileIdx;
tmpObj.fileObj = files[0];
_fileForm2.push(tmpObj);
tempFileInfo(files[0]);
_fileIdx++;
}
function tempFileInfo(fileObj){
$("#fileInfo").val(fileObj.name);
}
function sendKaKaoImage(){
var form = document.imgForm;
var atchFileSts = true; //첨부파일 갯수 상태 값
var data = new FormData(form);
_fileForm2.forEach(function(obj, idx) {
if (obj) data.append("file"+idx, obj.fileObj);
if(idx > 1){
atchFileSts = false;
return false;
}
});
//첨부파일 갯수가 1개가 넘어가는경우 실패처리
if(!atchFileSts){
alert("첨부파일은 1개만 등록 가능합니다.");
return false;
}
if(confirm("친구톡 이미지 등록을 하시겠습니까? 등록된 이미지는 변경이 불가 합니다.")){
$.ajax({
type : 'POST'
, enctype : 'multipart/form-data'
, url : "<c:url value='/web/mjon/test/sendKakaoImageUploadAjax.do'/>"
, data : data
, dataType:'json'
, async:false
, processData: false
, contentType: false
, cache : false
, success : function(returnData, status){
if(returnData.result == "success") {
var code = returnData.code;
var msg = returnData.msg;
var imgUrl = returnData.imgUrl;
if(code == "200"){//등록 성공시 메시지 및 이미지 표시 처리
alert("이미지 등록이 완료 되었습니다.");
$('.kakaoImgView').css("display", "block");
$("#kakaoImg").attr("src", imgUrl);
}else if(code == "2002"){//일반 이미지 가로 세로 크기 오류 발생
alert("이미지의 가로:세로 비율은 2:1 이상 또는 3:4 이하여야 합니다");
return false;
}else{
alert(msg);
return false;
}
}else if(returnData.result == "loginFail"){
location.href="/web/user/login/login.do";
}else{
alert("이미지 등록 중 오류가 발생하였습니다.!!!");
return;
}
}
,error : function(request , status, error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
});
}
}
// 첨부파일 등록 종료 ----------------------
</script>
<form id="bizForm" name="bizForm" method="post">
<input type="hidden" id="bizUrl" name="bizUrl" value="">
<input type="hidden" id="phoneNumber" name="phoneNumber" value="">
<input type="hidden" id="yellowId" name="yellowId" value="">
<input type="hidden" id="token" name="token" value="">
<input type="hidden" id="categoryCode" name="categoryCode" value="">
</form>
<!-- content 영역 -->
<div class="inner">
<!-- send top -->
<div class="send_top">
<!-- tab button -->
<ul class="tabType4">
<li class="tab"><button type="button" onclick="location.href='/web/mjon/test/selectSendCategoryView.do'">카카오톡 카테고리 등록</button></li>
<li class="tab"><button type="button" onclick="location.href='/web/mjon/test/selectSendTestView.do'">카카오톡 발신프로필 등록</button></li>
<li class="tab"><button type="button" onclick="location.href='/web/mjon/test/selectTemplateView.do'">카카오톡 템플릿 등록</button></li>
<li class="tab active"><button type="button" onclick="location.href='/web/mjon/test/selectKakaoImageView.do'">카카오톡 친구톡 이미지 등록</button></li>
<li class="tab"><button type="button" onclick="location.href='/web/mjon/test/kakaoApiNotityTalkView.do'">카카오톡 알림톡 전송</button></li>
<li class="tab"><button type="button" onclick="location.href='/web/mjon/test/kakaoApiNotityTalkViewWithExcel.do'">카카오톡 알림톡 엑셀 등록</button></li>
</ul>
<form id="imgForm" name="imgForm" method="multipart/form-data">
<!--// tab button -->
<div class="serv_content current" id="tab5_5">
<div class="heading">
<h2>카카오 친구톡 이미지 등록</h2>
</div>
<div class="pay_cont current" id="tab1_1">
<p class="tType1_title">카카오 친구톡 이미지 등록</p>
<table class="tType1">
<caption>카카오 친구톡 이미지 등록</caption>
<colgroup>
<col style="width: 190px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr class="autoY">
<th scope="row">
체널 ID
</th>
<td>
<label for="senderKey" class="채널ID 선택"></label>
<select class="list_selType1" id="senderKey" name="senderKey">
<option value="">채널ID 선택</option>
<c:forEach var="kakaoProfileInfo" items="${kakaoProfileList}" varStatus="status">
<option value="${kakaoProfileInfo.senderKey}"><c:out value='${kakaoProfileInfo.yellowId}'/></option>
</c:forEach>
</select>
</td>
</tr>
<tr class="autoY">
<th scope="row">
이미지 타입
</th>
<td>
<label for="imageType" class="이미지 타입 선택"></label>
<select class="list_selType1" id="imageType" name="imageType">
<option value="">이미지 타입 선택</option>
<option value="I">기본 이미지</option>
<option value="W">와이드 이미지</option>
</select>
</td>
</tr>
<tr class="autoY">
<th scope="row">
이미지 제목
</th>
<td>
<label for="imgTitle" class="label">이미지 제목</label>
<input type="text" name="imgTitle" id="imgTitle" value="">
</td>
</tr>
<tr class="autoY">
<th scope="row">이미지 링크 URL</th>
<td>
<input type="text" id="imgLink" name="imgLink" value="" />
</td>
</tr>
<tr id="upload">
<th scope="row">등록 이미지</th>
<td>
<ul class="file_content">
<li><span>!</span>기본 이미지 <br/> 파일규격 : JPG, JPEG, PNG 만 가능/ 용량 최대 500KB <br/>권장 사이즈 : 720px X 720px(가로 500px 미만, 가로:세로 비율이 2:1 미만 또는 3:4 초과 시 업로드 불가)</li>
<li><span>!</span>와이드 이미지 <br/> 파일규격 : JPG, JPEG, PNG 만 가능/ 용량 최대 2MB 사이즈 : 800px X 600px </li>
<li>
<div class="file_box">
<input type="file" name="file_temp" id="file_temp" accept=".png, .jpg, jpeg"/>
<label for="file_temp">파일첨부</label>
</div>
</li>
</ul>
<div class="upload_area">
<div class="no_img_box file_upload_box tb_wrap">
<table class="tType4">
<colgroup>
<col style="width:auto;">
<col style="width:135px;">
<col style="width:180px;">
<col style="width:65px;">
</colgroup>
<thead>
<tr>
<th>파일명</th>
<th>파일크기</th>
<th>등록일시</th>
<th>삭제</th>
</tr>
</thead>
</table>
</div>
<div class="file_list_div fileAfter tb_wrap">
<table class="tType4">
<colgroup>
<col style="width:auto;">
<col style="width:135px;">
<col style="width:180px;">
<col style="width:45px;">
</colgroup>
<thead>
<tr>
<th>파일명</th>
<th>파일크기</th>
<th>등록일시</th>
<th>삭제</th>
</tr>
</thead>
<tbody id="tbody_fiielist"></tbody>
</table>
<div class="file_info">총 <strong class="totalfileCount"></strong>개<span></span><strong class="totalfileSize"></strong></div>
</div>
</div>
</td>
</tr>
<tr class="autoY">
<th scope="row">업로드 완료 이미지</th>
<td>
<div class="kakaoImgView" style="display:none;">
<img src="" id="kakaoImg" style="width:20%;" />
</div>
</td>
</tr>
</tbody>
</table>
<div style="text-align: center;">
<button type="button" class="btnType btnType16" onclick="javascript:sendKaKaoImage();">등록</button>
</div>
</div>
</div>
</form>
</div>
<!--// send top -->
</div>
<!--// send top -->