<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
    <title>工程项目信息管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(function(){
            $("img").not(".upload_ico").each(function () {
                var num = 1 ;
                $(this).click(function () {
                    var flag = num%2;
                    if(flag == 1){
                        $(this).css("width","90%");
                        $(this).css("height","90%");
                        num++;
                    }else if(flag ==0){
                        $(this).css("width","50px");
                        $(this).css("height","50px");
                        num++;
                    }
                })
            });
        })
        $(document).ready(function() {
            var oneSize = $(".oneTab").size();
            for(var i = 0;i < oneSize;i++){
                var hei = $(".oneTab:eq("+i+")").parent().height()-20;
                $(".oneTab:eq("+i+")").css("height",hei)
                    .css("vertical-align","middle")
                    .css("line-height",hei+"px")
            }
        });
    </script>
</head>
<body class="hideScroll">
<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="ibox-content">
            <div class="col-sm-12">
                <div class="col-sm-2 gray-bg text-center oneTab">
                    <label>文件信息</label>
                </div>
                <div class="col-sm-10 " >
                    <table class="table table-striped table-bordered table-hover table-condensed dataTables-example">
                        <tbody>
                        <tr>
                            <td class="width-35" colspan="4">
                                <label class="pull-left">报告文件：</label>
                                <table id="workReportList"  style="text-align: center;width: 100%;margin-top:10px;"  class="table table-striped table-bordered table-condensed" >
                                    <tr>
                                       <%-- <td>序号</td>--%><td>文件名</td><td>上传人</td><td>上传时间</td><td>操作</td>
                                    </tr>
                                    <c:forEach items="${workReportList}" var="attachment" varStatus="status">
                                    <tr>
                                            <%--<td>${status.index + 1}</td>--%>
                                            <c:choose>
                                                <c:when test="${fn:containsIgnoreCase(attachment.attachmentName,'jpg')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'png')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'gif')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'bmp')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'jpeg')}">
                                                    <td><img src="${attachment.url}" width="50" height="50" alt="${attachment.attachmentName}"/></td>
                                                </c:when>
                                                <c:otherwise>
                                                    <c:choose>
                                                        <c:when test="${fn:containsIgnoreCase(attachment.attachmentName,'pdf')}">
                                                            <td><a href="javascript:void(0)" onclick="preview('预览','${attachment.url}','80%','80%','1')">${attachment.attachmentName}</a></td>
                                                        </c:when>
                                                        <c:otherwise>
                                                            <td><a href="javascript:void(0)" onclick="preview('预览','${attachment.url}','80%','80%')">${attachment.attachmentName}</a></td>

                                                        </c:otherwise>
                                                    </c:choose>
                                                </c:otherwise>
                                        </c:choose>

                                        <td>${attachment.attachmentUser}</td>
                                            <td><fmt:formatDate value="${attachment.createDate}" pattern="yyyy-MM-dd"/></td>
                                            <td>
                                                <a href="${ctx}/workfullmanage/workFullManage/downLoadAttach?file=${attachment.url}" class="btn btn-success btn-xs">下载</a>
                                                <c:if test="${attachment.createBy.id eq fns:getUser().id}">
                                                    <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/workengineeringproject/workEngineeringProject/deleteFileFromAliyun?attachmentId=${attachment.id}&id=${workEngineeringProject.id}&type=2')" class="btn btn-danger btn-xs" >删除</a>
                                                </c:if>
                                            </td>
                                    </tr>
                                    </c:forEach>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td class="width-35" colspan="4">
                                <label class="pull-left">依据性资料：</label>
                                <table id="workBasisInformationList"  style="text-align: center;width: 100%;margin-top:10px;"  class="table table-striped table-bordered table-condensed" >
                                    <tr>
                                        <%--<td>序号</td>--%><td>文件名</td><td>上传人</td><td>上传时间</td><td>操作</td>
                                    </tr>
                                    <c:forEach items="${workBasisInformationList}" var="attachment" varStatus="status">
                                    <tr>
                                           <%-- <td>${status.index + 1}</td>--%>
                                            <c:choose>
                                                <c:when test="${fn:containsIgnoreCase(attachment.attachmentName,'jpg')
                                                                   or fn:containsIgnoreCase(attachment.attachmentName,'png')
                                                                   or fn:containsIgnoreCase(attachment.attachmentName,'gif')
                                                                   or fn:containsIgnoreCase(attachment.attachmentName,'bmp')
                                                                   or fn:containsIgnoreCase(attachment.attachmentName,'jpeg')}">
                                                    <td><img src="${attachment.url}" width="50" height="50" alt="${attachment.attachmentName}"/></td>
                                                </c:when>
                                                <c:otherwise>
                                                    <c:choose>
                                                        <c:when test="${fn:containsIgnoreCase(attachment.attachmentName,'pdf')}">
                                                            <td><a href="javascript:void(0)" onclick="preview('预览','${attachment.url}','80%','80%','1')">${attachment.attachmentName}</a></td>
                                                        </c:when>
                                                        <c:otherwise>
                                                            <td><a href="javascript:void(0)" onclick="preview('预览','${attachment.url}','80%','80%')">${attachment.attachmentName}</a></td>

                                                        </c:otherwise>
                                                    </c:choose>
                                                </c:otherwise>
                                            </c:choose>
                                            <td>${attachment.attachmentUser}</td>
                                            <td><fmt:formatDate value="${attachment.createDate}" pattern="yyyy-MM-dd"/></td>
                                            <td>
                                                <a href="${ctx}/workfullmanage/workFullManage/downLoadAttach?file=${attachment.url}" class="btn btn-success btn-xs">下载</a>
                                                <c:if test="${attachment.createBy.id eq fns:getUser().id}">
                                                    <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/workengineeringproject/workEngineeringProject/deleteFileFromAliyun?attachmentId=${attachment.id}&id=${workEngineeringProject.id}&type=2')" class="btn btn-danger btn-xs" >删除</a>
                                                </c:if>
                                            </td>
                                    </tr>
                                    </c:forEach>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td class="width-35" colspan="4">
                                <label class="pull-left">过程控制资料：</label>
                                <table id="workRemoteControlList"  style="text-align: center;width: 100%;margin-top:10px;"  class="table table-striped table-bordered table-condensed" >
                                    <tr>
                                       <%-- <td>序号</td>--%><td>文件名</td><td>上传人</td><td>上传时间</td><td>操作</td>
                                    </tr>
                                        <c:forEach items="${workRemoteControlList}" var="attachment" varStatus="status">
                                    <tr>
                                    <td><%--${status.index + 1}</td>--%>
                                        <c:choose>
                                            <c:when test="${fn:containsIgnoreCase(attachment.attachmentName,'jpg')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'png')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'gif')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'bmp')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'jpeg')}">
                                                <td><img src="${attachment.url}" width="50" height="50" alt="${attachment.attachmentName}"/></td>
                                            </c:when>
                                            <c:otherwise>
                                                <c:choose>
                                                    <c:when test="${fn:containsIgnoreCase(attachment.attachmentName,'pdf')}">
                                                        <td><a href="javascript:void(0)" onclick="preview('预览','${attachment.url}','80%','80%','1')">${attachment.attachmentName}</a></td>
                                                    </c:when>
                                                    <c:otherwise>
                                                        <td><a href="javascript:void(0)" onclick="preview('预览','${attachment.url}','80%','80%')">${attachment.attachmentName}</a></td>

                                                    </c:otherwise>
                                                </c:choose>
                                            </c:otherwise>
                                        </c:choose>
                                            <td>${attachment.attachmentUser}</td>
                                            <td><fmt:formatDate value="${attachment.createDate}" pattern="yyyy-MM-dd"/></td>
                                            <td>
                                                <a href="${ctx}/workfullmanage/workFullManage/downLoadAttach?file=${attachment.url}" class="btn btn-success btn-xs">下载</a>
                                                <c:if test="${attachment.createBy.id eq fns:getUser().id}">
                                                    <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/workengineeringproject/workEngineeringProject/deleteFileFromAliyun?attachmentId=${attachment.id}&id=${workEngineeringProject.id}&type=2')" class="btn btn-danger btn-xs" >删除</a>
                                                </c:if>
                                           </td>
                                    </tr>
                                        </c:forEach>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td class="width-35" colspan="4">
                                <label class="pull-left">汇总表：</label>
                                <table id="workSummaryList"  style="text-align: center;width: 100%;margin-top:10px;"  class="table table-striped table-bordered table-condensed" >
                                    <tr>
                                        <%--<td>序号</td>--%><td>文件名</td><td>上传人</td><td>上传时间</td><td>操作</td>
                                    </tr>
                                    <c:forEach items="${workSummaryList}" var="attachment" varStatus="status">
                                    <tr>
                                           <%-- <td>${status.index + 1}</td>--%>
                                        <c:choose>
                                            <c:when test="${fn:containsIgnoreCase(attachment.attachmentName,'jpg')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'png')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'gif')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'bmp')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'jpeg')}">
                                                <td><img src="${attachment.url}" width="50" height="50" alt="${attachment.attachmentName}"/></td>
                                            </c:when>
                                            <c:otherwise>
                                                <c:choose>
                                                    <c:when test="${fn:containsIgnoreCase(attachment.attachmentName,'pdf')}">
                                                        <td><a href="javascript:void(0)" onclick="preview('预览','${attachment.url}','80%','80%','1')">${attachment.attachmentName}</a></td>
                                                    </c:when>
                                                    <c:otherwise>
                                                        <td><a href="javascript:void(0)" onclick="preview('预览','${attachment.url}','80%','80%')">${attachment.attachmentName}</a></td>
                                                    </c:otherwise>
                                                </c:choose>
                                            </c:otherwise>
                                        </c:choose>
                                            <td>${attachment.attachmentUser}</td>
                                            <td><fmt:formatDate value="${attachment.createDate}" pattern="yyyy-MM-dd"/></td>
                                            <td>
                                                <a href="${ctx}/workfullmanage/workFullManage/downLoadAttach?file=${attachment.url}" class="btn btn-success btn-xs">下载</a>
                                                 <c:if test="${attachment.createBy.id eq fns:getUser().id}">
                                                     <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/workengineeringproject/workEngineeringProject/deleteFileFromAliyun?attachmentId=${attachment.id}&id=${workEngineeringProject.id}&type=2')" class="btn btn-danger btn-xs" >删除</a>
                                                 </c:if>
                                            </td>
                                    </tr>
                                    </c:forEach>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td class="width-35" colspan="4">
                                <label class="pull-left">其他资料：</label>
                                <table id="workOtherList"  style="text-align: center;width: 100%;margin-top:10px;"  class="table table-striped table-bordered table-condensed" >
                                    <tr>
                                        <%--<td>序号</td>--%><td>文件名</td><td>上传人</td><td>上传时间</td><td>操作</td>
                                    </tr>
                                    <c:forEach items="${workOtherList}" var="attachment" varStatus="status">
                                    <tr>
                                           <%-- <td>${status.index + 1}</td>--%>
                                        <c:choose>
                                            <c:when test="${fn:containsIgnoreCase(attachment.attachmentName,'jpg')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'png')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'gif')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'bmp')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'jpeg')}">
                                                <td><img src="${attachment.url}" width="50" height="50" alt="${attachment.attachmentName}"/></td>
                                            </c:when>
                                            <c:otherwise>
                                                <c:choose>
                                                    <c:when test="${fn:containsIgnoreCase(attachment.attachmentName,'pdf')}">
                                                        <td><a href="javascript:void(0)" onclick="preview('预览','${attachment.url}','80%','80%','1')">${attachment.attachmentName}</a></td>
                                                    </c:when>
                                                    <c:otherwise>
                                                        <td><a href="javascript:void(0)" onclick="preview('预览','${attachment.url}','80%','80%')">${attachment.attachmentName}</a></td>
                                                    </c:otherwise>
                                                </c:choose>
                                            </c:otherwise>
                                        </c:choose>
                                            <td>${attachment.attachmentUser}</td>
                                            <td><fmt:formatDate value="${attachment.createDate}" pattern="yyyy-MM-dd"/></td>
                                            <td>
                                                <a href="${ctx}/workfullmanage/workFullManage/downLoadAttach?file=${attachment.url}" class="btn btn-success btn-xs">下载</a>
                                                <c:if test="${attachment.createBy.id eq fns:getUser().id}">
                                                    <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/workengineeringproject/workEngineeringProject/deleteFileFromAliyun?attachmentId=${attachment.id}&id=${workEngineeringProject.id}&type=2')" class="btn btn-danger btn-xs" >删除</a>
                                                </c:if>
                                            </td>
                                    </tr>
                                    </c:forEach>
                                </table>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>