Jump to content

Recommended Posts

Posted (edited)

Title says it all

Ez-Track

Posted Image

Enjoy!!!

Code as requested

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <ButtonConstants.au3>
#Include <File.au3>
#Include <GuiListView.au3>

Dim $PEver = "1.0.6" ; May 2008 Autoit Ver[b] 3.2.12.0[/b]
Dim $data_Location = @ScriptDir & "\Data\"
Dim $File_Location = @ScriptDir & "\Data\Address.ini"
Dim $num = 0, $Input[10], $data_[10], $COAInput[10]

DirGetSize($data_Location)
If @error= 1 Then
    DirCreate($data_Location)
EndIf

$Sound_lnk = @TempDir & "\Sound_lnk.wav"
FileInstall("C:\XPClean-web\Settings\XPClean-pics\Sounds\Notify.wav", $Sound_lnk)
$Logo_jpg = @TempDir & "\Ez-Track.jpg"
FileInstall("C:\Temp\Ez-Track.jpg", $Logo_jpg)
$Logo_back = @TempDir & "\Ez-Back.jpg"
FileInstall("C:\Temp\Ez-back.jpg", $Logo_back)
$Logo_icon = @TempDir & "\Ez-Track.ico"
FileInstall("C:\Temp\Ez-Track.ico", $Logo_icon)
$Sound_clk = @TempDir & "\Sound_clk.wav"
FileInstall("C:\XPClean-web\Settings\XPClean-pics\Sounds\Clickerx.wav", $Sound_clk)
$Sound_grp = @TempDir & "\Sound_grp.wav"
FileInstall("C:\XPClean-web\Settings\XPClean-pics\Sounds\Group_open.wav", $Sound_grp)

SplashImageOn("", $Logo_jpg, 335, 240, -1, -1, 1)
SoundPlay ($Sound_lnk,1)
Sleep(2000)
SplashOff()

If Not FileExists($File_Location) Then
    Set_Ini()
    MsgBox(262208, "Welcome...", "Please Select *View All Customers* to begin...   ", 5)
EndIf

