<!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>
<link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
<link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
<link rel="stylesheet" href="../static/web/css/admin.css">
<script>const cfg_uplitpic_cut = '<?php echo $cfg_uplitpic_cut; ?>';</script>
<script language="javascript" src="../static/web/js/jquery.min.js"></script>
<script language="javascript" src="../static/web/js/webajax.js"></script>
<script type="text/javascript" src="../static/web/js/moment.min.js"></script>
<script type="text/javascript" src="../static/web/js/daterangepicker.js"></script>
<script language="javascript" src="js/main.js"></script>
<link rel="stylesheet" href="../static/web/css/daterangepicker.css">
<script src="../static/web/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="../static/web/css/jquery.fileupload.css">
<link rel="stylesheet" href="../static/web/css/cropper.min.css">
<script src="../static/web/js/cropper.min.js"></script>
<script language="javascript">
function checkSubmit()
{
   if(document.form1.title.value==""){
	 ShowMsg("<?php echo $cInfos['titlename']; ?>不能为空");
	 document.form1.title.focus();
	 return false;
  }
}
</script>
<style>
body{background:#fff}
img{vertical-align:baseline}
table{border-collapse:separate}
.form-control{display:inline-block;margin-right:6px;width:160px}
</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 src="../static/web/img/book1.gif"><a href="content_sg_list.php?cid=<?php echo $addRow['typeid']?>&channelid=<?php echo $channelid?>&dopost=listArchives">文档列表</a> &gt; 修改分类</td>
      <td width="30%" align='right'><?php echo $backurl; ?><a class="btn btn-success btn-sm" href="catalog_main.php">栏目管理</a></td>
    </tr>
  </table>
  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" id="head1">
    <tr>
      <td colspan="2">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="86" height="26" align="center" background="../static/web/img/itemnote1.gif">常规信息</td>
            <td width="86"></td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
<form name="form1" action="archives_sg_edit.php" enctype="multipart/form-data" method="post" onSubmit="return checkSubmit();">
<input type="hidden" name="channelid" value="<?php echo $channelid; ?>">
<input type="hidden" name="id" value="<?php echo $aid; ?>">
<input type="hidden" name="sortrank" value="<?php echo $addRow['senddate']; ?>">
<input type="hidden" name="dopost" value="save">
  <table width="98%"  border="0" align="center" cellpadding="2" cellspacing="2" id="needset" style="border:1px solid #dee2e6;background:#ffffff;">
    <tr>
      <td height="26" 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="<?php echo $addRow['title']; ?>" style="width:380px"></td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td width="400%" height="26" class="bline">
      	<table width="800" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="90">&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())
            {
              if(preg_match("#".$trow->att."#", $addRow['flag']))
              echo "<label><input class='np' type='checkbox' name='flags[]' id='flags{$trow->att}' value='{$trow->att}' checked='checked' /> {$trow->attname}[{$trow->att}]</label> ";
              else
              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>
      <td height="26" 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:160px">
              <option value='<?php echo $addRow["arcrank"]; ?>'><?php echo $addRow["rankname"]; ?></option>
              <?php
              $urank = $cuserLogin->getUserRank();
              $dsql->SetQuery("Select * from `#@__arcrank` where adminrank<='$urank' And `rank`<>'{$addRow["arcrank"]}' ");
              $dsql->Execute();
              while($row = $dsql->GetObject()) {
              	echo "<option value='".$row->rank."'>".$row->membername."</option>";
              }
              ?>
              </select>
            </td>
          </tr>
        </table>
       </td>
    </tr>
    <tr id="pictable" style='<?php if($cInfos['needpic']==0) echo 'display:none'; ?>'>
      <td height="26" class="bline">
      	<table width="800" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="90">&nbsp;缩略图：</td>
            <td>
              <input name="picname" type="text" id="picname" style="width:300px" value="<?php echo $addRow['litpic']?>">
              <label><input type='checkbox' class='np' name='ddisremote' value='1'>&nbsp;远程</label>
              <span class="btn btn-success btn-sm fileinput-button">上传图片<input type="file" name="files[]" id="iptAddImages"></span>
              <button type="button" name="Submit" onClick="SelectImage('form1.picname','');" class="btn btn-success btn-sm">选择图片</button>
              <button id="btnClearAll" type="button" class="btn btn-success btn-sm delete">清空</button>
            </td>
            <td align="center"><img id="litPic" src="<?php if($addRow['litpic']!='') echo $addRow['litpic']; else echo '../static/web/img/defaultpic.jpg'; ?>" style="height:80px"></td>
          </tr>
        </table>
      </td>
    </tr>
    <?php if($cInfos['dfcid']>0)
    {
      echo "<input type='hidden' name='typeid' value='{$cInfos['dfcid']}' />";
    } else {
    ?>
    <tr>
      <td height="26" class="bline">
        <table width="800" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="90">&nbsp;文档主栏目：</td>
            <td>
            <?php
            $typeOptions = GetOptionList($addRow['typeid'],$cuserLogin->getUserChannel(),$channelid);
            echo "<select name='typeid' id='typeid' style='width:240px'>";
            if($addRow["typeid"]=="0") echo "<option value='0' selected>请选择栏目</option>";
            echo $typeOptions;
            echo "</select>";
			     ?>
			     <img src='../static/web/img/menusearch.gif' onClick="ShowCatMap(event,this,<?php echo $channelid; ?>,'typeid','<?php echo $addRow['typeid']; ?>')" title='快捷选择' style='cursor:pointer'>
			     </td>
          </tr>
      </table>
    </td>
    </tr>
    <?php
    }
    ?>
    <tr>
     <td>
      <?php PrintAutoFieldsEdit(stripslashes($cInfos['fieldset']),$addRow,'autofield'); ?>
     </td>
   </tr>
  </table>
  <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#f8f8f8" style="border:1px solid #dee2e6;border-top:none" class="mb-3">
    <tr height="36">
      <td style="padding:.6rem">
        <button type="submit" class="btn btn-success">保存</button>
        <button type="button" onClick="location.reload();" class="btn btn-success">重置</button>
      </td>
    </tr>
  </table>
</form>
</body>
</html>