<!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>
<title>编辑软件:<?php echo $row['title']?></title>
<?php include(DEDEMEMBER."/templets/head_inc.htm"); ?>
<script type="text/javascript" language='javascript' src='js/main.js'></script>
<script type="text/javascript" language="javascript">
<!--
function checkSubmit()
{

	if(document.form1.title.value==""){
		alert("文章标题不能为空！");
		document.form1.title.focus();
		return false;
	}

	if(document.form1.typeid.value==0){
		alert("文章隶属栏目必须选择！");
		return false;
	}

	if(document.form1.typeid.options[document.form1.typeid.selectedIndex].className!='option3')
	{
		alert("文章隶属栏目必须选择白色背景的项目！");
		return false;
	}

	if(document.form1.vdcode.value==""){
		document.form1.vdcode.focus();
		alert("验证码不能为空！");
		return false;
	}

}

var startNum = 2;
function MakeUpload()
{
	var upfield = document.getElementById("uploadfield");
	var morelinkobj = document.getElementById("morelink");
	var endNum =  parseInt(document.form1.picnum.value) + startNum;
	morelinkobj.style.display = "block";
	if(endNum>12) endNum = 12;
	for(startNum;startNum<=endNum;startNum++){
		upfield.innerHTML += "<div class='mT10'>";
		upfield.innerHTML += "软件地址"+startNum+"：<input class='text' type='text' name='softurl"+startNum+"' value='http://'> ";
		upfield.innerHTML += " ";
		upfield.innerHTML += "服务器名称：<input class='text' type='text' name='servermsg"+startNum+"' >\r\n";
		upfield.innerHTML += "</div>";
	}
}

function ShowHideAddr()
{
	document.getElementById('morelink').style.display = (document.getElementById('morelink').style.display=='block' ? 'none' : 'block');
	document.getElementById('btsh3').value = (document.getElementById('morelink').style.display=='block' ? '隐藏地址' : '显示地址');
}