$main = GUICreate(" * Ez-Track *      v" & $PEver, 612, 412)
GUISetIcon($Logo_icon)
GUICtrlCreatePic($Logo_back, 1, 1, 610, 415, $SS_SUNKEN)
GUICtrlSetState(-1, $GUI_DISABLE)
$Group_1 = GUICtrlCreateGroup("Customer Panel", 10, 10, 250, 390)
GUICtrlSetBkColor(-1, 0xCBD7ED)
$Group_2 = GUICtrlCreateGroup("Customer Information", 280, 10, 320, 390)
GUICtrlSetBkColor(-1, 0xCBD7ED)
$Group_3 = GUICtrlCreateGroup("Search", 20, 30, 230, 130)
GUICtrlSetBkColor(-1, 0xCBD7ED)
$Group_4 = GUICtrlCreateGroup("Controls", 20, 165, 230, 235)
GUICtrlSetBkColor(-1, 0xE1E9F6)
$Combo_3 = GUICtrlCreateCombo("Search by...", 80, 50, 100, 21)
$Input11 = GUICtrlCreateInput("Search Criteria", 45, 85, 180, 20)
$Label_10 = GUICtrlCreateLabel("Customer #: " & $num, 450, 28, 120, 22, BitOR($SS_SUNKEN, $SS_CENTER), $WS_EX_TRANSPARENT )
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1, 9.5, 550)
$Label_12 = GUICtrlCreateLabel("Name", 300, 40, 70, 20, $WS_EX_TRANSPARENT )
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Input[1] = GUICtrlCreateInput("", 300, 60, 280, 20)
$Label_14 = GUICtrlCreateLabel("Address", 300, 90, 90, 20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Label_15 = GUICtrlCreateLabel("Street Name", 380, 90, 140, 20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Input[2] = GUICtrlCreateInput("", 300, 110, 70, 20)
$Input[3] = GUICtrlCreateInput("", 380, 110, 200, 20)
$Label_18 = GUICtrlCreateLabel("City", 300, 140, 50, 20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Label_19 = GUICtrlCreateLabel("Change Of Address", 440, 140, 120, 20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Input[4] = GUICtrlCreateInput("", 300, 160, 110, 20)
$Input[5] = GUICtrlCreateInput("", 430, 160, 130, 20)
$Label_22 = GUICtrlCreateLabel("State", 300, 190, 70, 20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Label_23 = GUICtrlCreateLabel("Zip + 4", 390, 190, 110, 20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Input[6] = GUICtrlCreateInput("", 300, 210, 80, 20)
$Input[7] = GUICtrlCreateInput("", 390, 210, 190, 20)
$Edit_26 = GUICtrlCreateLabel("Notes", 300, 240, 80, 20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Edit_26 = GUICtrlCreateInput("", 300, 260, 280, 20)

; controls
$Button_5 = GUICtrlCreateButton("", 530, 310, 50, 50, $BS_ICON)
GUICtrlSetImage(-1, $Logo_icon )
GUICtrlSetTip( -1, "About QTasc")
$Button_6 = GUICtrlCreateButton("Close Ez-Track", 320, 365, 180, 25)
$Button_7 = GUICtrlCreateButton("Clear Form", 320, 330, 180, 25)
$Button_8 = GUICtrlCreateButton("View COA" , 320, 295, 180, 25)
$Button_9 = GUICtrlCreateButton("Start Search", 45, 120, 180, 25)
$Button_10 = GUICtrlCreateButton("Add Customer", 45, 260, 180, 25)
$Button_11 = GUICtrlCreateButton("Update Customer", 45, 225, 180, 25)
$Button_12 = GUICtrlCreateButton("View All Customers", 45, 190, 180, 25)
$Button_13 = GUICtrlCreateButton("Remove Customer", 45, 295, 180, 25)
$Button_14 = GUICtrlCreateButton("COA  On-Line", 45, 330, 180, 25)
$Button_15 = GUICtrlCreateButton("View/Print in Excel", 45, 365, 180, 25)
GUISetState()

GUICtrlSetData($Combo_3, "Customer #|Name|COA|Address|Street|City|Zip+4|Notes")

$viewer = GUICreate("  * Ez-Track *   ", 700, 500, 5, 5,$WS_BORDER, -1, $main)
GUISetIcon($Logo_icon)
GUISetBkColor (0xE1E9F6)
$Listview = GUICtrlCreateListView("#|Name|COA|Address|Street|City|State|Zip+4|Notes", 10, 10, 680, 400, -1, BitOR($LVS_EX_REGIONAL, $LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES))
$Closer = GUICtrlCreateButton("Close", 460, 425, 180, 30)
$Btn_view = GUICtrlCreateButton("View / Edit", 260, 425, 180, 30)
$Btn_COA = GUICtrlCreateButton("View COA", 60, 425, 180, 30)
GUISetState(@SW_HIDE)

$COA = GuiCreate("  * Ez-Track *   ", 392, 340, 205, 150,$WS_BORDER, -1, $main)
GUISetIcon($Logo_icon)
GUISetBkColor (0xE1E9F6)
GUICtrlCreateGroup("COA Dates", 15, 5, 365, 95)
GUICtrlCreateGroup("New Address", 15, 110, 365, 190)
$COALabel_1 = GuiCtrlCreateLabel("Customer #: ", 240, 25, 120, 22, $SS_SUNKEN + $SS_CENTER)
GUICtrlSetFont(-1, 9.5, 550)
$COAInput[1] = GuiCtrlCreateDate("", 100, 25, 100, 20)
$COAInput[2] = GuiCtrlCreateDate("", 100, 60, 100, 20)
$COAInput[3] = GUICtrlCreateCombo("", 240, 60, 120, 20)
GUICtrlSetData( -1, "Individual|Family|Business", "Individual")
$COALabel_4 = GuiCtrlCreateLabel("Address", 30, 135, 70, 20)
$COALabel_5 = GuiCtrlCreateLabel("Street Name", 150, 135, 110, 20)
$COAInput[4] = GuiCtrlCreateInput("", 30, 155, 70, 20)
$COAInput[5] = GuiCtrlCreateInput("", 150, 155, 220, 20)
$COALabel_8 = GuiCtrlCreateLabel("City", 30, 190, 80, 20)
$COALabel_9 = GuiCtrlCreateLabel("State", 140, 190, 80, 20)
$COALabel_10 = GuiCtrlCreateLabel("Zip + 4", 240, 190, 70, 20)
$COAInput[6] = GuiCtrlCreateInput("", 30, 210, 90, 20)
$COAInput[7] = GuiCtrlCreateInput("", 140, 210, 80, 20)
$COAInput[8] = GuiCtrlCreateInput("", 240, 210, 130, 20)
$COALabel_15 = GuiCtrlCreateLabel("Start Date", 30, 28, 50, 20)
$COALabel_17 = GuiCtrlCreateLabel("End Date", 30, 62, 70, 20)
; Buttons
$COAButton_14 = GuiCtrlCreateButton("Save", 30, 255, 100, 30)
$COAButton_15 = GuiCtrlCreateButton("Delete", 150, 255, 100, 30)
$COAButton_16 = GuiCtrlCreateButton("Close", 270, 255, 100, 30)

; Date set up
Global Const $DTM_SETFORMAT = 0x1005 ; Changed this to a global const SmOke_N
$COAstyle = "MM/dd/yyyy"
GuiCtrlSendMsg($COAInput[1], $DTM_SETFORMAT, 0, $COAstyle)
GuiCtrlSendMsg($COAInput[2], $DTM_SETFORMAT, 0, $COAstyle)

GuiSetState(@SW_HIDE)
Dim $B_DESCENDING ; [_GUICtrlListViewGetSubItemsCount ($listview) ]

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $Button_6
            ExitLoop
        Case $msg = $Button_15
            SoundPlay($Sound_clk)
            Open_Office()
        Case $msg = $Button_5
            Set_QT()
        Case $msg = $Button_7
            SoundPlay($Sound_clk)
            Clear_Customers()
        Case $msg = $Button_9
            SoundPlay($Sound_clk)
            Set_Customers()
        Case $msg = $Button_10
            SoundPlay($Sound_clk)
            Add_Customer()
        Case $msg = $Button_11
            SoundPlay($Sound_clk)
            Update_Customer()
        Case $msg = $Button_12
            SoundPlay($Sound_clk)
            GUISetState(@SW_SHOW, $viewer)
            Get_List()
        Case $msg = $Button_13
            SoundPlay($Sound_clk)
            Remove_Customer()
        Case $msg = $Button_14
            SoundPlay($Sound_clk)
            CO_Address()
        Case $msg = $Input11
            GUICtrlSetState($Button_9, $GUI_FOCUS )
            ; List View controls
        Case $msg = $Closer
            SoundPlay($Sound_clk)
            Close_List()
        Case $msg = $Btn_view
            SoundPlay($Sound_clk)
            Local $s_indices =  _GUICtrlListView_GetSelectedIndices($listview)
            Get_CNumber($s_indices + 1)
            GUISetState(@SW_HIDE, $viewer)
            _GUICtrlListView_DeleteAllItems($listview)
            Close_COA()
            GUISetState(@SW_SHOW, $main)
            GUISetState(@SW_RESTORE, $main)
        Case $msg = $Btn_COA
            SoundPlay($Sound_clk)
            Local $s_indices =  _GUICtrlListView_GetSelectedIndices($listview)
            Get_CNumber($s_indices + 1)
            Show_COA()
        Case $msg = $listview
            SoundPlay($Sound_clk)
            GUICtrlSetState( $Btn_view, $GUI_DISABLE)
            GUICtrlSetState( $Btn_COA, $GUI_DISABLE)
            _GUICtrlListView_SimpleSort($listview, $B_DESCENDING, GUICtrlGetState($listview))
        ; COA Controls
    Case $msg = $Button_8
            SoundPlay($Sound_clk)
            Show_COA()
        Case $msg = $COAButton_14
            SoundPlay($Sound_clk)
            Save_COA()
        Case $msg = $COAButton_15
            SoundPlay($Sound_clk)
            Delete_COA()
        Case $msg = $COAButton_16
            SoundPlay($Sound_clk)
            Close_COA()
            GUISetState(@SW_SHOW, $main)
            GUISetState(@SW_RESTORE, $main)
    EndSelect
WEnd
SoundPlay ($Sound_lnk,1)
Exit

; --------------------------- Functions -----------------

Func Set_Ini()
    FileWriteLine($File_Location, "[Address]")
    FileWriteLine($File_Location, "1=David Jones,12345,This way,East Covina,None,CA,95505-4321,BIG DOG!!!")
    FileWriteLine($File_Location, "2=Danny Smith,678,That way,North Covina,None,CA,95505-4321,Rear House")
    FileWriteLine($File_Location, "3=Debra Jones,910,Which way,West Covina,None,CA,95505-4321,Cookies and Milk")
EndFunc   ;==>Set_Ini

Func Set_Customers()
    $num = 0
    $temp_info = GUICtrlRead($Combo_3)
    If $temp_info = "Name" Then
        $temp_search = 1
    ElseIf $temp_info = "Address" Then
        $temp_search = 2
    ElseIf $temp_info = "Street" Then
        $temp_search = 3
    ElseIf $temp_info = "City" Then
        $temp_search = 4
    ElseIf $temp_info = "COA" Then
        $temp_search = 5
    ElseIf $temp_info = "Zip+4" Then
        $temp_search = 7
    ElseIf $temp_info = "Notes" Then
        $temp_search = 8
    ElseIf $temp_info = "Customer #" Then
        $num = GUICtrlRead($Input11)
        Get_CNumber($num)
        Return
    Else
        MsgBox(262208, "Sorry...", "Please Select a Search by...   ", 1)
        Return
    EndIf
    $temp_find = GUICtrlRead($Input11)
    $length = _FileCountLines($File_Location)
    For $x = 1 To $length - 1
        $temp_file = IniRead($File_Location, "Address", $x, "Not Found")
        If $temp_file = "Not Found" Then
            MsgBox(262208, "Sorry...", "No Files\Folders Found....   ", 1)
            Return
        EndIf
        $temp_split = StringSplit($temp_file, ",")
        If StringInStr($temp_split[$temp_search], $temp_find) Then
            For $t = 1 To $temp_split[0] -1
                GUICtrlSetData($Input[$t], $temp_split[$t])
                $num = $x
            Next
            GUICtrlSetData($Edit_26, $temp_split[8])
            GUICtrlSetData($Label_10, "Customer #: " & $num)
            Return
        EndIf
    Next
EndFunc   ;==>Set_Customers

Func Get_CNumber($x)
    $temp_file = IniRead($File_Location, "Address", $x, "Not Found")
    If $temp_file = "Not Found" Then
        MsgBox(262208, "Sorry...", "No Customer Found/Selected...   ", 1)
        Return
    EndIf
    $temp_split = StringSplit($temp_file, ",")
    For $t = 1 To $temp_split[0] - 1
        GUICtrlSetData($Input[$t], $temp_split[$t])
        $num = $x
    Next
    GUICtrlSetData($Edit_26, $temp_split[8])
    GUICtrlSetData($Label_10, "Customer #: " & $num)
    Return
EndFunc   ;==>Get_CNumber

Func Get_List()
    $length = _FileCountLines($File_Location)
    For $x = 1 To $length - 1
        $temp_file = IniRead($File_Location, "Address", $x, "Not Found")
        If $temp_file = "Not Found" Then Return
        $temp_split = StringSplit($temp_file, ",")
        GUICtrlCreateListViewItem( $x & "|" & $temp_split[1] & "|" & $temp_split[5] & "|" & $temp_split[2] & "|" & $temp_split[3] & "|" & $temp_split[4] & "|" & $temp_split[6] & "|" & $temp_split[7] & "|" & $temp_split[8] ,$listview)
    Next
EndFunc

Func Close_List()
    GUICtrlSetState( $Btn_view, $GUI_ENABLE)
    GUICtrlSetState( $Btn_COA, $GUI_ENABLE)
    _GUICtrlListView_DeleteAllItems($listview)
    GUISetState(@SW_HIDE, $viewer)
    GUISetState(@SW_SHOW, $main)
    GUISetState(@SW_RESTORE, $main)
EndFunc

Func Clear_Customers()
    If GUICtrlRead($Input[1]) = "" then Return
    for $x = 1 to 7
        GUICtrlSetData($Input[$x], "")
    Next
    GUICtrlSetData($Edit_26, "")
    Clear_List()
    GUICtrlSetData($Label_10, "Customer #: 0")
    GUISetState( @SW_HIDE, $COA )
    Close_List()
EndFunc

Func Add_Customer()
    If GUICtrlRead($Input[1]) = "" then
        MsgBox(262208, "Sorry...", "No Customer Found/Selected...   ", 1)
        Return
    EndIf
    $length = _FileCountLines($File_Location)
    IniWrite($File_Location, "Address", $length, GUICtrlRead($Input[1]) &","& GUICtrlRead($Input[2])&","& GUICtrlRead($Input[3])&","& GUICtrlRead($Input[4])&","& GUICtrlRead($Input[5])&","& GUICtrlRead($Input[6])&","&GUICtrlRead($Input[7])&","& GUICtrlRead($Edit_26))
    GUICtrlSetData($Label_10, "Customer #: " & $length)
    Clear_List()
    MsgBox(262208, "Great...", "Customer Added...   ", 1)
EndFunc

Func UpDate_Customer()
    If GUICtrlRead($Input[1]) = "" then
        MsgBox(262208, "Sorry...", "No Customer Found/Selected...   ", 1)
        Return
    EndIf
    $num = StringTrimLeft(GUICtrlRead($Label_10), 12)
    IniWrite($File_Location, "Address", $num, GUICtrlRead($Input[1]) &","& GUICtrlRead($Input[2])&","& GUICtrlRead($Input[3])&","& GUICtrlRead($Input[4])&","& GUICtrlRead($Input[5])&","& GUICtrlRead($Input[6])&","&GUICtrlRead($Input[7])&","& GUICtrlRead($Edit_26))
    Clear_List()
    MsgBox(262208, "Great...", "Customer Updated...   ", 1)
EndFunc

Func Remove_Customer()
    If GUICtrlRead($Input[1]) = "" then
        MsgBox(262208, "Sorry...", "No Customer Found/Selected...   ", 1)
        Return
    EndIf
    $num = StringTrimLeft(GUICtrlRead($Label_10), 12)
    IniWrite($File_Location, "Address", $num, ",,,,,,,")
    FileDelete($data_Location & "COA_" & $num &".dat")
    for $x = 1 to 7
        GUICtrlSetData($Input[$x], "")
    Next
    GUICtrlSetData($Edit_26, "")
    Clear_List()
    GUICtrlSetData($Label_10, "Customer #: 0")
    MsgBox(262208, "Great...", "Customer Removed...   ", 1)
EndFunc

Func Clear_List()
    FileDelete($data_Location & "Address.bak")
    FileDelete(@TempDir & "\new.ini")
    FileCopy($File_Location, $data_Location & "Address.bak", 1)
    FileWriteLine(@TempDir & "\new.ini", "[Address]")
    $t = 0
    $length = _FileCountLines($File_Location)
    For $x = 1 To $length - 1
        $temp_file = IniRead($File_Location, "Address", $x, "Not Found")
        If $temp_file = "Not Found" Then Return
        $temp_split = StringSplit($temp_file, ",")
        If $temp_split[1] = "" Then ContinueLoop
        $t = $t + 1
        IniWrite(@TempDir & "\new.ini", "Address", $t, $temp_split[1] & "," & $temp_split[2] & "," & $temp_split[3] & "," & $temp_split[4] & "," & $temp_split[5] & "," & $temp_split[6] & "," & $temp_split[7] & "," & $temp_split[8])
    Next
    FileCopy(@TempDir & "\new.ini", $File_Location, 1)
EndFunc

Func CO_Address()
    $web_loc = "https://moversguide.usps.com/mgservice/Home"
    Run(@ComSpec & " /c Start " & $web_loc, "", @SW_HIDE)
EndFunc

Func Open_Office()
    FileDelete($data_Location & "Address.bak")
    FileDelete($data_Location & "Office.csv")
    FileCopy($File_Location, $data_Location & "Address.bak", 1)
    $length = _FileCountLines($data_Location & "Address.bak")
    $Rfile = FileOpen($data_Location & "Address.bak", 0)
    $Wfile = FileOpen($data_Location & "Office.csv", 2)
    For $x = 2 To $length ; - 1
        $line = FileReadLine($Rfile, $x)
        If @error = -1 Then ExitLoop
        $line_pos = StringInStr($line, "=")
        FileWriteLine($Wfile, StringTrimLeft($line, $line_pos))
    Next
    FileClose($Rfile)
    FileClose($Wfile)
    $Off_loc = FileGetShortName($data_Location & "Office.csv")
    Run(@ComSpec & " /c Start " & $Off_loc, "", @SW_HIDE)
EndFunc

Func Show_COA()
    If GUICtrlRead($Input[1]) = "" then
        MsgBox(262208, "Sorry...", "No Customer Found/Selected...   ", 1)
        Return
    EndIf
    $num = StringTrimLeft(GUICtrlRead($Label_10), 12)
    If $num = 0 Or $num = "" then Return
    GUICtrlSetData($COALabel_1, "Customer #: " & $num)
    GUISetState( @SW_SHOW, $COA )
    For $x = 1 to 8
        if $x = 3 then ContinueLoop
        GUICtrlSetData( $COAInput[$x], "" )
    Next
    If FileExists($data_Location & "COA_" & $num & ".dat") Then
        $temp_split = StringSplit(FileReadLine($data_Location & "COA_" & $num & ".dat", 1), ",")
        For $x = 1 to 8
            If $x == 1 Or $x == 2 Then
                GUICtrlSendMsg($COAInput[$x], $DTM_SETFORMAT, 0, $temp_split[$x])
            Else
                GUICtrlSetData( $COAInput[$x], $temp_split[$x])     
            EndIf
        Next
    EndIf
EndFunc

Func Save_COA()
    If GUICtrlRead($COAInput[4]) = "" then
        MsgBox(262208, "Sorry...", "No Address Found/Selected...   ", 1)
        Return
    EndIf
    $num = StringTrimLeft(GUICtrlRead($Label_10), 12)
    If $num = 0 Or $num = "" then Return
    $temp_info = ""
    For $x = 1 to 7
        $temp_info = $temp_info & GUICtrlRead($COAInput[$x]) & ","
    Next
    $temp_info = $temp_info & GUICtrlRead($COAInput[$x])
    FileDelete($data_Location & "COA_" & $num &".dat")
    FileWriteLine($data_Location & "COA_" & $num &".dat", $temp_info)
    GUICtrlSetData( $Input[5], GUICtrlRead($COAInput[2]))
    GUISetState( @SW_HIDE, $COA )
    Close_List()
    UpDate_Customer()
EndFunc   

Func Delete_COA()
    If GUICtrlRead($COAInput[4]) = "" then
        MsgBox(262208, "Sorry...", "No Address Found/Selected...   ", 1)
        Return
    EndIf
    $num = StringTrimLeft(GUICtrlRead($Label_10), 12)
    If $num = 0 Or $num = "" then Return
    FileDelete($data_Location & "COA_" & $num &".dat")
    For $x = 1 to 8
        if $x = 3 then ContinueLoop
        GUICtrlSetData( $COAInput[$x], "" )
    Next
    GUICtrlSetData( $Input[5], "None" )
    GUISetState( @SW_HIDE, $COA )
    Close_List()
    UpDate_Customer()
EndFunc
   
Func Close_COA()
    GUISetState( @SW_HIDE, $COA )
EndFunc

Func Set_QT()
    SoundPlay($Sound_grp)
    $iMsgBoxAnswer = MsgBox(32, "* Ez-Track * ,  by   QTasc", "WHO IS,  QT APPRAISAL SERVICE CO ?" & @CRLF & "" & @CRLF & "We are a Real Estate Appraisal Company based in Riverside, California.      " & @CRLF & "" & @CRLF & _
    "I hope this program has been helpful." & @CRLF & "" & @CRLF & "Thank You... Valuater" & @CRLF & "" & @CRLF & "", 60)
    Select
        Case $iMsgBoxAnswer = -1 ;Timeout
    EndSelect
    SoundPlay($Sound_grp)
EndFunc   ;==>Set_QT

... Tested and Updated May 2008 Autoit Ver 3.2.12.0

Valuater

8)

Edited by Valuater

NEWHeader1.png

Posted (edited)

Wow this is very very very nice (trust me, it deserves all 3 very's). Really cool stuff, mind posting the .au3 script? It's up to you, though. I'd love to look over your script :P

Great Work.

Kurt

*Edit* Posted too soon :D Thanks

Edited by _Kurt

Awaiting Diablo III..

Posted

Wow this is very very very nice (trust me, it deserves all 3 very's). Really cool stuff, mind posting the .au3 script? It's up to you, though. I'd love to look over your script :P

Great Work.

Kurt

as requested by PM's and other post..

I added it to the original post above

... and Thanks!

8)

NEWHeader1.png

Posted

as requested by PM's and other post..

I added it to the original post above

... and Thanks!

8)

Awsome script. Hopefully i will be able to get my head round it and learn from it

Cheers

Lee

Posted

Nice Valuater

Here is some idea to make background gradient without JPEG image:

#include <GUIConstants.au3>
#include <Color.au3>

$color1 = 0x000066
$color2 = 0x0000FF

$gui = GUICreate("Gradient Demo")
$size = WinGetClientSize($gui)
GUICtrlCreateLabel("test label", 100,100)
GUICtrlSetColor(-1, 0x00ff00)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateButton("test button",100,150)
_GUICtrlCreateGradient($color1, $color2, 0, 0, $size[0], $size[1])
GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then Exit
Wend

Func _GUICtrlCreateGradient($nStartColor, $nEndColor, $nX, $nY, $nWidth, $nHeight)
    Local $color1R = _ColorGetRed($nStartColor)
    Local $color1G = _ColorGetGreen($nStartColor)
    Local $color1B = _ColorGetBlue($nStartColor)

    Local $nStepR = (_ColorGetRed($nEndColor) - $color1R) / $nHeight
    Local $nStepG = (_ColorGetGreen($nEndColor) - $color1G) / $nHeight
    Local $nStepB = (_ColorGetBlue($nEndColor) - $color1B) / $nHeight

    GuiCtrlCreateGraphic($nX, $nY, $nWidth, $nHeight)
    For $i = 0 To $nHeight - $nY
        $sColor = "0x" & StringFormat("%02X%02X%02X", $color1R+$nStepR*$i, $color1G+$nStepG*$i, $color1B+$nStepB*$i)
        GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $sColor, 0xffffff)
        GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
        GUICtrlSetGraphic(-1, $GUI_GR_LINE, $nWidth, $i)
    Next
EndFunc
Posted

Nice Valuater

Here is some idea to make background gradient without JPEG image:

(Snipped)

Wow, that's really cool! I never knew you could do that without a picture of some sort

Awaiting Diablo III..

  • 7 months later...
Posted

Title says it all

Ez-Track

Posted Image

Enjoy!!!

Code as requested

#include <GuiConstants.au3>
#Include <File.au3>
#Include <GuiListView.au3>

Dim $PEver = "1.0.5"
Dim $data_Location = @ScriptDir & "\Data\"
Dim $File_Location = @ScriptDir & "\Data\Address.ini"
Dim $num = 0, $Input[10], $data_[10], $COAInput[10]

DirGetSize($data_Location)
If @error= 1 Then
    DirCreate($data_Location)
EndIf

$Sound_lnk = @TempDir & "\Sound_lnk.wav"
FileInstall("C:\XPClean-web\Settings\XPClean-pics\Sounds\Notify.wav", $Sound_lnk)
$Logo_jpg = @TempDir & "\Ez-Track.jpg"
FileInstall("C:\Temp\Ez-Track.jpg", $Logo_jpg)
$Logo_back = @TempDir & "\Ez-Back.jpg"
FileInstall("C:\Temp\Ez-back.jpg", $Logo_back)
$Logo_icon = @TempDir & "\Ez-Track.ico"
FileInstall("C:\Temp\Ez-Track.ico", $Logo_icon)
$Sound_clk = @TempDir & "\Sound_clk.wav"
FileInstall("C:\XPClean-web\Settings\XPClean-pics\Sounds\Clickerx.wav", $Sound_clk)
$Sound_grp = @TempDir & "\Sound_grp.wav"
FileInstall("C:\XPClean-web\Settings\XPClean-pics\Sounds\Group_open.wav", $Sound_grp)

SplashImageOn("", $Logo_jpg, 335, 240, -1, -1, 1)
SoundPlay ($Sound_lnk,1)
Sleep(2000)
SplashOff()

If Not FileExists($File_Location) Then 
    Set_Ini()
    MsgBox(262208, "Welcome...", "Please Select *View All Customers* to begin...   ", 5)
EndIf

$main = GUICreate(" * Ez-Track *      v" & $PEver, 612, 412)
GUISetIcon($Logo_icon)
GUICtrlCreatePic($Logo_back, 1, 1, 610, 415, $SS_SUNKEN)
GUICtrlSetState(-1, $GUI_DISABLE)
$Group_1 = GUICtrlCreateGroup("Customer Panel", 10, 10, 250, 390) 
GUICtrlSetBkColor(-1, 0xCBD7ED)
$Group_2 = GUICtrlCreateGroup("Customer Information", 280, 10, 320, 390)
GUICtrlSetBkColor(-1, 0xCBD7ED)
$Group_3 = GUICtrlCreateGroup("Search", 20, 30, 230, 130)
GUICtrlSetBkColor(-1, 0xCBD7ED)
$Group_4 = GUICtrlCreateGroup("Controls", 20, 165, 230, 235)
GUICtrlSetBkColor(-1, 0xE1E9F6)
$Combo_3 = GUICtrlCreateCombo("Search by...", 80, 50, 100, 21)
$Input11 = GUICtrlCreateInput("Search Criteria", 45, 85, 180, 20)
$Label_10 = GUICtrlCreateLabel("Customer #: " & $num, 450, 28, 120, 22, BitOR($SS_SUNKEN, $SS_CENTER), $WS_EX_TRANSPARENT )
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1, 9.5, 550)
$Label_12 = GUICtrlCreateLabel("Name", 300, 40, 70, 20, $WS_EX_TRANSPARENT )
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Input[1] = GUICtrlCreateInput("", 300, 60, 280, 20)
$Label_14 = GUICtrlCreateLabel("Address", 300, 90, 90, 20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Label_15 = GUICtrlCreateLabel("Street Name", 380, 90, 140, 20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Input[2] = GUICtrlCreateInput("", 300, 110, 70, 20)
$Input[3] = GUICtrlCreateInput("", 380, 110, 200, 20)
$Label_18 = GUICtrlCreateLabel("City", 300, 140, 50, 20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Label_19 = GUICtrlCreateLabel("Change Of Address", 440, 140, 120, 20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Input[4] = GUICtrlCreateInput("", 300, 160, 110, 20)
$Input[5] = GUICtrlCreateInput("", 430, 160, 130, 20)
$Label_22 = GUICtrlCreateLabel("State", 300, 190, 70, 20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Label_23 = GUICtrlCreateLabel("Zip + 4", 390, 190, 110, 20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Input[6] = GUICtrlCreateInput("", 300, 210, 80, 20)
$Input[7] = GUICtrlCreateInput("", 390, 210, 190, 20)
$Edit_26 = GUICtrlCreateLabel("Notes", 300, 240, 80, 20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Edit_26 = GUICtrlCreateInput("", 300, 260, 280, 20)

; controls
$Button_5 = GUICtrlCreateButton("", 530, 310, 50, 50, $BS_ICON)
GUICtrlSetImage(-1, $Logo_icon )
GUICtrlSetTip( -1, "About QTasc")
$Button_6 = GUICtrlCreateButton("Close Ez-Track", 320, 365, 180, 25)
$Button_7 = GUICtrlCreateButton("Clear Form", 320, 330, 180, 25)
$Button_8 = GUICtrlCreateButton("View COA" , 320, 295, 180, 25)
$Button_9 = GUICtrlCreateButton("Start Search", 45, 120, 180, 25)
$Button_10 = GUICtrlCreateButton("Add Customer", 45, 260, 180, 25)
$Button_11 = GUICtrlCreateButton("Update Customer", 45, 225, 180, 25)
$Button_12 = GUICtrlCreateButton("View All Customers", 45, 190, 180, 25)
$Button_13 = GUICtrlCreateButton("Remove Customer", 45, 295, 180, 25)
$Button_14 = GUICtrlCreateButton("COA  On-Line", 45, 330, 180, 25)
$Button_15 = GUICtrlCreateButton("View/Print in Excel", 45, 365, 180, 25)
GUISetState()

GUICtrlSetData($Combo_3, "Customer #|Name|COA|Address|Street|City|Zip+4|Notes")

$viewer = GUICreate("  * Ez-Track *   ", 700, 500, 5, 5,$WS_BORDER, -1, $main)
GUISetIcon($Logo_icon)
GUISetBkColor (0xE1E9F6) 
$Listview = GUICtrlCreateListView("#|Name|COA|Address|Street|City|State|Zip+4|Notes", 10, 10, 680, 400, -1, BitOR($LVS_EX_REGIONAL, $LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES))
$Closer = GUICtrlCreateButton("Close", 460, 425, 180, 30)
$Btn_view = GUICtrlCreateButton("View / Edit", 260, 425, 180, 30)
$Btn_COA = GUICtrlCreateButton("View COA", 60, 425, 180, 30)
GUISetState(@SW_HIDE)

$COA = GuiCreate("  * Ez-Track *   ", 392, 340, 205, 150,$WS_BORDER, -1, $main) 
GUISetIcon($Logo_icon)
GUISetBkColor (0xE1E9F6)
GUICtrlCreateGroup("COA Dates", 15, 5, 365, 95)
GUICtrlCreateGroup("New Address", 15, 110, 365, 190)
$COALabel_1 = GuiCtrlCreateLabel("Customer #: ", 240, 25, 120, 22, $SS_SUNKEN + $SS_CENTER)
GUICtrlSetFont(-1, 9.5, 550)
$COAInput[1] = GuiCtrlCreateDate("", 100, 25, 100, 20)
$COAInput[2] = GuiCtrlCreateDate("", 100, 60, 100, 20)
$COAInput[3] = GUICtrlCreateCombo("", 240, 60, 120, 20)
GUICtrlSetData( -1, "Individual|Family|Business", "Individual")
$COALabel_4 = GuiCtrlCreateLabel("Address", 30, 135, 70, 20)
$COALabel_5 = GuiCtrlCreateLabel("Street Name", 150, 135, 110, 20)
$COAInput[4] = GuiCtrlCreateInput("", 30, 155, 70, 20)
$COAInput[5] = GuiCtrlCreateInput("", 150, 155, 220, 20)
$COALabel_8 = GuiCtrlCreateLabel("City", 30, 190, 80, 20)
$COALabel_9 = GuiCtrlCreateLabel("State", 140, 190, 80, 20)
$COALabel_10 = GuiCtrlCreateLabel("Zip + 4", 240, 190, 70, 20)
$COAInput[6] = GuiCtrlCreateInput("", 30, 210, 90, 20)
$COAInput[7] = GuiCtrlCreateInput("", 140, 210, 80, 20)
$COAInput[8] = GuiCtrlCreateInput("", 240, 210, 130, 20)
$COALabel_15 = GuiCtrlCreateLabel("Start Date", 30, 28, 50, 20)
$COALabel_17 = GuiCtrlCreateLabel("End Date", 30, 62, 70, 20)
; Buttons
$COAButton_14 = GuiCtrlCreateButton("Save", 30, 255, 100, 30)
$COAButton_15 = GuiCtrlCreateButton("Delete", 150, 255, 100, 30)
$COAButton_16 = GuiCtrlCreateButton("Close", 270, 255, 100, 30)

; Date set up
Global Const $DTM_SETFORMAT = 0x1005 ; Changed this to a global const SmOke_N
$COAstyle = "MM/dd/yyyy"
GuiCtrlSendMsg($COAInput[1], $DTM_SETFORMAT, 0, $COAstyle)
GuiCtrlSendMsg($COAInput[2], $DTM_SETFORMAT, 0, $COAstyle)

GuiSetState(@SW_HIDE)
Dim $B_DESCENDING ; [_GUICtrlListViewGetSubItemsCount ($listview) ]

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $Button_6
            ExitLoop
        Case $msg = $Button_15
            SoundPlay($Sound_clk)
            Open_Office()
        Case $msg = $Button_5
            Set_QT()
        Case $msg = $Button_7
            SoundPlay($Sound_clk)
            Clear_Customers()
        Case $msg = $Button_9
            SoundPlay($Sound_clk)
            Set_Customers()
        Case $msg = $Button_10
            SoundPlay($Sound_clk)
            Add_Customer()
        Case $msg = $Button_11
            SoundPlay($Sound_clk)
            Update_Customer()
        Case $msg = $Button_12
            SoundPlay($Sound_clk)
            GUISetState(@SW_SHOW, $viewer)
            Get_List()
        Case $msg = $Button_13
            SoundPlay($Sound_clk)
            Remove_Customer()
        Case $msg = $Button_14
            SoundPlay($Sound_clk)
            CO_Address()
        Case $msg = $Input11
            GUICtrlSetState($Button_9, $GUI_FOCUS )
            ; List View controls
        Case $msg = $Closer
            SoundPlay($Sound_clk)
            Close_List()
        Case $msg = $Btn_view
            SoundPlay($Sound_clk)
            Local $s_indices =  _GUICtrlListViewGetSelectedIndices($listview)
            Get_CNumber($s_indices + 1)
            GUISetState(@SW_HIDE, $viewer)
            _GUICtrlListViewDeleteAllItems($listview)
            Close_COA()
            GUISetState(@SW_SHOW, $main)
            GUISetState(@SW_RESTORE, $main)
        Case $msg = $Btn_COA
            SoundPlay($Sound_clk)
            Local $s_indices =  _GUICtrlListViewGetSelectedIndices($listview)
            Get_CNumber($s_indices + 1)
            Show_COA()
        Case $msg = $listview
            SoundPlay($Sound_clk)
            GUICtrlSetState( $Btn_view, $GUI_DISABLE)
            GUICtrlSetState( $Btn_COA, $GUI_DISABLE)
            _GUICtrlListViewSort($listview, $B_DESCENDING, GUICtrlGetState($listview))
        ; COA Controls
    Case $msg = $Button_8
            SoundPlay($Sound_clk)
            Show_COA()
        Case $msg = $COAButton_14
            SoundPlay($Sound_clk)
            Save_COA()
        Case $msg = $COAButton_15
            SoundPlay($Sound_clk)
            Delete_COA()
        Case $msg = $COAButton_16
            SoundPlay($Sound_clk)
            Close_COA()
            GUISetState(@SW_SHOW, $main)
            GUISetState(@SW_RESTORE, $main)
    EndSelect
WEnd
SoundPlay ($Sound_lnk,1)
Exit

; --------------------------- Functions -----------------

Func Set_Ini()
    FileWriteLine($File_Location, "[Address]")
    FileWriteLine($File_Location, "1=David Jones,12345,This way,East Covina,None,CA,95505-4321,BIG DOG!!!")
    FileWriteLine($File_Location, "2=Danny Smith,678,That way,North Covina,None,CA,95505-4321,Rear House")
    FileWriteLine($File_Location, "3=Debra Jones,910,Which way,West Covina,None,CA,95505-4321,Cookies and Milk")
EndFunc   ;==>Set_Ini

Func Set_Customers()
    $num = 0
    $temp_info = GUICtrlRead($Combo_3)
    If $temp_info = "Name" Then 
        $temp_search = 1
    ElseIf $temp_info = "Address" Then 
        $temp_search = 2
    ElseIf $temp_info = "Street" Then 
        $temp_search = 3
    ElseIf $temp_info = "City" Then 
        $temp_search = 4
    ElseIf $temp_info = "COA" Then 
        $temp_search = 5
    ElseIf $temp_info = "Zip+4" Then 
        $temp_search = 7
    ElseIf $temp_info = "Notes" Then 
        $temp_search = 8
    ElseIf $temp_info = "Customer #" Then
        $num = GUICtrlRead($Input11)
        Get_CNumber($num)
        Return
    Else
        MsgBox(262208, "Sorry...", "Please Select a Search by...   ", 1)
        Return
    EndIf
    $temp_find = GUICtrlRead($Input11)
    $length = _FileCountLines($File_Location)
    For $x = 1 To $length - 1
        $temp_file = IniRead($File_Location, "Address", $x, "Not Found")
        If $temp_file = "Not Found" Then
            MsgBox(262208, "Sorry...", "No Files\Folders Found....   ", 1)
            Return
        EndIf
        $temp_split = StringSplit($temp_file, ",")
        If StringInStr($temp_split[$temp_search], $temp_find) Then
            For $t = 1 To $temp_split[0] -1
                GUICtrlSetData($Input[$t], $temp_split[$t])
                $num = $x
            Next
            GUICtrlSetData($Edit_26, $temp_split[8])
            GUICtrlSetData($Label_10, "Customer #: " & $num)
            Return
        EndIf
    Next
EndFunc   ;==>Set_Customers

Func Get_CNumber($x)
    $temp_file = IniRead($File_Location, "Address", $x, "Not Found")
    If $temp_file = "Not Found" Then
        MsgBox(262208, "Sorry...", "No Customer Found/Selected...   ", 1)
        Return
    EndIf
    $temp_split = StringSplit($temp_file, ",")
    For $t = 1 To $temp_split[0] - 1
        GUICtrlSetData($Input[$t], $temp_split[$t])
        $num = $x
    Next
    GUICtrlSetData($Edit_26, $temp_split[8])
    GUICtrlSetData($Label_10, "Customer #: " & $num)
    Return
EndFunc   ;==>Get_CNumber

Func Get_List()
    $length = _FileCountLines($File_Location)
    For $x = 1 To $length - 1
        $temp_file = IniRead($File_Location, "Address", $x, "Not Found")
        If $temp_file = "Not Found" Then Return
        $temp_split = StringSplit($temp_file, ",")
        GUICtrlCreateListViewItem( $x & "|" & $temp_split[1] & "|" & $temp_split[5] & "|" & $temp_split[2] & "|" & $temp_split[3] & "|" & $temp_split[4] & "|" & $temp_split[6] & "|" & $temp_split[7] & "|" & $temp_split[8] ,$listview)
    Next
EndFunc

Func Close_List()
    GUICtrlSetState( $Btn_view, $GUI_ENABLE)
    GUICtrlSetState( $Btn_COA, $GUI_ENABLE)
    _GUICtrlListViewDeleteAllItems($listview)
    GUISetState(@SW_HIDE, $viewer)
    GUISetState(@SW_SHOW, $main)
    GUISetState(@SW_RESTORE, $main)
EndFunc

Func Clear_Customers()
    If GUICtrlRead($Input[1]) = "" then Return
    for $x = 1 to 7
        GUICtrlSetData($Input[$x], "")
    Next
    GUICtrlSetData($Edit_26, "")
    Clear_List()
    GUICtrlSetData($Label_10, "Customer #: 0")
    GUISetState( @SW_HIDE, $COA )
    Close_List()
EndFunc

Func Add_Customer()
    If GUICtrlRead($Input[1]) = "" then 
        MsgBox(262208, "Sorry...", "No Customer Found/Selected...   ", 1)
        Return
    EndIf
    $length = _FileCountLines($File_Location)
    IniWrite($File_Location, "Address", $length, GUICtrlRead($Input[1]) &","& GUICtrlRead($Input[2])&","& GUICtrlRead($Input[3])&","& GUICtrlRead($Input[4])&","& GUICtrlRead($Input[5])&","& GUICtrlRead($Input[6])&","&GUICtrlRead($Input[7])&","& GUICtrlRead($Edit_26))
    GUICtrlSetData($Label_10, "Customer #: " & $length)
    Clear_List()
    MsgBox(262208, "Great...", "Customer Added...   ", 1)
EndFunc

Func UpDate_Customer()
    If GUICtrlRead($Input[1]) = "" then 
        MsgBox(262208, "Sorry...", "No Customer Found/Selected...   ", 1)
        Return
    EndIf
    $num = StringTrimLeft(GUICtrlRead($Label_10), 12)
    IniWrite($File_Location, "Address", $num, GUICtrlRead($Input[1]) &","& GUICtrlRead($Input[2])&","& GUICtrlRead($Input[3])&","& GUICtrlRead($Input[4])&","& GUICtrlRead($Input[5])&","& GUICtrlRead($Input[6])&","&GUICtrlRead($Input[7])&","& GUICtrlRead($Edit_26))
    Clear_List()
    MsgBox(262208, "Great...", "Customer Updated...   ", 1)
EndFunc

Func Remove_Customer()
    If GUICtrlRead($Input[1]) = "" then 
        MsgBox(262208, "Sorry...", "No Customer Found/Selected...   ", 1)
        Return
    EndIf
    $num = StringTrimLeft(GUICtrlRead($Label_10), 12)
    IniWrite($File_Location, "Address", $num, ",,,,,,,")
    FileDelete($data_Location & "COA_" & $num &".dat")
    for $x = 1 to 7
        GUICtrlSetData($Input[$x], "")
    Next
    GUICtrlSetData($Edit_26, "")
    Clear_List()
    GUICtrlSetData($Label_10, "Customer #: 0")
    MsgBox(262208, "Great...", "Customer Removed...   ", 1)
EndFunc

Func Clear_List()
    FileDelete($data_Location & "Address.bak")
    FileDelete(@TempDir & "\new.ini")
    FileCopy($File_Location, $data_Location & "Address.bak", 1)
    FileWriteLine(@TempDir & "\new.ini", "[Address]")
    $t = 0
    $length = _FileCountLines($File_Location)
    For $x = 1 To $length - 1
        $temp_file = IniRead($File_Location, "Address", $x, "Not Found")
        If $temp_file = "Not Found" Then Return
        $temp_split = StringSplit($temp_file, ",")
        If $temp_split[1] = "" Then ContinueLoop
        $t = $t + 1
        IniWrite(@TempDir & "\new.ini", "Address", $t, $temp_split[1] & "," & $temp_split[2] & "," & $temp_split[3] & "," & $temp_split[4] & "," & $temp_split[5] & "," & $temp_split[6] & "," & $temp_split[7] & "," & $temp_split[8])
    Next
    FileCopy(@TempDir & "\new.ini", $File_Location, 1)
EndFunc

Func CO_Address()
    $web_loc = "https://moversguide.usps.com/mgservice/Home"
    Run(@ComSpec & " /c Start " & $web_loc, "", @SW_HIDE)
EndFunc

Func Open_Office()
    FileDelete($data_Location & "Address.bak")
    FileDelete($data_Location & "Office.csv")
    FileCopy($File_Location, $data_Location & "Address.bak", 1)
    $length = _FileCountLines($data_Location & "Address.bak")
    $Rfile = FileOpen($data_Location & "Address.bak", 0)
    $Wfile = FileOpen($data_Location & "Office.csv", 2)
    For $x = 2 To $length ; - 1
        $line = FileReadLine($Rfile, $x)
        If @error = -1 Then ExitLoop
        $line_pos = StringInStr($line, "=")
        FileWriteLine($Wfile, StringTrimLeft($line, $line_pos))
    Next
    FileClose($Rfile)
    FileClose($Wfile)
    $Off_loc = FileGetShortName($data_Location & "Office.csv")
    Run(@ComSpec & " /c Start " & $Off_loc, "", @SW_HIDE)
EndFunc

Func Show_COA()
    If GUICtrlRead($Input[1]) = "" then 
        MsgBox(262208, "Sorry...", "No Customer Found/Selected...   ", 1)
        Return
    EndIf
    $num = StringTrimLeft(GUICtrlRead($Label_10), 12)
    If $num = 0 Or $num = "" then Return
    GUICtrlSetData($COALabel_1, "Customer #: " & $num)
    GUISetState( @SW_SHOW, $COA )
    For $x = 1 to 8
        if $x = 3 then ContinueLoop
        GUICtrlSetData( $COAInput[$x], "" )
    Next
    If FileExists($data_Location & "COA_" & $num & ".dat") Then 
        $temp_split = StringSplit(FileReadLine($data_Location & "COA_" & $num & ".dat", 1), ",")
        For $x = 1 to 8
            If $x == 1 Or $x == 2 Then
                GUICtrlSendMsg($COAInput[$x], $DTM_SETFORMAT, 0, $temp_split[$x])
            Else
                GUICtrlSetData( $COAInput[$x], $temp_split[$x])     
            EndIf
        Next
    EndIf
EndFunc

Func Save_COA()
    If GUICtrlRead($COAInput[4]) = "" then 
        MsgBox(262208, "Sorry...", "No Address Found/Selected...   ", 1)
        Return
    EndIf
    $num = StringTrimLeft(GUICtrlRead($Label_10), 12)
    If $num = 0 Or $num = "" then Return
    $temp_info = ""
    For $x = 1 to 7
        $temp_info = $temp_info & GUICtrlRead($COAInput[$x]) & ","
    Next
    $temp_info = $temp_info & GUICtrlRead($COAInput[$x])
    FileDelete($data_Location & "COA_" & $num &".dat")
    FileWriteLine($data_Location & "COA_" & $num &".dat", $temp_info)
    GUICtrlSetData( $Input[5], GUICtrlRead($COAInput[2]))
    GUISetState( @SW_HIDE, $COA )
    Close_List()
    UpDate_Customer()
EndFunc    

Func Delete_COA()
    If GUICtrlRead($COAInput[4]) = "" then 
        MsgBox(262208, "Sorry...", "No Address Found/Selected...   ", 1)
        Return
    EndIf
    $num = StringTrimLeft(GUICtrlRead($Label_10), 12)
    If $num = 0 Or $num = "" then Return
    FileDelete($data_Location & "COA_" & $num &".dat")
    For $x = 1 to 8
        if $x = 3 then ContinueLoop
        GUICtrlSetData( $COAInput[$x], "" )
    Next
    GUICtrlSetData( $Input[5], "None" )
    GUISetState( @SW_HIDE, $COA )
    Close_List()
    UpDate_Customer()
EndFunc
    
Func Close_COA()
    GUISetState( @SW_HIDE, $COA )
EndFunc

Func Set_QT()
    SoundPlay($Sound_grp)
    $iMsgBoxAnswer = MsgBox(32, "* Ez-Track * ,  by   QTasc", "WHO IS,  QT APPRAISAL SERVICE CO ?" & @CRLF & "" & @CRLF & "We are a Real Estate Appraisal Company based in Riverside, California.      " & @CRLF & "" & @CRLF & _
    "I hope this program has been helpful." & @CRLF & "" & @CRLF & "Thank You... Valuater" & @CRLF & "" & @CRLF & "", 60)
    Select
        Case $iMsgBoxAnswer = -1 ;Timeout
    EndSelect
    SoundPlay($Sound_grp)
EndFunc   ;==>Set_QT

Valuater

8)

Hey I know this is a old topic but i have a question about the search function.

You have 2 people with the name "jones" in the ini file.

If you search at "jones" then you see only 1 name.

Is it not better that he display all the results with the name "jones" ?

Sapiente vince, rex, noli vincere ferro!

  • 5 months later...
Posted

thanks for the script Valuater. this is great. i get a chance to learn a lot from this. Did not realize autoit could do this.

Welcome, Autoit can accomplish almost anything!!!

8)

NEWHeader1.png

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...