<?php
/**
 * 拒绝直接访问模板
 */ 
if(ZIBANMA_SYS_LINK != 'zibanma_com'){
	die('access deny');
}
?>
<!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>main</title>
<link href="/template/admin/style/style.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
th {text-align:right; font-weight:normal;}
</style>
<script src="/library/jquery/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="/library/editor/kindeditor-min.js" type="text/javascript"></script>
<script src="/library/js/zibanma.admin.js" type="text/javascript"></script>
<script type="text/javascript">
zibanma.adminLoadSimpleEditer();
zibanma.adminLoadMultiImageEditer();
zibanma.userIsExists = function(user){
	if(user!=''){
		var url = '<?php echo $user_is_exists_post_url;?>';
		$.post(url, {'user':user}, function(data){
			try{var json=eval(data);}catch(e){}
			if(json){
				if(json.status=='success'){
					url = '<?php echo $user_album_list_url;?>';
					$.post(url, {'user':user}, function(data){
						try{json=eval(data);}catch(e){}
						if(json && json.length>0){
							var list = [];
							list.push('<select name="album" class="select">');
							for(var i=0; i<json.length; i++){
								list.push('<option value="'+json[i].id+'">'+json[i].title+'</option>');
							}
							list.push('</select>');
							$('#album_list_div').html(list.join(''));
						}else{
							$('#album_list_div').html('该用户没有创建相册');
							$('#submit').attr('disabled', true);
						}
					});
					$('#user_is_exists_span').html('');
					$('#user_album_list').css('display','');
					$('#submit').attr('disabled', false);
				}else{
					$('#user_is_exists_span').html('<font style="color:#ff0000;">* 用户不存在</font>');
					$('#submit').attr('disabled', true);
				}
			}
		});
	}else{
		$('#user_is_exists_span').html('<font style="color:#ff0000;">* 请输入正确用户名</font>');
	}
}
</script>
</head>
<body id="main">
	<div class="body">
		<div class="title"><?php echo $menu_name;?></div>
		<div class="content">
			<form action="" method="post">
			<table>
				<tr>
					<td colspan="2">本操作将直接发布图片至用户相册内</td>
				</tr>
				<tr>
					<th>所属用户：</th>
					<td><input type="text" id="user" name="create_user" class="input" onblur="zibanma.userIsExists(this.value);" /> <span id="user_is_exists_span">* 输入用户名</span></td>
				</tr>
				<tr id="user_album_list" style="display:none;">
					<th>所属相册：</th>
					<td><div id="album_list_div"></div></td>
				</tr>
				<tr>
					<th>&nbsp;</th>
					<td>优化选项，多个关键词以半角逗号 , 隔开</td>
				</tr>
				<tr>
					<th>图片关键词：</th>
					<td><textarea id="keywords" name="keywords" style="width:500px; height:60px;"></textarea></td>
				</tr>
				<tr>
					<th>&nbsp;</th>
					<td>优化选项，说明不超过200字，请勿在说明里使用特殊符号</td>
				</tr>
				<tr>
					<th>图片说明：</th>
					<td><textarea id="description" name="description" style="width:500px; height:60px;"></textarea></td>
				</tr>
				<tr>
					<th>发布日期：</th>
					<td><input type="text" id="create_time" name="create_time" class="input" value="<?php echo date('Y-m-d H:i:s');?>" onblur="zibanma.adminCheckFromIsNull(this)" /></td>
				</tr>
				<tr>
					<th>初始点击：</th>
					<td><input type="text" id="click" name="click" class="input" value="500" onblur="zibanma.adminCheckFromIsNull(this)" /> * 本选项只可为数字</td>
				</tr>
				<tr>
					<th>上传图片：</th>
					<td><input type="button" id="zibanma_select_image" class="button" value="选择图片" /></td>
				</tr>
				<tr id="upload_image_list" style="display:none;">
					<th>图片预览：</th>
					<td>
						<div id="zibanma_image_view"></div>
						<input type="hidden" id="graph" name="graph" />
					</td>
				</tr>
				<tr>
					<th>相册简介：</th>
					<td><textarea id="content" name="content"></textarea></td>
				</tr>
				<tr>
					<th>&nbsp;</th>
					<td><input type="submit" id="submit" name="submit" class="button" disabled="disabled" value="确认提交" /></td>
				</tr>
			</table>
			</form>
		</div>
	</div>
</body>
</html>