#include #include #include #include global $customer[7], $sDataFilePath $sDataFilePath = "\\wrnm-dpcifs02\itd_shares$\HelpDesk\faisal islam\Check_In_Database\" &@year &"_Check_In_Database_" &@mon & ".csv" $Check = GUICreate("Check-In/Out", 448, 232) $rank = GUICtrlCreateInput("Rank", 8, 32, 81, 21) $first = GUICtrlCreateInput("First Name", 104, 32, 121, 21) $last = GUICtrlCreateInput("Last Name", 240, 32, 121, 21) $middle = GUICtrlCreateInput("MI", 376, 32, 41, 21) $account = GUICtrlCreateCheckbox("New Account", 72, 80, 97, 17) $ahlta = GUICtrlCreateCheckbox("AHLTA/CHCS", 72, 112, 97, 17) $essentris = GUICtrlCreateCheckbox("Essentris", 72, 144, 97, 17) $submit = GUICtrlCreateButton("Submit", 240, 96) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg case $submit $customer[3]=guictrlread($rank) $customer[5]=guictrlread($first) $customer[4]=guictrlread($last) $customer[6]=guictrlread($middle) $customer[0]=guictrlread($account) $customer[1]=guictrlread($ahlta) $customer[2]=guictrlread($essentris) Submit($customer) GUICtrlSetData($rank, "Rank") GUICtrlSetData($first, "First") GUICtrlSetData($last, "Last") GUICtrlSetData($middle, "MI") GUICtrlSetState($ahlta,4) GUICtrlSetState($essentris,4) GUICtrlSetState($account,4) Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func Submit($array) If Not FileExists($sDataFilePath) Then FileWriteLine($sDataFilePath, "New Account,AHLTA/CHCS,Essentris,Rank,Last Name,First Name,MI,DATE") EndIf For $i = 0 To 6 If $i=0 Then switch $array[$i] case 1 FileWrite($sDataFilePath, " X,") case 4 FileWrite($sDataFilePath, ",") EndSwitch ElseIf $i=1 Then switch $array[$i] case 1 FileWrite($sDataFilePath, " X,") case 4 FileWrite($sDataFilePath, ",") EndSwitch ElseIf $i=2 Then switch $array[$i] case 1 FileWrite($sDataFilePath, " X,") case 4 FileWrite($sDataFilePath, ",") EndSwitch Elseif $i=3 then FileWrite($sDataFilePath, $array[$i] & ",") Elseif $i=4 then FileWrite($sDataFilePath, $array[$i] & ",") Elseif $i=5 then FileWrite($sDataFilePath, $array[$i] & ",") Elseif $i=6 then FileWrite($sDataFilePath, $array[$i] & "," & @Mon & "/" &@MDAY) EndIf Next FileWriteLine($sDataFilePath, "") EndFunc