c-innovacion2/apply/cms_for_bcb/process/presentation/team/view.jsp

347 lines
14 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"%>
<%@include file="/cms_for_bcb/process/presentation/inc_presentation.jsp"%>
<%
String sql_pre = " select a.*, b.c_team_name, b.c_no as c_team_no from tbl_presentation_team a " ;
sql_pre = sql_pre + " inner join tbl_team b on b.c_no = a.c_team_no and b.c_use = 0";
sql_pre = sql_pre + " where a.c_use = 0 and a.c_no = " + c_p_team + " and a.c_project_no = " + session.getAttribute("member_project_no") ;
ResultSet rs_pre = stmt2.executeQuery(sql_pre);
if(rs_pre.next()){
%>
<div class="col-lg-9 col-md-9" style="background:#fffffff;padding-top:8px;padding-bottom:4px">
<div class="tab tab-border">
<div class="col-lg-12 col-md-12" style="background:#ededed;padding-top:8px;padding-bottom:4px">
<div class="col-lg-10 col-md-10" >
<b><%=rs_pre.getString("c_team_name")%></b> < <%=c_presentation_name%>
</div>
<div class="col-lg-2 col-md-2" style="text-align:right">
<%if(session.getAttribute("member_type").equals("0") && session.getAttribute("member_team_no").equals(rs_pre.getString("c_team_no"))){%>
<a href="/cms_for_bcb/process/presentation/team/edit.jsp?<%=para_t%>&c_p_team=<%=c_p_team%>&c_presentation_no=<%=c_presentation_no%>" title="Team Presentation Edit"><img src="/images/setting.png" width="14" alt=""></a>
<%}%>
</div>
</div>
<div class="col-lg-12 col-md-12" style="background:#ffffff;padding-top:8px;padding-bottom:4px">
<b>Presentation Link or File</b>
<div style="width:100%;height:80px;padding-left:10px;text-align:center;">
<%if(!rs_pre.getString("c_link").equals("")){%>
<%=rs_pre.getString("c_link")%>
<%}%>
<%if(!rs_pre.getString("c_file").equals("")){%>
<%=rs_pre.getString("c_file")%>
<%}%>
</div>
</div>
<%
int pt_rate = 100 / pt_count;
%>
<div class="col-lg-12 col-md-12" style="background:#ffffff;padding-top:8px;padding-bottom:4px">
<b>Point History</b>
<div style="width:100%;padding-left:10px;padding-top:10px">
<div class="tab tab-border">
<ul class="nav nav-tabs">
<li class="active"><a href="#info01" data-toggle="tab">Instructor</a></li>
<li><a href="#info02" data-toggle="tab">Mentor</a></li>
<li><a href="#info03" data-toggle="tab">Member in Project</a></li>
</ul>
<div class="tab-content white-bg">
<%
String tab_go[] = new String[4];
tab_go[1] = "1";
tab_go[2] = "2";
tab_go[3] = "0";
%>
<% for(int tab_no = 1;tab_no <4;tab_no++){%>
<div class="tab-pane fade<%if(tab_no==1){%> in active<%}%>" id="info0<%=tab_no%>">
<table cellspacing="0" cellpadding="0" width="100%">
<tr><td width="20px">
<img src="/images/graph_left.gif">
</td><td height="120px" valign="bottom" background="/images/graph_bg.gif">
<table height="120px" cellspacing=0 cellpadding=0 width="100%">
<tr>
<%
String p_name[] = new String[20];
String sql_pre2 = " select a.* ";
sql_pre2 = sql_pre2 + ", (select avg(c_point) from tbl_comment where c_type = 2 and c_relation = b.c_no and c_use = 0 and c_member_type = "+ tab_go[tab_no] +" and c_point > 0 ) as m_avg ";
sql_pre2 = sql_pre2 + " from tbl_presentation a ";
sql_pre2 = sql_pre2 + " inner join tbl_presentation_team b on b.c_presentation_no = a.c_no and b.c_use = 0 and c_team_no = " + rs_pre.getInt("c_team_no");
sql_pre2 = sql_pre2 + " where a.c_use = 0 and a.c_project_no = " + session.getAttribute("member_project_no");
sql_pre2 = sql_pre2 + " order by a.c_no asc";
ResultSet rs_pre2 = stmt2.executeQuery(sql_pre2);
int ppl = 0;
while(rs_pre2.next()){
ppl = ppl + 1;
p_name[ppl] = rs_pre2.getString("c_name");
%>
<td height="120px" width="<%=pt_rate%>%" valign=bottom align=center>
<%=rs_pre2.getFloat("m_avg")%>
<table width="50px">
<tr><td width="50px" height="<%=rs_pre2.getFloat("m_avg") * 10%>px" bgcolor=<%if(c_presentation_no == rs_pre2.getInt("c_no")){%>#FFF585<%}else{%>#cdcdcd<%}%>>
</td></tr>
</table>
</td>
<%}
rs_pre2.close();
%>
</td>
</table>
</td></tr>
<tr><td width="20px">
</td><td height=20px valign=bottom >
<table cellspacing=0 cellpadding=0 width=100%>
<tr>
<% for(int typ = 1; typ < ppl + 1;typ++){%>
<td height="20px" width="<%=pt_rate%>%" valign=top align=center>
<%=p_name[typ]%>
</td>
<%}%>
</td>
</table>
</td></tr>
</table>
</div>
<%}%>
</div>
</div>
</div>
</div>
<div class="col-lg-12 col-md-12" style="padding-top:20px">
<div class="divider mb-20" ></div>
<!---------------------comment---------------------------->
<div class="col-lg-12 col-md-12" >
<b>Comment & point</b><br><br>
<div class="tab tab-border">
<ul class="nav nav-tabs">
<li <%if(session.getAttribute("member_type").equals("1")){%> class="active"<%}%>><a href="#iinfo01" data-toggle="tab">Instructor</a></li>
<li <%if(session.getAttribute("member_type").equals("2")){%> class="active"<%}%>><a href="#iinfo02" data-toggle="tab">Mentor</a></li>
<li <%if(session.getAttribute("member_type").equals("0")){%> class="active"<%}%>><a href="#iinfo03" data-toggle="tab">Member in Project</a></li>
</ul>
<div class="tab-content white-bg">
<% for(int tab_no = 1;tab_no <4;tab_no++){%>
<div class="tab-pane fade<%if(session.getAttribute("member_type").equals(tab_go[tab_no])){%> in active<%}%>" id="iinfo0<%=tab_no%>">
<div class="row">
<%if( session.getAttribute("member_type").equals(tab_go[tab_no] ) ){%>
<%
String last_sql = " select c_content, c_point, c_no from tbl_comment ";
last_sql = last_sql + " where c_project_no = " + session.getAttribute("member_project_no") + " ";
last_sql = last_sql + " and c_pt_no = " + c_presentation_no + " ";
last_sql = last_sql + " and c_team_no = " + rs_pre.getInt("c_team_no") + " ";
last_sql = last_sql + " and c_type = 2 ";
last_sql = last_sql + " and c_relation = " + c_p_team + " ";
last_sql = last_sql + " and c_member_no = " + session.getAttribute("member_no") + " ";
last_sql = last_sql + " and c_member_type = " + session.getAttribute("member_type") + " ";
last_sql = last_sql + " and c_use=0 ";
ResultSet rs_last = stmt.executeQuery(last_sql);
if(rs_last.next()){
%>
<script>
function go_comment(){
if(document.bcb_comment.c_content.value == ""){
alert("Please enter the Comment.")
}else{
document.bcb_comment.method = "post"
document.bcb_comment.target = "exec"
document.bcb_comment.action = "/cms_for_bcb/process/comment/edit_ok.jsp"
document.bcb_comment.submit()
}
}
</script>
<form name="bcb_comment">
<input name="c_comment_no" value="<%=rs_last.getInt("c_no")%>" type="hidden">
<div class="col-lg-7 col-md-7" >
<table width="100%" cellpadding=0 cellspacing=0>
<% String sql_in = "select c_photo from tbl_member where c_no = " + session.getAttribute("member_no");
ResultSet rs_in = stmt.executeQuery(sql_in);
if(rs_in.next()){
%>
<tr>
<td style="width:56px">
<%if(!rs_in.getString("c_photo").equals("")){%>
<img src="/upload/photo/<%=rs_in.getString("c_photo")%>" width="50" height=50 style="border: 1px solid #ededed;border-radius: 50px; ">
<%}%>
</td>
<td >
<textarea name="c_content" style="width:100%;height:100px"><%=rs_last.getString("c_content")%></textarea>
</td>
</tr>
<tr>
<td >
</td>
<td style="font-size:15px;vertical-align:bottom;text-align:right">
Point :
<select name="c_point">
<option value="0" <%if(rs_last.getInt("c_point") == 0){%>selected<%}%>>score selection</option>
<%for(int po = 1; po < 11 ;po++){%>
<option value="<%=po%>" <%if(rs_last.getInt("c_point") == po){%>selected<%}%>><%=po%></option>
<%}%>
</select>
<a href="#none" onclick="go_comment()" style="width: 60px; line-height: 30px; text-align: center;display: inline-block; background: #5E9ECA; border: 1px solid #ffffff;border-radius: 15px; color: #ffffff;font-weight:400;font-size: 13px;">Edit</a>
</td>
</tr>
<tr><td colspan=2 style="height:30px"></td></tr>
<%
}
rs_in.close();
%>
</table>
</div>
<div class="col-lg-5 col-md-5">
</div>
</form>
<%
}else{
%>
<script>
function go_comment(){
if(document.bcb_comment.c_content.value == ""){
alert("Please enter the Comment")
}else{
document.bcb_comment.method = "post"
document.bcb_comment.target = "exec"
document.bcb_comment.action = "/cms_for_bcb/process/comment/insert_ok.jsp"
document.bcb_comment.submit()
}
}
</script>
<form name="bcb_comment">
<input name="c_pt_no" value="<%=c_presentation_no%>" type="hidden">
<input name="c_team_no" value="<%=rs_pre.getInt("c_team_no")%>" type="hidden">
<input name="c_type" value="2" type="hidden">
<input name="c_relation" value="<%=c_p_team%>" type="hidden">
<div class="col-lg-7 col-md-7" >
<table width="100%" cellpadding=0 cellspacing=0>
<% String sql_in = "select c_photo from tbl_member where c_no = " + session.getAttribute("member_no");
ResultSet rs_in = stmt.executeQuery(sql_in);
if(rs_in.next()){
%>
<tr>
<td style="width:56px">
<%if(!rs_in.getString("c_photo").equals("")){%>
<img src="/upload/photo/<%=rs_in.getString("c_photo")%>" width="50" height=50 style="border: 1px solid #ededed;border-radius: 50px; ">
<%}%>
</td>
<td >
<textarea name="c_content" style="width:100%;height:100px"></textarea>
</td>
</tr>
<tr>
<td >
</td>
<td style="font-size:15px;vertical-align:bottom;text-align:right">
Point :
<select name="c_point">
<option value="0">score selection</option>
<%for(int po = 1; po < 11 ;po++){%>
<option value="<%=po%>"><%=po%></option>
<%}%>
</select>
<a href="#none" onclick="go_comment()" style="width: 60px; line-height: 30px; text-align: center;display: inline-block; background: #5E9ECA; border: 1px solid #ffffff;border-radius: 15px; color: #ffffff;font-weight:400;font-size: 13px;">Insert</a>
</td>
</tr>
<tr><td colspan=2 style="height:30px"></td></tr>
<%
}
rs_in.close();
%>
</table>
</div>
<div class="col-lg-5 col-md-5">
</div>
</form>
<%}%>
<%}%>
<div class="col-lg-12 col-md-12" >
<table width="100%" cellpadding=0 cellspacing=0>
<% String sql_comment = " select a.c_content, a.c_date, b.c_photo, b.c_name, a.c_member_type, a.c_point,a.c_member_no from tbl_comment a ";
sql_comment = sql_comment + " inner join tbl_member b on b.c_no = a.c_member_no ";
sql_comment = sql_comment + " where a.c_type= 2 and a.c_relation = " + c_p_team + " and a.c_member_type= "+ tab_go[tab_no] +" order by a.c_no desc ";
ResultSet rs_comment = stmt.executeQuery(sql_comment);
while(rs_comment.next()){
%>
<tr>
<td style="width:56px">
<%if(!rs_comment.getString("c_photo").equals("")){%>
<img src="/upload/photo/<%=rs_comment.getString("c_photo")%>" width="50" height=50 style="border: 1px solid #ededed;border-radius: 50px; ">
<%}%>
</td>
<td style="padding:5px" <%if(rs_comment.getString("c_member_no").equals(session.getAttribute("member_no")) && rs_comment.getString("c_member_type").equals(session.getAttribute("member_type"))){%>bgcolor="#FFFBCB"<%}%>>
<%=rs_comment.getString("c_name")%>[
<%if(rs_comment.getInt("c_member_type") ==0){%>
Team Member
<%}%>
<%if(rs_comment.getInt("c_member_type") ==1){%>
Instructor
<%}%>
<%if(rs_comment.getInt("c_member_type") ==2){%>
Mentor
<%}%>
]
/
<%=rs_comment.getString("c_date")%>
<%if(rs_comment.getInt("c_point") >0){%>
/ point : <b><%=rs_comment.getInt("c_point")%></b>
<%}%>
</td>
</tr>
<tr>
<td >
</td>
<td style="font-size:15px;padding:5px" <%if(rs_comment.getString("c_member_no").equals(session.getAttribute("member_no")) && rs_comment.getString("c_member_type").equals(session.getAttribute("member_type"))){%>bgcolor="#FFFBCB"<%}%>>
<font color="#676767"><%=rs_comment.getString("c_content").replaceAll("\r\n","<br>")%></font>
</td>
</tr>
<tr><td colspan=2 style="height:30px"></td></tr>
<%
}
rs_comment.close();
%>
</table>
</div>
</div>
</div>
<%}%>
</div>
</div>
</div>
<!---------------------comment-E--------------------------->
</div>
</div>
</div>
<%
}else{
%>
<script>
alert("Wrong connection.")
location.href="/default.jsp"
</script>
<%
}
rs_pre.close();
%>
<%@include file="/cms_for_bcb/process/presentation/inc_presentation_bottom.jsp"%>
<%@include file="/cms_for_bcb/show_bottom.jsp"%>
<%@include file="/include/bottom.jsp"%>
<%@include file="/include/include_b.jsp"%>