<%@ page contentType="text/html; charset=GBK" session="false"%>

<%@ taglib uri="/cmsTag" prefix="cms"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<link href="../style/blue/css/main.css" type="text/css" rel="stylesheet"/>
<link href="../style/blue/css/reset-min.css" rel="stylesheet" type="text/css" />
<!--加载 js -->
<script type="text/javascript" src="../style/blue/js/tab_change.js"></script>
<script type="text/javascript" src="../common/js/jquery-1.7.gzjs"></script>
<script type="text/javascript" src="../javascript/commonUtil.js"></script>
<script type="text/javascript" src="../javascript/dialog/lhgdialog.min.js?skin=iblue"></script>
<script type="text/javascript" src="../javascript/page/pagination.js"></script>
<script language="javascript" type="text/javascript" src="../javascript/My97DatePicker/WdatePicker.js"></script>

<script>
	 //去掉点击链接 虚线边框
      window.onload=function()
      {
     for(var i=0; i<document.links.length; i++)
     document.links[i].onclick=function(){this.blur()}
     }

	// var d = $.dialog({content: 'url:http://www.sohu.com'});

　

      </script>
</head>
<body>

<div class="breadnav">
<table width="99.9%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="left">&nbsp;<img src="../style/blue/images/home.gif" width="16" height="16" class="home" /> 当前位置：<a href="#">图集管理</a> &raquo;</td>
    <td align="right"></td>
  </tr>
