<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../Inc/Commoncode.asp" -->
<!--#include file="../checkvalid.asp"-->
<%Action=trim(Request("Action"))
Select Case Action
	Case "CreateTradeJs"
	If Not FRAdminLevel(103) Then
		Call ErrorMsg()
	End If
		Call CreateTradeJs()
	Case "CreateProvinceJs"
	If Not FRAdminLevel(102) Then
		Call ErrorMsg()
	End If
		Call CreateProvinceJs()
	Case "CreatePositionJs"
	If Not FRAdminLevel(105) Then
		Call ErrorMsg()
	End If
		Call CreatePositionJs()
	Case "CreateComPositionJs"
	If Not FRAdminLevel(105) Then
		Call ErrorMsg()
	End If
		Call CreateComPositionJs()
	Case "CreateProfessionJs"
	If Not FRAdminLevel(104) Then
		Call ErrorMsg()
	End If
		Call CreateProfessionJs()
End Select

Sub CreateTradeJs()
tradearraycode="tradearray=new Array();"& vbCrLf 
'tradearraycode=tradearraycode&"tradearray[0]=new Array(""请选择行业类别"",""0"",""0000"");"& vbCrLf 
set CTJrs=conn.execute("select * from JOB_trade order by [order] asc")
if not CTJrs.eof then
	i=0
	do while not CTJrs.eof
	tradearraycode=tradearraycode&"tradearray["&i&"]=new Array("""&trim(CTJrs("trade_name"))&""",""0"","""&CTJrs("trade_id")&""","""&trim(CTJrs("trade_enname"))&""");"& vbCrLf 
	i=i+1
	if CTJrs.eof then exit do
	CTJrs.movenext
	loop
end if
CTJrs.close
set CTJrs=nothing
Set fso = Server.CreateObject("Scripting.FileSystemObject")
HtmlFileName=Server.MapPath(InstallDir&"Js/gettrade.js")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine tradearraycode
fout.close
set fout = nothing
response.write "<script>alert('生成完成！');location.href='javascript:history.back()';</script>"
Response.End 
End Sub

Sub CreateProvinceJs()
Pacarraycode="provincearray=new Array();"& vbCrLf 
'Pacarraycode=Pacarraycode&"provincearray[0]=new Array(""请选择区域"",""0"",""0000"");"& vbCrLf 
set CTJrs=conn.execute("select * from JOB_provinceandcity order by fid asc,[order] asc")
if not CTJrs.eof then
	i=0
	do while not CTJrs.eof
	Pacarraycode=Pacarraycode&"provincearray["&i&"]=new Array("""&trim(CTJrs("province_city"))&""","""&CTJrs("fid")&""","""&CTJrs("id")&""","""&trim(CTJrs("enprovince_city"))&""");"& vbCrLf 
	i=i+1
	if CTJrs.eof then exit do
	CTJrs.movenext
	loop
end if
CTJrs.close
set CTJrs=nothing
Set fso = Server.CreateObject("Scripting.FileSystemObject")
HtmlFileName=Server.MapPath(InstallDir&"Js/GetProvince.js")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine Pacarraycode
fout.close
set fout = nothing
response.write "<script>alert('生成完成！');location.href='javascript:history.back()';</script>"
Response.End 
End Sub

Sub CreatePositionJs()
positionarraycode="positionarray=new Array();"& vbCrLf 
'positionarraycode=positionarraycode&"positionarray[0]=new Array(""请选择岗位类别"",""0"",""0000"");"& vbCrLf 
set CTJrs=conn.execute("select * from JOB_position order by position_fid asc,[order] asc")
if not CTJrs.eof then
	i=0
	do while not CTJrs.eof
	positionarraycode=positionarraycode&"positionarray["&i&"]=new Array("""&trim(CTJrs("position_name"))&""","""&CTJrs("position_fid")&""","""&CTJrs("position_id")&""","""&trim(CTJrs("position_enname"))&""");"& vbCrLf 
	i=i+1
	if CTJrs.eof then exit do
	CTJrs.movenext
	loop
end if
CTJrs.close
set CTJrs=nothing
Set fso = Server.CreateObject("Scripting.FileSystemObject")
HtmlFileName=Server.MapPath(InstallDir&"Js/getposition.js")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine positionarraycode
fout.close
set fout = nothing
response.write "<script>alert('生成完成！');location.href='javascript:history.back()';</script>"
Response.End 
End Sub

Sub CreateComPositionJs()
positionarraycodes="positionarrays=new Array();"& vbCrLf 
'positionarraycode=positionarraycode&"positionarray[0]=new Array(""请选择岗位类别"",""0"",""0000"");"& vbCrLf 
set CTJrss=conn.execute("select * from JOB_position where position_id in("&ComPositionId&") order by position_fid asc,[order] asc")
if not CTJrss.eof then
	i=0
	do while not CTJrss.eof
	positionarraycodes=positionarraycodes&"positionarrays["&i&"]=new Array("""&trim(CTJrss("position_name"))&""","""&CTJrss("position_fid")&""","""&CTJrss("position_id")&""","""&trim(CTJrss("position_enname"))&""");"& vbCrLf 
	i=i+1
	if CTJrss.eof then exit do
	CTJrss.movenext
	loop
end if
CTJrss.close
set CTJrss=nothing
Set fso = Server.CreateObject("Scripting.FileSystemObject")
HtmlFileName=Server.MapPath(InstallDir&"Js/getpositions.js")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine positionarraycodes
fout.close
set fout = nothing
response.write "<script>alert('生成完成！');location.href='javascript:history.back()';</script>"
Response.End 
End Sub

Sub CreateProfessionJs()
professionarraycode="professionarray=new Array();"& vbCrLf 
'professionarraycode=professionarraycode&"professionarray[0]=new Array(""请选择专业类别"",""0"",""0000"");"& vbCrLf 
set CTJrs=conn.execute("select * from JOB_profession order by profession_fid asc,[order] asc")
if not CTJrs.eof then
	i=0
	do while not CTJrs.eof
	professionarraycode=professionarraycode&"professionarray["&i&"]=new Array("""&trim(CTJrs("profession_name"))&""","""&CTJrs("profession_fid")&""","""&CTJrs("profession_id")&""","""&trim(CTJrs("profession_enname"))&""");"& vbCrLf 
	i=i+1
	if CTJrs.eof then exit do
	CTJrs.movenext
	loop
end if
CTJrs.close
set CTJrs=nothing
Set fso = Server.CreateObject("Scripting.FileSystemObject")
HtmlFileName=Server.MapPath(InstallDir&"Js/getprofession.js")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine professionarraycode
fout.close
set fout = nothing
response.write "<script>alert('生成完成！');location.href='javascript:history.back()';</script>"
Response.End 
End Sub
%>
