c-innovacion2/resoft/field_manager/process/menu/edit.jsp

161 lines
6.9 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/field_manager/include/manager_head.jsp"%>
<script src="/ckeditor/ckeditor.js"></script>
<%
String c_home = r_call(request.getParameter("c_home"));
String c_maker = r_call(request.getParameter("c_maker"));
String c_up_no = r_call(request.getParameter("c_up_no"));
String c_no = r_call(request.getParameter("c_no"));
if(c_up_no.equals("")){
%>
<script>
alert("Wrong Connection")
</script>
<%
}else{
String up_name = "";
String sql = "select c_name from tbl_menu where c_no = " + c_up_no + "";
ResultSet rs = stmt.executeQuery(sql);
if(rs.next()){
up_name = rs.getString("c_name");
}
rs.close();
sql = "select * from tbl_menu where c_no = " + c_no + "";
rs = stmt.executeQuery(sql);
if(rs.next()){
%>
<script>
var IMG_FORMAT = "\\.(bmp|gif|jpg|jpeg|png|hwp|doc|docx|xls|xlsx|ppt|pptx|txt|zip|)$";
function go(){
if(document.kku.c_name.value==""){
alert("Please enter the menu name")
}else{
document.kku.action = "edit_ok.jsp?c_home=<%=c_home%>&c_maker=<%=c_maker%>";
document.kku.submit();
}
}
function chk(flag){
if(flag ==0 ){
document.getElementById("ct").innerHTML = "Up Menu "
}
if(flag ==1 ){
document.getElementById("ct").innerHTML = "Contents File"
}
if(flag ==2 ){
document.getElementById("ct").innerHTML = "Process Kind"
}
if(flag ==3 ){
document.getElementById("ct").innerHTML = "Inner LINK"
}
if(flag ==4 ){
document.getElementById("ct").innerHTML = "Outer LINK"
}
if(flag ==5 ){
document.getElementById("ct").innerHTML = "Direct input"
}
document.getElementById("ct0").style.display = "none"
document.getElementById("ct1").style.display = "none"
document.getElementById("ct3").style.display = "none"
document.getElementById("ct4").style.display = "none"
document.getElementById("ct5").style.display = "none"
document.getElementById("ct2").style.display = "none"
document.getElementById("ct"+flag).style.display = "block"
}
</script>
<center>
<br /><br /><br />
<table width="1000" border="0" cellspacing="1" bgcolor=cdcdcd cellpadding="0" class="tabRsv3">
<form name="kku" method="post" encType="multipart/form-data">
<input name="c_up_no" value="<%=c_up_no%>" type="hidden">
<input name="c_no" value="<%=c_no%>" type="hidden">
<tr bgcolor=ffffff>
<td height=30 bgcolor=ededed width=15% style="text-align:center"> Upper menu </td>
<td width=85% style="padding-left:5px"> <%=up_name%> </td>
</tr>
<tr bgcolor=ffffff>
<td height=30 bgcolor=ededed style="text-align:center"> Name </td>
<td style="padding-left:5px"> <input type="text" name="c_name" id="" style="width:258px" value="<%=rs.getString("c_name")%>"/> </td>
</tr>
<tr bgcolor=ffffff>
<td height=30 bgcolor=ededed style="text-align:center"> Type </td>
<td style="padding-left:5px">
<input type="radio" name="c_type" value="0" onclick="chk(0)" <%if(rs.getInt("c_type")==0){%>checked<%}%>>UP Menu
&nbsp;&nbsp;
<input type="radio" name="c_type" value="1" onclick="chk(1)" <%if(rs.getInt("c_type")==1){%>checked<%}%>>Contents File
&nbsp;&nbsp;
<input type="radio" name="c_type" value="5" onclick="chk(5)" <%if(rs.getInt("c_type")==5){%>checked<%}%>>Contents(Direct)
&nbsp;&nbsp;
<input type="radio" name="c_type" value="2" onclick="chk(2)" <%if(rs.getInt("c_type")==2){%>checked<%}%>>Process
&nbsp;&nbsp;
<input type="radio" name="c_type" value="3" onclick="chk(3)" <%if(rs.getInt("c_type")==3){%>checked<%}%>>Inner Link
&nbsp;&nbsp;
<input type="radio" name="c_type" value="4" onclick="chk(4)" <%if(rs.getInt("c_type")==4){%>checked<%}%>>Outer Link
</td>
</tr>
<tr bgcolor=ffffff>
<td height=30 bgcolor=ededed style="text-align:center"> <div id="ct">Contents File</div> </td>
<td style="padding-left:5px">
<div id="ct0" style="display:none">
* In the case of Up Menu, be sure to create a sub-menu.
</div>
<div id="ct1">
<%if(rs.getInt("c_type")==1){%>
<input name="old_file" value="<%if(rs.getString("c_content") != null){%><%=rs.getString("c_content")%><%}%>" type="hidden">
Now file : <%=rs.getString("c_content")%><br>Change :
<%}%>
<input name="c_content1" type="file" id="" style="width:400px;height:30px" />
<br>* jsp file, using English file name, Char. You need to put the type utf-8 at the top.
</div>
<div id="ct2" style="display:none">
<select name="c_content2">
<option value="notice" <%if(rs.getString("c_content") != null){%><%if(rs.getString("c_content").equals("notice")){%>selected<%}%><%}%>>General bulletin board (notice, news, etc.)</option>
<option value="board" <%if(rs.getString("c_content") != null){%><%if(rs.getString("c_content").equals("board")){%>selected<%}%><%}%>>Archives (file download, etc.)</option>
<option value="photo" <%if(rs.getString("c_content") != null){%><%if(rs.getString("c_content").equals("photo")){%>selected<%}%><%}%>>Photo Gallery (Photos, etc.)</option>
<option value="faq" <%if(rs.getString("c_content") != null){%><%if(rs.getString("c_content").equals("faq")){%>selected<%}%><%}%>>FAQ Board</option>
</select>
</div>
<div id="ct3" style="display:none">
<input type="text" name="c_content3" id="" style="width:500px" value="<%if(rs.getInt("c_type")==3){%><%if(rs.getString("c_content") != null){%><%=rs.getString("c_content")%><%}%><%}%>"/>
</div>
<div id="ct4" style="display:none">
<input type="text" name="c_content4" id="" style="width:500px" value="<%if(rs.getInt("c_type")==4){%><%if(rs.getString("c_content") != null){%><%=rs.getString("c_content")%><%}%><%}%>"/>
<br>* Be sure to include http://.
</div>
<div id="ct5" style="display:none">
<textarea name="c_content5" class="ckeditor" id="" style="width:800px;height:400px"><%if(rs.getInt("c_type")==5){%><%if(rs.getString("c_content") != null){%><%=rs.getString("c_content")%><%}%><%}%></textarea>
</div>
</td>
</tr>
<script>
chk(<%=rs.getInt("c_type")%>)
</script>
<tr bgcolor=ffffff>
<td height=30 bgcolor=ededed style="text-align:center">Whether or not to use </td>
<td style="padding-left:5px">
Please correct the usage in the list right away..
</td>
</tr>
</table>
<table width="100%">
<tr bgcolor=ffffff>
<td height="35" align="center" colspan="5" style="padding-bottom:10px;padding-top:10px">
<a href="#none" onclick="go()" style="width: 98px; line-height: 30px; text-align: center;display: inline-block; background: #5e7cc4; border: 1px solid #555; border-radius: 5px; color: #ffffff;">Menu Edit</a>
<a href="list.jsp?c_home=<%=c_home%>&c_maker=<%=c_maker%>" style="width: 98px; line-height: 30px; text-align: center;display: inline-block; background: #ededed; border: 1px solid #555; border-radius: 5px; color: #000000;">Cancel</a>
</td>
</tr>
</table>
<%
}
rs.close();
}
%>
<%@ include file="/field_manager/include/manager_bottom.jsp"%>