%
If session("username")="" then
Response.Redirect("login.asp")
Response.End()
End if
Dim Cnn,strsql,rsnationality,rscat
Dim rsApplicants
Set Cnn=Server.CreateObject("ADODB.Connection")
Set rsnationality =Server.Createobject("Adodb.recordset")
With cnn
.Provider = "SQLOLEDB"
.ConnectionString = Application("SqlConnectionString")
.Open
End With
strsql="Select Distinct Countryname from countries Order by Countryname"
rsnationality.open strsql,Cnn
Set rscat =Server.Createobject("Adodb.recordset")
strsql="Select distinct Category from Jobcategory Order by category"
rscat.open strsql,Cnn
dim musername,mpassword,mtitle,mfirstname,mlastname,msex,mmaritalstatus,mage,mnationality,mstayingin,mPhoneresidence
dim mMobile,mvisastatus,mEmail
musername=session("username")
Set rsApplicants =Server.Createobject("Adodb.recordset")
strsql="Select * from Applicants where username like '" & musername & "'"
strsql="Select * from Applicants where regno = '" & trim(Session("regno")) & "'"
'response.Write(strsql)
'Response.End()
rsApplicants.open strsql,Cnn,adopendynamic,adlockpessimistic,adcmdtext
If Not rsApplicants.eof then
session("regno")=rsApplicants("regno")
musername=rsApplicants("username")
mtitle=rsApplicants("Title")
mFirstname=rsApplicants("Firstname")
mLastname=rsApplicants("Lastname")
mSex=rsApplicants("Sex")
mMaritalstatus=rsApplicants("Maritalstatus")
Mage=rsApplicants("Age")
mNationality=rsApplicants("Nationality")
mstayingin=rsApplicants("Stayingin")
mVisastatus=rsApplicants("visa")
mPhoneresidence=rsApplicants("Phoneresidence")
mMobile=rsApplicants("Mobile")
mEmail=rsApplicants("Email")
If msex="F" then
msex="Female"
Else
mSex="Male"
End if
If mmaritalstatus="M" then mmaritalstatus="Married"
If mmaritalstatus="S" then mmaritalstatus="Single"
If mmaritalstatus="D" then mmaritalstatus="Divorce"
If mVisastatus="E" then mVisastatus="Employment"
If mVisastatus="F" then mVisastatus="Father"
If mVisastatus="M" then mVisastatus="Mother"
If mVisastatus="H" then mVisastatus="Husband"
If mVisastatus="V" then mVisastatus="Visit Visa"
If mVisastatus="N" then mVisastatus="No Visa"
If mVisastatus="S" then mVisastatus="Student Visa"
End If
Dim errmsg
If request.querystring("Updt")="T" then
mtitle=Request.form("Title")
mFirstname=Request.form("Firstname")
mLastname=Request.form("Lastname")
mSex=Request.form("Sex")
mMaritalstatus=Request.form("Maritalstatus")
Mage=Request.form("Age")
mNationality=Request.form("Nationality")
mstayingin=Request.form("Stayingin")
mVisastatus=Request.form("visastatus")
mPhoneresidence=Request.form("Phoneresidence")
mMobile=Request.form("Mobile")
mEmail=Request.form("Email")
If len(msex) < 1 then errmsg="sex not selected"
If len(mmaritalstatus) < 1 then errmsg=errmsg +" Mariatl Status not selected"
If mtitle ="" then errmsg=errmsg +" Title not selected"
If len(mfirstname) < 2 then errmsg=errmsg +" Firstname not entered "
If len(mLastname) < 2 then errmsg=errmsg +" Lastname not entered "
If len(mnationality) < 2 then errmsg=errmsg +" Nationality not selected "
If len(mstayingin) < 2 then errmsg=errmsg +" Stayingin not selected "
If len(mEmail) < 4 then errmsg=errmsg +" Invalid Email ID "
If mvisastatus="" then errmsg= errmsg + " Visa status not selected"
If phoneresidence ="" and mMobile="" then errmsg= errmsg + " Phone numbers are not entered"
If not isnumeric(mage) then errmsg= errmsg + " Age not selected"
If errmsg="" then
Set rsApplicants =Server.Createobject("Adodb.recordset")
strsql="Select * from Applicants where username like '" & musername & "'"
rsApplicants.open strsql,Cnn,adopendynamic,adlockpessimistic,adcmdtext
If rsapplicants.eof then
rsApplicants.Addnew
Dim rssettings
Set rssettings =Server.Createobject("Adodb.recordset")
strsql="Select * from Settings"
rssettings.open strsql,Cnn,adopendynamic,adlockpessimistic,adcmdtext
session("regno")=rssettings("regno")
rssettings("regno")=rssettings("regno")+1
rssettings.Updatebatch
rssettings.Close
Set rssettings = Nothing
rsapplicants("Regno")=session("regno")
End If
rsapplicants("username") =musername
rsapplicants("Password")=mPassword
rsapplicants("Title")=mTitle
rsapplicants("Firstname")=mfirstname
rsapplicants("Lastname")=mLastname
rsapplicants("Sex")=left(mSex,1)
rsapplicants("Nationality") =mNationality
rsapplicants("Stayingin")=mstayingin
rsapplicants("Lastupdatedate")=date
rsapplicants("Email")=memail
rsapplicants("Maritalstatus")=left(mMaritalstatus,1)
rsapplicants("Visa")=left(mVisastatus,1)
rsapplicants("age")=mAge
rsapplicants("Phoneresidence")=mPhoneresidence
rsapplicants("Mobile")=mMobile
rsapplicants("clientupdated")=0
rsapplicants.Update
rsapplicants.Close
cnn.close
Set rsnationality = Nothing
Set rsapplicants = nothing
Set cnn = Nothing
Response.Redirect("EditCv2.asp")
Response.End
End If
End If
%>
Apt - Human Resource & Management Consultancy
<%
If errmsg<>"" then
Response.write(link)
Response.write("")
Response.write(errmsg)
Response.write("")
End if
%>