﻿// JScript 文件
window.IncludeFile={"header":"head.html","tailer":"tail.html"};
window.JsModule=["system/jqframe.js"];
function WebMain()
{ 
    $.SetFormat("zh","rc_zwdh","<li class='linkover'><a style=\"\" href=\"rc_zhaopindetail.html?{'zpid':'#0#'}\" ><b style=\"font-weight:normal;color:#1A3874;padding-right:30px;\">[#2#]</b>#1#</a></li>","","");
    $.SetFormat("zh","settypesmall","<p style=\"float:left;width:100px;\"><a href=\"rc_zhaopin.html?{'Sort':'#1#'}\">#0#</a></p>","","");
    /*职位导航-招聘信息*/$("#rc_zwdh").SendMessage({bLoading:false,type:"DBSelect",id:"rc_zwdh",pm :"<@ehai_jobsupply%16Id%16Id,jobnamemc,DATE_FORMAT(PubDate,'%m-%d'),CompanyName%16%16%16PubDate desc%160%16IsShow=1 and status=1@>%16",format:"rc_zwdh",start:0,total:15});
    /*职位分类列表*/$.SendMessage({callback:setbigtype,bLoading:false,type:"DBSelect",id:"getzhiweitypebig",pm :"<@ehai_typetable%16Id%16eName,Class,Id%16%16%16Class asc%160%16Sort=5 and LENGTH(Class)=2%16@>"});
	if($.PageParam.qzid)
	{
    /*求职信息详细内容*/
	$.SendMessage({callback:setqiuzhiinfo,type:"DBSelect",pm :"<@ehai_jobseek left join ehai_typetable on (ehai_jobseek.Sort=ehai_typetable.Class and ehai_typetable.Sort=5 )%16ehai_jobseek.Id%16ehai_jobseek.eName,ehai_jobseek.Sex,ehai_jobseek.BirthY,ehai_jobseek.BirthM,ehai_jobseek.Political,ehai_jobseek.Residence,ehai_jobseek.School,ehai_jobseek.Education,ehai_jobseek.Major,ehai_jobseek.Phone,ehai_jobseek.CellPhone,ehai_jobseek.Email,ehai_jobseek.SalaryRequest,ehai_typetable.eName,ehai_jobseek.SchoolExperience,ehai_jobseek.Reward,ehai_jobseek.LangLevel,ehai_jobseek.Computer,ehai_jobseek.Lang,ehai_jobseek.Special,ehai_jobseek.JobExperience,ehai_jobseek.Appraise,ehai_jobseek.CreateTime,ehai_jobseek.jiphoto%16%16%16%160%16ehai_jobseek.Id=@>"+ $.PageParam.qzid +"%16"});
	}
	if($.PageParam.zpid)
	{
    /*招聘信息详细内容*/$.SendMessage({callback:setzhaopininfo,type:"DBSelect",pm :"<@ehai_jobsupply%16Id%16JobName,DATE_FORMAT(PubDate,'%Y-%m-%d'),CompanyName,WorkPlace,Num,ValidTime,CompanyInfo,Resposibility,Address,Post,Contactor,Telephone,Email,jobnamemc%16%16%16%160%16ehai_jobsupply.Id=@>"+ $.PageParam.zpid +" and ehai_jobsupply.IsShow=1%16"});
    }
    else
    {
    /*招聘信息*/$.SendMessage({callback:setzhaopinlist,bLoading:false,type:"DBSelect",id:"zpxx",pm :"<@ehai_jobsupply%16Id%16Id,jobnamemc,DATE_FORMAT(PubDate,'%m-%d'),CompanyName%16%16%16PubDate desc%160%16IsShow=1 and status=1@>%16"});
    /*求职信息*/$.SendMessage({callback:setqiuzhilist,bLoading:false,type:"DBSelect",id:"qzxx",pm :"<@ehai_jobseek%16Id%16Id,eName,Major,DATE_FORMAT(CreateTime,'%m-%d'),jobpost%16%16%16CreateTime desc%160%16IsShow=1 and IsCheck=1@>%16"});
    }
    getAdsInfo(36);
}
//读取职位分类列表
function setbigtype(re)
{
    if(re)
    {
        var h=""
        for(i=0;i<re.length;i++)
        {
            h+="<div class=\"bantitle\"><a href=\"rc_zhaopin.html?{'Sort':'"+re[i][1]+"'}\"><b>"+re[i][0]+"</b></a></div><div id=\"bigtypeli"+re[i][1]+"\"></div><div style=\"height:1px;clear:both\"></div>"
           
        }
         $("#rc_left").html(h);
        for(i=0;i<re.length;i++)
        {
            /*职位小类*/$("#bigtypeli"+re[i][1]).SendMessage({bLoading:false,type:"DBSelect",pm :"<@ehai_typetable%16Id%16eName,Class,Id%16%16%16Class asc%160%16Sort=5 and LENGTH(Class)=4 and left(Class,2)='@>"+re[i][1]+"'%16",format:"settypesmall"});
        }
    }
};
function setqiuzhiinfo(re)
{
    //debugger;
    var qzhtml;
    if(re && !re.error && !re.wrong && re[0])
    {
        var html="";
        html="姓名："+"<span id='name' class=\"biaotinr\">"+re[0][0]+"</span><span class=\"biaotinr\">性别："+((re[0][1]==0)?"男":((re[0][1]==1)?"女":""))+"</span><span class=\"biaotinr\">出生年月："+re[0][2]+"-"+re[0][3]+"</span><span class=\"biaotinr\" >政治面貌："+re[0][4]+"</span><span class=\"biaotinr\" style=\" border-right-width:0px\">籍贯："+re[0][5]+"</span><br /><span class=\"biaotinr\" >毕业院校："+re[0][6]+"</span>学历："+"<span id='xueli' class=\"biaotinr\" >"+re[0][7]+"</span>专业："+"<span id='zhuanye' class=\"biaotinr\" style=\" border-right-width:0px\">"+re[0][8]+"</span><br /><span class=\"biaotinr\" >电话："+re[0][9]+"</span><span class=\"biaotinr\" style=\" border-right-width:0px\">手机："+re[0][10]+"</span><br /><span class=\"biaotinr\" style=\" border-right-width:0px\" >Email："+re[0][11]+"</span>";
        $("#qztitle").html(re[0][0]+"的简历"); 
        $("#basicinf").html(html);   
        $("#qqyx").html("<span class=\"biaotinr\" style=\" border-right-width:0px\">薪金要求："+re[0][12]+"</span><br /><span class=\"biaotinr\" style=\" border-right-width:0px\">工作意向："+re[0][13]+"</span>");
        $("#education").html("<span class=\"biaotinr\" style=\" border-right-width:0px\">"+jQuery.htmldecode(re[0][14],1)+"</span>"); 
        $("#english").html("<span class=\"biaotinr\" style=\" border-right-width:0px\">英语等级："+re[0][16]+"</span><br /><span class=\"biaotinr\" style=\" border-right-width:0px\">计算机水平："+re[0][17]+"</span><br /><span class=\"biaotinr\" style=\" border-right-width:0px\">其他外语水平："+re[0][18]+"</span><br /><span class=\"biaotinr\" style=\" border-right-width:0px\">其他特殊技能水平："+re[0][19]+"</span>");
        $("#pingjia").html("<span class=\"biaotinr\" style=\" border-right-width:0px\">"+jQuery.htmldecode(re[0][21],1)+"</span>");
        if(re[0][23].length>11) 
        $("#jlphoto").html("<img alt=\"photo\" style=\"width:113px;height:135px;display:block;border:1px solid #D9D9D9\" src=\""+re[0][23]+"\" />");
        else $("#jlphoto").html("<img alt=\"photo\" src=\"images/jianlixp.jpg\" />");
    }else{
        qzhtml="对不起，没有此信息！"
        $("#qzdetail").html(qzhtml); 
		$("#text_name").val(re[0][0]);
		$("#text_name").val(re[0][0]);
    }
};
function setzhaopininfo(re)
{
    var zphtml;
    if(re!="")
    {
        $("#zhaopinbt").html(re[0][13]); 
        $("#zhaopinrq").html("发布日期："+re[0][1]+"公司名称："+"<span id='sczhaopincom'>"+re[0][2]+"</span>"); 
        $("#workplace").html("工作地点："+re[0][3]+"<br />人数："+re[0][4]+" <br />有效期："+re[0][5]+" 天<br />公司简介："+jQuery.htmldecode(re[0][6],1)); 
        $("#resposibility").html(jQuery.htmldecode(re[0][7],1)); 
        $("#contract").html("地 址："+re[0][8]+"<br />邮 编："+re[0][9]+"<br />联 系 人："+re[0][10]+"<br />电 话："+re[0][11]+"<br>E-mail："+re[0][12]+""); 

        
    }else{
        zphtml="对不起，没有此信息！"
        $("#zpdetail").html(zphtml);      
    }
}
//求职列表
function setqiuzhilist(re)
{
    var qiuzhi=""
    for(i=0;i<re.length;i++)
    {
        if(i<3)
        qiuzhi+="<li style=\"color:red;\"><a style='width:430px;' href=\"rc_qiuzhidetail.html?{'qzid':"+re[i][0]+"}\"><p style='float:left;width:60px;margin:0 5px;color:red;padding-top:3px;'>["+re[i][3]+"]</p><p style='float:left;margin-left:10px;width:50px;color:red'>"+re[i][1]+"</p><p style='float:left;margin-left:20px;color:red;width:120px;overflow:hidden;'>"+re[i][2]+"</p><p style='float:left;margin-left:20px;color:red;width:130px;overflow:hidden;''>"+re[i][4]+"</p></a></li>"
        else
        qiuzhi+="<li><a style='width:430px;' href=\"rc_qiuzhidetail.html?{'qzid':"+re[i][0]+"}\"><p style='float:left;width:60px;margin:0 5px;color:#07536D;padding-top:3px;'>["+re[i][3]+"]</p><p style='float:left;margin-left:10px;width:50px;'>"+re[i][1]+"</p><p style='float:left;margin-left:20px;width:120px;overflow:hidden;''>"+re[i][2]+"</p><p style='float:left;margin-left:20px;width:130px;overflow:hidden;''>"+re[i][4]+"</p></a></li>"
       
    }

     $("#qzxx").html(qiuzhi);
};
//招聘列表
function setzhaopinlist(re)
{
        var zhaopin=""
        for(i=0;i<re.length;i++)
        {
            if(i<3)
            zhaopin+="<li><a style='width:420px;' href=\"rc_zhaopindetail.html?{'zpid':'"+re[i][0]+"'}\"><p style='float:left;width:60px;margin:0 5px;color:red;padding-top:3px;'>["+re[i][2]+"]</p><p style='float:left;margin-left:10px;width:100px;color:red;'>"+re[i][1]+"</p><p style='float:left;margin-left:10px;color:red;'>"+re[i][3]+"</p></a></li>"
            else
            zhaopin+="<li><a style='width:420px;' href=\"rc_zhaopindetail.html?{'zpid':'"+re[i][0]+"'}\"><p style='float:left;width:60px;margin:0 5px;color:#07536D;padding-top:3px;'>["+re[i][2]+"]</p><p style='float:left;margin-left:10px;width:100px;'>"+re[i][1]+"</p><p style='float:left;margin-left:10px;'>"+re[i][3]+"</p></a></li>"
        }
         $("#zpxx").html(zhaopin);
};



