<?php
define('EmpireCMSAdmin','1');
require("../class/connect.php");
require("../class/db_sql.php");
require("../class/functions.php");
require("../class/dpfun.php");
require("../class/writer.php");
require LoadLang("pub/fun.php");
$link=db_connect();
$empire=new mysqlquery();
//验证用户
$lur=is_login();
$logininid=$lur['userid'];
$loginin=$lur['username'];
$loginrnd=$lur['rnd'];
$loginlevel=$lur['groupid'];
$loginadminstyleid=$lur['adminstyleid'];

$url='<a href="ListWriter.php">全部作者管理</a>&nbsp;>&nbsp;<a href="ListWriterSet.php">设置</a>';

$r=$empire->fetch1("select wlistnum,wbooknum,winid,wclid,wriid from {$dbtbpre}enewspublic limit 1");

//列表模板
$listtemp1='';
$listtemp2='';
$listtemp3='';

$lt_sql=$empire->query("select tempid,tempname from ".GetTemptb("enewslisttemp")." where classid=2");
while($lt_r=$empire->fetch($lt_sql))
{
		if($lt_r[tempid]==$r[winid]){$lt_d1=" selected";}
		else{$lt_d1="";}

		$listtemp1.="<option value=".$lt_r[tempid].$lt_d1."> |-".$lt_r[tempname]."</option>";
}

$lt_sql2=$empire->query("select tempid,tempname from ".GetTemptb("enewslisttemp")." where classid=2");
while($lt_r2=$empire->fetch($lt_sql2))
{
		if($lt_r2[tempid]==$r[wclid]){$lt_d2=" selected";}
		else{$lt_d2="";}

		$listtemp2.="<option value='".$lt_r2[tempid]."' ".$lt_d2."> |-".$lt_r2[tempname]."</option>";
}

$lt_sql3=$empire->query("select tempid,tempname from ".GetTemptb("enewslisttemp")." where classid=2");
while($lt_r3=$empire->fetch($lt_sql3))
{
		if($lt_r3[tempid]==$r[wriid]){$lt_d3=" selected";}
		else{$lt_d3="";}

		$listtemp3.="<option value=".$lt_r3[tempid].$lt_d3."> |-".$lt_r3[tempname]."</option>";
}

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="adminstyle/<?=$loginadminstyleid?>/adminstyle.css" type="text/css">
<title>全部分卷管理</title>
<style type="text/css">
	.zm a{padding:0 5px;}
</style>
<script>
function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall')
       e.checked = form.chkall.checked;
    }
  }

//删除
function delc(wid){
	if(confirm('确认要删除此作者吗？'))
	{
		self.location.href='ListWriter.php?wid='+wid+'&enews=DelWriter';
	}
}

</SCRIPT>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  <tr> 
    <td width="40%">位置： 
      <?=$url?>
    </td>
    <td width="60%">
		<div align="right" class="emenubutton">
      </div>
	</td>
  </tr>
</table>

  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
    <tr class="header">
      <td height="25" style="padding:0 15px;">作者相关设置        
      </td>
    </tr>
	<form name="form1" method="post" action="ListWriter.php">
	<input name=enews type=hidden id="enews" value=WriterSet>
    <tr> 
      <td height="25" bgcolor="#FFFFFF" style="padding:10px 15px;">
	  <div class="zm">作者首页模板：
		<select name="winid" id="winid">
			<option value=0 style='background:#99C4E3'>请选择模板</option>
              <?=$listtemp1?>
        </select>
	  </div>
      </td>
    </tr>
	<tr> 
      <td height="25" bgcolor="#FFFFFF" style="padding:10px 15px;">
	  <div class="zm">作者分类模板：
		<select name="wclid" id="wclid">
			<option value=0 style='background:#99C4E3'>请选择模板</option>
              <?=$listtemp2?>
        </select>
	  </div>
      </td>
    </tr>
	<tr> 
      <td height="25" bgcolor="#FFFFFF" style="padding:10px 15px;">
	  <div class="zm">默认作者文集模板：
		<select name="wriid" id="wriid">
			<option value=0 style='background:#99C4E3'>请选择模板</option>
              <?=$listtemp3?>
        </select>
	  </div>
      </td>
    </tr>
	<tr> 
      <td height="25" bgcolor="#FFFFFF" style="padding:10px 15px;">
	  <div class="zm">作者列表每页显示数 <input type="text" name="wlistnum" size=5 value="<?=$r[wlistnum]?>"> ，作者文集每页显示数 <input type="text" name="wbooknum" size=5 value="<?=$r[wbooknum]?>">
	  </div>
      </td>
    </tr>
	<tr> 
      <td height="25" bgcolor="#FFFFFF" style="padding:10px 15px;">
	  <input type="submit" value=" 提交 ">
      </td>
    </tr>
	</form>
  </table>

<?
db_close();
$empire=null;
?>