#include #include #include #include #include #include #include #include #include #include Global $VERSION = "v0.2" _TOP() Func _TOP() ;====================================================================================================================================================================== $INLOGGUI = GUICreate("Inloggen", 255, 141, -1, -1) GUICtrlCreateLabel("Gebruiker", 8, 0, 50, 17) $Combo1 = GUICtrlCreateCombo("", 8, 24, 233, 25, BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL)) GUICtrlCreateLabel("Wachtwoord:", 8, 52, 77, 17, 0) $PasswordEdit = GUICtrlCreateInput("", 8, 72, 233, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD)) $ButtonOk = GUICtrlCreateButton("&OK", 86, 104, 75, 25, $BS_NOTIFY) $ButtonCancel = GUICtrlCreateButton("&Cancel", 167, 104, 75, 25, $BS_NOTIFY) GUISetState(@SW_SHOW) ; Get the sections of the ini file Global $aSections = IniReadSectionNames(@ScriptDir & "\DB\medewerker.ini") ; If the IniReadSectionNames succeeded, conver the array to a string with each item separated by a | (pipe) and set the default selected item to $aSections[1] If (Not @Error) Then GUICtrlSetData($Combo1, _ArraytoString($aSections, "|", 1), $aSections[1]) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ButtonOk Global $NAAMMEDEWERKER = GUICtrlRead($Combo1) $PASSINPUT = GUICtrlRead($PasswordEdit) $PASSINI = IniRead(@ScriptDir & "\DB\medewerker.ini", $NAAMMEDEWERKER, "Pass", "") If GUICtrlRead($Combo1) = "B&F Groep" Then MsgBox(4096, "Let op!", "Kies een medewerker") GUIDelete($INLOGGUI) _TOP() ExitLoop EndIf If $PASSINPUT = $PASSINI Then GUIDelete($INLOGGUI) MAINMENU() Else MsgBox(4096, "Let op!", "Het wachtwoord is onjuist.") EndIf Case $ButtonCancel Exit EndSwitch WEnd EndFunc ;====================================================================================================================================================================== Func MAINMENU() $MAINMENU = GUICreate($VERSION & " - RMA-Module", 274, 399, -1, -1) $AANVRAAG = GUICtrlCreateButton("RMA Aanvragen", 71, 32, 131, 41) $ZOEKEN = GUICtrlCreateButton("Zoeken", 71, 72, 131, 41) $OVERZICHT = GUICtrlCreateButton("Overzicht", 71, 112, 131, 41) GUICtrlCreateLabel("Ingelogd als: " & $NAAMMEDEWERKER, 8, 376) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Select Case $nMsg = $GUI_EVENT_CLOSE $YesOrNo = msgBox(4,"Sluiten","Weet u zeker dat u wilt stoppen?") If $YesOrNo = 6 then Exit EndIf Case $nMsg = $AANVRAAG GUIDelete($MAINMENU) NEWRMA() ExitLoop Case $nMsg = $ZOEKEN GUIDelete($MAINMENU) ZOEKENRMA() ExitLoop Case $nMsg = $OVERZICHT GUIDelete($MAINMENU) OVERZICHT() ExitLoop EndSelect WEnd EndFunc ;====================================================================================================================================================================== Func NEWRMA() $NEWRMA = GUICreate($VERSION & " - Nieuwe RMA aanvraag", 1235, 772, -1, -1) GUICtrlCreateLabel("Ingelogd als: " & $NAAMMEDEWERKER, 8, 0) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateGroup("Algemeen", 8, 16, 305, 249) GUICtrlCreateLabel("RMAnr.", 32, 32, 40, 17) $RMANRINPUT = GUICtrlCreateInput("", 32, 56, 121, 21) GUICtrlSetState(-1, $GUI_DISABLE) $aArray = IniReadSection(@ScriptDir & "\DB\rma.ini", "RMANR") $count = UBound($aArray,1) $var = $count + 1 GUICtrlSetData($RMANRINPUT, "BNF" & $var) GUICtrlCreateLabel("RMAnr. Leverancier", 168, 32, 99, 17) $RMANREXTERN = GUICtrlCreateInput("", 168, 56, 121, 21) GUICtrlCreateLabel("Debiteurnummer", 32, 88, 81, 17) $DEBITNRINPUT = GUICtrlCreateInput("", 32, 112, 121, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER)) GUICtrlCreateLabel("Aangevraagd door", 168, 88) $AANGEMELDDOOR = GUICtrlCreateInput("", 168, 112, 121, 21) GUICtrlSetState($AANGEMELDDOOR, $GUI_DISABLE) GUICtrlSetData($AANGEMELDDOOR, $NAAMMEDEWERKER) GUICtrlCreateLabel("Naam Debiteur", 32, 144, 75, 17) $NAAMKLANT = GUICtrlCreateInput("", 32, 168, 257, 21) GUICtrlCreateLabel("Status", 32, 200, 37, 17) $STATUS = GUICtrlCreateCombo("", 32, 224, 257, 25,BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL)) GUICtrlSetData($STATUS, "Aangevraagd|Verzonden|Afgehandeld", "Aangevraagd") GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("Hardware informatie", 328, 16, 265, 249) GUICtrlCreateLabel("Apparaat / Model", 352, 32, 90, 17) $MODEL = GUICtrlCreateInput("", 352, 56, 217, 21) GUICtrlCreateLabel("Serienummer", 352, 88, 68, 17) $SERIENRINPUT = GUICtrlCreateInput("", 352, 112, 217, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("Verzend informatie", 608, 16, 180, 249) GUICtrlCreateLabel("Aanmeld datum", 628, 32, 77, 17) $AANMELDDATUM = GUICtrlCreateInput("", 628, 56, 140, 21) GUICtrlSetData($AANMELDDATUM, @MDAY & "-" & @MON & "-" & @YEAR) GUICtrlCreateLabel("Datum verzonden", 628, 88, 88, 17) $VERZONDENDATUM = GUICtrlCreateInput("",628, 112, 140, 21) GUICtrlCreateLabel("Datum retour", 628, 144, 65, 17) $RETOURDATUM = GUICtrlCreateInput("", 628, 168, 140, 21) GUICtrlCreateLabel("Track en Trace", 628, 200) $TRACKENTRACE = GUICtrlCreateInput("", 628, 224, 140, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("", 8, 272, 1217, 489) GUICtrlCreateLabel("Klacht omschrijving", 32, 296, 98, 17) $KLACHT = GUICtrlCreateEdit("", 32, 320, 1169, 225) GUICtrlSetData(-1, "") GUICtrlCreateLabel("Oplossing", 32, 568, 53, 17) $OPLOSSING = GUICtrlCreateEdit("", 32, 592, 1169, 153) GUICtrlSetData(-1, "") If GUICtrlRead($STATUS) = "Afgehandeld" Then GUICtrlSetState($OPLOSSING, $GUI_ENABLE) Else GUICtrlSetState($OPLOSSING, $GUI_DISABLE) EndIf GUICtrlCreateGroup("", -99, -99, 1, 1) $NEW = GUICtrlCreateButton("Nieuw", 1104, 8, 123, 33) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $SAVE = GUICtrlCreateButton("Opslaan", 1104, 48, 123, 33) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $EXIT = GUICtrlCreateButton("Hoofdmenu", 1104, 88, 123, 33) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $STATUS If GUICtrlRead($STATUS) = "Afgehandeld" Then GUICtrlSetState($OPLOSSING, $GUI_ENABLE) Else GUICtrlSetState($OPLOSSING, $GUI_DISABLE) EndIf Case $NEW $YesOrNo = msgBox(4,"Nieuwe RMA","Weet u zeker dat u een nieuwe RMA wilt maken?") If $YesOrNo = 6 then GUIDelete($NEWRMA) NEWRMA() ExitLoop EndIf Case $SAVE $GO = 1 $savermanr = GUICtrlRead($RMANRINPUT) $savermanrsup = GUICtrlRead($RMANREXTERN) $debitnrread = GUICtrlRead($DEBITNRINPUT) $NAAMKLANTRead = GUICtrlRead($NAAMKLANT) $AANMELDDATUMREAD = GUICtrlRead($AANMELDDATUM) $VERZONDENDATUMREAD = GUICtrlRead($VERZONDENDATUM) $MODELREAD = GUICtrlRead($MODEL) $SERIENRINPUTREAD = GUICtrlRead($SERIENRINPUT) $STATUSREAD = GUICtrlRead($STATUS) $KLACHTOMSCHRIJVING = GUICtrlRead($KLACHT) $OPLOSSINGREAD = GUICtrlRead($OPLOSSING) $RETOURDATUMREAD = GUICtrlRead($RETOURDATUM) $TRACKENTRACEREAD = GUICtrlRead($TRACKENTRACE) If $debitnrread = "" Then MsgBox(4096, "Let op!", "Debiteurnummer mag niet leeg zijn.") $GO = 0 EndIf If $NAAMKLANTRead = "" Then MsgBox(4096, "Let op!", "Klant naam mag niet leeg zijn.") $GO = 0 EndIf If $MODELREAD = "" Then MsgBox(4096, "Let op!", "Apparaat / Model mag niet leeg zijn.") $GO = 0 EndIf If $SERIENRINPUTREAD = "" Then MsgBox(4096, "Let op!", "Serienummer mag niet leeg zijn.") $GO = 0 EndIf If $GO = 1 Then $aArray = IniReadSection(@ScriptDir & "\DB\rma.ini", "RMANR") $count = UBound($aArray,1) $RMANR = $count + 1 IniWrite(@scriptdir & "\DB\rma.ini", "RMANR", $RMANR, $savermanr) IniWrite(@ScriptDir & "\DB\rma.ini", "RMANREXTERN", $RMANR, $savermanrsup) IniWrite(@ScriptDir & "\DB\rma.ini", "DEBITNR", $RMANR, $debitnrread) IniWrite(@ScriptDir & "\DB\rma.ini", "KLANT", $RMANR, $NAAMKLANTRead) IniWrite(@ScriptDir & "\DB\rma.ini", "AANGEMELDDOOR", $RMANR, $NAAMMEDEWERKER) IniWrite(@ScriptDir & "\DB\rma.ini", "AANMELDDATUM", $RMANR, $AANMELDDATUMREAD) IniWrite(@ScriptDir & "\DB\rma.ini", "VERZENDDATUM", $RMANR, $VERZONDENDATUMREAD) IniWrite(@ScriptDir & "\DB\rma.ini", "MODEL", $RMANR, $MODELREAD) IniWrite(@ScriptDir & "\DB\rma.ini", "SERIENR", $RMANR, $SERIENRINPUTREAD) IniWrite(@ScriptDir & "\DB\rma.ini", "STATUS", $RMANR, $STATUSREAD) IniWrite(@ScriptDir & "\DB\rma.ini", "KLACHT", $RMANR, $KLACHTOMSCHRIJVING) IniWrite(@ScriptDir & "\DB\rma.ini", "OPLOSSING", $RMANR, $OPLOSSINGREAD) IniWrite(@ScriptDir & "\DB\rma.ini", "RETOURDATUM", $RMANR, $RETOURDATUMREAD) IniWrite(@ScriptDir & "\DB\rma.ini", "TRACKENTRACE", $RMANR, $TRACKENTRACEREAD) MsgBox(4096, "Opgeslagen", "RMA opgeslagen.") GUIDelete($NEWRMA) NEWRMA() ExitLoop EndIf Case $EXIT $YesOrNo = msgBox(4,"","Terug naar het hoofdmenu?") If $YesOrNo = 6 then GUIDelete($NEWRMA) MAINMENU() ExitLoop EndIf EndSwitch WEnd EndFunc ;====================================================================================================================================================================== Func ZOEKENRMA() $ZOEKENGUI = GUICreate("", 171, 228, -1, -1, $WS_POPUPWINDOW) GUICtrlCreateLabel("RMAnr.", 24, 16, 40, 17) $RMANRZOEKINPUT = GUICtrlCreateInput("", 24, 40, 121, 21) GUICtrlCreateLabel("RMAnr. Leverancier", 24, 72, 99, 17) $RMANRZOEKINPUTLEV = GUICtrlCreateInput("", 24, 96, 121, 21) GUICtrlCreateLabel("Debiteurnr.", 24, 128, 56, 17) $DEBITNRZOEKINPUT = GUICtrlCreateInput("", 24, 152, 121, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER)) $ZOEKEN = GUICtrlCreateButton("Zoeken", 8, 192, 75, 25) $BACK = GUICtrlCreateButton("Terug", 88, 192, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $ZOEKEN $GO = 1 Global $FINDRMA = GUICtrlRead($RMANRZOEKINPUT) Global $FINDRMALEV = GUICtrlRead($RMANRZOEKINPUTLEV) Global $FINDRMADEBIT= GUICtrlRead($DEBITNRZOEKINPUT) If $FINDRMA <> "" And $FINDRMALEV <> "" And $FINDRMADEBIT <> "" Then MsgBox(4096, "Let op!", "Gebruik één zoekfunctie tegelijk.") EndIf If $FINDRMA <> "" And $FINDRMALEV <> "" Then MsgBox(4096, "Let op!", "Gebruik één zoekfunctie tegelijk.") $GO = 0 EndIf If $FINDRMA <> "" And $FINDRMADEBIT <> "" Then MsgBox(4096, "Let op!", "Gebruik één zoekfunctie tegelijk.") $GO = 0 EndIf If $FINDRMALEV <> "" And $FINDRMADEBIT <> "" Then MsgBox(4096, "Let op!", "Gebruik één zoekfunctie tegelijk.") $GO = 0 EndIf If $GO = 1 Then If $FINDRMA <> "" Then Local $aArray = IniReadSection(@ScriptDir & "\DB\rma.ini", "RMANR") $VAR = _ArraySearch($aArray, $FINDRMA) If $var = -1 Then MsgBox(4096, "Niet gevonden", "Het nummer is niet gevonden.") $GO = 0 EndIf If $VAR <> -1 Then $VAR2 = $VAR + 1 EndIf If $VAR = 1 Then $VAR2 = 1 EndIf If $GO = 1 Then Global $FOUNDRMANR = $VAR2 GUIDelete($ZOEKENGUI) EDITRMA() ExitLoop EndIf EndIf If $FINDRMALEV <> "" Then Local $aArray = IniReadSection(@ScriptDir & "\DB\rma.ini", "RMANREXTERN") $VAR = _ArraySearch($aArray, $FINDRMALEV) If $var = -1 Then MsgBox(4096, "Niet gevonden", "Het nummer is niet gevonden.") $GO = 0 EndIf If $VAR <> -1 Then $VAR2 = $VAR + 1 EndIf If $VAR = 1 Then $VAR2 = 1 EndIf If $GO = 1 Then Global $FOUNDRMANR = $VAR2 GUIDelete($ZOEKENGUI) EDITRMA() ExitLoop EndIf EndIf If $FINDRMADEBIT <> "" Then Local $aArray = IniReadSection(@ScriptDir & "\DB\rma.ini", "DEBITNR") $VAR = _ArraySearch($aArray, $FINDRMADEBIT) If $var = -1 Then MsgBox(4096, "Niet gevonden", "Het nummer is niet gevonden.") $GO = 0 EndIf If $VAR <> -1 Then $VAR2 = $VAR + 1 EndIf If $VAR = 1 Then $VAR2 = 1 EndIf If $GO = 1 Then Global $FOUNDRMANR = $VAR2 GUIDelete($ZOEKENGUI) EDITRMA() ExitLoop EndIf EndIf EndIf Case $BACK GUIDelete($ZOEKENGUI) MAINMENU() ExitLoop EndSwitch WEnd EndFunc ;====================================================================================================================================================================== Func EDITRMA() $EDITRMA = GUICreate($VERSION & " - RMA bewerken", 1235, 772, -1, -1) GUICtrlCreateLabel("Ingelogd als: " & $NAAMMEDEWERKER, 8, 0) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateGroup("Algemeen", 8, 16, 305, 249) GUICtrlCreateLabel("RMAnr.", 32, 32, 40, 17) $RMANRINPUT = GUICtrlCreateInput("", 32, 56, 121, 21) GUICtrlSetState(-1, $GUI_DISABLE) $VAR = IniRead(@ScriptDir & "\DB\rma.ini", "RMANR", $FOUNDRMANR, "Niet gevonden") GUICtrlSetData($RMANRINPUT, $VAR) GUICtrlCreateLabel("RMAnr. Leverancier", 168, 32, 99, 17) $RMANREXTERN = GUICtrlCreateInput("", 168, 56, 121, 21) $VAR = IniRead(@ScriptDir & "\DB\rma.ini", "RMANREXTERN", $FOUNDRMANR, "Niet gevonden") GUICtrlSetData($RMANREXTERN, $VAR) GUICtrlCreateLabel("Debiteurnummer", 32, 88, 81, 17) $DEBITNRINPUT = GUICtrlCreateInput("", 32, 112, 121, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER)) GUICtrlSetState($DEBITNRINPUT, $GUI_DISABLE) $VAR = IniRead(@ScriptDir & "\DB\rma.ini", "DEBITNR", $FOUNDRMANR, "Niet gevonden") GUICtrlSetData($DEBITNRINPUT, $VAR) GUICtrlCreateLabel("Aangevraagd door", 168, 88) $AANGEMELDDOOR = GUICtrlCreateInput("", 168, 112, 121, 21) GUICtrlSetState($AANGEMELDDOOR, $GUI_DISABLE) $VAR = IniRead(@ScriptDir & "\DB\rma.ini", "AANGEMELDDOOR", $FOUNDRMANR, "Niet gevonden") GUICtrlSetData($AANGEMELDDOOR, $VAR) GUICtrlCreateLabel("Naam Debiteur", 32, 144, 75, 17) $NAAMKLANT = GUICtrlCreateInput("", 32, 168, 257, 21) GUICtrlSetState($NAAMKLANT, $GUI_DISABLE) $VAR = IniRead(@ScriptDir & "\DB\rma.ini", "KLANT", $FOUNDRMANR, "Niet gevonden") GUICtrlSetData($NAAMKLANT, $VAR) GUICtrlCreateLabel("Status", 32, 200, 37, 17) $STATUS = GUICtrlCreateCombo("", 32, 224, 257, 25,BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL)) $VAR = IniRead(@ScriptDir & "\DB\rma.ini", "STATUS", $FOUNDRMANR, "Niet gevonden") GUICtrlSetData($STATUS, "Aangevraagd|Verzonden|Afgehandeld", $VAR) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("Hardware informatie", 328, 16, 265, 249) GUICtrlCreateLabel("Apparaat / Model", 352, 32, 90, 17) $MODEL = GUICtrlCreateInput("", 352, 56, 217, 21) $VAR = IniRead(@ScriptDir & "\DB\rma.ini", "MODEL", $FOUNDRMANR, "Niet gevonden") GUICtrlSetData($MODEL, $VAR) GUICtrlCreateLabel("Serienummer", 352, 88, 68, 17) $SERIENRINPUT = GUICtrlCreateInput("", 352, 112, 217, 21) $VAR = IniRead(@ScriptDir & "\DB\rma.ini", "SERIENR", $FOUNDRMANR, "Niet gevonden") GUICtrlSetData($SERIENRINPUT, $VAR) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("Verzend informatie", 608, 16, 180, 249) GUICtrlCreateLabel("Aanmeld datum", 628, 32, 77, 17) $AANMELDDATUM = GUICtrlCreateInput("", 628, 56, 140, 21) $VAR = IniRead(@ScriptDir & "\DB\rma.ini", "AANMELDDATUM", $FOUNDRMANR, "Niet gevonden") GUICtrlSetData($AANMELDDATUM, $VAR) GUICtrlCreateLabel("Datum verzonden", 628, 88, 88, 17) $VERZONDENDATUM = GUICtrlCreateInput("",628, 112, 140, 21) $VAR = IniRead(@ScriptDir & "\DB\rma.ini", "VERZENDDATUM", $FOUNDRMANR, "Niet gevonden") GUICtrlSetData($VERZONDENDATUM, $VAR) GUICtrlCreateLabel("Datum retour", 628, 144, 65, 17) $RETOURDATUM = GUICtrlCreateInput("", 628, 168, 140, 21) $VAR = IniRead(@ScriptDir & "\DB\rma.ini", "RETOURDATUM", $FOUNDRMANR, "Niet gevonden") GUICtrlSetData($RETOURDATUM, $VAR) GUICtrlCreateLabel("Track en Trace", 628, 200) $TRACKENTRACE = GUICtrlCreateInput("", 628, 224, 140, 21) $VAR = IniRead(@ScriptDir & "\DB\rma.ini", "TRACKENTRACE", $FOUNDRMANR, "Niet gevonden") GUICtrlSetData($TRACKENTRACE, $VAR) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("", 8, 272, 1217, 489) GUICtrlCreateLabel("Klacht omschrijving", 32, 296, 98, 17) $KLACHT = GUICtrlCreateEdit("", 32, 320, 1169, 225) $VAR = IniRead(@ScriptDir & "\DB\rma.ini", "KLACHT", $FOUNDRMANR, "Niet gevonden") GUICtrlSetData($KLACHT, $VAR) GUICtrlCreateLabel("Oplossing", 32, 568, 53, 17) $OPLOSSING = GUICtrlCreateEdit("", 32, 592, 1169, 153) $VAR = IniRead(@ScriptDir & "\DB\rma.ini", "OPLOSSING", $FOUNDRMANR, "Niet gevonden") GUICtrlSetData($OPLOSSING, $VAR) If GUICtrlRead($STATUS) = "Afgehandeld" Then GUICtrlSetState($OPLOSSING, $GUI_ENABLE) Else GUICtrlSetState($OPLOSSING, $GUI_DISABLE) EndIf GUICtrlCreateGroup("", -99, -99, 1, 1) $NEW = GUICtrlCreateButton("Nieuw", 1104, 8, 123, 33) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $SAVE = GUICtrlCreateButton("Opslaan", 1104, 48, 123, 33) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $EXIT = GUICtrlCreateButton("Hoofdmenu", 1104, 88, 123, 33) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $STATUS If GUICtrlRead($STATUS) = "Afgehandeld" Then GUICtrlSetState($OPLOSSING, $GUI_ENABLE) Else GUICtrlSetState($OPLOSSING, $GUI_DISABLE) EndIf Case $NEW $YesOrNo = msgBox(4,"Nieuwe RMA","Weet u zeker dat u een nieuwe RMA wilt maken?") If $YesOrNo = 6 then GUIDelete($EDITRMA) NEWRMA() ExitLoop EndIf Case $SAVE $GO = 1 $savermanr = GUICtrlRead($RMANRINPUT) $savermanrsup = GUICtrlRead($RMANREXTERN) $debitnrread = GUICtrlRead($DEBITNRINPUT) $NAAMKLANTRead = GUICtrlRead($NAAMKLANT) $AANMELDDATUMREAD = GUICtrlRead($AANMELDDATUM) $VERZONDENDATUMREAD = GUICtrlRead($VERZONDENDATUM) $MODELREAD = GUICtrlRead($MODEL) $SERIENRINPUTREAD = GUICtrlRead($SERIENRINPUT) $STATUSREAD = GUICtrlRead($STATUS) $KLACHTOMSCHRIJVING = GUICtrlRead($KLACHT) $OPLOSSINGREAD = GUICtrlRead($OPLOSSING) $RETOURDATUMREAD = GUICtrlRead($RETOURDATUM) $TRACKENTRACEREAD = GUICtrlRead($TRACKENTRACE) If $debitnrread = "" Then MsgBox(4096, "Let op!", "Debiteurnummer mag niet leeg zijn.") $GO = 0 EndIf If $NAAMKLANTRead = "" Then MsgBox(4096, "Let op!", "Klant naam mag niet leeg zijn.") $GO = 0 EndIf If $MODELREAD = "" Then MsgBox(4096, "Let op!", "Apparaat / Model mag niet leeg zijn.") $GO = 0 EndIf If $SERIENRINPUTREAD = "" Then MsgBox(4096, "Let op!", "Serienummer mag niet leeg zijn.") $GO = 0 EndIf If $GO = 1 Then $aArray = IniReadSection(@ScriptDir & "\DB\rma.ini", "RMANR") $RMANR = $FOUNDRMANR IniWrite(@scriptdir & "\DB\rma.ini", "RMANR", $RMANR, $savermanr) IniWrite(@ScriptDir & "\DB\rma.ini", "RMANREXTERN", $RMANR, $savermanrsup) IniWrite(@ScriptDir & "\DB\rma.ini", "DEBITNR", $RMANR, $debitnrread) IniWrite(@ScriptDir & "\DB\rma.ini", "KLANT", $RMANR, $NAAMKLANTRead) IniWrite(@ScriptDir & "\DB\rma.ini", "AANGEMELDDOOR", $RMANR, $NAAMMEDEWERKER) IniWrite(@ScriptDir & "\DB\rma.ini", "AANMELDDATUM", $RMANR, $AANMELDDATUMREAD) IniWrite(@ScriptDir & "\DB\rma.ini", "VERZENDDATUM", $RMANR, $VERZONDENDATUMREAD) IniWrite(@ScriptDir & "\DB\rma.ini", "MODEL", $RMANR, $MODELREAD) IniWrite(@ScriptDir & "\DB\rma.ini", "SERIENR", $RMANR, $SERIENRINPUTREAD) IniWrite(@ScriptDir & "\DB\rma.ini", "STATUS", $RMANR, $STATUSREAD) IniWrite(@ScriptDir & "\DB\rma.ini", "KLACHT", $RMANR, $KLACHTOMSCHRIJVING) IniWrite(@ScriptDir & "\DB\rma.ini", "OPLOSSING", $RMANR, $OPLOSSINGREAD) IniWrite(@ScriptDir & "\DB\rma.ini", "RETOURDATUM", $RMANR, $RETOURDATUMREAD) IniWrite(@ScriptDir & "\DB\rma.ini", "TRACKENTRACE", $RMANR, $TRACKENTRACEREAD) MsgBox(4096, "Opgeslagen", "RMA opgeslagen.") GUIDelete($EDITRMA) MAINMENU() ExitLoop EndIf Case $EXIT $YesOrNo = msgBox(4,"","Terug naar het hoofdmenu?") If $YesOrNo = 6 then GUIDelete($EDITRMA) MAINMENU() ExitLoop EndIf EndSwitch WEnd EndFunc ;====================================================================================================================================================================== Func OVERZICHT() Local $hINI_FILENAME = @ScriptDir & "\DB\rma.ini" Local $aINI_SECTIONS[13] = ['RMANR', 'RMANRLEV', 'DEBITNR', 'KLANT', 'STATUS', 'MODEL', 'SERIENR', 'AANGEMELDDOOR', 'AANMELDDATUM', 'VERZENDDATUM', 'RETOURDATUM', 'KLACHT', 'OPLOSSING'] ;~ Sections that should be read from Ini and added to ListView, also used as ListView Header Local $aSTATUS_SECTION = IniReadSection($hINI_FILENAME, 'STATUS') ;~ Use the Options section to populate the ComboBox Local $aSTATUS_ITEMS[0] $OVERZICHTGUI = GUICreate("RMA Overzicht", 1235, 742, -1, -1) GUICtrlCreateLabel("Ingelogd als: " & $NAAMMEDEWERKER, 8, 0) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateGroup("", 8, 16, 185, 89) GUICtrlCreateLabel("Status:", 32, 40, 37, 17) $STATUS = GUICtrlCreateCombo("", 32, 64, 140, 25,BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL)) GUICtrlSetData($STATUS, _ArrayToString(_ArrayUnique($aSTATUS_SECTION, 1), '|', 1, -1, '|', 1, 1), "") GUICtrlCreateGroup("", -99, -99, 1, 1) $hGUI_LISTVIEW = GUICtrlCreateListView(_ArrayToString($aINI_SECTIONS), 8, 120, 1218, 614) $Exit = GUICtrlCreateButton("Hoofdmenu", 1104, 8, 123, 33) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $EXIT $YesOrNo = msgBox(4,"","Terug naar het hoofdmenu?") If $YesOrNo = 6 then GUIDelete($OVERZICHTGUI) MAINMENU() ExitLoop EndIf Case $STATUS $STATE = GUICtrlRead($STATUS) $aSTATUS_INDEX = _ArrayFindAll($aSTATUS_SECTION, $STATE, 1, 0, 0, 0, 1) ReDim $aSTATUS_ITEMS[UBound($aSTATUS_INDEX)] For $i = 0 To UBound($aSTATUS_INDEX) - 1 $aSTATUS_ITEMS[$i] = $aSTATUS_SECTION[$aSTATUS_INDEX[$i]][0] Next If IsArray($aSTATUS_ITEMS) Then _GUICtrlListView_DeleteAllItems($hGUI_LISTVIEW) ;~ Remove this if you just want to append the data to the ListView without removing all items For $i = 0 To UBound($aSTATUS_ITEMS) - 1 $sListViewItem = '' For $j = 0 To UBound($aINI_SECTIONS) - 1 If $j = UBound($aINI_SECTIONS) - 1 Then $sListViewItem &= IniRead($hINI_FILENAME, $aINI_SECTIONS[$j], $aSTATUS_ITEMS[$i], -1) ExitLoop EndIf $sListViewItem &= IniRead($hINI_FILENAME, $aINI_SECTIONS[$j], $aSTATUS_ITEMS[$i], -1) & '|' Next GUICtrlCreateListViewItem($sListViewItem, $hGUI_LISTVIEW) Next EndIf EndSwitch WEnd EndFunc ;======================================================================================================================================================================