Jump to content
Sign in to follow this  
Awais

Multiple GUI Error

Recommended Posts

Awais

i am using multiple GUI

but it stops 

Copyscript()
#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <GuiStatusBar.au3>
#include <Date.au3>
Opt("GUIOnEventMode", 1)
#Region variable
Global Const $Path = "E:\Masdar Internatinoal Office Files"
DirCreate($Path)
Global Const $pathMD = 'Data.tc'
Global Const $tp = $Path &'\'& $pathMD
Global Const $pathreference = 'Reference.Doc'
Global Const $tpr = $pathMD & '\' & $pathreference
Global Const $referencefolder = $path &'\'& "Reference"
DirCreate($referencefolder)

Global Const $referencefolderwaheedsharif = $referencefolder & '\'& "Waheed Sharif"
DirCreate($referencefolderwaheedsharif)
Global Const $referencefolderwaheedshariffile = $referencefolderwaheedsharif & '\'& "Details.ref"
;hERE waheed sharif completed
Global Const $referencefolderMuhamadAsharafGujar = $referencefolder & '\' & "MuhammadAsharafGujar"
DirCreate($referencefolderMuhamadAsharafGujar)
Global Const $referencefolderMuhamadAsharafGujarfile = $referencefolderMuhamadAsharafGujar & '\' & "Details.ref"
;here muhammad asharaf Gujar completed
Global Const $referencefolderMianNaveedAhmad = $referencefolder & '\' & "MianNaveedAhmad"
DirCreate($referencefolderMianNaveedAhmad)
Global Const $referencefolderMianNaveedAhmadfile = $referencefolderMianNaveedAhmad & '\' & "Details.ref"
;Mian Naveed Ahmad
Global Const $RFMuhammadKhalil = $referencefolder & '\' & "MuhammadKhalil"
DirCreate($RFMuhammadKhalil)
Global Const $RFMuhammadKhalilfile = $RFMuhammadKhalil & '\' & "Details.ref"
;'Muhammad Khalil
Global Const $RFMuhammadJaved = $referencefolder & '\' & "MuhammadJaved"
DirCreate($RFMuhammadJaved)
Global Const $RFMuhammadJavedFile = $RFMuhammadJaved & '\' & "Details.ref"
; Muhammad Javed
Global Const $RFMuhammadMustaq = $referencefolder & '\' & "MuhammadMustaq"
DirCreate($RFMuhammadMustaq)
Global Const $RFMuhammadMustaqfile = $RFMuhammadMustaq & '\' & "MuhammadMustaq"
;here Muhammad Mustaq Completed
Global Const $RFMuhammadAbid = $referencefolder & '\' & "MuhammadAbid"
DirCreate($RFMuhammadAbid)
Global Const $RFMuhammadAbidfile = $RFMuhammadAbid & '\' & "Details.ref"
;hERE Muhammad Abid
Global Const $RFChSaeedShahid = $referencefolder & '\' & "Ch Saeed Shadid"
DirCreate($RFChSaeedShahid)
Global Const $RFChSaeedShahidFile = $RFChSaeedShahid & '\' & "details.ref"
; Here CH Saeed Shahid
Global Const $RFOfficeBooking = $referencefolder & '\' & "Office Booking"
DirCreate($RFOfficeBooking)
Global Const $RFOfficeBookingfile = $RFOfficeBooking & '\' & "Details.ref"

Global $hGUI1, $hGUI2 = 9999, $hButton1, $hButton2, $hButton3 = 9999 ; Predeclare the variables with dummy values to prevent firing the Case statements
Global $px , $py ,$aPos
Global $Buttond = 9999
Global $secondgui = 9999
Global $Form1 = 9999 ,$Displaygui = 9999
#EndRegion
HotKeySet("{ESC}","EXITA")
Getpostion()
Main()
Func EXITA()
    Exit
