<?php
require_once (dirname(__FILE__).'/global.php');
if(!$lfjid){
	die("<A HREF='$webdb[www_url]/do/login.php'>ÇëÏÈµÇÂ¼</A>");
}
if($action=='copyimg'){
	$picurl=$_POST[picurl];
	$strcode = file_get_contents($picurl);
	$name = $lfjuid.'_'.rands(4).'_'.$timestamp.'.jpg';
	if(!is_dir(ROOT_PATH."$webdb[updir]/$updir")){
		makepath(ROOT_PATH."$webdb[updir]/$updir");
	}
	write_file(ROOT_PATH."$webdb[updir]/$updir/$name",$strcode);
	echo "<script>
				window.parent.upimg1(\"{$updir}/$name\");
		 </script>";
	exit;
}
print <<<EOT
<html>
<head>
<title>ÇëÑ¡ÔñÍ¼Æ¬</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
body{margin:0px;padding:0px;font-size:12px;background:#FFF;}
input{border:1px solid #ddd; height:25px;}
</style>
<script type="text/javascript" src="$webdb[www_url]/images/default/hf/jquery-v1.7.2.js"></script>
<script type="text/javascript" src="$webdb[www_url]/images/exif/selectimg.js"></script>
<script type="text/javascript" src="$webdb[www_url]/images/exif/exif.js"></script>
<SCRIPT LANGUAGE='JavaScript'>
<!--
function uploadImages(picurl){
	$('#testaaaa').val(picurl);
	$('form').submit();
}
//-->
</SCRIPT>
</head>
<body>
<form method="post" action="?action=copyimg&updir=$updir">
  <input type="file" onChange="selectFileImage(this);"/>
  <textarea name="picurl" id="testaaaa" style="display:none;"></textarea>
</form>
</body>
</html>
EOT;
?>