<% crlf=chr(13)+chr(10) =Sys(3101,1256) record_number=orequest.form("record_number") if isnull(record_number) record_number=orequest.querystring("rref") endif record_fileref=orequest.form("file_reference") if isnull(record_fileref) record_fileref=orequest.querystring("fref") endif erase (ADDBS(oprop.appstartpath)+'temp\putstring.json') msg=[] putstring=[] arstring=[] tfilename=dbclocation+[details] tcmd=[select * from (']+tfilename+[') where recno()=val(record_number) into cursor detailcursor] &tcmd email=allt(wadr) thenewreference=allt(reffid) tfilename=addbs(oprop.appstartpath)+[countries] tcmd=[select * from (']+tfilename+[') where upper(code)=upper(detailcursor.pop) into cursor justx] &tcmd if type([namea])<>[C] use in select('countries') tmcd=[alter table (']+tfilename+[') add column namea c(100)] &tcmd use in select('countries') endif tfilename=addbs(oprop.appstartpath)+[countries] tcmd=[select * from (']+tfilename+[') where upper(code)=upper(detailcursor.pop) into cursor justx] if _tally=0 select * from (addbs(oprop.appstartpath)+[countries]) where upper(code)=upper([PAK]) into cursor justx endif PLACE_OF_PASSPORT=name place_of_passportA=namea select [detailcursor] *SET NOCPTRANS TO prof tfilename=dbclocation+[fileref] tcmd=[select * from (']+tfilename+[') where allt(reffid)==thenewreference into cursor filecursor] &tcmd select [filecursor] *set NOCPTRANS to SPONNAMEA, SPONADD1A if empty(email) email=allt(sendmail) endif if empty(email) email=allt(xcompany.email) endif tfilename=addbs(oprop.appstartpath)+[visatypesA] tcmd=[Use (']+tfilename+[') In Select('visatypesA') Again Alias 'visatypesA'] &tcmd IF TYPE([EMBASSY_VAR])=[U] PUBLIC EMBASSY_VAR endif Select 'visatypesA' Locate For Number=detailcursor.PURPOSE If Eof() Locate For Number='01' Endif APRPSE=Alltrim(ARABIC) NPRPSE=Alltrim(Str(Val(Number))) EPRPSE=Alltrim(ENGLISH) Use In Select('visatypesA') Select 'detailcursor' rmsg=[error occurred ] theembassy=UPPER(ALLTRIM(filecursor.embassy)) EMBASSY_VAR=ICASE(theembassy='ISL','210',theembassy='210','210','231') PURPOSE_VAR=EPRPSE THEHOMEADR=Iif(Not Empty(HOMEADR),UPPER(Alltrim(HOMEADR))+' ','') If Not Empty(CITY) And Not Alltrim(CITY) $ THEHOMEADR THEHOMEADR=THEHOMEADR+Alltrim(UPPER(CITY))+' ' Endif If Not Empty(PROVINCE) And Not Alltrim(PROVINCE) $ THEHOMEADR THEHOMEADR=THEHOMEADR+Alltrim(UPPER(PROVINCE))+' ' Endif THEQUALIFICATION=Iif(Empty(QUALIFICAT),'NIL',QUALIFICAT) QISSUEDFROM=Iif(Empty(QUALIFICAT),'NIL',QPISSUE) PLACE_OF_BIRTH=POBIRTH THESPONSOR_NAME=Iif(Empty(filecursor.SPONNAMEA),filecursor.SPONNAME,filecursor.SPONNAMEA) THESPONSOR_ADDRESS=Iif(Not Empty(filecursor.SPONADD1A), filecursor.SPONADD1A, (Alltrim(filecursor.SPONADD1)+' '+Iif(Alltrim(filecursor.DESTINATIO) $ filecursor.SPONADD1,'',Alltrim(filecursor.DESTINATIO)))) JOB_VAR=iif(empty(prof),allt(category),allt(prof)) Store Space(0) To XNAME1, XNAME2, XNAME3, XNAME4, XNAME5, XNAME6 Store Space(0) To AXNAME1, AXNAME2, AXNAME3, AXNAME4, AXNAME5, AXNAME6 ***Visa to Enter the Kingdom from Saudi Mission Abroad putid('VisaKind',NPRPSE) putid('NATIONALITY',NATIONALIT) putid('EmbassyCode',EMBASSY_VAR) NUMOFENTRIES=0 NUMOFENTRIESTEXT=Icase(NUMOFENTRIES=0,"Single Entry",NUMOFENTRIES=1,"Multiple Entries",NUMOFENTRIES=2,"Exit-Return",NUMOFENTRIES=3,"Two Entries") PUTID('NUMBER_OF_ENTRIES',numofentries) putid('Number_Entry_Day','90') putid('RESIDENCY_IN_KSA','90') PUTID('DocumentNumber',ALLTRIM(filecursor.visaid)) ***END***Visa to Enter the Kingdom from Saudi Mission Abroad ***Personal Information select [detailcursor] XNAME1=Alltrim(GNAME) XNAME2=Alltrim(SNAME) THESCRIPT=[] Do Case Case Empty(XNAME1) And Not Empty(XNAME2) PUTID('EFIRSTNAME',XNAME2) PUTID('EFATHER',XNAME1) Case Not Empty(XNAME1) And Empty(XNAME2) PUTID('EFIRSTNAME',XNAME1) PUTID('EFATHER',XNAME2) Case Not Empty(XNAME1) And Not Empty(XNAME2) PUTID('EFIRSTNAME',XNAME1) PUTID('EFATHER',XNAME2) Otherwise *Messagebox('Name of the applicant is required in English',64,'SSSoft') Endcase XNAME3=Alltrim(FGNAME) XNAME4=Alltrim(FSNAME) Do Case Case Empty(XNAME3) And Not Empty(XNAME4) PUTID('EGRAND',XNAME3) PUTID('EFAMILY',XNAME4) Case Not Empty(XNAME3) And Empty(XNAME4) PUTID('EGRAND',XNAME4) PUTID('EFAMILY',XNAME3) Case Not Empty(XNAME3) And Not Empty(XNAME4) PUTID('EGRAND',XNAME3) PUTID('EFAMILY',XNAME4) Otherwise *Messagebox([Name of the applicant's father is required in English],64,'SSSoft') Endcase AXNAME1=Iif(Empty(Alltrim(GNAMEA)),[],Alltrim(GNAMEA)) AXNAME2=Iif(Empty(Alltrim(SNAMEA)),[],Alltrim(SNAMEA)) Do Case Case Empty(AXNAME1) And Not Empty(AXNAME2) PUTID('AFIRSTNAME',AXNAME2) PUTID('AFATHER',AXNAME1) Case Not Empty(AXNAME1) And Empty(AXNAME2) PUTID('AFIRSTNAME',AXNAME1) PUTID('AFATHER',AXNAME2) Case Not Empty(AXNAME1) And Not Empty(AXNAME2) PUTID('AFIRSTNAME',AXNAME1) PUTID('AFATHER',AXNAME2) Otherwise * Messagebox('Name of the applicant is required in English',64,'SSSoft') Endcase AXNAME3=Iif(Empty(Alltrim(FGNAMEA)),[],Alltrim(FGNAMEA)) AXNAME4=Iif(Empty(Alltrim(FSNAMEA)),[],Alltrim(FSNAMEA)) Do Case Case Empty(AXNAME3) And Not Empty(AXNAME4) PUTID('AGRAND',AXNAME3) PUTID('AFAMILY',AXNAME4) Case Not Empty(AXNAME3) And Empty(AXNAME4) PUTID('AGRAND',AXNAME4) PUTID('AFAMILY',AXNAME3) Case Not Empty(AXNAME3) And Not Empty(AXNAME4) PUTID('AGRAND',AXNAME3) PUTID('AFAMILY',AXNAME4) Otherwise *Messagebox('Name of the applicant is required in English',64,'SSSoft') Endcase *****END***Personal Information part 1 If Empty(Nvl(PNATIONALI,'')) Or allt(upper(PNATIONALI))=='NUL' TPNATION=NATIONALIT PUTID('Has_NATIONALITY_FIRST',0) putid('NATIONALITY_FIRST',TPNATION) Else PUTID('Has_NATIONALITY_FIRST',1) TPNATION=PNATIONALI putid('NATIONALITY_FIRST',TPNATION) ENDIF PUTID('PASSPORTnumber',Alltrim(PASSPORT)) putid('PASSPORType','1') PUTID('PASSPORT_ISSUE_PLACE',PLACE_OF_PASSPORT) PUTID('PASSPORT_ISSUE_PLACEA',PLACE_OF_PASSPORTA) PUTID('PASSPORT_ISSUE_DATE',DOP) PUTID('PASSPORT_EXPIRY_DATe',EOP) PLACEOFBIRTH=Alltrim(Strtran(detailcursor.POBIRTH,[PAKISTAN],[])) PLACEOFBIRTH=Alltrim(Strtran(detailcursor.POBIRTH,[-],[])) If Empty(PLACEOFBIRTH) PLACEOFBIRTH=[PAKISTAN] Else PLACEOFBIRTH=Alltrim(PLACEOFBIRTH)+[ - PAKISTAN] Endif PUTID('BIRTH_PLACE',PLACEOFBIRTH) PUTID('BIRTH_DATE',DOBIRTH) PUTID('PersonId',NIC) ****end***Personal Information part 2 PUTID('ADDRESS_HOME',filecursor.DESTINATIO) Local ORL ORL=Upper(RELIGION) RELIGIONTEXT=Icase(ORL='ISL','Islam',ORL='MUS','Islam',ORL='CHR','Christianity',ORL='BOZ','Budhhism',ORL='BUD','Budhhism',ORL='HON','Hinduism',ORL='HIN','Hinduism',ORL='SI','Sikhism',ORL='OTH','Non-Muslim','Islam') RELIGIONNUMBER=Icase(RELIGIONTEXT='Islam',1,RELIGIONTEXT='Chr',2,RELIGIONTEXT='Bud',3,RELIGIONTEXT='Hin',4,RELIGIONTEXT='Si',5,6) putid('RELIGION',iif(RELIGIONTEXT='Islam','1','2')) putid('SOCIAL_STATUS',MSTATUS) putid('Sex',Transform(Iif(MALE,1,2))) *Occopation PUTID('DEGREE',QUALIFICAT) PUTID('DEGREE_SOURCE',QPISSUE) PUTID('Personal_Email',Email) *car_number is flightnumber *More things ***Sponsor Information PUTID('SPONSER_NUMBER',filecursor.SPONID) PUTID('SPONSER_NAME',THESPONSOR_NAME) PUTID('SPONSER_PHONE',filecursor.SPONPHONE) PUTID('SPONSER_ADDRESS',THESPONSOR_ADDRESS) Local DSTNA, DSTN DSTNA=Upper(filecursor.DESTINATIO) DSTN=Icase(DSTNA="RIYADH",1,DSTNA="JEDDAH",2,DSTNA="DAHRAM",3,DSTNA="MADINA",4,DSTNA="DAMAM",5,1) putid('ExpectedEntryDate',gomonth(date(),1)-12) putid('ENTRY_POINT',dstn) PUTID('porpose',EPRPSE) putid('COMING_THROUGH','2') putid('serial',xcompany.password) *** PUTID('JOB_OR_RELATION',JOB_VAR) *When called it clipboard contains imagepath *JOB_OR_RELATION_Id is clicked, we have to put job_var to clipboard. *And when input by class select2-search__field gets focus, we put from clipboard putstring=[{]+SUBSTR(putstring,2)+[}] STRTOFILE(putstring,ADDBS(oprop.appstartpath)+'temp\putstring.json') oResponse.ContentType = "text/json;" oResponse.Write(putstring) oresponse.flush %>