<?php
!defined('ADMIN')&&die("<meta http-equiv='refresh' content=0;url='/'>");
FN("title","文章管理");
global $z,$i,$title;
_F("top");
$id=N;
?>
<tt id="tw"></tt>
<fieldset class="form">
<script type="text/javascript" src="system/js/py.js"></script>
<legend><h1><b><var><img src="system/img/left.gif" /></var><dfn class="hide"><img src="system/img/right.gif" /></dfn></b>　<a href="<?php echo URL._1.D._2.D?>"><?php echo $title?></a></h1></legend>
<script>
function souzi(a){
	if(a>=0)return window.location.href="<?php echo URL._1.D._2.D?>1/<?php echo _4?_4:0?>/"+a+"/";
	var zi=document.getElementById("zi").value;
	if(/[_\/]/.test(zi)){
		tanchuang('错误！','搜索内容不能含有" _ \\ / "字符！');
	}else window.location.href="<?php echo URL._1.D._2.D?>1/"+encodeURI(zi)+"/<?php echo _5?_5:0?>/";
}
function shenhe(a,b,c){
	if(a==0)c='管理员审核中';
	if(a==2)c='审核未通过';
	if(a==3)c='该信息已被移入回收站';
	tanchuang(c,b);if(a==0)tuitan(2);
}
function plsc(a){
	var w1=document.getElementById("w1").value,w2=document.getElementById("w2").value;
	if(a){
		tanchuang('请稍后！');
		$.ajax({
			url : window.location.href,
			data: "cgi=new&aspx="+w1+"&asp="+w2,
			type: "POST",
			dataType: "text",
			success: function(g){goto(window.location.href);}
		})
		return;
	}
	if(w1=='')return tanchuang('id开始值不能为空！');	
	if(w2=='')return tanchuang('id结束值不能为空！');	
	if(parseInt(w2)<parseInt(w1))return tanchuang('结束值不能小于开始值！');
	tanchuang('请注意！','<div style="padding:0 0 10px 5px">删除后数据将无法恢复，是否继续？</div><div class="l anniu2" onclick="plsc(1)">确定</div><div class="l anniu2" onclick="tuitan()">取消</div>');
	
}
</script>
<tt></tt>
<?php
if(ADMIN>15){
	if(ADMIN>19){
	?>
<div class="fieldset form ">
<big><samp class="del">&#9682;</samp><span>&#9681;</span>批量删除文章<del> </del></big>
<div class="del">
将文章id大于等于<input id="w1" value="" size="10" /> 并且id小于等于<input id="w2" value="" size="10" />的文章全部删除！ <b onclick="plsc()">立即执行</b>
</div>
</div>
<tt></tt>
<?php }?>
<div class="fieldset form ">
<big><samp>&#9682;</samp><span class="del">&#9681;</span>更多操作<del> </del></big>
<div>
<main id="sozi">
<dd><input type="text" size="11" id="zi" placeholder="请输入关键词" onfocus="this.select()" value="<?php echo _4?_4:''?>">
<b onclick="souzi()">搜索</b></dd>
<dd>
<select onchange="souzi(this.value)">
<option value="0">==所有分类==</option>
<?php
$html="";
$r1=$z->A("new_category","uid=0 order by paixu desc");
foreach($r1 as $v){
	$html.="<option value='{$v['id']}' ".($v['id']==_5?'selected ':'').">{$v['name']}</option>\n";
	$r2=$z->A("new_category","uid='{$v['id']}' order by paixu desc");
	foreach($r2 as $v2){
		$html.="<option value='{$v2['id']}' ".($v2['id']==_5?'selected ':'').">　∟{$v2['name']}　</option>\n";
	}
}
echo $html;?>
</select>
<a href="<?php echo URL._1.D._2.HZ?>"><b>全部/按时间</b></a>
<a href="<?php echo URL._1.D._2.'/1/0/0/1'.HZ?>"><b<?php echo _6==1?' class="red"':''?>>按排序大小</b></a>
<a href="<?php echo URL._1.D._2.'/1/0/0/2'.HZ?>"><b<?php echo _6==2?' class="red"':''?>>置顶推荐</b></a>
<a href="<?php echo URL._1.D._2.'/1/0/0/9'.HZ?>"><b<?php echo _6==9?' class="red"':''?>>专题置顶</b></a>
<a href="<?php echo URL._1.D._2.'/1/0/0/4'.HZ?>"><b<?php echo _6==4?' class="red"':''?>>已审核</b></a>
<a href="<?php echo URL._1.D._2.'/1/0/0/3'.HZ?>"><b<?php echo _6==3?' class="red"':''?>>未审核</b></a>
<a href="<?php echo URL._1.D._2.'/1/0/0/5'.HZ?>"><b<?php echo _6==5?' class="red"':''?>>内部商品</b></a>
<a href="<?php echo URL._1.D._2.'/1/0/0/6'.HZ?>"><b<?php echo _6==6?' class="red"':''?>>外部商品</b></a>
<a href="<?php echo URL._1.D._2.'/1/0/0/8'.HZ?>"><b<?php echo _6==8?' class="red"':''?>>抢购秒杀</b></a>
<a href="<?php echo URL._1.D._2.'/1/0/0/7'.HZ?>"><b<?php echo _6==7?' class="red"':''?>>全部商品</b></a>
<a href="<?php echo URL._1.D._2.'/1/0/0/10'.HZ?>"><b<?php echo _6==10?' class="red"':''?>>回收站</b></a>
<a href="<?php echo URL._1.D._2.'/1/0/0/i'.HZ?>"><b<?php echo _6=='i'?' class="red"':''?>><?php echo _7?'用户'._7:'我'?>发布的</b></a>
</dd>
<div id='xjfw'>
<i>伪造虚假访问量：</i>给文章id:<input id="i1" value="1" /> 到id: <input id="i2" value="1000" />随机增加<input id="i3" value="1" /> - <input id="i4" value="0" />个访问量 <b>立即执行</b><input type="hidden" id="i5" value="<?php echo URL._1.D?>" />
</div>
</main>
</div>
</div>
<tt></tt>
<?php
}
$p = intval(_3)?intval(_3):1;
$d=50;
$a=($p-1)*$d;
$tj=_6=='10'?'yn=3':'yn<3';
$_4=_4?_4:0;
if(_4)$tj.=" and ( id='$_4' or huohao LIKE '%".$_4."%' or url LIKE '%".$_4."%' or title LIKE '%".$_4."%' or keywords LIKE '%".$_4."%' or description LIKE '%".$_4."%')";
if($_5=intval(_5)){
	$r=$z->R('new_category','id='._5);
	if($r)$tj.='and a'.($r['uid']?2:1).'='._5;
}
switch (_6){
	case '1':$px='paixu desc,id desc';break;
	case '2':$px='all_zhiding desc,index_zhiding desc,mobile_zhiding desc,zhiding desc,tuijian desc,u_paixu desc,btime desc,id desc';break;
	case '3':$tj.=' and yn<>1';$px='id desc';break;
	case '4':$tj.=' and yn=1';$px='id desc';break;
	case '5':$tj.=' and jiage>0 and api=0';$px='id desc';break;
	case '6':$tj.=' and jiage>0 and api=1';$px='id desc';break;
	case '7':$tj.=' and jiage>0';$px='id desc';break;
	case '8':$tj.=' and ctime>0';$px='id desc';break;
	case '9':$tj.=' and u_paixu<>0';$px='u_paixu desc';break;
	case '10':$px='id desc';break;
	case 'i':$tj.=' and uid='.(_7?_7:$i['id']);$px='id desc';break;
	default:$px=' id desc';
}
if(!_7&&(_6=='i'||ADMIN<15))$tj='yn<3 and uid='.$i['id'];
$s=$z->S("new",$tj);
$fenye=URL._1.D._2."/";
$m=ceil($s/$d);
$dir=S($p,$m,$s,$fenye,D.$_4.D.$_5.D.(_6?_6:0).D);
foreach($z->A("new",$tj." order by $px limit $a,$d") as $v){
	if($v['h1']=='')$z->U("new","id={$v['id']}","h1='".addslashes($v['title'])."'");
	$jg=$v['jiage']>0?'[进价：<i class="lan">'.$v['jiage_d'].'</i> / 售价：<i class="red">'.$v['jiage'].'</i>]':'';
	$top=$v['all_zhiding']||$v['index_zhiding']||$v['mobile_zhiding']||$v['zhiding']?'<img src="system/img/top.gif" title="置顶" />':($v['u_paixu']?'<img src="system/img/up2.gif" title="专题置顶" />':'');
	$jian=$v['tuijian']?' <img src="system/img/jian.gif" title="推荐文章" />':'';
	$id=_4?preg_replace("#$_4#","<u>$_4</u>",$v['id']):$v['id'];
	if(_4)$v['h1']=preg_replace("#$_4#","<u>$_4</u>",$v['h1']);
	echo '<h5><i>'.$id.'.　</i><a class=lv>'.date('Y-m-d H:i:s',$v['atime']).'</a>　<i>'.$top.$jian.' '.($v['yn']==1?'':'<img src="system/img/warning.gif" title="'.($v['yn']?'审核未通过'.($v['beizhu']?'，点击标题，查看详情':''):'管理员审核中').'" /> ').'</i>'.$jg.'<q><a '.($v['yn']==1?'href="'.URL.'p-'.$v['url'].HZ.'"':' onclick="shenhe('.$v['yn'].',\''.GL(GL($v['beizhu'],2),4).'\')"').' target="_blank"><img src="system/img/link.png" />'.htmlspecialchars_decode(GL($v['h1'],4)).'</a></q>　<bdi><i class="zi" title="全站置顶='.$v['all_zhiding'].', PC置顶='.$v['index_zhiding'].', 手机置顶='.$v['mobile_zhiding'].', 本类置顶='.$v['zhiding'].', 推荐排序='.$v['tuijian'].', 专题排序='.$v['u_paixu'].', 其它排序='.$v['paixu'].'">排序{'.$v['all_zhiding'].','.$v['index_zhiding'].','.$v['mobile_zhiding'].','.$v['zhiding'].','.$v['tuijian'].','.$v['u_paixu'].','.$v['paixu'].'}</i>　<i onclick="durl(\''.URL.'p-'.$v['url'].HZ.'\',\''.GL(GL($v['h1'],2),4).'\')"><img src="system/img/mini_query.gif" />获取地址</i>
　<a href="'.URL._1.'/id/'.$v['id'].HZ.'"><img src="system/img/iconedit.gif" />修改</a>
 <a onclick="sc(\''.URL._1.D.'s/new/id/'.$v['id'].HZ.'\')">　<img src="system/img/icondel.gif" />删除</a>
　<a target="_blank" href="'.URL.'u_'.urlencode($v['uname']).'/"><img src="system/img/user_1_1.png" title="发布者：" />'.$v['uname'].'</a>

</bdi></h5><tt></tt>';
}?>
<tt></tt>
<dir><?php echo $dir.' <span>（共'.$s.'条）</span>'?></dir><font color="#CC6666"></font>
<ul><tt></tt></ul>
<ul><tt></tt></ul>
</fieldset>
<?php
_F("end");