REC604_PHATRA.jsp 9.74 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="com.csc.library.utilities.CheckNull,com.csc.library.mail.SendMail,com.csc.library.utilities.*"%>
<%@page import="com.csc.library.entry.*,com.csc.library.system.*,com.csc.library.utilities.*,com.csc.library.session.*,com.csc.library.report.*"%>
<%request.setCharacterEncoding("UTF-8");%>
<%
   CheckNull  chk = new CheckNull();
   String cmd = chk.chkNullString(request.getParameter("__cmd"));
   ThaiUtilities th = new ThaiUtilities();
   int result;
   if(cmd.equalsIgnoreCase("send")){
   		String from = chk.chkNullString(request.getParameter("__mail_from"));
		String to = chk.chkNullString(request.getParameter("__mail_to"));
		String cc = chk.chkNullString(request.getParameter("__mail_cc"));
		String subject = chk.chkNullString(request.getParameter("__mail_subject"));
		String message = "<PRE>"+chk.chkNullString(request.getParameter("__mail_message"))+"</PRE>";
		String applicantid = chk.chkNullString(request.getParameter("__applicantid"));
		SendMail mail = new SendMail( "", from, to, cc, subject, message);
		result = mail.send();
   }
  UProfile  UPro= (UProfile) session.getAttribute("userprofile"); 
  String Day = chk.chkNullString(request.getParameter("date"));
   //out.print(UPro.toString());
   //out.print(Day);
   CscCalendar calendar = new CscCalendar(Day);
   //calendar.setSign("#hjk");
  String dateemail = calendar.getEngLongMonth()+" "+calendar.getDD()+", "+calendar.getEngYYYY();

   


/*DbInquiry inqMcom = new InitialInquiry(this.getUProfile()).getDbInquiry("MAPPLICANT");
inqMcom.setSchemaName(screenSingle.getUProfile().getSchemaName());
inqMcom.setFilter("appcantid='"+applicantid+"'");
inqMcom.setColumn("*");*/

%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../CSS/TISCO.css" rel="stylesheet" type="text/css">
<script type='text/javascript' src='../JS/SCREEN.js'></script>
<script type='text/javascript' src='../JS/DATEINPUT.js'></script>
<script type='text/javascript' src='../JS/VIEWCALENDAR.js'></script>
<script type='text/javascript' src='../JS/ICONSMENU.js'></script>
<script language='javascript'>setLang('tha');</script>
<script language="javascript">getTitleName();</script>
<script language='javascript' src='../JS/HOTKEY.js'></script>
<script language="JavaScript" type="text/JavaScript">


function GoSave(){}
function GoUpdate(){}
function GoDelete(){}
function GoSearch(){}

function goHelp(helpName,inputName){
	var helpReturn;
	if(inputName=="__mail_from" )
		helpReturn="__mail_from:";

	linkHelp_Return(helpName,helpReturn);
	
}

function sendMail(){
	with(document.cscform){
		if (__mail_from.value == "" ) {
			alert("กรุณากรอกเมล์ผู้รับ");
			__mail_from.focus();
		} else if (__mail_to.value == "" ) {
			alert("กรุณากรอกเมล์ผู้ส่ง");
			__mail_to.focus();
		} else if (__mail_message.value == "") {
			alert("กรุณาใส่เนื้อหาในการส่งเมล์ครั้งนี้");
			__mail_message.focus();
		} else {
			__cmd.value = "send";
			submit();
		}
	}
}

function goBack(){
	close();
}


function sendMailComp() {
	alert("ส่งเมล์เรียบร้อยแล้ว");
	//window.close();
}

