You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
19 KiB
1 lines
19 KiB
<%@ page import="kr.co.kihyun.mail.getMailid"%>
<%@ page language="java" contentType="text/html;charset=EUC-KR" %>
<%@ page import="javax.rmi.*"%>
<%@ page import="javax.naming.*"%>
<%@ page
import="java.net.URLEncoder"
import="java.util.Date"
import="java.util.List"
import="java.util.Set"
import="java.util.Map"
import="java.util.HashMap"
import="java.text.SimpleDateFormat"
import="javax.jdo.Query"
import="javax.jdo.PersistenceManager"
import="javax.jdo.Transaction"
import="kr.co.kihyun.beans.entity.TotDocType"
import="kr.co.kihyun.beans.user.Dept"
import="kr.co.kihyun.beans.entity.util.QueryImpl"
import="kr.co.kihyun.beans.user.HttpSSOLogin"
import="kr.co.kihyun.db.DBUtil"
import="kr.co.kihyun.util.MDate"
import="kr.co.kihyun.lang.Encoder"
import="kr.co.kihyun.lang.MInteger"
import="kr.co.kihyun.lang.MString"
import="kr.co.kihyun.moumi.Moumi"
import="kr.co.kihyun.moumi.doc.MDoc"
import="kr.co.kihyun.moumi.report.MReport"
import="kr.co.kihyun.beans.totsys.doc.Doc"
import="kr.co.kihyun.beans.totsys.report.Report"
import="kr.co.kihyun.beans.totsys.repoper.RepoPerDocList"
import="kr.co.kihyun.beans.entity.util.*"
import="kr.co.kihyun.beans.entity.*"
import="org.slf4j.Logger"
import="org.slf4j.LoggerFactory"
import="kr.co.kihyun.beans.user.User"
%>
<%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%>
<%! static final String DEFAULT_MAIL_TITLE;
static final String DEFAULT_MAIL_CONTENT;
static {
DEFAULT_MAIL_TITLE = "자료취합양식에 대한 제출을 요청합니다.";
DEFAULT_MAIL_CONTENT = "수신된 자료취합 문서를 확인하시고 제출을 요청합니다. .";
}
%>
<% PersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager());
Transaction tx = pm.currentTransaction();
String usID = HttpSSOLogin.getLoginID(request);
int sysAuth = HttpSSOLogin.getSysAuth(request);
String dpID = HttpSSOLogin.getDeptID(request);
String docID = request.getParameter("docID");
String rptID = request.getParameter("rptID");
System.out.println(":::sysAuth " + sysAuth + ":::usID:::" + usID + ":::dpID::" + dpID + "::::docID:::" + docID + "::::rptID:::" + rptID);
//String usID = request.getParameter("usID");
//String dpID = request.getParameter("dpID");
Date today = new Date();
//SimpleDateFormat dateForm=new SimpleDateFormat("yyyy년 MM월 dd일 hh시 mm분 ss초");
SimpleDateFormat dateForm = new SimpleDateFormat("yyyy년 MM월 dd일");
System.out.println(dateForm.format(today));
String[] DEPTNAME;
String[] NAME;
String[] EMPCODE;
String[] ID;
String[] DEPTID;
String USERID;
String EMP_CODE;
int tcount;
getMailid gmt = new getMailid();
gmt.getEmpCode(usID, dpID);
EMP_CODE = gmt.getEmp_Code();
gmt.getUserId(dpID, docID);
USERID = gmt.getUserId();
//System.out.println(":::USERID:::::::"+USERID+":::EMP_CODE::::"+EMP_CODE);
//USERID = USERID.replace(" ","");
gmt.getEmailIdList(docID, dpID, rptID);
DEPTNAME = gmt.getDeptName();
NAME = gmt.getName();
EMPCODE = gmt.getEmpCode();
ID = gmt.getID();
DEPTID = gmt.getDeptId();
tcount = gmt.getTcount();
int count = 0;
int endPage = 0;
int pageSize = 0;
int currentPage = 0;
int absolutePage = 0;
int currentPageSetUp = 0;
int recordSize = 0;
System.out.println("tcount갯수:::::" + tcount);
if (tcount == 0) {
recordSize = 1;
} else {
recordSize = tcount;
}
currentPage = 1;
if ((tcount % recordSize) == 0) {
pageSize = (int) (tcount / recordSize);
} else {
pageSize = (int) (tcount / recordSize) + 1;
}
currentPageSetUp = (int) (currentPage / 10) * 10;
if (currentPage % 10 == 0) {
currentPageSetUp -= 10;
}
Date nowDate = new Date();
%>
<html>
<head>
<title>독촉메일 보내기</title>
<link href="/totsys/common/css/SpongeBasicEx.css" rel="stylesheet" type="text/css">
<script language="javascript">
function windowClose() {
if (confirm("메일 쓰기를 종료하시겠습니까?"))
window.close();
}
function sendMail() {
if (document.getElementById("receiveID")) {
var form = document.frmSendMail;
var tmpI = form.receiveID.length;
if (tmpI > 0) {
sendMailAll();
} else {
sendMailAlone();
}
} else {
alert("독촉메일을 발송할 수신처가 존재하지 않습니다!");
return;
}
}
function sendMailAll() {
var strUserSpecId = "";
var strUserSpecIdName = "";
var form = document.frmSendMail;
form.strUserSpecId.vlaue = ""; // 초기화
form.strUserSpecIdName.value = "";
if (document.getElementById("receiveID")) {
for (var i = 0; i < form.receiveID.length; i++) {
if (form.receiveID[i].checked) {
strUserSpecId += form.receiveID[i].value + ";";
strUserSpecIdName += form.receiveID[i].getAttribute("receiveName") + ";";
}
}
if (strUserSpecId.length > 0) {
strUserSpecId = strUserSpecId.substring(0, strUserSpecId.length - 1);
}
if (strUserSpecIdName.length > 0) {
strUserSpecIdName = strUserSpecIdName.substring(0, strUserSpecIdName.length - 1);
}
form.strUserSpecId.value = strUserSpecId;
form.strUserSpecIdName.value = strUserSpecIdName;
} else {
alert("독촉메일을 발송할 수신처가 존재하지 않습니다!");
return;
}
if (form.title.value == "") {
alert("편지제목을 입력하십시오.");
form.title.focus();
chkFlag = 0;
return;
}
if (form.strUserSpecId.value.length == "" || form.strUserSpecIdName.value.length == "") {
alert("수신처를 선택하십시오.");
chkFlag = 0;
return;
}
if (form.content.value.length == "") {
alert("메일 내용를 입력하십시오.");
chkFlag = 0;
return;
}
if(confirm("모든 수신자에게 독촉 메일을 보내시겠습니까?")){
form.target = "sendMailCheck";
form.submit();
alert("메일을 전송하였습니다.");
self.close();
}
/*alert( form.strUserSpecId.value );
alert( form.strUserSpecIdName.value );*/
}
function sendMailAlone() {
var strUserSpecId = "";
var strUserSpecIdName = "";
var form = document.frmSendMail;
form.strUserSpecId.vlaue = ""; // 초기화
form.strUserSpecIdName.value = "";
if (document.getElementById("receiveID")) {
if (form.receiveID.checked) {
strUserSpecId = form.receiveID.value;
strUserSpecIdName = form.receiveID.getAttribute("receiveName");
}
if (strUserSpecId.length > 0) {
strUserSpecId = strUserSpecId.substring(0, strUserSpecId.length);
}
if (strUserSpecIdName.length > 0) {
strUserSpecIdName = strUserSpecIdName.substring(0, strUserSpecIdName.length);
}
form.strUserSpecId.value = strUserSpecId;
form.strUserSpecIdName.value = strUserSpecIdName;
} else {
alert("독촉메일을 발송할 수신처가 존재하지 않습니다!");
return;
}
if (form.title.value == "") {
alert("편지제목을 입력하십시오.");
form.title.focus();
chkFlag = 0;
return;
}
if (form.strUserSpecId.value.length == "" || form.strUserSpecIdName.value.length == "") {
alert("수신처를 선택하십시오.");
chkFlag = 0;
return;
}
if (form.content.value.length == "") {
alert("메일 내용를 입력하십시오.");
chkFlag = 0;
return;
}
if(confirm("선택하신 수신자에게 독촉 메일을 보내시겠습니까?")){
form.target = "sendMailCheck";
form.submit();
alert("메일을 전송하였습니다.");
self.close();
}
/*alert( form.strUserSpecId.value );
alert( form.strUserSpecIdName.value );*/
}
function allCheck(obj) {
var rcvID = document.frmSendMail.receiveID;
if (rcvID) {
if (rcvID.length) {
var checkF = obj.checked;
for (var i = 0; i < rcvID.length; i++) {
rcvID[ i ].checked = checkF;
}
} else {
rcvID.checked = obj.checked;
}
}
}
</script>
</head>
<body>
<!--<form name="frmSendMail" method="post" action="http://192.168.1.28/mail/admReportSend.jsp">-->
<form name="frmSendMail" method="post" action="http://gw.kohom.co.kr//sign/onAudit/onAuditToMail.jsp">
<input type="hidden" name="user_name" value="<%=new User().getName(usID)%>">
<input type="hidden" name="sendID" value="<%=EMP_CODE%>"><!--//MUSER 테이블의 사원코드//-->
<input type="hidden" name="strUserSpecId" value="">
<input type="hidden" name="strUserSpecIdName" value="">
<input type="hidden" name="title" value="<%=URLEncoder.encode(DEFAULT_MAIL_TITLE, "UTF-8")%>">
<input type="hidden" name="contents" value="<%=URLEncoder.encode(DEFAULT_MAIL_CONTENT, "UTF-8")%>">
<table border="0" width="480" cellpadding="0" cellspacing="0" align="center">
<tr valign="middle">
<td align="right">
<a href="javascript:sendMail()" onMouseOver="window.status = '편지보내기';
return true;">
<strong><font color="#000000"><img src="/totsys/common/images/B_SEND.gif" alt="편지보내기" border="0"></font></strong></a>
<a href="javascript:windowClose();" onMouseOver="window.status = '종료';
return true;">
<strong><font color="#000000"><img src="/totsys/common/images/EXIT.gif" alt="종료" border="0"></font></strong></a>
</td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td height="2">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="2" bgcolor="#4883AD"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" width="480" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" width="100%" cellpadding="2" cellspacing="1" bgcolor="#D1DFE3">
<tr height="24">
<td bgcolor="#F1F9FB" align="center" nowrap><b><font face=굴림 size='2'>제 목</font></b></td>
<td colspan="3" bgcolor="#FFFFFF">
<input type=text name="title" size="70" style="width:100%" maxlength="100" value="<%= DEFAULT_MAIL_TITLE%>">
</td>
</tr>
<tr height="24">
<td bgcolor="#F1F9FB" align="center" nowrap><b><font face=굴림 size='2'>보 낸 이</font></b></td>
<td bgcolor="#FFFFFF" nowrap> <font face=굴림 size='2'><%=new User().getName(usID)%>(<%=usID%>)</font></td>
<td bgcolor="#F1F9FB" align="center" nowrap><b><font face=굴림 size='2'>날 짜</font></b></td>
<td bgcolor="#FFFFFF" nowrap> <font face=굴림 size='2'><%=dateForm.format(today)%></font></td>
</tr>
<tr>
<td bgcolor="#F1F9FB" align="center" nowrap><b><font face=굴림 size='2'>받 는 이</font></b></td>
<td colspan="3" bgcolor="#FFFFFF">
<table border="0" width="400" cellpadding="3" cellspacing="1" bgcolor="#7D7878">
<tr align="center">
<td width="50%" bgcolor="#F3F3F3"><b><font face=굴림 size='2'>부서명</font></b></td>
<td width="30%" bgcolor="#F3F3F3"><b><font face=굴림 size='2'>이름</font></b></td>
<td width="20%" bgcolor="#F3F3F3"><input type="checkbox" name="chkAll" value="allcheck" onclick="javascript:allCheck(this);
this.blur();" checked> <b><font face=굴림 size='2'>선택</font></b></td>
</tr>
</table>
<div style="width: 100%; height: 175px; overflow: auto;">
<table border="0" width="400" cellpadding="2" cellspacing="1" bgcolor="#7D7878">
<tr height="1">
<td width="50%"></td>
<td width="30%"></td>
<td width="20%"></td>
</tr>
<tr>
<%
int index = 0; //배열에서 값을 꺼내오는 키값
int nextCount = 0; //
if (currentPage > 1) {
nextCount = ((currentPage - 1) * recordSize);
}
for (int i = 0; (i < recordSize) && ((nextCount + i) < tcount); i++) {
index = nextCount + i;
%>
<%if (tcount > 0) {%>
<tr>
<td bgcolor="#FFFFFF"><font face=굴림 size='2'><%= DEPTNAME[index]%></font> </td>
<td bgcolor="#FFFFFF"><font face=굴림 size='2'><%=NAME[index]%></font> </td>
<td align="center" bgcolor="#FFFFFF">
<input type="checkbox" name="receiveID" value="<%=EMPCODE[index]%>" receiveName="<%=NAME[index]%>" onclick="this.blur();" checked>
</td>
</tr>
<%} else if (tcount <= 0) {%>
<tr>
<td height="167" colspan="3" align="center" valign="middle" bgcolor="#FFFFFF">
<font face=굴림 size='2'>메일을 발송할 미처리부서가 존재하지 않습니다.</font>
</td>
</tr>
<%}%>
<%}%>
</table>
</td>
</tr>
<tr>
<td colspan="4" bgcolor="#FFFFFF">
<br>
<font face=굴림 size='2'>
<textarea width="100%" name="content" style="font-size: 10pt; height: 260; width: 100%" wrap="physical"><%=DEFAULT_MAIL_CONTENT%>
</textarea>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<iframe name="sendMailCheck" width="100%" height="100%" style="display:none"></iframe>
</body>
</html> |