<form action="news.manage.php" method="get" name="form_search" id="form_search"  onsubmit="return ajax_search_list();">
<input type="hidden" name="action" id="action" value="ajax_news_search" />
<table width="680" border="0" cellpadding="0" cellspacing="0" class="from_table2">
	<tr>
	<th width="10%" align="center" valign="middle"> <tpl> $langSysNNewsName </tpl>:</th>
	  <td width="50%" align="left"><input type="text" value="<tpl> $condition.search_title </tpl>" name="search_title" id="search_title" class="txtinput" /></td>
	  <th width="15%" align="left"><tpl> $langSysNClassName </tpl>:</th><td width="25%" align="left">
	    <tpl> $slCId </tpl></td>
</tr>
	<tr>
	<th width="10%" align="center" valign="middle"><tpl> $langSysNNewsSort </tpl>:</th>	<td width="50%" align="left"> <tpl> $slOrder </tpl></td>
	
	<th colspan="4">
		<span class="btn_left" style="float:right">
		<input name="submit3" value="<tpl> $langSysNNewsSearch </tpl>" type="submit" class="btn_submit"/>
	  </span></th>
	</tr>
	
</table>
</form>
<form action="news.manage.php" id="form_del" name="form_del" method="post">
	<input type="hidden" name="action" id="action" value="del" />
<table border="0" cellpadding="0" cellspacing="0" class="from_table2_one top-1">
	  <thead>
		<tr class="area_ajax_list_title">
		  <th class="pd-left" width="10%" align="center" valign="middle">		    <tpl> $langSysNSel </tpl>		    </th>
		  <th width="300" align="center" valign="middle">		    <tpl> $langSysNNewsName </tpl>		    </th>
		  <th width="25%" align="center" valign="middle">		    <tpl> $langSysNNewsDate </tpl>		    </th>
		  <th width="10%" align="center" valign="middle">		    <tpl> $langSysNNewsSort </tpl>		    </th>
		  <th width="10%" align="center" valign="middle">		    <tpl> $langSysNManage </tpl>		    </th>
		</tr>
	</thead>
	<tpl> if $news_array[0].news_id neq '' </tpl>
		<tpl> section name=i loop=$news_array </tpl>
		<tr>
		  <td class="pd-left" width="10%" align="left" valign="middle"><input name="news_id[]" type="checkbox" value="<tpl> $news_array[i].news_id </tpl>"/></td>	
		  <td width="250" align="left" valign="middle"><tpl> $news_array[i].news_title </tpl></td>
		  <td width="25%" align="left" valign="middle"><tpl> $news_array[i].news_date </tpl></td>
		  <td width="10%" align="left" valign="middle"><tpl> $news_array[i].news_sort </tpl></td>
			<td width="10%" align="left" valign="middle"><a href="javascript:;" onclick="hideMessage();ajax_modi('<tpl> $news_array[i].news_id </tpl>');" title="<tpl> $langSysNEdit </tpl>" class="edit_a_pic">
		  </a>		  </td>
		</tr>
		<tpl> /section </tpl>
	
	<tpl> else  </tpl>
	<tr>
		<td colspan="6"><tpl> $langSysCNoThing </tpl></td>
	</tr>
	<tpl> /if </tpl>
  </table>
  <tpl> if $news_array[0].news_id neq '' </tpl>
  <div class="table-5-bottom"><div class="p-left"><div style="float:left; padding-left:20px">
		<span class="btn_left">
			<input name="selectall" type="button" id="selectall" class="btn_submit" value="<tpl> $langSysNSelAll </tpl>" />
		  </span>
			<span class="btn_left">
			<input name="negative" type="button" id="negative" class="btn_submit" value="<tpl> $langSysNSelNegative </tpl>" />
			</span>
			<span class="btn_left">
			<input type="button" id="delbutton" class="btn_submit" name="delbutton" value="<tpl> $langSysNDel </tpl>" />
			</span>		</div>
		<div style="float:right; padding-right:20px">
			<tpl> $page_list </tpl>		
		</div>		</div></div>
		<tpl> /if </tpl>
</form>
<div id="question" style="display:none; cursor: default; padding:10px"> 
        <b style=" font-size:14px; margin-top:10px; line-height:50px; height:50px;padding-top:10px; padding-bottom:10px"><tpl> $langSysNConfirmationDel </tpl></b> <br />
        <input type="button" id="yes" value="<tpl> $langCYes </tpl>"  style=" border:1px solid #CCCCCC;width:80px; margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/> 
        <input type="button" id="no" value="<tpl> $langCNo </tpl>"  style="border:1px solid #CCCCCC;width:80px; margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/>
		<input type="hidden" id="del_value" />
</div> 


<script>
$(document).ready(function() {
	$('#negative').click(
		function(){
			$('#form_del input[@type=checkbox]').each(function(){
				$(this).attr('checked',!$(this).attr('checked'))
			})
		}
	);
	$('#selectall').click(
		function(){
			$('#form_del input[@type=checkbox]').each(function(){
				$(this).attr('checked',true)
			})
		}
	);
	//删除操作
	var options_del = {
		beforeSubmit:  function(){showLoading(showText);},
		success:       function(msg){
						hideLoading();
						showMessage(msg.message,msg.type);
						if(msg.type == '1'){
							ShowDiv = "result_content";
							getPageContent("news.manage.php?action=ajax_list&search_title=<tpl> $condition.search_title </tpl>&search_cid=<tpl> $condition.search_cid </tpl>&search_order=<tpl> $condition.search_order </tpl><tpl>if $news_array|@count neq 1</tpl>&curpage=<tpl>$curpage</tpl><tpl>/if</tpl>");
						}
					},
		type:      'post',
		dataType:  'json'
	};
	var question = $('#question')[0];
	$("#delbutton").click(function(){
		$.blockUI(question, { width: '275px' });
	});
	
	$('#yes').click(function() {
		$.unblockUI();
		$('#form_del').ajaxSubmit(options_del);	
		return false;
	});
	$('#no').click($.unblockUI);
});	

//编辑
function ajax_modi(id){
	//载入页面
	ShowDiv = "result_content";
	getPageContent("news.manage.php?action=modi&id="+id+"&search_title=<tpl> $condition.search_title </tpl>&search_cid=<tpl> $condition.search_cid </tpl>&search_order=<tpl> $condition.search_order </tpl><tpl>if $news_array|@count neq 1</tpl>&curpage=<tpl>$curpage</tpl><tpl>/if</tpl>");
}
</script>