EndFunc
Func ViewRecord()
    GUICtrlSetState($Buttond,$GUI_DISABLE)
    GUICtrlSetState($secondgui,$GUI_DISABLE)
    Global $GUITHIRD = GUICreate("View Record",400,300,-1,-1, -1, BitOR($WS_EX_APPWINDOW,$WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
    GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close")
    Global $tLabel = GUICtrlCreateLabel("Enter Passport",20,20,100,20)
    Global $tinput1 = GUICtrlCreateInput("12345678",100,20-2,200,20)
    Global $tButton1 = GUICtrlCreateButton("Display",100,45,200,40)
    GUICtrlSetOnEvent($tButton1,"DisplayTheRecord")
    Global $tLabel2 = GUICtrlCreateLabel("Record Not Found",100,100,300,40)
    GUICtrlSetState($tLabel2,$GUI_HIDE)
    GUICtrlSetFont($tLabel2, 17, 800, 0, "Arial")
    GUICtrlSetColor($tLabel2, 0xFF0000)
    GUISetState()
EndFunc
Func DisplayTheRecord()
    Local $pICaddressA = GUICtrlRead($tinput1)
    Local $result = IniReadSection($tp,GUICtrlRead($tinput1))
    Global $section = $result
    If $result = @error Then
            GUICtrlSetState($tLabel2,$GUI_SHOW)
    Else
                GUICtrlSetState($tLabel2,$GUI_HIDE)
                GUICtrlSetState($tButton1,$GUI_DISABLE)
                $Displaygui = GUICreate("Muhammad (S.A.W)", 800, 600,-1, -1, -1, BitOR($WS_EX_APPWINDOW,$WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
                GUISetOnEvent($GUI_EVENT_CLOSE,"On_Close")
                GUICtrlCreatePic($path &"\"& $pICaddressA &"\"& "Person Copy.Jpeg",800-230,20,200,200)
                GUICtrlCreateLabel("Passport Number ::",5,5,100,20)
                GUICtrlCreateLabel("",150,5,200,20)
                GUICtrlCreateLabel("Full Name ::",5,25,100,20)

                GUISetState()
    EndIf
EndFunc
Func inforeturn($key)
    Local $result = IniRead($tp,$section,$key,"")
EndFunc

Func Main()
    $hGUI1 = GUICreate("Muhammad (S.A.W)", 800, 600,$px, $py, -1, BitOR($WS_EX_APPWINDOW,$WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
    GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close")
    Global $Buttond = GUICtrlCreateButton("Database",20,20,150,30,BitOR($BS_DEFPUSHBUTTON,$BS_FLAT))
    GUICtrlSetOnEvent($Buttond,"Database")
    Global $secondgui = GUICtrlCreateButton("View Record",200,20,150,30,BitOR($BS_DEFPUSHBUTTON,$BS_FLAT))
    GUICtrlSetOnEvent($secondgui,"ViewRecord")
    GUISetState(@SW_SHOW)
    While 1
        Sleep(10)
    WEnd
EndFunc
Func Database()
    GUICtrlSetState($Buttond,$GUI_DISABLE)
    Global $Form1 = GUICreate("Masdar International", 480, 617, -1, -1, -1, BitOR($WS_EX_APPWINDOW,$WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
    GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close")
    GUICtrlCreatePic("E:\img7.jpg",0,0,1208,647)
    GUICtrlSetState(-1,$GUI_DISABLE)
    Global $Input1 = GUICtrlCreateInput("", 96, 10, 120, 21)
    GUICtrlSetOnEvent($Input1, "Input1Change")
    Global $Input2 = GUICtrlCreateInput("", 96, 30, 120, 21)
    GUICtrlSetOnEvent($Input2, "Input2Change")
    Global $Input3 = GUICtrlCreateInput("", 96, 50, 120, 21)
    GUICtrlSetOnEvent($Input3, "Input3Change")
    Global $Passport = GUICtrlCreateLabel("Passport No ", 5, 10, 65, 17)
    GUICtrlSetOnEvent($Passport, "PassportClick")
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT )
    Global $Label1 = GUICtrlCreateLabel("Full Name", 5, 30, 51, 17)
    GUICtrlSetOnEvent($Label1, "Label1Click")
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT )
    Global $Label2 = GUICtrlCreateLabel("Father Name", 5, 50, 65, 17)
    GUICtrlSetOnEvent($Label2, "Label2Click")
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT )
    Global $Checkbox1 = GUICtrlCreateCheckbox("Waheed Sharif", 225, 20, 99, 17)
    GUICtrlSetTip($Checkbox1, "From Sahiwal")
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT )
    GUICtrlSetOnEvent($Checkbox1, "Checkbox1Click")
    Global $Group1 = GUICtrlCreateGroup("Reference By", 220, 5, 250, 160)               ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT )
    Global $Checkbox2 = GUICtrlCreateCheckbox("Muhammad Asharaf Gujar", 225, 20 +15, 149, 17)
    GUICtrlSetTip($Checkbox2, "From Dunia Pur")
    GUICtrlSetOnEvent($Checkbox2, "Checkbox2Click")
    Global $Checkbox3 = GUICtrlCreateCheckbox("Mian Naveed Ahmad", 225, 30+ 20, 124, 17)
    GUICtrlSetTip($Checkbox3, "From Shekho Pura")
    GUICtrlSetOnEvent($Checkbox3, "Checkbox3Click")
    Global $Checkbox4 = GUICtrlCreateCheckbox("Muhammad Mushtaq", 225, 40+ 30-5, 129, 17)
    GUICtrlSetTip($Checkbox4, "From Gujranwala")
    GUICtrlSetOnEvent($Checkbox4, "Checkbox4Click")
    Global $Checkbox5 = GUICtrlCreateCheckbox("Muhammad Khalil", 225, 50+ 40 -10, 117, 17)
    GUICtrlSetTip($Checkbox5, "From Faqirwali ")
    GUICtrlSetOnEvent($Checkbox5, "Checkbox5Click")
    Global $Checkbox6 = GUICtrlCreateCheckbox("Muhammad Javed", 225, 60+ 50 - 15, 110, 17)
    GUICtrlSetTip($Checkbox6, "From Thuthianwali")
    GUICtrlSetOnEvent($Checkbox6, "Checkbox6Click")
    Global $Checkbox7 = GUICtrlCreateCheckbox("CH Abid ", 225, 70+ 60 -20, 97, 17)
    GUICtrlSetTip($Checkbox7, "From Haroon Abad (Office Persional)")
    GUICtrlSetOnEvent($Checkbox7, "Checkbox7Click")
    Global $Checkbox8 = GUICtrlCreateCheckbox("Ch Saeed Shahid", 225, 80+ 70 -25, 101, 17)
    GUICtrlSetTip($Checkbox8, "From Sudia (Office Persional)")
    GUICtrlSetOnEvent($Checkbox8, "Checkbox8Click")
    Global $Checkbox9 = GUICtrlCreateCheckbox("Office Booking", 225, 90+ 80 -30, 97, 17)
    GUICtrlSetTip($Checkbox9, "From Office")
    GUICtrlSetOnEvent($Checkbox9, "Checkbox9Click")
    Global $Group2 = GUICtrlCreateGroup("Select Scan Data", 0, 165, 217, 175)
    Global $Button1 = GUICtrlCreateButton("Passport", 8, 185, 100, 25)
    GUICtrlSetOnEvent($Button1, "Button1Click")
    Global $Button2 = GUICtrlCreateButton("ID Card A", 8, 215, 200, 25)
    GUICtrlSetOnEvent($Button2, "Button2Click")
    Global $Button3 = GUICtrlCreateButton("ID Card B", 8, 245, 200, 25)
    GUICtrlSetOnEvent($Button3, "Button3Click")
    Global $Buttonl1 = GUICtrlCreateButton("License A", 8, 275, 200, 25)
    Global $Buttonl3 = GUICtrlCreateButton("License B", 8, 305, 200, 25)
    Global $Buttonl4 = GUICtrlCreateButton("Person", 110, 185, 100, 25)
    GUICtrlSetOnEvent($Buttonl4, "Button14Click")

    GUICtrlSetOnEvent($Buttonl1, "ButtonClickL1") ;SAVEE LICNESA AAAAAA
    GUICtrlSetOnEvent($Buttonl3, "ButtonClickL3") ;SAVE LICENSE B
    Global $nlabel = GUICtrlCreateLabel("Name",5,120,40,25)
    GUICtrlSetTip($nlabel,"The Name Of the person who has this number")
    Global $ninput1 = GUICtrlCreateInput("",96,120,120,20)
    Global $nlabe2 = GUICtrlCreateLabel("Phon No",5,140,60,25)
    Global $ninput2 = GUICtrlCreateInput("",96,140,120,20)

    Global $Group3 = GUICtrlCreateGroup("Medical Details", 0, 342 , 217, 81)
    Global $Input4 = GUICtrlCreateInput("", 70, 360, 25, 21) ;ddddd
    GUICtrlSetOnEvent($Input4, "ExpireCalculater")
    GUICtrlSetTip($Input4, "DD")
    Global $Label3 = GUICtrlCreateLabel("Issue Date", 8, 360, 54, 17)
    GUICtrlSetOnEvent($Label3, "ExpireCalculater")
    Global $Input5 = GUICtrlCreateInput("", 102, 360, 25, 21)
    GUICtrlSetOnEvent($Input5, "ExpireCalculater")
    GUICtrlSetTip($Input5, "MM")
    Global $Input6 = GUICtrlCreateInput("2014", 134, 360, 33, 21)
    GUICtrlSetOnEvent($Input6, "ExpireCalculater")
    GUICtrlSetTip($Input6, "YY")
    Global $Label4 = GUICtrlCreateLabel("Expire Date", 8, 390, 59, 17)
    GUICtrlSetOnEvent($Label4, "Label4Click")
    Global $Input7 = GUICtrlCreateInput("", 70, 390, 25, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
    GUICtrlSetOnEvent($Input7, "Input7Change")
    GUICtrlSetTip($Input7, "DD")
    Global $Input8 = GUICtrlCreateInput("", 103, 390, 25, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
    GUICtrlSetOnEvent($Input8, "Input8Change")
    GUICtrlSetTip($Input8, "MM")
    Global $Input9 = GUICtrlCreateInput("", 134, 390, 33, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
    GUICtrlSetOnEvent($Input9, "Input9Change")
    GUICtrlSetTip($Input9, "YY")
    Global $LABELFORleftdays = GUICtrlCreateLabel("Days left",170,360,45,22)
    Global $daysleft = GUICtrlCreateInput("Days",170,390,33,22)

    Global $Group4 = GUICtrlCreateGroup("Process Step", 220, 165, 250 , 175)

    Global $Checkbox10 = GUICtrlCreateCheckbox("Recived To Office", 225, 184, 104, 17)
    GUICtrlSetOnEvent($Checkbox10, "Checkbox10Click")
    Global $Checkbox11 = GUICtrlCreateCheckbox("Submeted For Processing", 225, 200, 145, 17)
    GUICtrlSetOnEvent($Checkbox11, "Checkbox11Click")
    Global $Checkbox12 = GUICtrlCreateCheckbox("Stump Visa", 225, 215, 83, 17)
    GUICtrlSetOnEvent($Checkbox12, "Checkbox12Click")
    Global $Checkbox13 = GUICtrlCreateCheckbox("Protecter", 225, 230, 65, 17)
    GUICtrlSetOnEvent($Checkbox13, "Checkbox13Click")
    Global $Checkbox14 = GUICtrlCreateCheckbox("Ready For Ticket", 225, 245, 106, 17)
    GUICtrlSetOnEvent($Checkbox14, "Checkbox14Click")
    Global $Checkbox15 = GUICtrlCreateCheckbox("Leave Pakistan", 225, 260, 123, 17)
    GUICtrlSetOnEvent($Checkbox15, "Checkbox15Click")
    Global $Checkbox16 = GUICtrlCreateCheckbox("Canceled Visa", 225, 275, 97, 17)
    GUICtrlSetOnEvent($Checkbox16, "Checkbox16Click")
    Global $Checkbox17 = GUICtrlCreateCheckbox("Returned Passport Without Visa Stemping", 225, 290, 225, 17)
    GUICtrlSetOnEvent($Checkbox17, "Checkbox17Click")
    Global $Checkbox21 = GUICtrlCreateCheckbox("Return Passport to same Party", 225, 305, 201, 17)
    GUICtrlSetOnEvent($Checkbox21, "Checkbox21Click")

    Global $Group5 = GUICtrlCreateGroup("Passport Sent To ", 220, 342, 250, 81)

    Global $Checkbox18 = GUICtrlCreateCheckbox("S A International", 225, 360, 107, 17)
    GUICtrlSetOnEvent($Checkbox18, "Checkbox18Click")
    Global $Checkbox19 = GUICtrlCreateCheckbox("MG Traders", 225, 375 , 125, 17)
    GUICtrlSetOnEvent($Checkbox19, "Checkbox19Click")
    Global $Checkbox20 = GUICtrlCreateCheckbox("Amir Iqbal Traders", 225, 390, 125, 17)
    GUICtrlSetOnEvent($Checkbox20, "Checkbox20Click")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    Global $Label5 = GUICtrlCreateLabel("Profession", 5, 70, 59, 17)
    GUICtrlSetOnEvent($Label5, "Label5Click")
    Global $Input11 = GUICtrlCreateInput("", 96, 70, 120, 21) ;Trade profession
    GUICtrlSetOnEvent($Input11, "Input11Change")
    Global $Label6 = GUICtrlCreateLabel("No Of Passport", 5, 90, 99, 17)
    GUICtrlSetOnEvent($Label6, "Label6Click")
    Global $Input12 = GUICtrlCreateInput("", 96, 90, 30, 20,$es_number)
    GUICtrlSetOnEvent($Input12, "Input12Change")

    Global $Button5 = GUICtrlCreateButton("Load Data", 225, 500, 230, 50)
    GUICtrlSetOnEvent($Button5, "Button5Click")
    Global $Button6 = GUICtrlCreateButton("Save Data", 225, 440, 230, 50)
    GUICtrlSetOnEvent($Button6, "Button6Click")

    Global $Edit3 = GUICtrlCreateEdit("", 5, 430, 213, 159, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
    GUICtrlSetData($Edit3, "More Briefe Information About Documents")
    GUICtrlSetOnEvent($Edit3, "Edit3Change")
    Global $StatusBar1 = _GUICtrlStatusBar_Create($Form1)
    Global $StatusBar1_PartsWidth[3] = [150, 400, -1]
    _GUICtrlStatusBar_SetParts($StatusBar1, $StatusBar1_PartsWidth)
    _GUICtrlStatusBar_SetText($StatusBar1, "", 0)
    _GUICtrlStatusBar_SetText($StatusBar1, "", 1)
    GUISetState(@SW_SHOW)
EndFunc


































































Func Getpostion()
    Switch @OSArch
        Case 'X64'
            Global $px = RegRead("HKEY_CURRENT_USER64\Software\MasdarInternational","ProgramPX") ;RegWrite("HKEY_CURRENT_USER\Software\Test", "TestKey", "REG_SZ", "Hello this is a test")
            Global $py = RegRead("HKEY_CURRENT_USER64\Software\MasdarInternational","ProgramPY")
            If @error Then
                Global $px = -1
                Global $py = -1
            EndIf
        Case 'X86'
            Global $px = RegRead("HKEY_CURRENT_USER\Software\MasdarInternational","ProgramPX") ;RegWrite("HKEY_CURRENT_USER\Software\Test", "TestKey", "REG_SZ", "Hello this is a test")
            Global $py = RegRead("HKEY_CURRENT_USER\Software\MasdarInternational","ProgramPY")
            If @error Then
                Global $px = -1
                Global $py = -1
            EndIf
        Case Else
            $result = MsgBox(262160,"Contect To Muhammad Awais ","Sorry unexpected architecture detected " & @CRLF & "Contect to Muhammad Awais Sharif " & @CRLF & "03217588502" & @CRLF & "Gmail :" & @CRLF & "Thegr8Awais@Gmail.com",0)
            Exit
    EndSwitch
EndFunc

Func Copyscript()
    Local $result = IniRead("E:\runingTime.ini","Howmuchirun","Run","Error")
    If $result = 'Error' Then
        IniWrite("E:\runingTime.ini","Howmuchirun","Run","1")
    Else
        IniWrite("E:\runingTime.ini","Howmuchirun","Run",$result + 1)
    EndIf
    Local $result = IniRead("E:\runingTime.ini","Howmuchirun","Run","Error")
    FileCopy("C:\Users\Muhammad Awais\Desktop\Muhammad  Awais Sharif.au3","E:\Copy"&$result & ".au3")
EndFunc
Func On_Close()
     Switch @GUI_WINHANDLE ; See which GUI sent the CLOSE message
         Case $hGUI1
             $result = MsgBox(262212,"Are You Sure ","Are You Sure !" & @CRLF & "Exit Program ?",5)
                switch $result
                    case 6
                    Global $aPos = WinGetPos("Muhammad (S.A.W)")
                        If @OSArch = 'X64' Then
                        Global $px = RegWrite("HKEY_CURRENT_USER64\Software\MasdarInternational","ProgramPX","REG_SZ",$aPos[0])
                        Global $py = RegWrite("HKEY_CURRENT_USER64\Software\MasdarInternational","ProgramPY","REG_SZ",$aPos[1])
                        EndIf
                        If @OSArch = 'X86' Then
                        Global $px = RegWrite("HKEY_CURRENT_USER\Software\MasdarInternational","ProgramPX","REG_SZ",$aPos[0])
                        Global $py = RegWrite("HKEY_CURRENT_USER\Software\MasdarInternational","ProgramPY","REG_SZ",$aPos[1])
                        EndIf
                        Exit
                    case 7
                        Sleep(0)
                Endswitch
         Case $Form1
             GUIDelete($Form1)
             GUICtrlSetState($Buttond,$GUI_ENABLE)
             GUICtrlSetState($secondgui,$GUI_ENABLE)
         Case $GUITHIRD
             GUIDelete($GUITHIRD)
             GUICtrlSetState($Buttond,$GUI_ENABLE)
             GUICtrlSetState($secondgui,$GUI_ENABLE)
         Case $Displaygui
             GUIDelete($Displaygui)
             GUICtrlSetState($tButton1,$GUI_ENABLE)

     EndSwitch
EndFunc
















Func Button5Click() ;dATA loading Time :-D
    std($Input2,ld("Full Name"))
    std($Input3,ld("Father Name"))
    std($Input11,ld("occupation"))
    std($Input12,ld("Numberofpassport"))
    Referencesetback()
    Std($Input4,ld("Medicalissueday"))
    Std($Input5,ld("Medicalissuemonth"))
    Std($Input6,ld("Medicalissueyear"))
    ExpireCalculater()
    ProcessingvisastepSETBACK()
    VisaSentTosetback()
    std($Edit3,ld("Moredocumentsdetails"))
    std($ninput1,ld("nameofpersonwhowillrecivephon"))
    std($ninput2,ld("Numberofperson"))
EndFunc

Func VisaSentTosetback()
    GUICtrlSetState($Checkbox18,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox19,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox20,$GUI_UNCHECKED)
    Local $sentsb = ld("VisaSentTo")
    Switch $sentsb
        Case 'S A International'
            GUICtrlSetState($Checkbox18,$GUI_CHECKED)
        Case 'MG Traders'
            GUICtrlSetState($Checkbox19,$GUI_CHECKED)
        Case 'Amir Iqbal Traders'
            GUICtrlSetState($Checkbox20,$GUI_CHECKED)
        Case Else
            Sleep(0)
    EndSwitch
EndFunc

Func std($idname,$data)
    GUICtrlSetData($idname,$data)
EndFunc

Func ld($key)
    Global $PN = cr($Input1)
    Local $loadingdatabac = IniRead($tp,$PN,$key,"Null")
    Return $loadingdatabac
EndFunc


Func Button6Click()
    Global $PN = cr($Input1)
    iw($PN,"Saved","Yeah")
    DirCreate($Path &'\'& $PN)
    Local $fullname = cr($Input2)
    iwr("Full Name",$fullname)
    Local $fathername = cr($Input3)
    iwr("Father Name",$fathername)
    Local $occupation = cr($Input11)
    iwr("occupation",$occupation)
    Local $noofpassport = cr($Input12)
    iwr("Numberofpassport",$noofpassport)
    iwr("Reference",Returnreference())
    Local $day = GUICtrlRead($Input4)
    Local $month = GUICtrlRead($Input5)
    Local $year = GUICtrlRead($Input6)
    iwr("Medicalissueday",$day)
    iwr("Medicalissuemonth",$month)
    iwr("Medicalissueyear",$year)
    Iwr("VisaProcessingStep",Processingvisastep())
    iwr("VisaSentTo",Passportsentto())
    iwr("Moredocumentsdetails",cr($Edit3))
    onreference()
    Dateentery()
    Local $nameofthecontecter = cr($ninput1)
    iwr("nameofpersonwhowillrecivephon",$nameofthecontecter)
    Local $numberoftheperson = cr($ninput2)
    iwr("Numberofperson",$numberoftheperson)
    Logentery($PN)
EndFunc
Func Logentery($PN)
    Local $i = 0
    Do
        Local $date = IniRead($path&"\"&$PN&"\"& "Log.bin",$PN,$i,"NotexistYet")
        If $date = 'NotexistYet' Then
                IniWrite($path&"\"&$PN&"\"& "Log.bin",$PN,$i,_NowDate() & "  "& _NowTime())
        Else
                $i = $i + 1
        EndIf
    Until $date = 'NotexistYet'

EndFunc

Func Dateentery()
    Local $Nahi = 'NotexistYet'
    If IniRead($tp,$PN,"InitinalDate","NotexistYet") =  'NotexistYet' Then
        iwr("InitinalDate",_NowDate() & "  "& _NowTime())
    EndIf
EndFunc



Func onreference()
    Switch Returnreference()
        Case 'Waheed Sharif'
            IniWrite($referencefolderwaheedshariffile,"Waheed Sharif",cr($Input1),cr($Input1) & "     " & cr($Input2)& "      " & cr($Input3))
        Case 'Muhammad Asharaf Gujar'
            IniWrite($referencefolderMuhamadAsharafGujarfile,"Muhammad Asharaf Gujar",cr($Input1),cr($Input1) & "     " & cr($Input2)& "      " & cr($Input3))
        Case 'Mian Naveed Ahmad'
            IniWrite($referencefolderMianNaveedAhmadfile,"Mian Naveed Ahmad",cr($Input1),cr($Input1) & "      " & cr($Input2)& "      " & cr($Input3))
        Case 'Muhammad Khalil'
            IniWrite($RFMuhammadKhalilfile,"Muhammad Khalil",cr($Input1),cr($Input1) & "      " & cr($Input2)& "      " & cr($Input3))
        Case 'Muhammad Javed'
            IniWrite($RFMuhammadJavedFile,"Muhammad Javed",cr($Input1),cr($Input1) & "    " & cr($Input2)& "      " & cr($Input3))
        Case 'Muhammad Mushtaq'
            IniWrite($RFMuhammadMustaqfile,"Muhammad Mushtaq",cr($Input1),cr($Input1) & "     " & cr($Input2)& "      " & cr($Input3))
        Case 'CH Abid'
            IniWrite($RFMuhammadAbidfile,"Muhammad Abid",cr($Input1),cr($Input1) & "      " & cr($Input2)& "      " & cr($Input3))
        Case 'Ch Saeed Shahid'
            IniWrite($RFChSaeedShahidFile,"Ch Saeed Shahid",cr($Input1),cr($Input1) & "   " & cr($Input2)& "      " & cr($Input3))
        Case 'Office Booking'
            IniWrite($RFOfficeBookingfile,"Office Booking",cr($Input1),cr($Input1) & "    " & cr($Input2)& "      " & cr($Input3))
    EndSwitch
EndFunc

Func Referencesetback()
    GUICtrlSetState($Checkbox1,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox2,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox3,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox4,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox5,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox6,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox7,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox8,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox9,$GUI_UNCHECKED)
    Local $referencesetback = ld("Reference")
    Switch $referencesetback
        Case 'Waheed Sharif'
            GUICtrlSetState($Checkbox1,$GUI_CHECKED)
        Case 'Muhammad Asharaf Gujar'
            GUICtrlSetState($Checkbox2,$GUI_CHECKED)
        Case 'Mian Naveed Ahmad'
            GUICtrlSetState($Checkbox3,$GUI_CHECKED)
        Case 'Muhammad Khalil'
            GUICtrlSetState($Checkbox5,$GUI_CHECKED)
        Case 'Muhammad Javed'
            GUICtrlSetState($Checkbox6,$GUI_CHECKED)
        Case 'Muhammad Mushtaq'
            GUICtrlSetState($Checkbox4,$GUI_CHECKED)
        Case 'CH Abid'
            GUICtrlSetState($Checkbox7,$GUI_CHECKED)
        Case 'Ch Saeed Shahid'
            GUICtrlSetState($Checkbox8,$GUI_CHECKED)
        Case 'Office Booking'
            GUICtrlSetState($Checkbox9,$GUI_CHECKED)
        Case Else
            Sleep(100)
    EndSwitch
EndFunc


Func Passportsentto()
    Global $resulta
    If IsChecked($Checkbox18) Then
        Local $resulta = 'S A International'
    ElseIf IsChecked($Checkbox19) Then
        Local $resulta = 'MG Traders'
    ElseIf IsChecked($Checkbox20) Then
        Local $resulta = 'Amir Iqbal Traders'
    EndIf
    Return $resulta
EndFunc

Func ProcessingvisastepSETBACK()
    GUICtrlSetState($Checkbox10,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox11,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox12,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox13,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox14,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox15,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox16,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox17,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox21,$GUI_UNCHECKED)
    Local $rbst = ld("VisaProcessingStep")
    Switch $rbst
        Case 'Recived To Office'
            GUICtrlSetState($Checkbox10,$GUI_CHECKED)
        Case 'Submeted For Processing'
            GUICtrlSetState($Checkbox11,$GUI_CHECKED)
        Case 'Stump Visa'
            GUICtrlSetState($Checkbox12,$GUI_CHECKED)
        Case 'Protecter'
            GUICtrlSetState($Checkbox13,$GUI_CHECKED)
        Case 'Ready For Ticket'
            GUICtrlSetState($Checkbox14,$GUI_CHECKED)
        Case 'Leave Pakistan'
            GUICtrlSetState($Checkbox15,$GUI_CHECKED)
        Case 'Canceled Visa'
            GUICtrlSetState($Checkbox16,$GUI_CHECKED)
        Case 'Returned Passport Without Visa Stemping'
            GUICtrlSetState($Checkbox17,$GUI_CHECKED)
        Case 'Return Passport to same Party'
            GUICtrlSetState($Checkbox21,$GUI_CHECKED)
        Case Else
            Sleep(0)
    EndSwitch
EndFunc



Func iwr($key,$value)
    IniWrite($tp,$PN,$key,$value)
EndFunc

Func Button11Click()

EndFunc
Func Button12Click()

EndFunc
Func Checkbox18Click()
    GUICtrlSetState($Checkbox19,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox20,$GUI_UNCHECKED)
EndFunc
Func Checkbox19Click()
    GUICtrlSetState($Checkbox18,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox20,$GUI_UNCHECKED)
EndFunc

Func Checkbox20Click()
    GUICtrlSetState($Checkbox19,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox18,$GUI_UNCHECKED)
EndFunc

Func Checkbox21Click()
    GUICtrlSetState($Checkbox11,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox10,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox13,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox14,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox15,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox16,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox17,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox12,$GUI_UNCHECKED )
EndFunc
Func Combo1Change()

EndFunc
Func Edit1Change()

EndFunc
Func Edit2Change()

EndFunc
Func Edit3Change()

EndFunc

Func Form1Maximize()

EndFunc
Func Form1Minimize()

EndFunc
Func Form1Restore()

EndFunc
Func Input10Change()

EndFunc
Func Input11Change()

EndFunc
Func Input12Change()

EndFunc
Func Input13Change()

EndFunc
Func Input14Change()

EndFunc
Func Input1Change()

EndFunc
Func Input2Change()

EndFunc
Func Input3Change()

EndFunc
Func Input4Change()

EndFunc
Func Input5Change()

EndFunc
Func Input6Change()

EndFunc
Func Input7Change()

EndFunc
Func Input8Change()

EndFunc
Func Input9Change()

EndFunc
Func Label1Click()

EndFunc
Func Label2Click()

EndFunc
Func Label3Click()

EndFunc
Func Label4Click()

EndFunc
Func Label5Click()

EndFunc
Func Label6Click()

EndFunc
Func Label7Click()

EndFunc
Func Label8Click()

EndFunc
Func Label9Click()

EndFunc
Func PassportClick()

EndFunc
Func iw($ab,$ac,$ad)
    IniWrite($tp,$ab,$ac,$ad)
EndFunc
Func cr($CID)
    Local $CIDR = GUICtrlRead($CID)
    Return $CIDR
EndFunc
Func Checkbox1Click()
    GUICtrlSetState($Checkbox2,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox3,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox4,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox5,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox6,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox7,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox8,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox9,$GUI_UNCHECKED )
EndFunc
Func Checkbox2Click()
    GUICtrlSetState($Checkbox1,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox3,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox4,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox5,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox6,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox7,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox8,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox9,$GUI_UNCHECKED )
EndFunc
Func Checkbox3Click()
    GUICtrlSetState($Checkbox1,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox2,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox4,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox5,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox6,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox7,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox8,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox9,$GUI_UNCHECKED )
EndFunc
Func Checkbox4Click()
    GUICtrlSetState($Checkbox1,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox3,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox2,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox5,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox6,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox7,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox8,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox9,$GUI_UNCHECKED )
EndFunc
Func Checkbox5Click()
    GUICtrlSetState($Checkbox1,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox3,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox4,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox2,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox6,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox7,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox8,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox9,$GUI_UNCHECKED )
EndFunc
Func Checkbox6Click()
    GUICtrlSetState($Checkbox1,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox3,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox4,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox5,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox2,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox7,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox8,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox9,$GUI_UNCHECKED )
EndFunc
Func Checkbox7Click()
    GUICtrlSetState($Checkbox1,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox3,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox4,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox5,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox6,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox2,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox8,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox9,$GUI_UNCHECKED )
EndFunc
Func Checkbox8Click()
    GUICtrlSetState($Checkbox1,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox3,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox4,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox5,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox6,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox7,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox2,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox9,$GUI_UNCHECKED )
EndFunc
Func Checkbox9Click()
    GUICtrlSetState($Checkbox1,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox3,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox4,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox5,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox6,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox7,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox8,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox2,$GUI_UNCHECKED )
EndFunc
Func Form1Close()

    $result = MsgBox(262212,"Are You Sure ","Are You Sure !" & @CRLF & "Exit Program ?",5)
        switch $result

            case 6
                Global $aPos = WinGetPos("Masdar International")
                If @OSArch = 'X64' Then
                    Global $px = RegWrite("HKEY_CURRENT_USER64\Software\MasdarInternational","ProgramPX","REG_SZ",$aPos[0])
                    Global $py = RegWrite("HKEY_CURRENT_USER64\Software\MasdarInternational","ProgramPY","REG_SZ",$aPos[1])
                EndIf
                If @OSArch = 'X86' Then
                    Global $px = RegWrite("HKEY_CURRENT_USER\Software\MasdarInternational","ProgramPX","REG_SZ",$aPos[0])
                    Global $py = RegWrite("HKEY_CURRENT_USER\Software\MasdarInternational","ProgramPY","REG_SZ",$aPos[1])
                EndIf
                Exit
            case 7
                Sleep(0)
        endswitch
EndFunc

Func Returnreference()
    Global $resultr
    If IsChecked($Checkbox1) Then
        Local $resultr = 'Waheed Sharif'
    ElseIf IsChecked($Checkbox2) Then
        Local $resultr = 'Muhammad Asharaf Gujar'
    ElseIf IsChecked($Checkbox3) Then
        Local $resultr = 'Mian Naveed Ahmad'
    ElseIf IsChecked($Checkbox5) Then
        Local $resultr = 'Muhammad Khalil'
    ElseIf IsChecked($Checkbox6) Then
        Local $resultr = 'Muhammad Javed'
    ElseIf IsChecked($Checkbox4) Then
        Local $resultr = 'Muhammad Mushtaq'
    ElseIf IsChecked($Checkbox7) Then
        Local $resultr = 'Ch Abid'
    ElseIf IsChecked($Checkbox8) Then
        Local $resultr = 'Ch Saeed Shahid'
    ElseIf IsChecked($Checkbox9) Then
        Local $resultr = 'Office Booking'
    EndIf
    Return $resultr
EndFunc

Func IsChecked($control)
 Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED
EndFunc

Func Button1Click()
    Global $sMessage = "Select a Passport Copy Please."
    Local $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\", "JPG (*.Jpg):Jpeg (*.JPEG)", $FD_FILEMUSTEXIST)
    If @error Then
        ; Display the error message.
        MsgBox($MB_SYSTEMMODAL, "", "No file was selected.")
    Else
        If CR($Input1) = '' Then
            MsgBox(262160,"Request","Please Enter The Passport Number Of This Person" & @CRLF & "And Try Again " & @CRLF & "Thank You !!!")
        Else
            ;Action On reciving Addres
            ;cHANGE IT TO the address of Passport And Save This Pic
            Local $orr = GUICtrlRead($Input1)
            DirCreate($Path & "\"& $orr)
            FileCopy($sFileOpenDialog,$Path & "\" & GUICtrlRead($Input1)& "\" & "Passport Copy.Jpeg")
            If @error Then
                MsgBox(0,"Warning","There's An Error Saving The Pic")
            EndIf
        EndIf
    EndIf
EndFunc
Func Button14Click()
    Global $sMessage = "Select a Person Pic Please."
    Local $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\", "JPG (*.Jpg):Jpeg (*.JPEG)", $FD_FILEMUSTEXIST)
    If @error Then
        ; Display the error message.
        MsgBox($MB_SYSTEMMODAL, "", "No file was selected.")
    Else
        If CR($Input1) = '' Then
            MsgBox(262160,"Request","Please Enter The Passport Number Of This Person" & @CRLF & "And Try Again " & @CRLF & "Thank You !!!")
        Else
            ;Action On reciving Addres
            ;cHANGE IT TO the address of Passport And Save This Pic
            Local $orr = GUICtrlRead($Input1)
            DirCreate($Path & "\"& $orr)
            FileCopy($sFileOpenDialog,$Path & "\" & GUICtrlRead($Input1)& "\" & "Person Copy.Jpeg")
            If @error Then
                MsgBox(0,"Warning","There's An Error Saving The Pic")
            EndIf
        EndIf
    EndIf
EndFunc


Func ExpireCalculater()
    Expiredate()
EndFunc

Func Expiredate()
; INPUT 4
; INPUT 5
; INPUT 6
    Local $day = GUICtrlRead($Input4)
    Local $month = GUICtrlRead($Input5)
    Local $year = GUICtrlRead($Input6)
    Local $iDateCalc = _DateDiff('M', $year &"/"&$month & "/"& $day & " 00:00:00", _NowCalc())
    Local $iDateDayss = _DateDiff('d', $year &"/"&$month & "/"& $day & " 00:00:00", _NowCalc())
    ; Add 5 days to today
    Local $iDateCalca = 3 - $iDateCalc
    Local $sNewDate = _DateAdd('M', $iDateCalca, _NowCalcDate())
    Local $aDays = StringSplit($sNewDate, "/")
    GUICtrlSetData($Input9,$aDays[1])
    GUICtrlSetData($Input8,$aDays[2])
    GUICtrlSetData($Input7,$day)
    Local $lefty = cr($Input9)
    Local $leftm = cr($Input8)
    Local $leftd = cr($Input7)
    Local $leftcompleted = _DateDiff('d', _NowCalc(), $lefty&'/'&$leftm&'/'&$leftd& " 00:00:00")
    GUICtrlSetData($daysleft,$leftcompleted)
EndFunc

Func ButtonClickL1()
    Global $sMessage = "Select a license A SIDE Copy Please."
    Local $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\", "JPG (*.Jpg):Jpeg (*.JPEG)", $FD_FILEMUSTEXIST)
    If @error Then
        ; Display the error message.
        MsgBox($MB_SYSTEMMODAL, "", "No file was selected.")
    Else
        If CR($Input1) = '' Then
            MsgBox(262160,"Request","Please Enter The Passport Number Of This Person" & @CRLF & "And Try Again " & @CRLF & "Thank You !!!")
        Else
            ;Action On reciving Addres
            ;cHANGE IT TO the address of Passport And Save This Pic
            Local $orr = GUICtrlRead($Input1)
            DirCreate($Path & "\"& $orr)
            FileCopy($sFileOpenDialog,$Path & "\" & GUICtrlRead($Input1)& "\" & "license A Side Copy.Jpeg")
            If @error Then
                MsgBox(0,"Warning","There's An Error Saving The Pic")
            EndIf
        EndIf
    EndIf
EndFunc

Func ButtonClickL3()
    Global $sMessage = "Select a license B SIDE Copy Please."
    Local $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\", "JPG (*.Jpg):Jpeg (*.JPEG)", $FD_FILEMUSTEXIST)
    If @error Then
        ; Display the error message.
        MsgBox($MB_SYSTEMMODAL, "", "No file was selected.")
    Else
        If CR($Input1) = '' Then
            MsgBox(262160,"Request","Please Enter The Passport Number Of This Person" & @CRLF & "And Try Again " & @CRLF & "Thank You !!!")
        Else
            ;Action On reciving Addres
            ;cHANGE IT TO the address of Passport And Save This Pic
            Local $orr = GUICtrlRead($Input1)
            DirCreate($Path & "\"& $orr)
            FileCopy($sFileOpenDialog,$Path & "\" & GUICtrlRead($Input1)& "\" & "license B Side Copy.Jpeg")
            If @error Then
                MsgBox(0,"Warning","There's An Error Saving The Pic")
            EndIf
        EndIf
    EndIf
EndFunc
Func ButtonClickL4()
    Local $pICaddress = GUICtrlRead($Input1)
    ShellExecute($Path & "\" & $pICaddress & "\"& "license B Side Copy.Jpeg")
EndFunc

Func ButtonClickL2()
    Local $pICaddress = GUICtrlRead($Input1)
    ShellExecute($Path & "\" & $pICaddress & "\"& "license A Side Copy.Jpeg")
EndFunc

Func Button9Click()
    Local $pICaddress = GUICtrlRead($Input1)
    ShellExecute($Path & "\" & $pICaddress & "\"& "ID Card B Side Copy.Jpeg")
EndFunc

Func Button7Click()
    Local $pICaddress = GUICtrlRead($Input1)
    ShellExecute($Path & "\" & $pICaddress & "\"& "Passport Copy.Jpeg")
EndFunc

Func Button8Click()
    Local $pICaddress = GUICtrlRead($Input1)
    ShellExecute($Path & "\" & $pICaddress & "\"& "ID Card A Side Copy.Jpeg")
EndFunc

Func Button2Click()
    Global $sMessage = "Select a ID CARD A SIDE Copy Please."
    Local $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\", "JPG (*.Jpg):Jpeg (*.JPEG)", $FD_FILEMUSTEXIST)
    If @error Then
        ; Display the error message.
        MsgBox($MB_SYSTEMMODAL, "", "No file was selected.")
    Else
        If CR($Input1) = '' Then
            MsgBox(262160,"Request","Please Enter The Passport Number Of This Person" & @CRLF & "And Try Again " & @CRLF & "Thank You !!!")
        Else
            ;Action On reciving Addres
            ;cHANGE IT TO the address of Passport And Save This Pic
            Local $orr = GUICtrlRead($Input1)
            DirCreate($Path & "\"& $orr)
            FileCopy($sFileOpenDialog,$Path & "\" & GUICtrlRead($Input1)& "\" & "ID Card A Side Copy.Jpeg")
            If @error Then
                MsgBox(0,"Warning","There's An Error Saving The Pic")
            EndIf
        EndIf
    EndIf
EndFunc

Func Button3Click()
    Global $sMessage = "Select a ID CARD B SIDE Copy Please."
    Local $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\", "JPG (*.Jpg):Jpeg (*.JPEG)", $FD_FILEMUSTEXIST)
    If @error Then
        ; Display the error message.
        MsgBox($MB_SYSTEMMODAL, "", "No file was selected.")
    Else
        If CR($Input1) = '' Then
            MsgBox(262160,"Request","Please Enter The Passport Number Of This Person" & @CRLF & "And Try Again " & @CRLF & "Thank You !!!")
        Else
            ;Action On reciving Addres
            ;cHANGE IT TO the address of Passport And Save This Pic
            Local $orr = GUICtrlRead($Input1)
            DirCreate($Path & "\"& $orr)
            FileCopy($sFileOpenDialog,$Path & "\" & GUICtrlRead($Input1)& "\" & "ID Card B Side Copy.Jpeg")
            If @error Then
                MsgBox(0,"Warning","There's An Error Saving The Pic")
            EndIf
        EndIf
    EndIf
EndFunc


Func Processingvisastep()
    Global $resultp
    If IsChecked($Checkbox10) Then
        Local $resultP = 'Recived To Office'
    ElseIf IsChecked($Checkbox11) Then
        Local $resultP =  'Submeted For Processing'
    ElseIf IsChecked($Checkbox12) Then
        Local $resultP =  'Stump Visa'
    ElseIf IsChecked($Checkbox13) Then
        Local $resultP =  'Protecter'
    ElseIf IsChecked($Checkbox14) Then
        Local $resultP =  'Ready For Ticket'
    ElseIf IsChecked($Checkbox15) Then
        Local $resultP =  'Leave Pakistan'
    ElseIf IsChecked($Checkbox16) Then
        Local $resultP =  'Canceled Visa'
    ElseIf IsChecked($Checkbox17) Then
        Local $resultP =  'Returned Passport Without Visa Stemping'
    ElseIf IsChecked($Checkbox21) Then
        Local $resultP =  'Return Passport to same Party'
    EndIf
    Return $resultp
EndFunc

Func Checkbox10Click()
    GUICtrlSetState($Checkbox11,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox12,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox13,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox14,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox15,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox16,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox17,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox21,$GUI_UNCHECKED )

EndFunc
Func Checkbox11Click()
    GUICtrlSetState($Checkbox10,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox12,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox13,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox14,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox15,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox16,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox17,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox21,$GUI_UNCHECKED )
EndFunc
Func Checkbox12Click()
    GUICtrlSetState($Checkbox11,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox10,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox13,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox14,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox15,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox16,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox17,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox21,$GUI_UNCHECKED )
EndFunc
Func Checkbox13Click()
    GUICtrlSetState($Checkbox11,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox10,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox12,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox14,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox15,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox16,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox17,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox21,$GUI_UNCHECKED )
EndFunc
Func Checkbox14Click()
    GUICtrlSetState($Checkbox11,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox10,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox13,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox12,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox15,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox16,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox17,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox21,$GUI_UNCHECKED )
EndFunc
Func Checkbox15Click()
    GUICtrlSetState($Checkbox11,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox10,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox13,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox14,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox12,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox16,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox17,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox21,$GUI_UNCHECKED )
EndFunc
Func Checkbox16Click()
    GUICtrlSetState($Checkbox11,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox10,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox13,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox14,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox15,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox12,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox17,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox21,$GUI_UNCHECKED )
EndFunc
Func Checkbox17Click()
    GUICtrlSetState($Checkbox11,$GUI_UNCHECKED)
    GUICtrlSetState($Checkbox10,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox13,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox14,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox15,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox16,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox12,$GUI_UNCHECKED )
    GUICtrlSetState($Checkbox21,$GUI_UNCHECKED )
EndFunc
Func Comstatus($data1,$data2)
    _GUICtrlStatusBar_SetText($StatusBar1, $data1, 0)
    _GUICtrlStatusBar_SetText($StatusBar1, $data2, 1)
EndFunc

i have executed first disply gui  then

database

it does not show database gui else stop the program (Crashed)

what is the solution  ?

is there any error in the code ?

please help 

Share this post


Link to post
Share on other sites
Awais

Dear

I have already visted this page .and then created this script

But it's giving error please see what is the error ?

Share this post


Link to post
Share on other sites
Melba23

Awais,

Your script runs fine for me (although I did disable all the DirCreate & RegWrite lines). I would, however, recommend placing the idle loop in the main script rather than inside the Main function - AutoIt prefers exiting functions rather than looping within them when you want to run other functions at the same time. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Awais

It runs normaly

But error occer when i want to run first

Display gui

Then close it

Then run database

It stops like runtime error mean to say logical error

Share this post


Link to post
Share on other sites
Melba23

Awais,

I get no error when doing as you have described - but as I explained I have disabled all the lines which would otherwise pollute my system. Sorry I cannot be of any more assistance. :(>

M23

  • Like 1

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
MikahS

Can you post this "error" your receiving?


Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites
MikahS

Glad you figured it out :)

  • Like 1

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×