c-innovacion2/apply/cms_for_bcb/process/community/edit_board.jsp

153 lines
6.1 KiB
Plaintext

<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%request.setCharacterEncoding("utf-8");%>
<%@include file="/include/include.jsp"%>
<%
login_tag = 1;
%>
<%@include file="/include/head.jsp"%>
<%@include file="/cms_for_bcb/show_top.jsp"%>
<%
String para_t = "show_no="+ show_no +"&check_no="+ check_no + "&c_relation=" + c_relation + "&c_relation2=" + c_relation2;
String c_no = r_call(request.getParameter("c_no"));
String c_board_no = r_call(request.getParameter("c_board_no"));
if(!c_board_no.equals("")){
%>
<script>
function go(){
if(document.ss.c_name.value == ""){
alert("Insertar nombre de tablero")
document.ss.c_name.focus()
}else{
document.ss.action = "edit_board_ok.jsp?<%=para_t%>"
document.ss.method = "post"
document.ss.target = "exec"
document.ss.submit()
}
}
</script>
<form name="ss">
<input name="c_home" value="<%=c_home%>" type="hidden">
<input name="c_no" value="<%=c_no%>" type="hidden">
<input name="c_board_no" value="<%=c_board_no%>" type="hidden">
<div class="row">
<%
String sql_c = "select a.* , b.c_name as m_name, b.c_id as m_id ";
sql_c = sql_c + ", (select count(c_no) as m_number from tbl_community_member where c_community_no = a.c_no and c_use = 0 and c_now in (0,1) ) as m_number ";
sql_c = sql_c + " from tbl_community a ";
sql_c = sql_c + " inner join tbl_member b on b.c_no = a.c_member_no ";
sql_c = sql_c + " where a.c_no = "+ c_no +" and a.c_use = 0 and a.c_home = "+ c_home +" and c_member_no = "+ session.getAttribute("member_no") +" ";
ResultSet rs_c = stmt.executeQuery(sql_c);
if (rs_c.next()) {
%>
<div class="col-lg-12 col-md-12 col-sm-12" style="">
<div style="padding-bottom:10px">
<b>◎ Community information</b>
</div>
<div class="col-lg-12 col-md-12 col-sm-12" style="border:1px solid #cdcdcd;padding:10px;padding-left:20px;padding-right:20px">
<table style="width:100%">
<tr><td style="width:10%;text-align:right;height:30px;padding-right:10px">
Name
</td><td style="width:90%;text-align:left;padding-left:10px;background:#efefef">
<b><%=rs_c.getString("c_name")%></b>
</td></tr>
<tr><td style="text-align:right;height:30px;padding-right:10px">
Target
</td><td style="\text-align:left;padding-left:10px;background:#efefef">
<b><%=rs_c.getString("c_target")%></b>
</td></tr>
<tr><td style="text-align:right;height:30px;padding-right:10px">
Date
</td><td style="\text-align:left;padding-left:10px;background:#efefef">
<b><%=rs_c.getString("c_date").substring(0,10)%></b>
</td></tr>
<tr><td style="text-align:right;height:30px;padding-right:10px">
Master
</td><td style="\text-align:left;padding-left:10px;background:#efefef">
<b><%=rs_c.getString("m_name")%></b> / <%=rs_c.getString("m_id")%>
</td></tr>
<tr><td colspan=2 style="text-align:right;height:10px;padding-right:10px">
</td></tr>
<tr><td colspan=2 style="text-align:left;padding:20px;background:#efefef">
<%=rs_c.getString("c_exp").replaceAll("\n","<br />")%>
</td></tr>
</table>
</div>
</div>
<div class="col-lg-12 col-md-12 col-sm-12" style="padding-top:30px">
<div style="padding-bottom:10px">
<b>◎ Edit Community Board</b>
</div>
<div class="col-lg-12 col-md-12 col-sm-12" style="border:1px solid #cdcdcd;padding:10px;padding-left:20px;padding-right:20px">
<%
String sql_b = "select * from tbl_community_board where c_no = "+ c_board_no +" and c_community_no = " + c_no;
ResultSet rs_b = stmt.executeQuery(sql_b);
if (rs_b.next()) {
%>
<table style="width:100%">
<tr><td style="width:20%;text-align:center;height:30px">
<font color=red>*</font>Board <b> Name</b>
</td><td style="width:80%;text-align:left;padding:10px">
<input name="c_name" value="<%=rs_b.getString("c_name")%>" style="width:80%;height:30px;border:solid 1px #cdcdcd" maxlength="300">
</td></tr>
<tr><td style="text-align:center;height:30px">
<font color=red>*</font>Write <b> authority</b>
</td><td style="text-align:left;padding:10px">
<input name="c_type" value="0" type="radio" <%if(rs_b.getInt("c_type") == 0){%>checked<%}%>> Members escriben
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
<input name="c_type" value="1" type="radio" <%if(rs_b.getInt("c_type") == 1){%>checked<%}%>> Solo escritura maestra
</td></tr>
<tr><td style="text-align:center;height:30px;">
<font color=red>*</font> Board <b> Use</b>
</td><td style="text-align:left;padding:10px">
<input name="c_view" value="0" type="radio" <%if(rs_b.getInt("c_view") == 0){%>checked<%}%>> Use
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
<input name="c_view" value="1" type="radio" <%if(rs_b.getInt("c_view") == 1){%>checked<%}%>> No Use
</td></tr>
</table>
<%}
rs_b.close();
%>
</div>
</div>
<div class="col-lg-12 col-md-12 col-sm-12" style="padding-top:30px">
<table width="100%">
<tr>
<td align="center" style="padding-bottom:10px;padding-top:10px;font-weight:bold;">
<a href="#none" onclick="go()" style="width: 150px; line-height: 26px; text-align: center;display: inline-block; background: #F5E0CB; border: 1px solid #555; border-radius: 5px; color: #000000;">Edit Board</a>
&nbsp;&nbsp;&nbsp;
<a href="edit.jsp?<%=para_t%>&c_no=<%=c_no%>" style="width: 100px; line-height: 26px; text-align: center;display: inline-block; background: #ededed; border: 1px solid #555; border-radius: 5px; color: #000000;">Cancel</a>
</td>
</tr>
</table>
</div>
<%}else{%>
<script>
alert("You are not Master of this community")
location.href="list.jsp?<%=para_t%>"
</script>
<%}
rs_c.close();
%>
</div>
</form>
<iframe name="exec" id="exec" width="0px" height="0px"></iframe>
<% }else{%>
<script>
alert("wrong connection")
location.href="/"
</script>
<%}%>
<%@include file="/cms_for_bcb/show_bottom.jsp"%>
<%@include file="/include/bottom.jsp"%>
<%@include file="/include/include_b.jsp"%>