-->
</script>
</head>
<body>
<?php include(DEDEMEMBER."/templets/head.htm"); ?>
<div class="wrapper lineT">
  <div class="mainBox">
    <div class="main">
      <?php include(DEDEMEMBER."/templets/menu.php"); ?>
      <div class="dedeMain">
        <div class="location"><span class="titEditChannel3 icon">编辑</span>软件</div>
        <form class="mTB10 mR10 mL10" name="form1" action="soft_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 md5($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']; ?>" />
          <table cellspacing="1" class="submit mB10">
            <thead>
              <tr>
                <th colspan="4" ><strong>常规参数</strong></th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td width="15%" align="right" valign="top">软件名称：</td>
                <td colspan="3"><input name="title" type="text" id="title" class="text" size="30" style="width:400px;" value="<?php echo $row['title']?>" />
                  <span style="color:#F00">*</span></td>
              </tr>
              <tr>
                <td align="right" valign="top">标签TAG：</td>
                <td colspan="3"><input name="tags" type="text" id="tags" size="30" class="text" style='width:400px' value="<?php echo GetTags($row['id']); ?>"/>
                  (用逗号分开)</td>
              </tr>
              <tr>
                <td align="right" valign="top">作者：</td>
                <td colspan="3"><input name="writer" type="text" id="writer" size="30" style="width:95px;" class="text" value="<?php echo $cfg_ml->M_UserName?>" /></td>
              </tr>
              <tr>
                <td align="right" valign="top">文件类型：</td>
                <td><select name="filetype" id="filetype" style="width:100px">
                    <?php
       if($addRow["filetype"]!="") echo "<option value=\"".$addRow["filetype"]."\">".$addRow["filetype"]."</option>\r\n";
                ?>
                    <option value=".exe" selected="selected">.exe</option>
                    <option value=".zip">.zip</option>
                    <option value=".rar">.rar</option>
                    <option value=".iso">.iso</option>
                    <option value=".gz">.gz</option>
                    <option value="其它">其它</option>
                  </select></td>
                <td width="15%" align="right" valign="top">界面语言：</td>
                <td><select name="language" id="language" style="width:100px">
                    <?php
   if($addRow["language"]!="") echo "<option value=\"".$addRow["language"]."\">".$addRow["language"]."</option>\r\n";
                ?>
                    <option value="简体中文" selected="selected">简体中文</option>
                    <option value="英文软件">英文软件</option>
                    <option value="繁体中文">繁体中文</option>
                    <option value="其它类型">其它类型</option>
                  </select></td>
              </tr>
              <tr>
                <td align="right" valign="top">软件类型：</td>
                <td><select name="softtype" id="softtype" style="width:100px">
                    <?php
      if($addRow["softtype"]!="") echo "<option value=\"".$addRow["softtype"]."\">".$addRow["softtype"]."</option>\r\n";
                ?>
                    <option value="国产软件" selected="selected">国产软件</option>
                    <option value="国外软件">国外软件</option>
                    <option value="汉化补丁">汉化补丁</option>
                  </select></td>
                <td align="right" valign="top">授权方式：</td>
                <td><select name="accredit" id="accredit" style="width:100px">
                    <?php
              if($addRow["accredit"]!="") echo "<option value=\"".$addRow["accredit"]."\">".$addRow["accredit"]."</option>\r\n";
                ?>
                    <option value="共享软件" selected="selected">共享软件</option>
                    <option value="免费软件">免费软件</option>
                    <option value="开源软件">开源软件</option>
                    <option value="商业软件">商业软件</option>
                    <option value="破解软件">破解软件</option>
                    <option value="游戏外挂">游戏外挂</option>
                  </select></td>
              </tr>
              <tr>
                <td align="right" valign="top">运行环境：</td>
                <td><input class="text" type='text' name='os' value="<?php echo $addRow['os'] ?>" /></td>
                <td align="right" valign="top">软件等级：</td>
                <td><select name="softrank" id="softrank" style="width:100px">
                    <?php
              if($addRow["softrank"]!="") echo "<option value=\"".$addRow["softrank"]."\">".$addRow["softrank"]."星</option>\r\n";
                ?>
                    <option value="1">一星</option>
                    <option value="2">二星</option>
                    <option value="3" selected="selected">三星 </option>
                    <option value="4">四星</option>
                    <option value="5">五星</option>
                  </select></td>
              </tr>
              <tr>
                <td align="right" valign="top">官方网址：</td>
                <td><input class="text" name="officialUrl" type="text" id="officialUrl" value="<?php echo $addRow['officialUrl'] ?>" /></td>
                <td align="right" valign="top">程序演示：</td>
                <td><input class="text" name="officialDemo" type="text" id="officialDemo" value="<?php echo $addRow['officialDemo'] ?>" /></td>
              </tr>
              <tr>
                <td align="right" valign="top">软件大小：</td>
                <td><input class="text" name="softsize" type="text" id="softsize" value="<?php echo $addRow['softsize'] ?>" /></td>
                <td align="right" valign="top">软件来源：</td>
                <td><input class="text" name="source" type="text" id="source" value="<?php echo $row['source'] ?>" /></td>
              </tr>
              <tr>
                <td align="right" valign="top">隶属栏目：</td>
                <td colspan="3"><?php
    $typeOptions = GetOptionList($row["typeid"],$row["channel"]);
    echo "<select name='typeid' size='1'>\r\n";
    echo $typeOptions;
    echo "</select>";
		?>
                  <span style="color:#F00">*</span></td>
              </tr>
              <tr>
                <td align="right" valign="top">缩略图：</td>
                <td colspan="3"><input name="litpic" type="file" id="litpic" style="width:408px" onchange="SeePicNew('divpicview',this);"  />
                  <div id='divpicview' class='divpre'></div></td>
              </tr>
              <?php if($row['litpic']!=''){ ?>
              <tr>
                <td align="right" valign="top">原来的缩略图：</td>
                <td colspan="3"><div id='divpicview' class='divpre mTB10 litPic'> <img name="nlitpic"  id="nlitpic" src='<?php  echo $row['litpic'];  ?>'  /></div></td>
              </tr>
              <?php
       }
       //自定义字段
       PrintAutoFieldsAdd($cInfos['fieldset'],'autofield');
      ?>
            </tbody>
          </table>
          <table cellspacing="1" class="submit">
            <thead>
              <tr>
                <th colspan="2" ><strong>软件详情</strong></th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td width="15%" align="right" valign="top">文字介绍：</td>
                <td><?php
          GetEditor("body",$addRow["introduce"],250,"Small");
	?></td>
              </tr>
              <tr>
                <td align="right" valign="top">其它地址：</td>
                <td><input class="text" name="picnum" type="text" id="picnum" size="8" value="5" />
                  <button class="buttonGary4" name='kkkup' type='button' id='kkkup2' onclick="MakeUpload();">增加地址</button>
                  <button class="buttonGary4 mL10" type="button" name="Submit3" id="btsh3" onclick="ShowHideAddr();">隐藏地址</button>
                  (最多为12个链接)
                  <div id="morelink" class="mT10">
                    <?php
        echo $nForm;
        echo "<span id='uploadfield'></span>";
	      ?>
                  </div></td>
              </tr>
              <?php
     //游客强制加验证码，会员则判断后台开关
     if(!$cfg_ml->IsLogin() || $cfg_vdcode_member=='Y')
     {
      ?>
              <tr>
                <td align="right" valign="top">验证码：</td>
                <td><input name="vdcode" type="text" id="vdcode" size="10" class="text"  style='width:50px;text-transform:uppercase;'/>
                  <img src='../include/vdimgck.php' width='50' height='20' align="absmiddle" /></td>
              </tr>
              <?php
     }
     else
     {
     	echo "<input name='vdcode' type='hidden' id='vdcode' value='notuse' />";
     }
      ?>
            </tbody>
            <tfoot>
              <tr>
                <td height="45">&nbsp;</td>
                <td height="45"><button class="button2" type="submit">提交</button>
                  <button class="button2 mL10" type="reset" onclick="location.reload();">重置</button></td>
              </tr>
            </tfoot>
          </table>
        </form>
      </div>
      <div class="clear"></div>
    </div>
    <div class="clear"></div>
  </div>
</div>
<?php include(DEDEMEMBER."/templets/foot.htm"); ?>
</body>
</html>
