<?php defined('IN_HS') or exit('Access Denied'); ?><html>
<head>
<title>在线上传</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $CONFIG['charset'];?>">
<style>
INPUT {BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #666 1px solid; PADDING-LEFT: 2px; BACKGROUND: #f9f9f9; PADDING-BOTTOM: 2px; BORDER-LEFT: #666 1px solid; COLOR: #333; PADDING-TOP: 2px; BORDER-BOTTOM: #ccc 1px solid;height:21px;}
.btn {PADDING-RIGHT: 5px; PADDING-LEFT: 5px; BORDER-LEFT-COLOR: #ddd; BACKGROUND: #ddd; BORDER-BOTTOM-COLOR: #666; PADDING-BOTTOM: 1px; MARGIN: 3px 0px; VERTICAL-ALIGN: middle; CURSOR: pointer; COLOR: #000; BORDER-TOP-COLOR: #ddd; PADDING-TOP: 4px; BORDER-RIGHT-COLOR: #666;height:25px;}

</style>
<script language="javascript" src="<?php echo HS_PATH;?>data/js/config.js"></script>
<script language="javascript" src="<?php echo HS_PATH;?>include/js/common.js"></script>
</head>
<body>
<script type="text/javascript">
function doCheck() {
if(upload.uploadfile.value == '') {
alert('请选择文件!');
return false;
}
return true;
}
</script>
<table cellpadding="5" cellspacing="3" style="border:#EEEEEE 1px solid;">
  <tr>
    <th style="text-align:center;">图片上传</th>
  </tr>
<form name="upload" method="post" action="<?php echo HS_PATH;?>upload.php?keyid=<?php echo $keyid;?>&uploadtext=<?php echo $uploadtext;?>&type=<?php echo $type;?>&width=<?php echo $width;?>&height=<?php echo $height;?>&upload_dir=<?php echo $upload_dir;?>" enctype="multipart/form-data" onSubmit="return doCheck();">
  <tr>
     <td class="tablerow" height="30">
     <input type="hidden" name="save" value="1">
             <input name="uploadfile" type="file" class="btn" size="19"  <?php if($type) { ?>onchange="upload.previewpic.src=upload.uploadfile.value"<?php } ?>>
             <input type="hidden" name="oldname">
             <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $maxfilesize;?>"> 
             <input type="submit" class="btn" name="submit" value="上传"><br>
  <!--<?php if($type) { ?><input style="width:100px" class="btn" type="button" name="submit" value=" 预览 " onClick="if(upload.uploadfile.value!='') upload.previewpic.src=upload.uploadfile.value"><?php } ?> <br>
!-->
 </td>
   </tr>
   <?php if($type=="water") { ?>

   <?php if($HS['water_type']==1) { ?> 
  <tr>
 <td class="tablerow">
 水印文字：<input name="water_text" type="text" size="34" value="<?php echo $HS['water_text'];?>"> <br>
 文字颜色：<input name="water_fontcolor" type="text" size="7" value="<?php echo $HS['water_fontcolor'];?>">
 <?php echo color_select("fontcolor","颜色",$HS['water_fontcolor'],0," onchange='upload.water_fontcolor.value=this.value'");?>
 文字大小：<input name="water_fontsize" type="text" size="5" value="<?php echo $HS['water_fontsize'];?>"> <br> 
 水印位置：<select name="water_pos">

<?php if(is_array($poss)) foreach($poss AS $id => $pos) { ?>
 <option value="<?php echo $id;?>" <?php if($HS['water_pos']==$id) { ?>selected<?php } ?>><?php echo $pos;?></option>

<?php } ?>

   </select>
 </td>
   </tr>
   <?php } elseif ($HS['water_type']==2) { ?>
<tr>
 <td class="tablerow">水印图片：<input name="water_image" type="text" size="5" value="<?php echo $HS['water_image'];?>"> px</td>
   </tr>
   <?php } ?>
  <tr>
     <td class="tablerow">说明：系统将按照指定的条件给图片加水印</td>
   </tr>
   <?php } ?>

 <?php if($type) { ?>
 <tr>
 <td class="tablerow">
<img id="previewpic" onload="setpicWH(this,300,300)">
<script>
if(window.opener.myform.<?php echo $uploadtext;?>.value!="")
{
    upload.oldname.value = window.opener.myform.<?php echo $uploadtext;?>.value;
    upload.previewpic.src = '<?php echo HS_PATH;?>'+window.opener.myform.<?php echo $uploadtext;?>.value;
}
else
{
    upload.previewpic.src = "<?php echo HS_PATH;?>img/main/nopic.gif";
}
</script>
</td>
   </tr>
<?php } else { ?>
<script>
if(window.opener.myform.<?php echo $uploadtext;?>.value!="")
{
    upload.oldname.value = window.opener.myform.<?php echo $uploadtext;?>.value;
}
</script>
<?php } ?>
</form>
</table>
</body>
</html>