</table>
</div>
<div style="height:25px;"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0"> 
  <tr>
    <td class="mainbody" align="left" valign="top"><!--main start-->
    <table class="listtable" width="100%" border="0" cellpadding="0" cellspacing="0">

            <tr>
              <td  style="padding: 6px 10px;" class="">
              <div class="fl">
              	
              	<a href="javascript:gotoAddPhotoContentPage();"  class="btnwithico">
              		<img src="../../core/style/default/images/doc_add.png" alt="" /><b>添加图集&nbsp;</b>
              	</a> 
              	<a href="javascript:;"  class="btnwithico"   onclick="">
              		<img src="../../core/style/default/images/doc_pub.png" alt="" /><b>发布&nbsp;</b>
              	</a>
              	<a href="javascript:;"  class="btnwithico"   onclick="">
              		<img src="../../core/style/default/images/doc_move.png" alt="" /><b>移动&nbsp;</b>
              	</a>
              	<a href="javascript:;"  class="btnwithico"   onclick="">
              		<img src="../../core/style/default/images/doc_bro.png" alt="" /><b>预览&nbsp;</b>
              	</a>
              	<a href="javascript:;"  class="btnwithico"   onclick="">
              		<img src="../../core/style/default/images/doc_copy.png" alt="" /><b>复制&nbsp;</b>
              	</a>
              	<a href="javascript:;"  class="btnwithico"   onclick="">
              		<img src="../../core/style/default/images/doc_line.png" alt="" /><b>引用&nbsp;</b>
              	</a>
              	<a href="javascript:;"  class="btnwithico"  onmousedown='javascript:sortContent();'>
              		<img src="../../core/style/default/images/sort-number.png" alt="" /><b>排序&nbsp;</b>
              	</a>
              	<a href="javascript:;"  class="btnwithico"   onclick="">
              		<img src="../../core/style/default/images/doc_delete.png" alt="" /><b>删除&nbsp;</b>
              	</a>
              </div>
              <div class="fr">
              </div>
              </td>
            </tr>
            <tr>
              <td  style="padding: 2px 10px;">
               <div class="fl">
				  <select id="filterBy" name="filterBy" onchange="javascript:filterAction(this.value);">
						<option value="-9999" selected>
							所有内容
						</option>
						<option value="top">
							固顶
						</option>
						<option value="commend">
							推荐
						</option>
						<option value="hot">
							热门
						</option>
						<option value="homeImage">
							首页引导图
						</option>
					</select>	
					&nbsp;
					<select id="censorBy" name="censorBy" onchange="javascript:filterAction(this.value);">
						<option value="-9999" selected>
							所有属性
						</option>
						<option value="1">
							已发布
						</option>
						<option value="2">
							待发布
						</option>
						<option value="3">
							已下线
						</option>
						<option value="4">
							已归档
						</option>
					</select>
					&nbsp;
					<select id="site" name="site">
						<option value="2">
							自然降序
						</option>
						<option value="1">
							自然升序
						</option>
						<option value="4">
							时间降序
						</option>				
						<option value="3">
							时间升序
						</option>
						<option value="4">
							点击降序
						</option>
						<option value="3">
							点击升序
						</option>
						<option value="6">
							ID降序
						</option>
						<option value="5">
							ID升序
						</option>
						
					</select>
                  &nbsp;从
                 <input id="appearStartDate" name="appearStartDate" size="12" maxlength="30" type="text" class="f_input_time" onmousedown="javascript:WdatePicker({dateFmt:'yyyy-MM-dd'});" value="${param.appearStartDate}"/>
                    至
                 <input id="appearEndDate" name="appearEndDate" size="12" maxlength="30" type="text" class="f_input_time" onmousedown="javascript:WdatePicker({dateFmt:'yyyy-MM-dd'});" value="${param.appearEndDate}"/>
                  <input onclick="" value="查询"   class="btn-1" type="button"/>
                  </div>
                  
                  <div class="fr">
                  		高级搜索:
                  		<select id="site" name="site">
							<option value="-1">
								关键词
							</option>
							<option value="1">
								ID
							</option>
						</select>
						&nbsp;
						<input id="query" name="query" size="20" maxlength="60"/>
						  <input onclick="" value="搜索"   class="btn-1" type="button"/>
              	  </div>
                  
                 </td>
            </tr>
            <tr>
              <td id="uid_td25" style="padding: 2px 6px;">
              <div class="DataGrid">
              <cms:SystemManageContentList filterBy="${param.filterBy}" censorBy="${param.censorBy}" page="true" pageSize="15" classId="${param.classId}" modelId="2" startDate="${param.appearStartDate}" endDate="${param.appearEndDate}">
                  <table class="listdate"       width="100%" cellpadding="0" cellspacing="0">
                    
                      <tr class="datahead">
                        <td width="4%" height="30"><strong>ID</strong></td>
                        <td width="3%" height="30"><input type="checkbox" name="checkbox" value="checkbox" /></td>
                        <td width="10%"><strong>图集封面</strong></td>
                        <td width="27%"><strong>标题</strong></td>
                        <td width="6%"><strong>所属栏目</strong></td>
                        <td width="7%"><strong>创建者</strong></td>
                        <td width="4%"><strong>点击</strong></td>
                        <td width="5%"><strong>发布时间</strong></td>
                        <td width="13%"><strong>操作</strong></td>
                      </tr>
                      
                      <cms:Content>
                                       
                      <tr height="20">
                        <td>${Info.contentId}</td>
                        <td><input type="checkbox" name="checkContent" value="${Info.contentId}" onClick="javascript:regId(this);" /></td>
                        <td align="center">
                        	<div style="height:3px;"></div>
                        	<cms:if test="${Info.resizeCover == ''}">
                        		<img id='showCover' name="showCover" src="../style/blue/images/no-image.png" width="100" height="65" />
                        	</cms:if>
                        	<cms:else>
                        	    <img src="${Info.resizeCover}" width="100" height="65" />
                        	
                        	</cms:else>
                        
                        	<div style="height:3px;"></div>
                        </td>
                        <td>
							<div align="left">
								<cms:if test="${Info.topFlag==1}">
									<img src="../../core/style/default/images/top_flag.png" alt="固顶内容" />
								</cms:if>
								<cms:elseif test="${Info.hotFlag==1}">
									<img src="../../core/style/default/images/hot.png" alt="热点内容" />
								</cms:elseif>
								<cms:elseif test="${Info.commendFlag==1}">
									<img src="../../core/style/default/images/commend.png" alt="推荐内容" />
								</cms:elseif>
								<cms:else>
									<img src="../../core/style/default/images/some.png" alt="普通内容" />
								</cms:else>
								<span class="STYLE1">&nbsp;<a target="_blank" href="<cms:ContentLink actParam='id=${Info.contentId}'/>">[预览]</a> ${Info.title }</span></a>
								<font color="red"> <cms:if test="${Info.photoArticleType==1}">
										<span class="STYLE1">&nbsp;[图文]</span>
									</cms:if>
									<cms:if test="${Info.videoType==1}">
										<span class="STYLE1">[视频]</span>
									</cms:if>
									<cms:if test="${Info.attachType==1}">
										<span class="STYLE1">[附件]</span>
									</cms:if> </font>
							</div>
						</td>
						<td>${Info.className}</td>
                        <td>${Info.creator}</td>
                        <td>${Info.clickCount}</td>
                        <td>${Info.appearStartDateTime}</td>
                        <td>
							<div align="center">
								<cms:if test="${Info.topFlag>0}">
									<span class="STYLE4"><img src="../../core/style/default/images/top_out.png" width="16" height="16" /><a href="../../content/setTopFlag.cmd?classId=${Info.classId}&modelId=${Info.modelId}&contentId=${Info.contentId}&topFlag=0">解固</a>&nbsp;&nbsp; 
								</cms:if>
								<cms:else>
									<span class="STYLE4"><img src="../../core/style/default/images/top_act.png" width="16" height="16" /><a href="../../content/setTopFlag.cmd?classId=${Info.classId}&modelId=${Info.modelId}&contentId=${Info.contentId}&topFlag=1">固顶</a>&nbsp;&nbsp; 
								</cms:else>
								<span class="STYLE4">
								<img src="images/edt.gif" width="16" height="16" /><a href="photo/EditPhotoContent.jsp?contentId=${Info.contentId}&classId=${Info.classId}">编辑</a>&nbsp; &nbsp; <img src="images/del.gif" width="16" height="16" />
								<a href="javascript:deletePhotoGroup('${param.classId}','${Info.contentId}');">删除</a> 
								</span>
							</div>
						</td>
                      
                      </tr>
                      
                      </cms:Content>
                      
                      <tr>
                        <td colspan="9" class="PageBar" align="left">
                        <div  class="fr">
                        	<page:page />
                        </div>
                          <div   class="fl"></div>
                         </td>
                      </tr>
                  
                  </table>
                  </cms:SystemManageContentList>
                </div>
              
                </td>
            </tr>
         
        </table>