function template(type){
with(document.cscform){
	var text ="";
	if(type=="com"){ 
		text ="\n\n         This is a reminder that you have the interview session  on tomorrow";
	}else if(type == "app"){
		text="Dear "+aname.value+" \n\nFurther to our conversation on phone, I am pleased to confirm you an interview \nappointment with "+com_ename.value+" for the position of "+position.value+" on  "+date.value+" at "+time.value+" at\n"+place.value+"\nContacted person is  "+efullname.value+" HR Recruitment \nand please bring the document as below;\n\n- Copy of ID card,\n- Copy of Housing Registration,\n- Copy of สด.8 or สด.43 (Male Applicant only)\n- Copy of Transcript (Bachelor and Master Degree)\n- 1 Recent Photo\n- Copy of Certificate or other documents\n\nIf you have any questions or need more information, please don't hesitate to contact\nme.\n\nBest Regards,\n"+efullname.value+"\nHuman Resources - Recruitment\nPhatra Securities Public Company Limited\nTel. (02) 305-9249\nFax (02) 305-9511\nE-mail : "+email.value+"";
	}
	__mail_message.value=text;
	}
}
</script>
</head>
<body leftmargin="0" topmargin="0">
<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
<form name="cscform" method="post" action="REC604_PHATRA.jsp">
    <!----------BEGIN CSC INITIAL ZONE ------------------------>
    <%//=screen.InitialVariable()%>
    <!----------END CSC INITIAL ZONE -------------------------->
    <!---------------- HIDDEN FIELD ZONE ---------------------->
    <!-- All Use -->
    <input type="hidden" name="__screen" value="REC604">
    <input type="hidden" name="__cmd" value="">
    <input type="hidden" name="__help" value="">
    <input type="hidden" name="__goPage" value="">
    <input type="hidden" name="__orderBy" value="">
    <input type="hidden" name="__helpReturn" value="">
    <input type="hidden" name="__helpName" value="">
    <input type="hidden" name="__pageCall" value="">
    <input type="hidden" name="__fixCon" value="">
    <input type="hidden" name="__fixFilter" value="">
    <input type="hidden" name="__language" value="<%//=screen.getUProfile().get("lang")%>">
    <input type="hidden" name="__companyid" value="<%//=screen.getUProfile().get("companyid")%>">
    <input name="aname" type="hidden"  value="<%=th.ASCII2Unicode(request.getParameter("aname"))%>">   
    <input name="position" type="hidden"  value="<%=th.ASCII2Unicode(request.getParameter("position"))%>">    
    <input name="place" type="hidden"   value="<%=th.ASCII2Unicode(request.getParameter("place"))%>">   
    <input name="room" type="hidden"  value="<%=th.ASCII2Unicode(request.getParameter("room"))%>">  
    <input name="date" type="hidden" value="<%=dateemail%>">   
    <input name="time" type="hidden"  value="<%=th.ASCII2Unicode(request.getParameter("time"))%>">
	<input name="__applicantid" type="hidden" value="<%=request.getParameter("__applicantid")%>">
	<input name="com_ename" type="hidden" value="<%=UPro.get("com_ename")%>">
	<input name="efullname" type="hidden" value="<%=UPro.get("efullname")%>">
	<input name="email" type="hidden" value="<%=UPro.get("email")%>">
  
 
    <script language="javascript">getInputFormatDate();</script>
    <script language="javascript">initToolTips();</script>
    <br>
    <table width="814" height=""  border="0" align="center" cellpadding="0" cellspacing="0" class="large">
        <tr>
            <td  height="20" class="header">REC604,<script language="javascript">swapLang("Send Mail");</script>&nbsp;</td>
        </tr>
        <tr>
            <td class="blankspace"></td>
        </tr>
        <td><table align="center" border="0" cellpadding="0" cellspacing="0" class="largest">
                    <tr>
                        <td><table border="0" cellpadding="0" cellspacing="1" class="inframe">
                  <tr>
                                    <td width="150" nowrap class="columnlabel"><script language="javascript">swapLang("To ");</script>&nbsp;</td>
                                  <td width="717"><input name="__mail_to" type="text" size="80" maxlength="80" onkeypress = "chkNotThaiChaOnly()" value="<%=chk.chkNullString(request.getParameter("__mail_to"))%>"></td>
                                </tr>
                                <tr>
                                    <td nowrap class="columnlabel"><script language="javascript">swapLang("From");</script>&nbsp;</td>
                                  <td><input name="__mail_from" type="text" size="80" maxlength="80" onblur = "chkEmail(this)" onkeypress = "chkNotThaiChaOnly()" value="<%=chk.chkNullString(request.getParameter("__mail_from"))%>"></td>
                                </tr>
                                <tr>
                                    <td nowrap class="columnlabel"><script language="javascript">swapLang("Subject");</script>&nbsp;</td>
                                  <td><input name="__mail_subject" type="text" size="80" maxlength="80" value="<%= chk.chkNullString(request.getParameter("subject"),"นัดหมายสัมภาษณ์งาน")%>"></td>
                                </tr>
                                <tr>
								
                                    <td valign="top" nowrap class="columnlabel"><script language="javascript">swapLang("Message");</script>&nbsp;</td>
                                  <td><textarea name="__mail_message" cols="125" rows="20"><%= chk.chkNullString(request.getParameter("__mail_message"),"")%></textarea>
								 
                                  <script language="javascript">//template('<%//=chk.chkNullString(request.getParameter("type"))%>');</script></td>
                          </tr>
                      </table></td>
                    </tr>
                </table></td>
        </tr>
        <tr>
            <td class="blankspace">&nbsp;</td>
        </tr>
        <tr>
            <td class="blankspace">
            <div align="center" >
            <a href="javascript:sendMail();"><img src="../IMAGES/BUTTON/SEND.gif" border="0"></a>&nbsp;&nbsp;
            <a href="javascript:goBack();"><img src="../IMAGES/BUTTON/BACK.gif" border="0"></a>           </div>          </td>
        </tr>
        <tr>
            <td class="blankspace"></td>
        </tr>
        <td height="28" class="bottom"></td>
        </tr>
    </table>
<%
		if (request.getParameter("__cmd") != null && request.getParameter("__cmd").equals("send")) {
%>
			<script language="javascript">sendMailComp()</script>
<%
		}else{
%>
			<script language="javascript">template('<%=chk.chkNullString(request.getParameter("type"))%>');</script>
<%		}%>
</form>
</body>
</html>