Re: Display an image based on the on the contents of a database field.
Thanks Tom .. now to digest it .. Don
Thanks Tom .. now to digest it .. Don
Alpha Software Mobile Development Tools: Alpha Anywhere | Alpha TransForm |
dim pict1 as C pict1 = "" if .not.exist(tbl1.SSN,"G:\CASEREG\image.dbf","ssn") then 'ui_msg_box(trim(aa.bcbss.agency)+" Client Information System","No Image Record exists for this Client") UI_MSG_BOX(aa.bcbss.agency+" - WARNING!!!!","ONLY interview on 1st Floor!!!"+chr(13)+chr(13)+"See CASE Folder for Details",16) end else tbl2 = table.open("G:\CASEREG\image.dbf") tbl2.index_primary_put("ssn") tbl2.fetch_find(tbl1.ssn) if upper(tbl2.Alt_payee)="X" name1 = upper(trim(tbl2.alt_fname)+" "+trim(tbl2.alt_lname))+" - Auth Rep" else name1 = upper(trim(tbl1.fname)+" "+trim(tbl1.lname)) end if pict1 = tbl2.image tbl2.close() end if 'pict1 = lookupc("F",client->SSN,"image","image.dbf","ssn") if pict1 <>"" oldfile = "G:\IMAGES"+chr(92)+trim(pict1)+".jpg" if .not. file.exists(oldfile) UI_MSG_BOX(aa.bcbss.agency+" - WARNING!!!!","ONLY interview on 1st Floor!!!"+chr(13)+chr(13)+"See CASE Folder for Details",16) end end if else UI_MSG_BOX(aa.bcbss.agency+" - WARNING!!!!","ONLY interview on 1st Floor!!!"+chr(13)+chr(13)+"See CASE Folder for Details",16) end end if 'new code for xdialog inserted here f = file.open(oldfile,FILE_RO_SHARED) ui_bitmap_load("temp",f.readb(10000000)) f.close() Dim msg1 as C = " - WARNING - ONLY interview on 1st Floor!!!" dim msg2 as C = "See CASE Folder for Details" ui_dlg_box(name1,<<%dlg% {lf}; {justify=center} {font=arial,12,b}{color=Red on Gray}{text=70,msg1}; {image=temp}; {lf}; {text=50,msg2}{Color=Black on Gray}{font=arial,8,n} {lf}; <*15&Close> %dlg%) ui_bitmap_drop("temp") delete msg1 delete msg2 delete name1
dim name1 as C = "" tc = table.current() name1 = trim(tc.wname) G_EMP = table.open("g:\bcbss\employee\g_employ.dbf",FILE_RO_SHARED) g_emp.index_primary_put("Emp_ID") found = G_EMP.fetch_find(tc.Emp_ID) if found >0 badgeno = G_EMP.badge_no dim Shared pict AS C dim bmpfile as C pict = alltrim(str(badgeno,9,0)) bmpfile = "g:\bcbss\photo"+chr(92)+trim(pict)+".jpg" if .not.file_exists(bmpfile) then bmpfile = "g:\bcbss\photo"+chr(92)+"not_avail.jpg" end if else bmpfile = "g:\bcbss\photo"+chr(92)+"not_avail.jpg" end if g_emp.close() 'bmpfile = lookupc("F",client->SSN,"image","image.dbf","ssn") 'new code for xdialog inserted here f = file.open(bmpfile,FILE_RO_SHARED) ui_bitmap_load("temp",f.readb(10000000)) f.close() Dim msg1 as C = name1 dim msg2 as C = "~~~~~~~~~~~~~~~~~~~" ui_dlg_box("EMPLOYEE PHOTO",<<%dlg% {lf}; {justify=center} {font=arial,12,b}{color=Red on Gray}{text=70,msg1}; {image=temp}; {lf}; {text=20,msg2}{Color=Black on Gray}{font=arial,8,n} {lf}; <*15&Close> %dlg%) ui_bitmap_drop("temp") end delete bmpfile delete name1 delete pict delete badgeno
Comment