<%@ page contentType="text/html; charset=utf-8" session="false"%>
<%@ taglib uri="/cmsTag" prefix="cms"%>

<!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">
<html>
	<head>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="${ResBase}member/css/style.css" rel="stylesheet" type="text/css"></link>
		<title>门户演示站 - 本站基于JTopcms构建</title>



	</head>


	<body>
		<div class="header">
			<!--头部开始-->
			<cms:Include page="common/member_head.jsp" />
			<script>
			  basePath='<cms:BasePath/>';
		
			</script>

			<script type="text/javascript" src="${ResBase}js/dialog/lhgdialog.min.js?skin=iblue"></script>
			<script type="text/javascript" src="${ResBase}member/editor/fckeditor.js"></script>
			<script type="text/javascript" src="${ResBase}member/editor/editor_content_format.js"></script>



			<!--头部结束-->

			<cms:Member loginMode="true">
		</div>

		<div class="container">

			<!--左边开始-->
			<cms:Include page="common/member_left.jsp" />
			<!--左边开始-->


			<div class="my_myresume_r">

				<div class="switchBox" id="switchBox">
					<h1 class="new_section">
						我要投稿
					</h1>
					<div class="eidt-password">
						<form id="memForm" name="memForm" method="post">
							<table width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td width="20%" align="right">
										投稿标题
									</td>
									<td>
										<input name="title" id="title" type="text" class="from-input" />
									</td>
								</tr>
								<tr>
									<td align="right">
										目标栏目
									</td>
									<td>
										<cms:Class id="${param.classId}">
											<input name="className" id="className" readonly type="text" class="from-input" value="${Class.className}" />
											<input name="classId" id="classId" readonly type="hidden" value="${Class.classId}" />
										</cms:Class>

									</td>
								</tr>
								<tr>
									<td align="right">
										关键字
									</td>
									<td>
										<input name="keywords" id="keywords" type="text" class="from-input" />
									</td>
								</tr>
								<tr>
									<td align="right">
										文章来源
									</td>
									<td>
										<input name="author" id="author" type="text" class="from-input" />
									</td>
								</tr>
								<tr>
									<td align="right">
										作者
									</td>
									<td>
										<input name="creator" id="creator" type="text" class="from-input" value="${Member.memberName}" />
									</td>
								</tr>
								<tr>
									<td align="right">
										摘要
									</td>
									<td>
										<input name="summary" id="summary" type="text" class="from-input" />
									</td>
								</tr>
								<tr>

									<td colspan="2">
										<textarea style="width:380px;height:250px" name="mh_wz_temp" id="mh_wz_temp" class="from-textarea"></textarea>

										<input type="hidden" id='mh_wz' name="mh_wz" />

										<script type="text/javascript">
											var editor1 = new FCKeditor('mh_wz_temp'); 
											editor1.BasePath = "${ResBase}member/editor/"; 
											editor1.ToolbarSet = 'noUpload'; 
										 	editor1.Height = 450 ;
										    editor1.Width = 620;
										    editor1.Config["EnterMode"] = "p";
										    editor1.ReplaceTextarea() ; 
										</script>

									</td>
								</tr>
								<tr>
									<td align="right">
										验证码
									</td>
									<td>
										<table border="0" cellpadding="0" cellspacing="0">
											<tr>
												<td>

													<input name="sysCheckCode" id="sysCheckCode" type="text" class="from-input" style="width:80px" maxlength="4" />


												</td>
												<td>
													<img id="checkCodeImg" src="${SiteBase}common/authImg.cmd?count=4&line=1&point=60&width=90&height=32&jump=8" />

												</td>
												<td>

													<a style="cursor: pointer;" onclick="javascript:changeCode();">重刷</a>
												</td>

											</tr>
										</table>

									</td>
								</tr>
								<tr>
									<td align="right">
										&nbsp;
									</td>
									<td>
										<input type="button" name="button" id="button" value="存稿" class="btn btn2 fl btn-primary" onclick="javascript:addContent('draft');" />

										&nbsp;&nbsp;&nbsp;&nbsp;
										<input value="发布" type="button" class="btn btn2  btn-primary" onclick="javascript:addContent('','-1','','-1');"/>

									</td>
								</tr>
							</table>
						</form>
					</div>


				</div>
			</div>

		</div>
		<div class="footer">
			© 2013 jtopcms.com All Rights Reserved
		</div>

		<script type="text/javascript">

		function addContent(mode, aid, fid, tid)
			{
				
			
				var cid =$('#classId').val(); 
  
		       if('-1' == cid)
		       {
			     alert('请选择一个投递栏目！');
		         return false;
			
			   }
			   
			   //获取editor值
			    var oEditor = FCKeditorAPI.GetInstance('mh_wz_temp'); 
    		 
    			$('#mh_wz').val(oEditor.GetXHTML(true));
			   
			
				var url = '${SiteBase}content/clientAddContent.cmd?contentAddStatus='+mode+'&actionId='+aid+'&fromStepId='+fid+'&toStepId='+tid;
			    var postData = encodeURI($("#memForm").serialize());
			    //alert(postData);
			    $.ajax({
			      	type: "POST",
			       	url: url,
			       	data:postData,
			   
			       	success: function(msg)
			        {        
			            //alert(msg);
			            if('1' == msg)
			            {
							if('draft' == mode)
			            	{
			            		alert('保存稿件成功!');
			            		
			            	}
			            	else
			            	{
								alert('投递稿件成功!请等待管理员处理');
							}
							
							window.location.href = '${SiteBase}member/member_all_content.jsp';
			            }
			            else if('-1' == msg)
			            {
							alert('请输入正确的验证码!');
			            	
			            }
			            else if('0' == msg)
			            {
							alert('当前栏目不允许投稿!');
			            	
			            }
			            else if('-3' == msg)
			            {
							alert('您的会员权限不够，无法投稿！');
			            	
			            }
						else 
			            {
							alert('投递稿件失败!');
			            	
			            }
						
			        }
			  });	

				 
			}
	
 
			function changeCode()
			{
				$('#checkCodeImg').attr('src','${SiteBase}common/authImg.cmd?count=4&line=1&point=60&width=90&height=32&jump=8&rand='+Math.random());
			
			}
</script>
	</body>
</html>



</cms:Member>
