<?php
/*
 * 注意：此文件由tpl_engine编译型模板引擎编译生成。
 * 如果您的模板要进行修改，请修改 templates/default/modules/group/group_subject.html
 * 如果您的模型要进行修改，请修改 models/modules/group/group_subject.php
 *
 * 修改完成之后需要您进入后台重新编译，才会重新生成。
 * 如果您开启了debug模式运行，那么您可以省去上面这一步，但是debug模式每次都会判断程序是否更新，debug模式只适合开发调试。
 * 如果您正式运行此程序时，请切换到service模式运行！
 * 
 * 如有您有问题请到官方论坛（http://tech.jooyea.com/bbs/）提问，谢谢您的支持。
 */
?><?php 
	//必须登录才能浏览该页面
	require("foundation/auser_mustlogin.php");
	
	//引入模块公共方法文件
	require("foundation/module_album.php");
	require("foundation/module_group.php");
	
	//引入语言包
	$g_langpackage=new grouplp;
	
	//变量区
	$user_id=get_sess_userid();
	$join_group=get_sess_jgroup();
	$group_id=short_check(get_argg('group_id'));
	$creat_group=get_sess_cgroup();
	$u_id=short_check(get_argg('user_id'));
	$role='';
	$album_id='';
	//数据表定义
	$t_album=$tablePreStr."album";
	
	//定义读操作
	$dbo=new dbex();	
	dbtarget('r',$dbServs);
	
	//权限判断
	$role=pri_limit($dbo,$user_id,$group_id);
	if(!isset($role)){
		echo "<script type='text/javascript'>alert(\"$g_langpackage->g_no_privilege\");window.history.go(-1);</script>";exit();
	}
?>

<!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 rel="stylesheet" type="text/css" href="skin/<?php echo $skinUrl;?>/css/row_menus.css">
<link rel="stylesheet" type="text/css" href="skin/<?php echo $skinUrl;?>/css/iframe.css">
<script type="text/javascript" src="skin/default/js/imgfix.js"></script>
<SCRIPT language=JavaScript src="servtools/ajax_client/ajax.js"></SCRIPT>
<script Language="JavaScript">

function CheckForm(){
	if(document.myform.LOG_TITLE.value==""){
		parent.Dialog.alert("<?php echo $g_langpackage->g_title;?>");
		document.myform.LOG_TITLE.focus();
		return false;
	}
    
	KindSubmit();
    
	if(document.myform.CONTENT.value==""){
		parent.Dialog.alert("<?php echo $g_langpackage->g_none_content;?>");
		return false;
	}
		return true;
}

function AddContentImg(ImgName,classId){
	var frm = document.myform;
	var htmlletter = window.frames["KindEditorForm"];
	htmlletter.document.getElementsByTagName("BODY")[0].innerHTML=htmlletter.document.getElementsByTagName("BODY")[0].innerHTML+"<br><IMG src='./"+ImgName+"' onload='fixImage(this,420,0)' classId="+classId+" /><br>";	
}

</script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  <div class="main_right_title">
     <span class="main_title_dot8"></span>
     <span class="main_title_txt"><?php echo $g_langpackage->g_subject;?></span>
  </div>
  <div id="tabsB">
  <ul>
    <li><a class="nowbutl"><span class="nowbutr"><?php echo $g_langpackage->g_subject;?></span></a></li>
  </ul>
	<div class="div_but_2" onclick="location.href='?app=group_space&group_id=<?php echo $group_id;?>&user_id=<?php echo $user_id;?>'">
	<?php echo $g_langpackage->g_re_space;?>
	</div>	
</div>

	<form action="do.php?act=group_send_sub&group_id=<?php echo $group_id;?>&user_id=<?php echo $u_id;?>"  method="post" style="margin-left:6px;margin-top:10px" name="myform" onSubmit="return CheckForm();">
		<table border="0" width="95%" cellpadding="2" cellspacing="1" style="margin: 0 auto; text-align: left;">
			
			<tr>
				<td nowrap="nowrap" width="63" align="right"><?php echo $g_langpackage->g_subject;?>：</td>
				<td class="TableLine1"><input class="BigInput" type="text" name="LOG_TITLE" value="" size="73" /></td>
			</tr>
			
			<tr>
      			<td valign="top"  style="text-align:right;"><?php echo $g_langpackage->g_content;?>：</td>
				<td class="TableLine1" align=left>
					<textarea name="CONTENT" id="CONTENT" cols="40" rows="5" style="display:none;"></textarea>
					<script type="text/javascript" src="servtools/simeditor/KindEditor.js"></script>
					<script type="text/javascript">
						var editor = new KindEditor("editor");
						editor.hiddenName = "CONTENT";
						editor.skinPath = "servtools/simeditor/skins/default/";
						editor.iconPath = "servtools/simeditor/icons/";
						editor.cssPath = "servtools/simeditor/common.css";
						editor.editorType = "simple";
						editor.editorWidth = "480px";
						editor.editorHeight = "300px";
						editor.show();
						function KindSubmit() {
						editor.data();
						}
					</script>				</td>
		  </tr>
		  
   		<tr>
	      <td  align="right"><?php echo $g_langpackage->g_pic;?>：</td>
	      <td  align=left>
	      	<div id="POPUP_KE_IMAGE">
	      		<iframe name="KindImageIframe" id="KindImageIframe" width="100%" height=30 align=top allowTransparency="true" scrolling=no src='?app=upload_form' frameborder=0></iframe>
	      	</div>	      </td>
		</tr>
		<tr>
			<td></td>
    		<td><?php echo album_name($dbo,$t_album,$user_id,$album_id);?><?php echo $g_langpackage->g_sel_album;?></td>
					<script type='text/javascript'>
						var album_select=document.getElementById("album_name");
						album_select.onchange=list_album_photos;										      
						function list_album_photos(){
								//获取接受返回信息层 
								var album_select_val=document.getElementById("album_name").value;
								
								var photos_list=document.getElementById("photos_list");
								
								if(album_select_val==""){
									return false;
								}else{						
									photos_list.innerHTML="数据加载中,请稍侯...";							
									var URL="?app=user_ico_select&type=blog_photo&album_id="+album_select_val;							
									ajax=InitAjax();//实例化Ajax
									ajax.open("GET",URL,true);//通过Post方式打开连接 						
									ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); //定义传输的文件HTTP头信息 
									ajax.send(null); //发送POST数据						
									//获取执行状态
									ajax.onreadystatechange = function() { 
										//如果执行状态成功，那么就把返回信息写到指定的层里 
										if(ajax.readyState==4&&ajax.status==200){ 
												photos_list.innerHTML=ajax.responseText; 								
										}
									}
								}					
						}
					</script> 					      
			</tr>
			<tr>
				<td></td>
				<td>
					<div id='photos_list'></div>				</td>
			</tr>
			<tr>
				<td></td>
				<td><input type=submit class=anniu value="<?php echo $g_langpackage->g_button_yes;?>"></td>
			</tr>
		</table>
	</form>
</body>
</html>