c-innovacion2/resoft/cms_for_bcb/process/board/insert.jsp

182 lines
6.1 KiB
Plaintext

<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="/include/include.jsp"%>
<%@include file="/include/head.jsp"%>
<%@include file="/cms_for_bcb/show_top.jsp"%>
<select id="language_select" onchange="setLanguage(this.value)">
<option value="en" <%= (request.getLocale().toString().equals("en") ? "selected" : "") %>>English</option>
<option value="es_PE" <%= (request.getLocale().toString().equals("es_PE") ? "selected" : "") %>>Spanish (Peru)</option>
</select>
</p>
<%
if(session.getAttribute("member_type").equals("1") || session.getAttribute("member_type").equals("2") || session.getAttribute("member_type").equals("3") ){
%>
<script>
function go(){
if(document.bcb.c_title.value == ""){
alert("Insert Title.")
document.bcb.c_title.focus()
}else if(document.bcb.c_content.value == ""){
alert("Insert Content.")
document.bcb.c_content.focus()
}else{
document.bcb.method = "post"
document.bcb.target = "exec"
document.bcb.action = "insert_ok.jsp?<%=para_t%>"
document.bcb.submit()
}
}
function check_check(){
if(document.bcb.c_type_0.checked == true){
for(i = 0; i < document.bcb.c_team.length; i = i +1){
document.bcb.c_team[i].checked = true;
}
}else{
for(i = 0; i < document.bcb.c_team.length; i = i +1){
document.bcb.c_team[i].checked = false;
}
}
}
function check_check2(){
check_no = 0
for(i = 0; i < document.bcb.c_team.length; i = i +1){
if(document.bcb.c_team[i].checked == false){
check_no = 1
}
}
if(check_no == 0){
document.bcb.c_type_0.checked = true
}else{
document.bcb.c_type_0.checked = false
}
}
</script>
<form name="bcb" encType="multipart/form-data">
<div class="row">
<div class="col-lg-12 col-md-12" style=" padding:0px 15px;">
<div class="col-lg-12 col-md-12" style="border-bottom: 1px solid #ccc; padding:10px ">
<label for="inputField" style="display: inline-block; margin-right: 10px;" id="a1">Title :</label>
<input name="c_title" style="width: calc(100% - 80px); height: 30px; box-sizing: border-box;" placeholder="Title.">
<!-- <input name="c_title" style="width:100%;height:30px," placeholder="Title.">-->
</div>
<div class="col-lg-12 col-md-12" style="border-bottom: 1px solid #ccc; padding:10px ">
<span id="a2">Name : <%=session.getAttribute("member_name")%>
<input name="c_name" value="<%=session.getAttribute("member_name")%>" type="hidden">
</div>
<div class="col-lg-12 col-md-12" style="border-bottom: 1px solid #ccc; padding:10px ">
<div class="col-lg-3 col-md-6" >
<b id="a3">To.</b><br>
<input name="c_type_0" value="y" type="checkbox" checked onclick="check_check()"><span id="a4"> All Members of Teams</span><br />
<input name="c_type_1" value="y" type="checkbox" checked> <span id="a5">All Instructors</span> <br />
<input name="c_type_2" value="y" type="checkbox" checked> <span id="a6">All Mentors </span> <br />
<input name="c_type_3" value="y" type="checkbox" checked onclick="return false" ><span id="a7"> All Observers</span> <br />
</div>
<div class="col-lg-9 col-md-6" >
&nbsp;<br>
<%String sql1 = " select c_no, c_team_name from tbl_team where c_use = 0 and c_project_no = " + session.getAttribute("member_project_no") + " order by c_team_name asc";
ResultSet rst = stmt.executeQuery(sql1);
while (rst.next()) {
%>
<nobr><input name="c_team" value="<%=rst.getInt("c_no")%>" checked type="checkbox" onclick="check_check2()"><span id="a8"> Members in team </span>[<%=rst.getString("c_team_name")%>] &nbsp;&nbsp;</nobr>
<%}
rst.close();
%>
</div>
</div>
<div class="col-lg-12 col-md-12" style="border-bottom: 1px solid #ccc; padding:10px ">
<textarea name="c_content" style="width:100%;height:200px"></textarea>
</div>
<div class="col-lg-12 col-md-12" style="border-bottom: 1px solid #ccc; padding:10px ">
<input name="c_file" type="file" style="width:100%;height:30px" placeholder="Choose File.">
</div>
</div>
</div>
<div class="col-lg-12 col-md-12" style="text-align:center;padding-top:20px">
<a href="#none" onclick="go()" style="width: 80px; line-height: 40px; text-align: center;display: inline-block; background: #5E9ECA; border: 1px solid #ffffff;border-radius: 20px; color: #ffffff;font-weight:400;font-size: 13px;"><span id="a9">Insert</span></a>
<a href="list.jsp?<%=para_t%>" style="width: 80px; line-height: 40px; text-align: center;display: inline-block; background: #787878; border: 1px solid #ffffff; border-radius: 20px; color: #ffffff;font-weight:400;font-size: 13px;"><span id="a10">Cancel</span></a>
</div>
</form>
<%
}else{
%>
<script>
alert("You do not have permission.")
location.href="/"
</script>
<%}%>
<script>
// 다국어 처리를 위한 i18n 객체
var i18n = {
en: {
a1: "Title :",
a2: " Name :",
a3: "To.",
a4: " All Members of Teams",
a5: " All Instructors",
a6: " All Mentors",
a7: " All Observers",
a8: " Members in team",
a9: "Insert",
a10: "Cancel"
},
es_PE: {
a1: "Título:",
a2: "Nombre:",
a3: "A.",
a4: " Todos los miembros de los equipos",
a5: " Todos los instructores",
a6: " Todos los mentores",
a7: " Todos los observadores",
a8: " Miembros del equipo",
a9: "Insertar",
a10: "Cancelar"
}
};
// 선택된 언어에 따라 다국어 텍스트 설정
function setLanguage(lang) {
var langData = i18n[lang];
document.getElementById("a1").innerText = langData.a1;
document.getElementById("a2").innerText = langData.a2;
document.getElementById("a3").innerText = langData.a3;
document.getElementById("a4").innerText = langData.a4;
document.getElementById("a5").innerText = langData.a5;
document.getElementById("a6").innerText = langData.a6;
document.getElementById("a7").innerText = langData.a7;
document.getElementById("a8").innerText = langData.a8;
document.getElementById("a9").innerText = langData.a9;
document.getElementById("a10").innerText = langData.a10;
}
</script>
<script>
setLanguage('<%= request.getLocale().toString() %>');
</script>
<%@include file="/cms_for_bcb/show_bottom.jsp"%>
<%@include file="/include/bottom.jsp"%>
<%@include file="/include/include_b.jsp"%>