//图片跳转
function tiaozhuan()
{
    $.SendMessage({type:"Session",callback:getsessiongq,pm :"<@@>"},true);
};
function getsessiongq(re)
{
    if(re[0][0])
        window.location.href="of_bangongshi.html";
    else
        alert("您未登录");
};

//页内搜索
window.tjtype2=1;
function rc_rightsearch()
{
    var aimUrl;
    var rczw=$("#rczw").val();
    var rcsf=$("#rcsf").val();
    var rctime=$("#rctime").val();
    if(tjtype2==1)
    {
        aimUrl="rc_qiuzhi.html?{'rczw':'"+rczw+"','rcsf':'"+rcsf+"','rctime':'"+rctime+"'}";
    }else if(tjtype2==2)
    {
        aimUrl="rc_zhaopin.html?{'rczw':'"+rczw+"','rcsf':'"+rcsf+"','rctime':'"+rctime+"'}";
    }    
    window.location=aimUrl;
};
function settype2(ra)
{
    tjtype2=ra;
};
//投递简历功能
function toudijl()
{
    $.SendMessage({type:"Session",callback:getjlsession,pm :"<@@>"},true);
}
function getjlsession(re)
{
    if(re[0][0]!="")
        $.SendMessage({callback:getqiuzhiid,bLoading:false,type:"DBSelect",id:"getqiuzhiid",pm :"<@ehai_jobseek%16Id%16Id%16%16%16%160%16UserName='{username}'%16@>"});
    else
        {alert("您未登陆，不能投递简历！");return false;}
};
function getqiuzhiid(re)
{
    if(re=="") alert("只有个人用户才可投递简历");
    else
    $.SendMessage({type:"DBInsert",pm :"<@ehai_resumetoposition%16JobSeekId,JobSupplyId,createtime%16@>"+re[0][0]+","+$.PageParam.zpid+",NOW()%16%16",callback:addjlresult},true);
}
function addjlresult(re)
{
    if(re=="success")
       alert("投递成功！");
    else
       alert("投递失败！");
};
