<!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=gb2312">
    <title>发布文档</title>
    <style type="text/css">
<!--
body { background-image: url(images/allbg.gif); }
-->
</style>
    <link href="css/base.css" rel="stylesheet" type="text/css">
    <script language="javascript" src="../include/js/dedeajax2.js"></script>
    <script language='javascript' src="js/main.js"></script>
    <script type="text/javascript" src="js/calendar/calendar.js"></script>
    <script language="javascript">
<!--
        function checkSubmit() {
            if (document.form1.title.value == "") {
                alert("标题不能为空！");
                return false;
            }
            if (document.form1.typeid.value == 0) {
                alert("请选择档案的主栏目！");
                return false;
            }
        }
-->
    </script>
</head>
<body topmargin="8">
  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="65%" height="30"><IMG height=14 src="images/book1.gif" width=20>&nbsp;<a href="content_sg_list.php?cid=<?php echo $cid?>&channelid=<?php echo $channelid?>&dopost=listArchives"><u>文档列表</u></a> &gt;&gt; 发布文档多大</td>
      <td width="30%" align='right'>&nbsp; <?php echo $backurl; ?><a href="catalog_main.php">[<u>栏目管理</u>]</a> </td>
      <td width="1%">&nbsp;</td>
    </tr>
  </table>

    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" id="head1">
        <tr>
            <td colspan="2">
                <table width="800" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="84" height="24" align="center" background="images/itemnote1.gif">
                            &nbsp;常规信息&nbsp;
                        </td>
                        <td width="260" height="24" align="center" background="images/itemnote1.gif">
                            &nbsp;
                            <input id="sheding" name="sheding" height="4" width="6" />
                            <input name="sd" type="button" value="设定&nbsp;" onclick="sheding()" />
                        </td>
                        <script language="javascript">
<!--

                            function sheding() {
                                var t = document.getElementById("sheding").value;
                                var nei = document.getElementById('dds').innerHTML;
                                for (i = 1; i < t; i++) {

                                    //document.getElementById("dd").innerHTML=要写入的内容;
                                    var str = document.getElementById('dds').innerHTML;
                                    //alert(i);
                                    str = str.replace(/flagss\[0\]\[\]/g, "flagss[" + i + "][]");
                                    str = str.replace(new RegExp("NewTitle", "gm"), "舞曲地址" + (i + 1));
                                    //str = str.replace(/class\='intxts' value='' \/\>/g,"class='intxts' value='"+document.getElementById("lujing").value +"' />");
                                    str = str.replace(new RegExp("NewDownTitle", "gm"), "舞曲下载地址" + (i + 1));

                                    str = str.replace(/lujings/g, document.getElementById("lujing").value + (i+1) + document.getElementById("houzhuia").value);
                                    str = str.replace(/lujingbs/g, document.getElementById("lujing").value + (i + 1) + document.getElementById("houzhuib").value); 
                                    nei += str;
                               
                                    //if (document.getElementById("lujing").value != '') { nei = nei.replace(/lujings/g, t }

                                }

                                //if (document.getElementById("lujing").value != '') { nei = nei.replace(/lujings/g, document.getElementById("lujing").value + document.getElementById("houzhuia").value); } else { nei = nei.replace(/lujings/g, '/'); }
                                nei = nei.replace(new RegExp("NewTitle", "gm"), "舞曲地址1");
                                nei = nei.replace(new RegExp("NewDownTitle", "gm"), "舞曲下载地址1");
                                nei = nei.replace(new RegExp("lujings", "gm"), document.getElementById("lujing").value + "1" + document.getElementById("houzhuia").value);
                                nei = nei.replace(new RegExp("lujingbs", "gm"), document.getElementById("lujing").value + "1" + document.getElementById("houzhuib").value);
                                nei = nei.replace(/quanzhongValue/g, document.getElementById("quanzhong").value);
                                //alert(nei);
                                document.getElementById('dd').innerHTML = nei;
                                // alert(nei);   

                                //document.getElementsClassName("intxts").value=document.getElementById("lujing").value;	


                            }

