<!DOCTYPE html>
<html>
<head>
  <meta charset="<?php echo $cfg_soft_lang; ?>">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <script src="<?php echo $cfg_cmsurl; ?>/static/web/js/jquery.min.js"></script>
  <link rel="stylesheet" href="<?php echo $cfg_cmsurl; ?>/static/web/css/bootstrap.min.css">
  <link href="<?php echo $cfg_cmsurl; ?>/static/web/font/css/font-awesome.min.css" rel="stylesheet">
  <link rel="stylesheet" href="<?php echo $cfg_cmsurl; ?>/static/web/css/style.css">
  <link rel="stylesheet" href="<?php echo $cfg_cmsurl; ?>/static/web/css/member.css">
  <script src="<?php echo $cfg_cmsurl; ?>/static/web/js/member_album.js"></script>
  <title>修改<?php echo $row['title']?> - 会员中心 - <?php echo $cfg_webname; ?></title>
</head>
<body>
  <?php include(DEDEMEMBER."/templets/top_login.htm"); ?>
  <main class="member">
    <div class="container-fluid pannel">
      <div class="container">
        <div class="row">
          <div class="pannel-main col-md-12 mt-3 mb-3">
            <div class="pannel-main-container">
              <nav class="navbar navbar-expand-lg">
                <ol class="breadcrumb mb-0 mr-auto">
                  <li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li>
                  <li class="breadcrumb-item">修改：<?php echo $row['title']?></li>
                  </li>
                </ol>
                <span class="navbar-text">
                  <a href="javascript:history.back(-1);" class="btn btn-sm">返回</a>
                </span>
              </nav>
              <form name="addcontent" action="album_edit.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit();">
                <input type="hidden" name="dopost" value="save" />
                <input type="hidden" name="aid" value="<?php echo $row['id']; ?>" />
                <input type="hidden" name="idhash" value="<?php echo hash('sha256', $row['id'].$cfg_cookie_encode); ?>" />
                <input type="hidden" name="channelid" value="<?php echo $row['channel']; ?>" />
                <input type="hidden" name="oldlitpic" value="<?php echo $row['litpic']; ?>" />
                <input type="hidden" name="sortrank" value="<?php echo $row['sortrank']; ?>" />
                <input type="hidden" name="imagebody" id="imagebody" value='' />
                <div id="mainCp">
                  <div class="form-group row">
                    <label class="col-sm-2 col-form-label">标题</label>
                    <div class="col-sm-10">
                      <input name="title" type="text" id="title" value="<?php echo $row['title']?>" class="form-control" placeholder="请输入内容主题" />
                    </div>
                  </div>
                  <div class="form-group row">
                    <label class="col-sm-2 col-form-label">标签Tag</label>
                    <div class="col-sm-10">
                      <input name="tags" type="text" id="tags"  value="<?php echo GetTags($row['id']); ?>" class="form-control" />
                    </div>
                  </div>
                  <div class="form-group row">
                    <label class="col-sm-2 col-form-label">作者</label>
                    <div class="col-sm-10">
                      <input name="writer" type="text" id="writer" value="<?php echo $cfg_ml->M_UserName?>" class="form-control" />
                    </div>
                  </div>
                  <div class="form-group row">
                    <label class="col-sm-2 col-form-label">隶属栏目</label>
                    <div class="col-sm-10">
                      <?php
                        $typeOptions = GetOptionList($row["typeid"],$row["channel"]);
                        echo "<select class='form-control' name='typeid' size='1'>\r\n";
                        echo $typeOptions;
                        echo "</select>";
                      ?>
                      <span style="color:#F00">*</span>（不能选择带颜色的分类）
                    </div>
                  </div>
                  <div class="form-group row">
                    <label class="col-sm-2 col-form-label">图集简介</label>
                    <div class="col-sm-10">
                      <textarea class='form-control' name="description" id="description"><?php echo $row["description"]; ?></textarea>（内容的简要说明）
                    </div>
                  </div>
                  <?php
                    //自定义字段
                    PrintAutoFieldsEdit($row['fieldset'],$addRow,'autofield');
                  ?>
                  <!-- 表单操作区域 -->
                  <label>图集内容</label>
                  <div class="contentShow postForm">
                    <input name="maxwidth" type="hidden" id="maxwidth" value="<?php echo $abinfo->GetAtt('maxwidth'); ?>" />
                    <input name="prow" type="hidden" value="<?php echo $abinfo->GetAtt('row'); ?>" />
                    <input name="pcol" type="hidden" value="<?php echo $abinfo->GetAtt('col'); ?>" />
                    <input name="ddmaxwidth" type="hidden" value="<?php echo $abinfo->GetAtt('ddmaxwidth'); ?>" />
                    <p class="cellBg">
                      <label>表现方式：</label>
                      <label><input name="pagestyle" type="radio" id="pagestyle1" onclick="checkMuList()" value="1"
                        <?php if($cfg_album_style==1) echo " checked='checked'"; ?> /> 多页多图显示(适用于QQ表情等)</label>
                      <label><input name="pagestyle" type="radio" id="pagestyle2" onclick="checkMuList()" value="2"
                        <?php if($cfg_album_style==2) echo " checked='checked'"; ?> />多页单图显示(幻灯)</label>
                      <label><input name="pagestyle" type="radio" id="pagestyle3" onclick="checkMuList()" value="3"
                        <?php if($cfg_album_style==3) echo " checked='checked'"; ?> />多行多列显示(缩略图)</label>
                      <div id='spagelist' style="<?php if($abinfo->GetAtt('value')!=2) echo "display:none"; ?>" class="mTB10"> 每页图片数：
                      <input name='pagpicnum' id='pagpicnum' size='10' class="text" value="<?php echo $abinfo->GetAtt('pagpicnum'); ?>" />
                      </div>
                    </p>
                    <p>
                      <label>手工上传：</label>
                      图片数目：<input name="picnum" type="text" id="picnum" size="6" value="3" maxlength="100" class="intxt" />
                      <button class="btn btn-success btn-sm" name='kkkup' type='button' id='kkkup2' onclick="MakeUpload(0);">增加</button>（最大60幅）
                    </p>
                    <p>
                      <div id="uploadfield"></div>
            <?php
       		$j = 1;
       		if(is_array($dtp->CTags))
       		{
       			foreach($dtp->CTags as $ctag){
       				if($ctag->GetName()=="img"){
	   ?>
            <table width='98%' align="center">
              <tr>
                <td height="18"><input type='checkbox' name='isokcheck<?php echo $j; ?>' id='isokcheck<?php echo $j; ?>' value='1' class='np' onclick='CheckSelTable(<?php echo $j; ?>)' checked='1' />
                  显示/隐藏图片[<?php echo $j; ?>]的选框 </td>
              </tr>
            </table>
            <table width="100%" border="0" id="seltb<?php echo $j; ?>" style="margin-bottom:10px;" align="center">
              <tr>
                <td height="26" colspan="2"> 图片</td>
              </tr>
              <tr>
                <td height="26"> 本地上传：
                  <input type="text" name='imgfile<?php echo $j; ?>' style="width:200px;" maxlength="100" class="intxt" />
                </td>
                <td rowspan="3" align="center">
                  <div id='divpicview<?php echo $j; ?>' class='divpre' style="height:5px"></div>
                  <img src="<?php echo trim($ctag->GetInnerText()); ?>" id="picview<?php echo $j; ?>" name="picview<?php echo $j; ?>" style="width: 128px; height: 128px;" />
                </td>
              </tr>
              <input type="hidden" name='imgurl<?php echo $j; ?>' value='<?php echo trim($ctag->GetInnerText())?>' />
              <tr>
                <td height="56"> 图片简介：
                  <textarea name='imgmsg<?php echo $j; ?>' style="height:46px;width:200px"><?php echo trim($ctag->GetAtt('text'))?></textarea></td>
              </tr>
            </table>
            <?php
              $j++;
                      }
                    }
                  }
                  $dtp->Clear();
            ?>
                    </p>
                    <script language="JavaScript">
                      startNum = <?php echo $j; ?>;
                    </script>
            <?php
              //游客强制加验证码，会员则判断后台开关
              if(preg_match("/3/",$safe_gdopen)){
            ?>
                      <div class="form-group row">
                        <label class="col-sm-2 col-form-label">验证码</label>
                        <div class="col-sm-10">
                          <input name="vdcode" type="text" id="vdcode" maxlength="100" class="intxt" style='width:100px;text-transform:uppercase;' />
                          <img src="../apps/vdimgck.php" alt="看不清点击更换" align="absmiddle" style="cursor:pointer" onclick="this.src=this.src+'?'" />
                        </div>
                      </div>
                    <?php }?>
                    <p>
                      <button class="btn btn-success" type="submit">提交</button>
                      <button class="btn btn-secondary" type="reset" onclick="location.reload();">重置</button>
                    </p>
                  </div>
                </div>
              </form>
            </div>
          </div>
        </div>
      </div>
    </div>
  </main>
  <?php include(DEDEMEMBER."/templets/footer.htm"); ?>
</body>
</html>