<html><script type="text/javascript">
$(document).ready(function()
{
function imgcaptcha(inputID,imgdiv)
{
	$(inputID).focus(function(){
		if ($(inputID).val()=="点击获取验证码")
		{
		$(inputID).val("");
		$(inputID).css("color","#333333");
		}
		$(inputID).parent("div").css("position","relative");
		//设置验证码DIV
		$(imgdiv).css({ position: "absolute", left:  $(inputID).width(), "bottom": "0px" , "z-index": "10", "background-color": "#FFFFFF", "border": "1px #A3C8DC solid","display": "none","margin-left": "15px"});
		$(imgdiv).show();
		if ($(imgdiv).html()=='')
		{
		$(imgdiv).append("<img src=\"{#$QISHI.site_dir#}include/imagecaptcha.php?t={#$random#}\" id=\"getcode\" align=\"absmiddle\"  style=\"cursor:pointer; margin:3px;\" title=\"看不请验证码？点击更换一张\"  border=\"0\"/>");
		}
		$(imgdiv+" img").click(function()
		{
			$(imgdiv+" img").attr("src",$(imgdiv+" img").attr("src")+"1");		
		});
		$(document).click(function(event)
		{
			var clickid=$(event.target).attr("id");
			if (clickid!="getcode" &&  clickid!="postcaptcha")
			{
			$(imgdiv).hide();
			$(inputID).parent("div").css("position","");
			}			
		});
	});
}
{#if $verify_simple=="1"#}
imgcaptcha("#postcaptcha","#imgdiv");
{#/if#}
//
$("#form_simple").validate({
 //debug: true,
// onsubmit:false,
//onfocusout :true,
   rules:{
   jobname:{
    required: true,
	minlength:2,
    maxlength:30
   },
   amount: {
	range:[0,999]
   },
   comname: "required",
   contact: "required",
   {#if $QISHI.simple_tel_edit=="1"#}
   tel:{
   required: true,
   digits:true, 
	minlength:7
	{#if $QISHI.simple_tel_repeat=="0"#}
	,
	remote:{     
		url:"{#$QISHI.site_dir#}plus/ajax_simple.php",     
		type:"get",    
		data:{"tel":function (){return $("#tel").val()},"id":function (){return $("#id").val()},"act":"check_tel","time":function (){return new Date().getTime()}}     
		}
	{#/if#}
   },
   {#/if#}
   email: {
	   email:true
	   },
   address:{
   required: true
   },
   pwd:{
   required: true,
   minlength:6,
   remote:{     
		url:"{#$QISHI.site_dir#}plus/ajax_simple.php",     
		type:"get",    
		data:{"pwd":function (){return $("#pwd").val()},"id":function (){return $("#id").val()},"act":"check_pwd","time":function (){return new Date().getTime()}}     
		}
   }
   ,
   detailed:{
   required: true,
   ISdetailed:true,
   maxlength:300
   }
	{#if $verify_simple=="1"#}
	,
		postcaptcha:{
		IScaptchastr: true,
		required: true,
		remote:{     
		url:"{#$QISHI.site_dir#}include/imagecaptcha.php",     
		type:"post",    
		data:{"postcaptcha":function (){return $("#postcaptcha").val()},"act":"verify","time":function (){return new Date().getTime()}}     
		}
	   }
	   {#/if#}	   
	},
    messages: {
    jobname: {
    required: "请输入职位名称",
    minlength: jQuery.format("职位名称不能小于{0}个字符"),
	maxlength: jQuery.format("职位名称不能大于{0}个字符")
   },
   amount: {
    range: jQuery.format("请输入一个介于 {0} 和 {1} 之间的值")
   },
   comname: {
    required: "请输入公司名称"
   },
   contact: {
    required: "请输入联系人"
   },
   tel: {
    required: "请输入联系电话",
	digits: "联系电话必须是数字",
    minlength: jQuery.format("电话不能<{0}位数")
	{#if $QISHI.simple_tel_repeat=="0"#}
	,
	remote: jQuery.format("此号码已存在,请更换")	
	{#/if#}
   },
   email: {
	email: jQuery.format("请正确填写电子邮箱")
   },
    address: {
    required: jQuery.format("请填写联系地址")
   },
    pwd: {
    required: jQuery.format("请输入管理密码"),
	minlength: jQuery.format("密码不能小于{0}个字符"),
	remote: jQuery.format("密码错误")	
   }
   ,
    detailed: {
    required: jQuery.format("请输入具体要求"),
	maxlength: jQuery.format("具体要求不能大于{0}个字符")
 
   }
   {#if $verify_simple=="1"#}
   ,
    postcaptcha: {
    required: "请填写验证码",
	remote: jQuery.format("验证码错误")	
   }
   {#/if#}
  },
  errorPlacement: function(error, element) {
    if ( element.is(":radio") )
        error.appendTo( element.parent().next().next() );
    else if ( element.is(":checkbox") )
        error.appendTo ( element.next());
	else if ( element.is("textarea") )
        error.appendTo ( $("#textareaerr"));
    else
        error.appendTo(element.parent());
	}
    });
	 //具体要求
	jQuery.validator.addMethod("ISdetailed", function(value, element) {
	var str="请填写招聘的具体要求，如：性别，学历，年龄，工作经验，工资待遇等相关信息";
	var flag=true;
	if (str==value)
	{
	flag=false;
	}
	return  flag || this.optional(element) ;
	}, "请填写具体要求");
	jQuery.validator.addMethod("IScaptchastr", function(value, element) {
	var str="点击获取验证码";
	var flag=true;
	if (str==value)
	{
	flag=false;
	}
	return  flag || this.optional(element) ;
	}, "请填写验证码");

	/////验证码部分
});
</script>
<form id="form_simple" name="form_simple" method="post" action="{#$QISHI.site_dir#}plus/ajax_simple.php?act=editsave">
<table width="100%" border="0" cellspacing="8" cellpadding="0">
  <tr>
    <td width="80" align="right">招聘职位：</td>
    <td><input name="jobname" type="text" class="simpleinput200" id="jobname" maxlength="20" value="{#$info.jobname#}"></td>
  </tr>
  <tr>
    <td align="right">招聘人数：</td>
    <td><input name="amount" type="text" id="amount" class="simpleinput200" style="width:60px;" value="{#$info.amount#}" maxlength="3">
	<span class="simple_note">填写数字，"0"为若干</span>	</td>
  </tr>
  <tr>
    <td align="right">招聘单位：</td>
    <td><input name="comname" type="text" class="simpleinput200" id="comname" maxlength="20" value="{#$info.comname#}"></td>
  </tr>
  <tr>
    <td align="right">联系人：</td>
    <td><input name="contact" type="text" class="simpleinput200" id="contact" maxlength="15" value="{#$info.contact#}" ></td>
  </tr>
  <tr>
    <td align="right">联系电话：</td>
    <td>
	{#if $QISHI.simple_tel_edit=="0"#}
	{#$info.tel#}<span class="simple_note" style="color:#0066FF">(不可修改，您可以删除本条信息再次发布)</span>	
	{#else#}
	<input name="tel" type="text" class="simpleinput200" id="tel" maxlength="25"  value="{#$info.tel#}">
	{#/if#}
	</td>
  </tr>
  <tr>
    <td align="right">联系邮箱：</td>
    <td><input name="email" type="text" class="simpleinput200" id="email" maxlength="30" value="{#$info.email#}"></td>
  </tr>
  <tr>
    <td align="right">联系QQ：</td>
    <td><input type="text" name="qq"  id="qq" class="simpleinput200" value="{#$info.qq#}"></td>
  </tr>
  <tr>
    <td align="right">联系地址：</td>
    <td><input name="address" type="text" class="simpleinput200" id="address" style="width:300px;" maxlength="50" value="{#$info.address#}"></td>
  </tr>
  <tr>
    <td align="right">具体要求：</td>
    <td><textarea name="detailed" id="detailed" class="simpleinput400" style="height:60px;">{#$info.detailed#}</textarea></td>
  </tr>
    <tr>
    <td align="right"> </td>
    <td>不能大于300字符
	<span id="textareaerr"></span>
	</td>
  </tr>
  <tr>
    <td align="right">有效期截至：</td>
    <td>
	{#if $info.deadline=="0"#}
	长期有效
	{#else#}
	{#$info.deadline|date_format:"%Y-%m-%d"#}	
	<span class="simple_note">到期后系统将自动删除</span>
	{#/if#}
	</td>
  </tr>
  {#if $info.deadline!="0"#}
  <tr>
    <td align="right">延长有效期：</td>
    <td>
	<input name="days" type="text" class="simpleinput200" id="days" style="width:100px;" maxlength="3" value="0">
	天
	<span class="simple_note">0为不延长</span>
	</td>
  </tr>
  {#/if#}
  <tr>
    <td align="right">管理密码：</td>
    <td><input name="pwd" type="text" class="simpleinput200" id="pwd" style="width:100px;" maxlength="25">
</td>
  </tr>
  {#if $verify_simple=="1"#}
	  <tr>
      <td align="right">验证码：</td>
      <td> 
	  
	  <div>
	  <div id="imgdiv"></div>
			<input  class="simpleinput200" name="postcaptcha" id="postcaptcha" type="text" value="点击获取验证码" style="color:#999999;width:100px;"/>
		</div>	  </td>
      </tr>
	  {#/if#}
  <tr>
    <td align="right">&nbsp;</td>
    <td height="40" valign="top">
	<input name="id" type="hidden"  id="id" value="{#$info.id#}" />
	<input name="" type="submit" class="but80" id="addsimple" value="修改" />
	</td>
  </tr>
</table>
</form>
