To the point.
I have it just where I want it. Except one feature. I would love for the ability to get employee totals in the area the says "view current times" in the admin.bat.
time.csv is created and stores this information. Im just not sure if it is possible. Any help would be greatly appreciated.
Thanks in advance, Hemlok
Below is code for both batch files. Just create two batch files. "admin.bat" & "Timeclock.bat".
Run Timeclock.bat and log in with user "admin", and create a password.
******
-admin.bat
Code: Select all
:::::::::::::::::::::::::::::::::::
:: Employee TIme Clock V 2.0 :
:: By Hemlok :
:: :
:: :
:::::::::::::::::::::::::::::::::::
@echo off
color 0F
mode con cols=45 lines=3
:admin
if exist pass.csv (goto login) else (goto create)
:login
set /p pass=Enter Password:
findstr %pass% pass.csv > temp.txt
set /p comp=<temp.txt
goto next
:next
if %pass%==%comp% goto panel
goto login
:create
cls
set /p pass=Create Password:
echo %pass% >> pass.csv
attrib +h pass.csv
goto panel
:panel
mode con cols=45 lines=10
del temp.txt
cls
echo 1. Set Up Employee
echo 2. Remove Employees
echo 3. View Employees
echo 4. Add Password
echo 5. Delete Passwords
echo 6. View Current Times
echo 7. Quit
echo.
set /p C=
if "%C%"=="1" goto employee
if "%C%"=="2" goto remove
if "%C%"=="3" goto viewcheck
if "%C%"=="4" goto newpass
if "%C%"=="5" goto delpass
if "%C%"=="6" goto timecheck
if "%C%"=="7" goto quit
:employee
cls
set /p emp=Enter Employee Name:
set /p num=Enter Employee Number:
findstr %num% Employees.csv >> temp.txt
set /p comp=<temp.txt
del temp.txt
if %num%==%comp% goto errors
goto employees
:employees
echo %emp% >> Employees.csv
echo %num% >> Employees.csv
echo. >> Employees.csv
attrib +h Employees.csv
echo Add another employee?
echo 1. Yes
echo 2. No
set /p add=
if "%add%"=="1" goto employee
if "%add%"=="2" goto panel
:view
cls
type Employees.csv
echo.
pause
goto panel
:newpass
cls
set /p pass=Create Password:
echo %pass% >> pass.csv
goto panel
:time
cls
type time.csv
pause
goto panel
:delpass
del /A:H "C:\Users\Admin\Desktop\Time Clock Bat\pass.csv"
goto create
:timecheck
if exist "C:\Users\Admin\Desktop\Time Clock Bat\time.csv" (goto time) else (goto error)
:viewcheck
if exist Employees.csv (goto view) else (goto error)
:error
cls
echo I am sorry it does not seem like that file exist yet.
pause
goto panel
:errors
cls
echo I am sorry that employee number is already in use. Please try another.
pause
goto employee
:remove
mode con cols=45 lines=5
set /p z=Enter Employee Name:
cls
attrib -h -a Employees.csv
findstr /v %z% Employees.csv >> temp2.txt
del Employees.csv
findstr .* temp2.txt >> Employees.csv
del temp2.txt
attrib +h +a Employees.csv
echo Remove Another Employee?
echo 1. Yes
echo 2. No
set /p a=
if "%a%"=="1" goto remove
if "%a%"=="2" goto panel
:quit
exit
-Timeclock.bat
Code: Select all
:::::::::::::::::::::::::::::::::::
:: Employee TIme Clock V 2.0 :
:: By Hemlok :
:: :
:: :
:::::::::::::::::::::::::::::::::::
@echo off
color 0F
mode con cols=45 lines=25
Title Employee Time Clock
Set mm=%DATE:~4,2%
Set dd=%DATE:~7,2%
Set yy=%DATE:~10,4%
::Time
for /f %%a in ('time /t') do (
set standardtime=%%a
)
:name
cls
echo.
echo **************************
echo *[----------------------]*
echo *[ Employee Time Clock ]*
echo *[ V 2.0 ]*
echo *[ ]*
echo *[ %mm%-%dd%-%yy% ]*
echo *[ ]*
echo *[ ]*
echo *[ %standardtime% ]*
echo *[ ]*
echo *[ ]*
echo *[----------------------]*
echo **************************
echo.
set /p name=Enter Your Name:
if %name%==admin goto admin
set /p input=Enter Employee Number:
findstr %input% Employees.csv > temp1.txt
findstr %name% Employees.csv > temp2.txt
goto next
:next
set /p comp=<temp1.txt
if %input%==%comp% goto then
goto error
:then
set /p com=<temp2.txt
if %name%==%com% goto menu
goto error
:menu
del temp2.txt
del temp1.txt
cls
echo.
echo `/ooo/`
echo .do-.-sh`
echo :m` -m-
echo `oy+++++y+`
echo -mmmy+ymmm-
echo -mmms smmm-
echo -mmmm/mmmm-
echo `sssssssss`
echo.
echo Time %standardtime%
echo ********************
echo *[ ]*
echo *[ 1. Clock In ]*
echo *[ ]*
echo *[ 2. Clock out ]*
echo *[ ]*
echo *[ 3. Exit ]*
echo *[ ]*
echo ********************
set /p c=
if "%c%"=="1" goto in
if "%c%"=="2" goto out
if "%c%"=="3" exit
:in
echo %name%,%input%,IN,%standardtime%,%date% >> "C:\Users\Admin\Desktop\Time Clock Bat\time.csv"
cls
goto thankyou
:out
echo %name%,%input%,OUT,%standardtime%,%date% >> "C:\Users\Admin\Desktop\Time Clock Bat\time.csv"
cls
goto thankyou
:admin
call admin.bat
:error
echo Your input does not match our records please try again
echo.
pause
goto name
:thankyou
echo Time Accepted!
pause
:end