<!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=utf-8" />
<title>图片展示添加</title>
<link href="<{$css_root}>images/admincp.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<{$web_url}>include/js/jquery.js"></script>
<script type="text/javascript" src="<{$web_url}>include/js/jquery.MultiFile.js"></script>
<script type="text/javascript">
<!--
function OpenDialog(url)
{
       return window.showModalDialog(url,window, "DialogWidth:500px;DialogHeight:450px;help:no;status:no");
}

function delOnePic(road,ext)
{
	$.post("picture.php",{
		act: "delonepic",
		picname: road,
		ext: ext,
		prid: $("#prid").val()
	}, function (data, textStatus){
		$("#apiclist").html(data);
	}
	)
}

$(function(){ // wait for document to load 
		$('#T8A').MultiFile({ 
		STRING: { 
		remove: '<img src="<{$css_root}>images/cancle.png" height="16" width="16" alt="删除"/>' 
				} 
		}); 
	});
	-->
</script>
</head>
<body>
<div id="append_parent"/>
<div id="cpcontainer" class="container">
  <div class="itemtitle">
    <h3>图片展示</h3>
    <ul class="tab1">
      <li> <a href="picture.php?act=show"> <span>展示列表</span> </a> </li>
      <li class="current"> <a href="picture.php?act=add"> <span>编辑图片</span> </a> </li>
    </ul>
  </div>
  <form id="form" action="picture.php?act=editok" method="post" name="form" enctype="multipart/form-data">
  <input type="hidden" id="prid" value="<{$pict_prid}>" name="prid" />
    <table class="tb tb2">
      <tbody>
        <tr>
          <td class="td27" colspan="2">图片组名称:</td>
        </tr>
        <tr class="noborder">
          <td class="vtop rowform"><input class="txt" type="text" value="<{$pict_title}>" name="pict[title]"/>          </td>
          <td class="vtop tips2"></td>
        </tr>
        <tr>
          <td class="td27" colspan="2">所属分类:</td>
        </tr>
        <tr class="noborder">
          <td class="vtop rowform"><select name="pict[catid]">
              <{section name=cates loop=$piccatelist}>
              <option 
               <{if $piccatelist[cates].catid eq $pict_catid}>
              selected="selected"
              <{/if}>
              value="<{$piccatelist[cates].catid}>"><{$piccatelist[cates].name}>
              </option>
              <{/section}>
            </select>          </td>
          <td class="vtop tips2">所属分类，选择改图片组对应的分类</td>
        </tr>
        <tr>
          <td class="td27" colspan="2">封面图片:</td>
        </tr>
        <tr class="noborder">
          <td class="vtop rowform"><input class="txt" type="text" value="<{$coverpic}>" id="coverpic" name="pict[coverpic]"/><input type="button" class="btn" value="选择" onclick="OpenDialog('open_onepic.php?txtName=coverpic')"/>          </td>
          <td class="vtop tips2"></td>
        </tr>
     
        <tr>
          <td class="td27" colspan="2">展示图片:</td>
        </tr>
        <tr class="noborder">
          <td colspan="2" class="vtop rowform">
          
          <ul id="apiclist">
           <{section name=list loop=$piclist}>
           <li><img src="<{$web_url}><{$piclist[list].thumb_name}>" /><a href="#" onclick="delOnePic('<{$piclist[list].basename}>','<{$piclist[list].ext}>');">删除</a></li>
           <{/section}>
          </ul>
          
          </td>
        </tr>
        
        <tr>
          <td class="td27" colspan="2">新增图片:</td>
        </tr>
        <tr class="noborder">
          <td class="vtop rowform"><input id="T8A" name="pic[]" type="file" class="multi"/></td>
          <td class="vtop tips2">如果需要增加图片，请上传</td>
        </tr>
        <div id="T8A-list"></div> 
        <tr>
          <td colspan="2"><input class="btn" type="submit" value="提交" name="submit"/>          </td>
        </tr>
      </tbody>
    </table>
  </form>
</div>
</body>
</html>