</td>
  </tr>

  <tr><td height="10">&nbsp;</td></tr>
</table>
<!--[if lt IE 7]>
        <script type="text/javascript" src="js/unitpngfix.js"></script>
<![endif]-->
</body>
</html>

<script type="text/javascript">

initSelect('filterBy','${param.filterBy}');
initSelect('censorBy','${param.censorBy}');

var currentClassId = "${param.classId}";
var currentModelId = "${param.modelId}"


var targetSortId = -1;

function regId(check)
{
   if(check.checked==true)
   {
      targetSortId=check.value;
   }
   else
   {
      targetSortId = -1;
   }
} 

function gotoAddUserDefineContentPage(modelId)
{
	window.location.href="UserDefineModelGeneralAdd.jsp?classId=${param.classId}&modelId="+modelId;
}




function sortContent()
{
   if(targetSortId == -1)
   {
     // alert("请选择待排序内容！");
     
        var dialog = $.dialog({ 
   					title :'提示',
    				width: '160px', 
    				height: '60px', 
                    lock: true, 
    				icon: '32X32/i.png', 
    				
                    content: '请选择待排序内容！',
                    
                   
    cancel: true 
                    
	
	//../../content/deleteUserDefineContent.cmd?contentId=${Info.contentId}&classId=${Info.classId}&&modelId=${Info.modelId}；
	});
      return;
   }
   

   
  
    //document.getElementById('targetId').value=targetSortId;
    //alert( document.getElementById('targetId').value);
   var returnValue = window.showModalDialog("SortContent.jsp"+window.location.search+"&targetId="+targetSortId,targetSortId,"dialogWidth=950px;dialogHeight=500px;status=yes");
   if("ok"==returnValue)
   {
      window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+'?classId='+currentClassId+'&modelId='+currentModelId;
   }
}

//以下为排序筛选操作

function filterAction(filterValue)
{
    var appearStartDate = document.getElementById('appearStartDate').value;
    var appearEndDate = document.getElementById('appearEndDate').value;
    //alert(appearStartDate);
    
    
    var filterByVar = document.getElementById('filterBy').value;
    var censorByVar = document.getElementById('censorBy').value;
	
    window.location='ManagePhotoContent.jsp?classId='+currentClassId+'&modelId='+currentModelId+'&appearStartDate='+appearStartDate+'&appearEndDate='+appearEndDate+'&filterBy='+filterByVar+'&censorBy='+censorByVar;
	

}






function deletePhotoGroup(classId,contentId)
{
	var dialog = $.dialog({ 
   					title :'提示',
    				width: '160px', 
    				height: '60px', 
                    lock: true, 
    				icon: '32X32/i.png', 
    				
                    content: '您确认删除此图集吗？',
                    
                    ok: function () { 
       
     window.location='../../content/deletePhoto.cmd?contentId='+contentId+'&classId='+classId;
       
    }, 
    cancel: true 
                    
	
	});



} 

function gotoAddPhotoContentPage()
{
	window.location.href="photo/PhotoGeneralAdd.jsp?classId=${param.classId}";
}


function submitGenerateClassForm()
{

  // document.getElementById("generateContentForm").action="../../engine/generateContent.cmd";
    document.getElementById("statictype").value=1;
   document.getElementById("generateForm").submit();
   
}

function submitGenerateContentForm()
{

  // document.getElementById("generateContentForm").action="../../engine/generateContent.cmd";
    document.getElementById("statictype").value=2;
   document.getElementById("generateForm").submit();
   
}


</script>

