<!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="Content-Type" content="text/html; charset=utf-8">
<title>批量提取摘要</title>
<script language='javascript' src='main.js'></script>
<script language='javascript' src='../include/dedeajax2.js'></script>
<script language='javascript'>
	function ShowFields(){
		var channel = $DE('channel').options[$DE('channel').selectedIndex].value;
		var queryUrl = "description_fetch_action.php?channel="+channel+"&action=getfields";
		var myajax = new DedeAjax($DE('fields'),true,true,'','x','...');
	    myajax.SendGet(queryUrl);
	}
	function CheckSubmit(){
	   if($DE('rpfield').value==""){
	      alert("你选择的操作为手工指定字段，但你并没指定！");
		  return false;
	   }
	   return true;
	}
	function pf(v){
	   $DE('rpfield').value = v;
	}

</script>
<link href="css_body.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="bodytitle">
	<div class="bodytitleleft"></div>
  <div class="bodytitletxt">批量提取摘要</div>
</div>
<table width="96%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="	background:#E2F5BC;">
  <form action="description_fetch_action.php" name="form1" method="post" target="stafrm" onSubmit="return CheckSubmit()">
  	<input type='hidden' name='action' value='fetch'>
    <tr>
      <td height="20" bgcolor="#EDF9D5"><table width="98%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td width="30%">
            	<strong>&nbsp;批量提取摘要</strong> </td>
            <td>&nbsp;</td>
        </tr>
      </table>      </td>
    </tr>
    <tr>
      <td bgcolor="#FFFFFF">
<table width="100%" border="0" cellpadding="2" cellspacing="2">
          <tr bgcolor="#FFFFFF">
            <td colspan="2" style="line-height:180%"><img src="img/help.gif" width="16" height="16">批量提取摘要的来源字段</td>
          </tr>
          <tr>
            <td width="15%" height="66">&nbsp;选择频道与关键词来源字段：</td>
            <td> <table width="98%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td id="tables">
                    <?php
	$dsql = new DedeSql(false);
	if(!$dsql->linkID){
		echo "<font color='red'>连接数据库失败！</font><br>";
		echo $qbutton;
		exit();
	}
	$dsql->SetQuery("select ID,typename,addtable from #@__channeltype");
  $dsql->Execute('t');
  if($dsql->GetError()!=""){
  	echo "<font color='red'>找不到你所指定的数据库！ $dbname</font><br>";
		echo $qbutton;
  }
  echo "<select name='channel' id='channel' size='10' style='width:60%' onchange='ShowFields()'>\r\n";

	while($row = $dsql->GetArray('t')){
		//$row[0] = setstr($row[0]);
		if($row['ID'] == 1)
		{
			$select  = 'selected';
		}else{
			$select = '';
		}
		echo "<option value='".$row['ID']."' $select>".$row['typename']."</option>\r\n";
	}
  echo "</select>\r\n";
	$dsql->Close();
				  ?>                  </td>
                </tr>
                <tr>
                  <td id='fields'>
                  	<div style='border:1px solid #ababab;background-color:#FEFFF0;margin-top:6px;padding:3px;line-height:160%'>
                  		表(dede_addonarticle)含有的字段：<br>
                  		<a href="javascript:pf('aid')"><u>aid</u></a>
                  		<a href="javascript:pf('typeid')"><u>typeid</u></a>
                  		<a href="javascript:pf('body')"><u>body</u></a>
                  		<input type='hidden' name='addtable' value='#@__addonarticle' />
                  	</div>
</td>
                </tr>
                <tr>
                  <td height="28"> 来源字段：
                    <input name="rpfield" type="text" id="rpfield" value="body"> 摘要长度<input type='text' name='dsize' value='250' />字节</td>
                </tr>
                <tr>
                  <td height="28">
最小值：
              <input name="msize" type="text" id="msize2" value="512" size="10">
              （字节，内容大于该值才分析）


每批处理：
              <input name="pagesize" type="text" id="pagesize" value="100" size="10">
              条记录
                  </td></tr>
<tr>
                  <td height="28">
开始ID：
              <input name="sid" type="text" id="sid3" size="8">
              结束ID：
              <input name="eid" type="text" id="eid" size="8">
               </td></tr>
              </table></td>
          </tr>
        </table>      </td>
    </tr>
    <tr>
      <td height="31" bgcolor="#F8FBFB" align="center"><input type="submit" name="Submit" value="开始提取摘要" class="inputbut"/></td>
    </tr>
  </form>
  <tr bgcolor="#E5F9FF">
    <td height="20" bgcolor="#EDF9D5"> <table width="100%">
        <tr>
          <td width="74%"><strong>结果：</strong></td>
          <td width="26%" align="right"> <script language='javascript'>
            	function ResizeDiv(obj,ty)
            	{
            		if(ty=="+") document.all[obj].style.pixelHeight += 50;
            		else if(document.all[obj].style.pixelHeight>80) document.all[obj].style.pixelHeight = document.all[obj].style.pixelHeight - 50;
            	}
            	</script>
            [<a href='#' onClick="ResizeDiv('mdv','+');">增大</a>] [<a href='#' onClick="ResizeDiv('mdv','-');">缩小</a>]          </td>
        </tr>
      </table></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td id="mtd"> <div id='mdv' style='width:100%;height:100;'>
        <iframe name="stafrm" frameborder="0" id="stafrm" width="100%" height="100%"></iframe>
      </div>
      <script language="JavaScript">
	  document.all.mdv.style.pixelHeight = screen.height - 520;
	  </script> </td>
  </tr>
</table>
</body>
</html>
