<% 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\reg.json') set date british set century on tfilename=dbclocation+[details] tcmd=[select * from (']+tfilename+[') where recno()==]+record_number+[ into cursor 'dcursor'] &tcmd * photoimage=[] IF NOT EMPTY(photoname) AND FILE(ADDBS(oprop.appstartpath)+'photos\'+ALLTRIM(photoname)+[.jpeg]) photoimage=ALLTRIM(photoname)+[.jpeg] else IF NOT EMPTY(photop) filename=[photos\]+SYS(2015)+[.jpeg] COPY MEMO photop TO (ADDBS(oprop.appstartpath)+filename) photoimage=JUSTFNAME(filename) tsql=[update (']+tfilename+[') set photoname=']+JUSTSTEM(filename)+[' where recno()==]+record_number &tsql select [dcursor] ELSE replace photoname WITH '' ENDIF endif * tfilename=dbclocation+[fileref] tcmd=[select * from (']+tfilename+[') where allt(reffid)==']+allt(dcursor.reffid)+[' into cursor 'fcursor'] &tcmd putstring=[] putid('ptn',allt(ptn)) putid('job_id',allt(dcursor.category)) select [dcursor] putid('full_name',allt(allt(gname)+[ ]+allt(sname))) putid('photoimage',photoimage) putid('gender',iif(male,1,0)) PUTID('father_name',Alltrim(Alltrim(FGNAME)+[ ]+Alltrim(FSNAME))) THENIC=Iif(Empty(Chrtran(NIC,'-','')),Chrtran(NICOP,'-',''),Chrtran(NIC,'-','')) PUTID('cnic',Alltrim(THENIC)) PUTID('date_of_birth',Transform(DOBIRTH)) PLACEOFPASSPORT=Alltrim(Strtran(POBIRTH,[PAKISTAN],[])) PLACEOFPASSPORT=Alltrim(Strtran(POBIRTH,[-],[])) If Empty(PLACEOFPASSPORT) PLACEOFPASSPORT=[PAKISTAN] Else PLACEOFPASSPORT=Alltrim(PLACEOFPASSPORT)+[ - PAKISTAN] Endif PUTID('place_of_birth',PLACEOFPASSPORT) *input passport_no Passport No. * PUTID('passport_no',Alltrim(PASSPORT)) If Type([oepvoucher])='C' And Not Empty(oepvoucher) PUTID('voucher_no',Alltrim(oepvoucher)) Endif If Type([oepdate])='D' And Not Empty(oepdate) PUTID('deposite_date',Alltrim(Transform(oepdate))) Endif If Type([oepamount])='C' And Not Empty(oepamount) PUTID('payment_recieved_from_the_emigrant',Alltrim(Transform(oepamount))) Endif If Type([oepact])='C' And Not Empty(oepact) PUTID('bank_account_title',Alltrim(Transform(oepact))) Endif If Type([oepac])='C' And Not Empty(oepac) PUTID('bank_account_no',Alltrim(Transform(oepac))) Endif If Type([oepbank])='C' And Not Empty(oepbank) putid('bank_id',Alltrim(oepbank)) Endif putid('phone_no',phone) PLACEOFPASSPORT=Alltrim(Strtran(Pop,[PAKISTAN],[])) PLACEOFPASSPORT=Alltrim(Strtran(Pop,[-],[])) If Empty(PLACEOFPASSPORT) PLACEOFPASSPORT=[PAKISTAN] Else PLACEOFPASSPORT=Alltrim(PLACEOFPASSPORT)+[ - PAKISTAN] Endif PUTID('passport_place_of_issue',PLACEOFPASSPORT) PUTID('passport_issue_date',Alltrim(Transform(DOP))) *input passport_expiry_date Passport Expiry Date * PUTID('passport_expiry_date',Alltrim(Transform(EOP))) THEADDRESS=Alltrim(HOMEADR)+' '+Alltrim(CITY)+[ ]+Alltrim(PROVINCE) THEADDRESS=Alltrim(Chrtran(THEADDRESS,[ ],[ ])) PUTID('address',Alltrim(THEADDRESS)) *select province_id Province * TPROVINCE=Alltrim(PROVINCE) putid('province_id',TPROVINCE) *select domicile_district_id Domicile District putid('district_id',Alltrim(CITY)) putid('domicile_district_id',Alltrim(DOMICILE)) *Education putid('education_id',Alltrim(QUALIFICAT)) *Nominee Details *Nominee Full Name * PUTID('nominee_full_name',Alltrim(NAMER)) If Type([kenphone])<>[U] PUTID('nominee_phone_no',Alltrim(kenphone)) Endif PUTID('nominee_age',Alltrim(Transform(AGER))) PUTID('nominee_address',Alltrim(ADDRESSR)) *Relation with Nominee * PUTID('nominee_relation',Alltrim(RELATIONR)) *Nominee CNIC No. * newnicr=Alltrim(Chrtran(NICR,'-','')) PUTID('nominee_cnic',newnicr) *Emigrant Registration Fee Details *OEP Service Charges *Fee Amount default 6000 *Fee Date *Fee Receipt No. *Bank Name *Bank Branch Name/Code *Welfare Fund (OPF) 2000 *Insurance Premium 2500 *Registration Fee 500 *OEC Fee 200 PUTID('insurance_certificate_no',Alltrim(INSNO)) putstring=[{]+SUBSTR(putstring,2)+[}] STRTOFILE(putstring,ADDBS(oprop.appstartpath)+'temp\reg.json') oResponse.ContentType = "text/json;" oResponse.Write(putstring) oresponse.flush %>