-->
                        </script>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <form name="form1" action="archives_add_p.php" enctype="multipart/form-data" method="post"
    onsubmit="return checkSubmit()">
    <input type="hidden" name="channelid" value="7" />
    <input type='hidden' name='dede_addonfields' value="dj_url,text;mp3_url,text">
    <input type="hidden" name="cid" value="7" />
    <input type="hidden" name="dopost" value="save" />
    &nbsp;文档主栏目：
   <?php
          $typeOptions = GetOptionList($cid,$cuserLogin->getUserChannel(),$channelid);
          echo "<select name='typeid' id='typeid' style='width:240px'>\r\n";
          echo "<option value='0'>请选择栏目...</option>\r\n";
          echo $typeOptions;
          echo "</select>";
			?> 
    &nbsp;共用路径：<input name="lujing" type="text" id="lujing" value="" style="width: 180px">
    试听听后缀：<input name="houzhuia" type="text" id="houzhuia" value=".wma" style="width: 70px">
    下载后缀：<input name="houzhuib" type="text" id="houzhuib" value=".mp3" style="width: 70px">
    权重：<input name="quanzhong" type="text" id="quanzhong" value="4" style="width: 70px">
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" id="head1">
        <tr>
            <td colspan="2">
                <div id="dd">
                    标题：<input name="titles[]" type="text" id="title" value="" style="width: 388px">
                    自定义属性：
                   <?php
            	$dsql->SetQuery("Select * From `#@__arcatt` where att<>'j' And att<>'p' order by sortid asc");
            	$dsql->Execute();
            	while($trow = $dsql->GetObject())
            	{
            		 echo "<input class='np' type='checkbox' name='flagss[0][]' id='flags{$trow->att}' value='{$trow->att}'>{$trow->attname}[{$trow->att}]";
            	}
            	?>权重：<input name="weights[]" type="text" id="weight" style="width: 50px"
                                            value="2" />(越小越靠前)
                    <br />
                    舞曲地址1<input type='text' name='dj_urls[]' id='dj_url' style='width: 250px' class='intxts'
                        value='lujings' />
                    舞曲下载地址：<input type='text' name='mp3_urls[]' id='mp3_url' style='width: 250px' class='intxts'
                        value='lujingbs' />
                    <hr color="#999999" />
                </div>
            </td>
        </tr>
    </table>
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" id="head1">
        <tr>
            <td colspan="2">
                <input name="imageField" type="image" src="images/button_ok.gif" width="60" height="22"
                    class="np" border="0" style="cursor: pointer;">
                <img src="images/button_reset.gif" width="60" height="22" border="0" onclick="location.reload();"
                    style="cursor: pointer;">
            </td>
        </tr>
    </table>
    </form>
    <div id="dds" style="display: none">
        &nbsp;标题：<input name="titles[]" type="text" id="title" value="" style="width: 388px">
        &nbsp; &nbsp;自定义属性：
       <?php
            	$dsql->SetQuery("Select * From `#@__arcatt` where att<>'j' And att<>'p' order by sortid asc");
            	$dsql->Execute();
            	while($trow = $dsql->GetObject())
            	{
            		 echo "<input class='np' type='checkbox' name='flagss[0][]' id='flags{$trow->att}' value='{$trow->att}'>{$trow->attname}[{$trow->att}]";
            	}
            	?>权重：<input name="weights[]" type="text" id="weight" style="width: 50px"
                                value="quanzhongValue" />(越小越靠前)
        <br />
        &nbsp;NewTitle<input type='text' name='dj_urls[]' id='dj_url' style='width: 250px'
            class='intxts' value='lujings' />
        &nbsp;NewDownTitle：<input type='text' name='mp3_urls[]' id='mp3_url' style='width: 250px'
            class='intxts' value='lujingbs' />
        发布时间
       <?php
			$nowtime = GetDateTimeMk(time());
			echo "<input name=\"pubdate\" value=\"$nowtime\" type=\"text\" id=\"pubdate\" style=\"width:200\">";
			?> 
        <input name="ishtml" class="np" value="1" checked>
        <hr color="#999999" />
    </div>
</body>
</html>
