<!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=<?php echo $cfg_soft_lang; ?>">
<title>发布文档</title>
<style type="text/css">
body { background-image: url(images/allbg.gif); }
</style>
<link rel="stylesheet" href="../static/css/bootstrap.min.css">
<link href="../static/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="css/base.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../static/js/jquery.js"></script>
<script src="../static/js/bootstrap.bundle.js"></script>
<script language="javascript" src="../static/js/dedeajax2.js"></script>
<link href="../static/css/daterangepicker.css" rel="stylesheet">
<script type="text/javascript" src="../static/js/moment.min.js"></script>
<script type="text/javascript" src="../static/js/daterangepicker.js"></script>
<script language='javascript' src="js/main.js"></script>
<link rel="stylesheet" href="../static/css/jquery.fileupload.css">
<link href="../static/css/cropper.min.css" rel="stylesheet">
<script src="../static/js/cropper.min.js"></script>
<script language="javascript">
function checkSubmit()
{
  if(document.form1.title.value==""){
	   ShowMsg("<?php echo $cInfos['titlename']; ?>不能为空");
	   return false;
  }
  if(document.form1.typeid.value==0){
    ShowMsg("请选择档案的主栏目");
	   return false;
  }
}
</script>
<style>
  img {
    vertical-align: baseline;
  }

  input,
  select {
    height: auto !important;
  }
</style>
</head>
<body topmargin="8">
  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="mt-3">
    <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">文档列表</a> &gt;&gt; 发布文档</td>
      <td width="30%" align='right'>&nbsp; <?php echo $backurl; ?><a class="btn btn-success btn-sm" href="catalog_main.php">栏目管理</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="84"></td>
            <td>&nbsp;</td>
          </tr>
        </table>
      </td>
    </tr>
  </table>

<form name="form1" action="archives_sg_add.php" enctype="multipart/form-data" method="post" onSubmit="return checkSubmit()">
  <input type="hidden" name="channelid" value="<?php echo $channelid?>" />
  <input type="hidden" name="cid" value="<?php echo $cid?>" />
  <input type="hidden" name="dopost" value="save" />
  <input type="hidden" id="litpic_b64" name="litpic_b64" value="">
  <table width="98%"  border="0" align="center" cellpadding="2" cellspacing="2" id="needset" style="border:1px solid #cfcfcf;background:#ffffff;">
    <tr>
      <td height="24" colspan="4" class="bline">
      	<table width="800" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="90">&nbsp;<?php echo $cInfos['titlename']; ?>：</td>
            <td>
            	<input name="title" type="text" id="title" value="" style="width:388px">             </td>
          </tr>
        </table>      </td>
    </tr>
    
    <tr>
      <td height="24" colspan="4" class="bline">
      	<table width="800" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="100">&nbsp;自定义属性：</td>
            <td>
            	<?php
            	$dsql->SetQuery("Select * From `#@__arcatt` where att<>'j' And att<>'p' order by sortid asc");
            	$dsql->Execute();
            	while($trow = $dsql->GetObject())
            	{
            		 echo "<label><input class='np' type='checkbox' name='flags[]' id='flags{$trow->att}' value='{$trow->att}'> {$trow->attname}[{$trow->att}]</label> ";
            	}
            	?>
            </td>
          </tr>
        </table>
       </td>
    </tr>
    <tr id="pictable" style='<?php if($cInfos['needpic']==0) echo 'display:none'; ?>'>
      <td height="24" colspan="4" class="bline">
      	<table width="800" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="90"> &nbsp;缩 略 图：</td>
            <td>
            	<table width="100%" border="0" cellspacing="1" cellpadding="1">
                <tr>
                  <td height="30">
                    <input name="picname" type="text" id="picname" style="width:240px" />
                    <button type="button" name="Submit2"
                      onClick="SelectImage('form1.picname','small');" class='btn btn-success btn-sm'>站内选择</button>
                    <label><input type='checkbox' class='np' name='ddisremote' value='1' id='ddisremote' /> 远程 </label>
                    <span class="btn btn-success btn-sm fileinput-button">
                      <i class="glyphicon glyphicon-plus"></i>
                      选择图片
                      <input type="file" name="files[]" id="iptAddImages">
                    </span>
                    <button id="btnClearAll" type="button" class="btn btn-success btn-sm delete">
                      <i class="fa fa-trash-o"></i>
                      <span>清空</span>
                    </button>
                  </td>
                </tr>
              </table>
             </td>
            <td width="150" align="center">
              <img id="litPic" src="../static/defaultpic.gif" style="height: 80px">
            </td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td height="24" colspan="4" class="bline">
      	<table width="800" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="90">&nbsp;浏览权限：</td>
            <td>
            	<select name="arcrank" id="arcrank" style="width:150px">
                <?php
              $urank = $cuserLogin->getUserRank();
              $dsql->SetQuery("Select * from `#@__arcrank` where adminrank<='$urank'");
              $dsql->Execute();
              while($row = $dsql->GetObject())
              {
              	echo "     <option value='".$row->rank."'>".$row->membername."</option>\r\n";
              }
              ?>
              </select>
             </td>
            <td width="90"></td>
            <td></td>
          </tr>
        </table>
       </td>
    </tr>
    <?php if($cInfos['dfcid']>0)
      {
      	echo "<input type='hidden' name='typeid' value='{$cInfos['dfcid']}' />\r\n";
      }
      else
      {
      ?>
    <tr>
      <td height="24" colspan="4" class="bline">
      	<table width="800" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="100">&nbsp;文档主栏目：</td>
          <td>
          	<span id='typeidct'>
       <?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>";
			?></span>
			<img src='images/menusearch.gif' style='cursor:pointer;' onClick="ShowCatMap(event, this, <?php echo $channelid; ?>, 'typeid')" alt='快捷选择' title='快捷选择' />
			&nbsp;<a href='catalog_main.php' class='btn btn-success btn-sm'>栏目管理</a>
			&nbsp;<a href='catalog_add.php?listtype=all' class='btn btn-success btn-sm'>增加大栏目</a>	
            </td>
        </tr>
      </table></td>
    </tr>
     <?php } ?>
    <tr>
     <td><?php PrintAutoFieldsAdd($cInfos['fieldset'],'autofield'); ?></td>
    </tr>
  </table>

<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F9FCEF" style="border:1px solid #cfcfcf;border-top:none;" class="mb-3">
  <tr>
    <td height="35">
	<table width="98%" border="0" cellspacing="1" cellpadding="1">
        <tr>
          <td width="17%">&nbsp;</td>
          <td width="83%"><table width="214" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="115" class="py-3">
                    <button type="submit" class="btn btn-success">保存</button>
                </td>
                <td width="99" class="py-3">
                  <button type="button" onClick="location.reload();" class="btn btn-success">重置</button>
                </td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
</form>
</body>
</html>