<!DOCTYPE html>
<html>
<head>
  <meta charset="<?php echo $cfg_soft_lang;?>">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <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">
  <link rel="stylesheet" href="../static/web/css/daterangepicker.css">
  <link rel="stylesheet" href="../static/web/css/jquery.fileupload.css">
  <link rel="stylesheet" href="../static/web/css/cropper.min.css">
  <script>const cfg_uplitpic_cut = '<?php echo $cfg_uplitpic_cut;?>';</script>
  <script src="../static/web/js/jquery.min.js"></script>
  <script src="../static/web/js/webajax.js"></script>
  <script src="../static/web/js/moment.min.js"></script>
  <script src="../static/web/js/daterangepicker.js"></script>
  <script src="js/main.js"></script>
  <script src="../static/web/js/bootstrap.bundle.min.js"></script>
  <script src="../static/web/js/cropper.min.js"></script>
  <style>table{border-collapse:inherit}</style>
  <script>
  function checkSubmit()
  {
	if (document.form1.title.value==""){
	  ShowMsg("<?php echo $cInfos['titlename'];?>不能为空");
	  document.form1.title.focus();
	  return false;
	}
  }
  </script>
</head>
<body>
  <table width="98%" align="center" cellpadding="0" cellspacing="0" id="head1" class="mt-3">
    <tr>
      <td>
        <table cellpadding="0" cellspacing="0">
          <tr>
            <td width="80" height="28" align="center" class="biz-itemnote1">常规内容</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%" align="center" cellpadding="2" cellspacing="2" id="needset" class="biz-border">
      <tr>
        <td class="biz-td">
          <table cellspacing="0" cellpadding="0">
            <tr>
              <td width="90"><?php echo $cInfos['titlename'];?>:</td>
              <td><input type="text" name="title" id="title" value="<?php echo $addRow['title'];?>" class="biz-input-lg"></td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td class="biz-td">
        	<table cellspacing="0" cellpadding="0">
            <tr>
              <td width="90">自定义属性:</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 class='mr-1'><input type='checkbox' name='flags[]' id='flags{$trow->att}' value='{$trow->att}' checked='checked'> {$trow->attname}[{$trow->att}]</label>";
                  else
                  echo "<label class='mr-1'><input 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 class="biz-td">
        	<table cellspacing="0" cellpadding="0">
            <tr>
              <td width="90">缩略图:</td>
              <td width="620">
                <input type="text" name="picname" id="picname" class="biz-input-md" value="<?php echo $addRow['litpic']?>">
                <label><input type="checkbox" name="ddisremote" value="1" id="ddisremote"> 远程</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 type="button" id="btnClearAll" class="btn btn-success btn-sm">清空</button>
              </td>
              <td><img src="<?php if ($addRow['litpic']!='') echo $addRow['litpic']; else echo '../static/web/img/thumbnail.jpg';?>" id="litPic" class="thumbnail"></td>
            </tr>
          </table>
        </td>
      </tr>
      <?php if ($cInfos['dfcid']>0)
      {
        echo "<input type='hidden' name='typeid' value='{$cInfos['dfcid']}'>";
      } else {
      ?>
      <tr>
        <td class="biz-td">
          <table cellspacing="0" cellpadding="0">
            <tr>
              <td width="90">发布栏目:</td>
              <td>
              <?php
              $typeOptions = GetOptionList($addRow['typeid'],$cuserLogin->getUserChannel(),$channelid);
              echo "<select name='typeid' id='typeid' class='biz-input-sm'>";
              if ($addRow["typeid"]=="0") echo "<option value='0' selected>请选择栏目</option>";
              echo $typeOptions;
              echo "</select>";
  			      ?>
  			      <i class="btn btn-sm fa fa-search" onClick="ShowCatMap(event,this,<?php echo $channelid;?>,'typeid','<?php echo $addRow['typeid'];?>')" title="快捷选择"></i> 
  			      </td>
            </tr>
          </table>
  	  </td>
      </tr>
      <tr>
        <td class="biz-td">
        	<table cellspacing="0" cellpadding="0">
            <tr>
              <td width="90">浏览权限:</td>
              <td>
                <select name="arcrank" id="arcrank" class="biz-input-sm">
                <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>
      <?php }?>
      <tr>
        <td><?php PrintAutoFieldsEdit(stripslashes($cInfos['fieldset']),$addRow,'autofield');?></td>
     </tr>
    </table>
    <table width="98%" cellspacing="0" cellpadding="0" align="center" bgcolor="#f8f8f8" class="biz-border border-top-0 mb-3">
      <tr>
        <td align="center" class="py-2">
          <button type="submit" class="btn btn-success btn-sm">保存</button>
          <button type="button" onClick="location.reload();" class="btn btn-success btn-sm">重置</button>
        </td>
      </tr>
    </table>
  </form>
</body>
</html>