1 /***************************************************************************
3 A small program to collect timecard information
5 begin : Tue Feb 22 09:41:09 CST 2000
6 copyright : (C) 2000 by Stephen Toothman
7 email : stephen.toothman@cicplan.com
8 ***************************************************************************/
10 /***************************************************************************
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
17 ***************************************************************************/
19 /***************************************************************************
21 * This is a complete GPL time clock system for small business. It will *
22 * have a time clock, a reporting system, an user management system, and *
23 * an administrative system for setting system options. The timeclock *
24 * section will rely on several external files when it is finished. *
25 * These files will be an administration file that holds the basic *
26 * company information, such as when the pay week begins and when the *
27 * pay week ends and in future versions may allow different payroll *
28 * systems such as bi-monthly and monthly. The second file will hold a *
29 * list of user ids and a flag for the privileges allowed individual *
30 * user. The last file will be the timecard file that holds the *
31 * individual timecard records. *
33 ***************************************************************************/
48 int main(int argc, char *argv[])
51 char userid[4] = "zzz"; /* the user id or employee number */
52 int usertype = 0; /* the user type used to determine access */
55 i = initializeprogram(&userid[0], &usertype, &weekends);
56 j = startprogram(&userid[0], &usertype, &weekends);
60 int initializeprogram(char *puserid1, int *pusertype1, int *pweekends1)
64 int tempusertype, tempweekends;
66 m = getenvironment(&tempweekends);
67 n = getuserid(&tempuser[0], &tempusertype);
68 for( loop = 0; loop < 4; loop++)
70 *puserid1 = toupper((unsigned char) tempuser[loop]);
71 puserid1 = puserid1 + 1;
73 *pusertype1 = tempusertype;
74 *pweekends1 = tempweekends;
78 int getenvironment(int *pweekends2)
83 fp = fopen("admin.txt", "r");
86 fscanf(fp, "%s %02d\n", fieldname, &testvalue);
87 if (strcmp(fieldname, "WEEKENDS") == 0)
89 *pweekends2 = testvalue;
95 int getuserid(char *puserid2, int *pusertype2)
99 int w = 0, x = 0, y, loop;
106 printf("Enter your user id\n");
107 z = fgets(name, 80, stdin);
108 y = (z == NULL ? 0 : 1);
109 for( loop = 0; loop < 4; loop++)
117 *puserid2 = toupper((unsigned char) name[loop]);
118 puserid2 = puserid2 + 1;
121 puserid2 = puserid2 - loop + 1;
122 fp = fopen("userlist.txt", "r");
123 while ( !feof(fp) && x == 0)
125 fscanf(fp, "%s %02d\n", testuserid, &testrights);
126 if (strcmp(puserid2, testuserid) == 0)
129 *pusertype2 = testrights;
133 if ( x == 0 && w >= 1)
135 printf("You have entered an incorrect user id\n");
136 printf("Please contact your supervisor for assistance.\n");
137 printf("Press <ENTER> to exit\n") ;
143 printf("You have entered an incorrect user id\n");
144 printf("Please enter your information again.\n");
151 int startprogram(char *puserid, int *pusertype, int *pweekends)
155 printf("Please enter what action you wish to take %s -- %d -- %d\n", puserid, *pusertype, *pweekends);
156 while (m < 1 || m > 4)
161 printf(" 1 Use Timeclock.\n");
164 printf(" 1 Use Timeclock.\n");
165 printf(" 2 Use Manager functions.\n");
168 printf(" 1 Use Timeclock.\n");
169 printf(" 2 Use Manager functions.\n");
170 printf(" 3 Use Reporting functions.\n");
173 printf(" 1 Use Timeclock.\n");
174 printf(" 2 Use Manager functions.\n");
175 printf(" 3 Use Reporting functions.\n");
176 printf(" 4 Use Administrative functions.\n");
179 printf(" 1 Use Timeclock.\n");
182 printf("\nEnter an item from the list ===> ");
185 /* this if statement checks that an item on the menu was entered */
189 printf("The number you entered is not valid.\n");
192 printf("the number must be from the list below. \n");
207 if (m != 1 && m != 2)
213 if (m != 1 && m != 2 && m != 3)
219 if (m != 1 && m != 2 && m != 3 && m != 4)
235 printf("The number you entered is not valid.\n");
236 printf("That number is not an allowed choice.\n");
238 printf("The number must be from the list below. \n");
247 n = timecard(puserid, *pusertype, *pweekends);
252 n = manager(puserid, *pusertype, *pweekends);
257 n = reporter(puserid, *pusertype, *pweekends);
262 n = administrator(puserid, *pusertype, *pweekends);
267 n = timecard(puserid, *pusertype, *pweekends);
274 int timecard(char userid[4], int usertype, int weekends)
276 int j, k, l, n, o, p, loop; /* return and miscellaneous variables */
278 timecardrecord currentpunch;
280 int itemflag[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} ; /* A flag array to hold whether a time card item has been used */
281 timecardrecord clockpunch[14]; /* an array of structures to hold previous time clock entries */
283 char weekstring[3]; /* filename portions */
288 /* The process works as follows: *
289 * First the user id is obtained from the user *
290 * Next the program gets the current time and gets the filename components *
291 * Next the program generates a filename *
292 * Next the program gets an action, clock in or clock out, from the user *
293 * Finally the timecard record is outputed to a file */
295 for( loop = 0; loop < 4; loop++)
297 currentpunch.userid[loop] = userid[loop];
299 j = gettimeanddate(¤tpunch, &weekstring[0], &yearstring[0], weekends);
300 k = getfilename(&filename[0], &weekstring[0], &yearstring[0]);
301 o = gettimecarddata(¤tpunch, &clockpunch[0], &itemflag[0], &filename[0]);
302 p = printtimecarddata(¤tpunch, &clockpunch[0]);
303 l = getaction(¤tpunch, &clockpunch[0], &itemflag[0]);
304 n = writerecord(¤tpunch, &filename[0]);
308 int gettimeanddate(timecardrecord *currentpunch, char *pweekstring, char *pyearstring, int weekends)
311 struct tm *timenow, *timetest, *timetemp;
316 char weekstringnow[3], weekstringtest[3];
317 char yearstringnow[5], yearstringtest[5];
319 /* get the current time information */
321 timenow = localtime(&now);
322 /* assigns the time information */
323 currentpunch->hour = timenow->tm_hour;
324 currentpunch->minute = timenow->tm_min;
325 currentpunch->second = timenow->tm_sec;
326 currentpunch->day = timenow->tm_mday;
327 currentpunch->month = timenow->tm_mon + 1;
328 currentpunch->year = timenow->tm_year + 1900;
329 weekdaynow = timenow->tm_wday;
330 strftime(weekstringnow, 3, "%U", timenow);
331 strftime(yearstringnow, 5, "%Y", timenow);
333 /* Find the adjustment needed to be added to the current time
334 * to return the last day of the pay period */
335 adjustfactor = ((weekends <= weekdaynow) ? 6 - weekdaynow + weekends : weekends - weekdaynow - 1);
337 /* get the time information of the last day of the payperiod */
339 timetemp->tm_mday = timetemp->tm_mday + adjustfactor;
340 test = mktime(timetemp);
341 timetest = localtime(&test);
342 yeartest = timetest->tm_year + 1900;
343 strftime(weekstringtest, 3, "%U", timetest);
344 strftime(yearstringtest, 5, "%Y", timetest);
346 /* puts the correct information into the file name components */
347 strcpy(pweekstring, weekstringtest);
348 if (currentpunch->year == yeartest)
350 strcpy(pyearstring, yearstringnow);
354 strcpy(pyearstring, yearstringtest);
361 int getfilename(char *pfilename, char *pweekstring, char *pyearstring)
365 /* this code generates the complete file name */
366 sprintf (pfilename, "tc%s%s.tcd", pyearstring, pweekstring);
372 int gettimecarddata(timecardrecord *currentpunch, timecardrecord *clockpunch, int *pitemflag, char *pfilename)
374 int a, b, c, d, w = 0, z, y;
377 int testaction, testyear, testmonth, testday, testhour, testminute, testsecond;
381 strcpy(clockpunch[w].userid, " ");
382 clockpunch[w].action = 0;
383 clockpunch[w].month = 0;
384 clockpunch[w].day = 0;
385 clockpunch[w].year = 0;
386 clockpunch[w].hour = 0;
387 clockpunch[w].minute = 0;
388 clockpunch[w].second = 0;
392 if ((fp = fopen(pfilename, "r")) != NULL)
396 fscanf(fp, "%s %02d%02d%02d%04d%02d%02d%02d\n", testuserid, &testaction, &testmonth, &testday, &testyear, &testhour, &testminute, &testsecond);
397 a = strcmp(currentpunch->userid, testuserid);
398 b = (currentpunch->month == testmonth ? 0 : 1);
399 c = (currentpunch->day == testday ? 0 : 1);
400 d = (currentpunch->year == testyear ? 0 : 1);
401 y = ((a == 0 && b == 0 && c == 0 && d == 0) ? 0 : 1);
405 strcpy(clockpunch[z].userid, testuserid);
406 clockpunch[z].action = testaction;
407 clockpunch[z].month = testmonth;
408 clockpunch[z].day = testday;
409 clockpunch[z].year = testyear;
410 clockpunch[z].hour = testhour;
411 clockpunch[z].minute = testminute;
412 clockpunch[z].second = testsecond;
421 int printtimecarddata(timecardrecord *currentpunch, timecardrecord *clockpunch)
426 printf("\n\n%s- -%02d-%02d-%04d-%02d-%02d-%02d\n\n", currentpunch->userid, currentpunch->month, currentpunch->day, currentpunch->year, currentpunch->hour, currentpunch->minute, currentpunch->second);
430 z = strcmp(clockpunch[y].userid, currentpunch->userid);
433 printf("%s-%02d-%02d-%02d-%04d-%02d-%02d-%02d\n", clockpunch[y].userid, clockpunch[y].action, clockpunch[y].month, clockpunch[y].day, clockpunch[y].year, clockpunch[y].hour, clockpunch[y].minute, clockpunch[y].second);
441 int getaction(timecardrecord *currentpunch, timecardrecord *clockpunch, int *pitemflag)
443 int u, v = 0, w = 0, x = 0, z;
446 /* This is the action menu */
447 if (pitemflag[0] == 1)
451 u = (clockpunch[w].hour*10000)+(clockpunch[w].minute*100)+(clockpunch[w].second);
455 x = clockpunch[w].action;
457 if (clockpunch[w].action == 6)
469 while (i < 1 || i > 14)
471 printf("Please enter what action you wish to take\n");
475 printf(" 1 Clock in for the day.\n");
478 printf(" 2 Clock out for lunch.\n");
479 printf(" 6 Clock out for the day.\n");
480 printf(" 7 Clock out for first break.\n");
483 printf(" 3 Clock in from lunch.\n");
486 printf(" 4 Clock out for dinner.\n");
487 printf(" 6 Clock out for the day.\n");
488 if (pitemflag[6] == 0)
490 printf(" 7 Clock out for first break.\n");
492 else if (pitemflag[8] == 0)
494 printf(" 9 Clock out for second break.\n");
496 else if (pitemflag[10] == 0)
498 printf("11 Clock out for third break.\n");
500 else if (pitemflag[12] == 0)
502 printf("13 Clock out for fourth break.\n");
506 printf(" 5 Clock in from dinner.\n");
509 printf(" 6 Clock out for the day.\n");
510 if (pitemflag[6] == 0)
512 printf(" 7 Clock out for first break.\n");
514 else if (pitemflag[8] == 0)
516 printf(" 9 Clock out for second break.\n");
518 else if (pitemflag[10] == 0)
520 printf("11 Clock out for third break.\n");
522 else if (pitemflag[12] == 0)
524 printf("13 Clock out for fourth break.\n");
528 printf("\n\nYou have exhausted all of your options for today\n");
529 printf("Please contact your supervisor if you believe\n");
530 printf("you have received this message in error or you\n");
531 printf("are not finished working for today.\n");
532 printf("Press <ENTER> to exit\n") ;
537 printf(" 8 Clock in from first break.\n");
540 if (pitemflag[1] == 0)
542 printf(" 2 Clock out for lunch.\n");
544 else if (pitemflag[3] == 0)
546 printf(" 4 Clock out for dinner.\n");
548 printf(" 6 Clock out for the day.\n");
549 printf(" 9 Clock out for second break.\n");
552 printf("10 Clock in from second break.\n");
555 if (pitemflag[1] == 0)
557 printf(" 2 Clock out for lunch.\n");
559 else if (pitemflag[3] == 0)
561 printf(" 4 Clock out for dinner.\n");
563 printf(" 6 Clock out for the day.\n");
564 printf("11 Clock out for third break.\n");
567 printf("12 Clock in from third break.\n");
570 if (pitemflag[1] == 0)
572 printf(" 2 Clock out for lunch.\n");
574 else if (pitemflag[3] == 0)
576 printf(" 4 Clock out for dinner.\n");
578 printf(" 6 Clock out for the day.\n");
579 printf("13 Clock out for fourth break.\n");
582 printf("14 Clock in from fourth break.\n");
585 if (pitemflag[1] == 0)
587 printf(" 2 Clock out for lunch.\n");
589 else if (pitemflag[3] == 0)
591 printf(" 4 Clock out for dinner.\n");
593 printf(" 6 Clock out for the day.\n");
596 printf("\nEnter an item from the list ===> ");
599 /* this if statement checks that an item on the menu was entered */
603 printf("The number you entered is not valid.\n");
606 printf("the number must be from the list below. \n");
611 /* This section of code makes sure that a menu item is only used once */
614 i = (pitemflag[i-1] == 1 ? 98 : i);
618 printf("The number you entered is not valid.\n");
619 printf("You have already used that action for today\n");
621 printf("the number must be from the list below. \n");
637 if (i != 2 && i != 6 && i != 7)
649 if (pitemflag[6] == 0)
651 if (i != 4 && i != 6 && i != 7)
656 else if (pitemflag[8] == 0)
658 if (i != 4 && i != 6 && i != 9)
663 else if (pitemflag[10] == 0)
665 if (i != 4 && i != 6 && i != 11)
670 else if (pitemflag[12] == 0)
672 if (i != 4 && i != 6 && i != 13)
685 if (pitemflag[6] == 0)
687 if (i != 6 && i != 7)
692 else if (pitemflag[8] == 0)
694 if (i != 6 && i != 9)
699 else if (pitemflag[10] == 0)
701 if (i != 6 && i != 11)
706 else if (pitemflag[12] == 0)
708 if (i != 6 && i != 13)
715 printf("You have exhausted all of your options for today\n");
716 printf("Please contact your supervisor if you believe\n");
717 printf("you have received this message in error or you\n");
718 printf("are not finished working for today.\n");
719 printf("Press <ENTER> to exit\n") ;
730 if (pitemflag[1] == 0)
732 if (i != 2 && i != 6 && i != 9)
737 else if (pitemflag[3] == 0)
739 if (i != 4 && i != 6 && i != 9)
752 if (pitemflag[1] == 0)
754 if (i != 2 && i != 6 && i != 11)
759 else if (pitemflag[3] == 0)
761 if (i != 4 && i != 6 && i != 11)
774 if (pitemflag[1] == 0)
776 if (i != 2 && i != 6 && i != 13)
781 else if (pitemflag[3] == 0)
783 if (i != 4 && i != 6 && i != 13)
796 if (pitemflag[1] == 0)
798 if (i != 2 && i != 6)
803 else if (pitemflag[3] == 0)
805 if (i != 4 && i != 6)
815 printf("The number you entered is not valid.\n");
816 printf("That number is not an allowed choice.\n");
818 printf("The number must be from the list below. \n");
825 /* If everything is correct the program assigns the action code to the pointer */
826 currentpunch->action = i;
832 int writerecord(timecardrecord *currentpunch, char *pfilename)
834 int a, b, c, d, e, f, g, h, z, y;
837 int testaction, testyear, testmonth, testday, testhour, testminute, testsecond;
839 /* opens the file and writes the timecard record to it */
840 fp = fopen(pfilename, "a");
841 fprintf(fp, "%s %02d%02d%02d%04d%02d%02d%02d\n", currentpunch->userid, currentpunch->action, currentpunch->month, currentpunch->day, currentpunch->year, currentpunch->hour, currentpunch->minute, currentpunch->second);
844 /* opens the file and reads back in the record just entered */
845 fp = fopen(pfilename, "r");
849 fscanf(fp, "%s %02d%02d%02d%04d%02d%02d%02d\n", testuserid, &testaction, &testmonth, &testday, &testyear, &testhour, &testminute, &testsecond);
850 a = strcmp(currentpunch->userid, testuserid);
851 b = (currentpunch->action == testaction ? 0 : 1);
852 c = (currentpunch->month == testmonth ? 0 : 1);
853 d = (currentpunch->day == testday ? 0 : 1);
854 e = (currentpunch->year == testyear ? 0 : 1);
855 f = (currentpunch->hour == testhour ? 0 : 1);
856 g = (currentpunch->minute == testminute ? 0 : 1);
857 h = (currentpunch->second == testsecond ? 0 : 1);
858 y = a + b + c + d + e + f + g + h;
862 /* prints both copys of the information for verification */
863 printf("\nprinted to filename %s - %s-%02d-%02d-%02d-%04d-%02d-%02d-%02d\n", pfilename, currentpunch->userid, currentpunch->action, currentpunch->month, currentpunch->day, currentpunch->year, currentpunch->hour, currentpunch->minute, currentpunch->second);
864 printf("read from filename %s - %s-%02d-%02d-%02d-%04d-%02d-%02d-%02d\n", pfilename, testuserid, testaction, testmonth, testday, testyear, testhour, testminute, testsecond);
865 printf("\n\nPress <ENTER> to exit\n") ;
872 int manager(char userid[4], int usertype, int weekends)
875 printf("\n\nManager Functions");
876 printf("\n\nPress <ENTER> to exit\n");
881 int reporter(char userid[4], int usertype, int weekends)
886 a = usefilename(&usefile[0]);
889 b = printhoursreport(usefile, weekends);
894 int usefilename(char *pusefile)
902 printf("Enter the name of the file you wish to open\n");
903 printf("\nThe format for the name is \"tc<year><week number>.tcd\"\n");
904 printf("This means the third week of the year 2000 would be\n");
905 printf("written tc200003.scd.\n");
906 printf("Type \"quit\" to quit the program.\n");
907 printf("Filename : ");
909 for (j = 0; j < 13; j++)
928 if (!strcmp(y , "quit\n"))
933 if ( (fp = fopen(z, "r")) != NULL)
941 printf("There was an error opening %s. Please try\n", pusefile);
942 printf("entering the file name again\n");
949 int printhoursreport(char usefile[12], int weekends)
954 e = reportfilename(usefile, &reportfile[0]);
955 f = writereportdata(usefile, reportfile, weekends);
959 int reportfilename(char usefile[12], char *preportfile)
964 for (y = 2; y <= 8; y++)
972 z[y - 2] = usefile[y];
975 sprintf (preportfile, "th%s.tcr", z);
979 int writereportdata(char usefile[12], char reportfile[12], int weekends)
982 daterecord filedates[7];
984 i = getreportdates(usefile, &filedates[0], weekends);
985 j = generatereport(usefile, reportfile, filedates);
989 int getreportdates(char usefile[12], daterecord *pfiledates, int weekends)
992 struct tm *timenow, *timetest, *timetemp;
995 int weekfile, weektest;
998 char weekstringfile[3], weekstringtest[3];
999 char yearstringfile[5];
1001 /* get the first of year time information */
1002 for (y = 2; y <= 6; y++)
1006 yearstringfile[y - 2] = '\0';
1010 yearstringfile[y - 2] = usefile[y];
1013 for (y = 6; y <= 8; y++)
1017 weekstringfile[y - 6] = '\0';
1021 weekstringfile[y - 6] = usefile[y];
1024 weekfile = atoi(weekstringfile);
1025 yearfile = atoi(yearstringfile);
1027 timenow = localtime(&now);
1029 timetemp->tm_year = yearfile - 1900;
1030 timetemp->tm_mon = 0;
1031 timetemp->tm_mday = 1;
1032 test = mktime(timetemp);
1033 timetest = localtime(&test);
1034 weekdaynow = timetest->tm_wday;
1035 if (weekdaynow <= weekends)
1037 timetemp->tm_mday = timetemp->tm_mday + (6 - weekdaynow + weekends);
1038 test = mktime(timetemp);
1039 timetest = localtime(&test);
1040 timetemp = timetest;
1041 strftime(weekstringtest, 3, "%U", timetest);
1042 weektest = atoi(weekstringtest);
1046 timetemp->tm_mday = timetemp->tm_mday + (weekends - weekdaynow);
1047 test = mktime(timetemp);
1048 timetest = localtime(&test);
1049 timetemp = timetest;
1050 strftime(weekstringtest, 3, "%U", timetest);
1051 weektest = atoi(weekstringtest);
1053 while (weektest != weekfile)
1055 timetemp->tm_mday = timetemp->tm_mday + 7;
1056 test = mktime(timetemp);
1057 timetest = localtime(&test);
1058 timetemp = timetest;
1059 strftime(weekstringtest, 3, "%U", timetest);
1060 weektest = atoi(weekstringtest);
1062 timetemp->tm_mday = timenow->tm_mday - 7;
1063 test = mktime(timetemp);
1064 timetest = localtime(&test);
1065 for (z = 0; z < 7; z++)
1067 timetemp->tm_mday = timetemp->tm_mday + 1;
1068 test = mktime(timetemp);
1069 timetest = localtime(&test);
1070 pfiledates[z].day = timetest->tm_mday;
1071 pfiledates[z].month = timetest->tm_mon + 1;
1072 pfiledates[z].year = timetest->tm_year + 1900;
1078 int generatereport(char usefile[12], char reportfile[12], daterecord filedates[7])
1080 int a, b, c, d, e, f, y;
1082 char testuserid1[4], testuserid2[4];
1083 int testaction, testyear, testmonth, testday, testhour, testminute, testsecond, testrights;
1084 float worktime, breaktime;
1085 float reporttimes[14] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} ; /* A flag array to hold whether a time card item has been used */
1086 timecardrecord reportpunch[14]; /* an array of structures to hold previous time clock entries */
1088 fp = fopen("userlist.txt", "r");
1089 fr = fopen(reportfile, "w");
1092 fscanf(fp, "%s %02d\n", testuserid1, &testrights);
1093 fprintf(fr, "%s\n", testuserid1);
1094 fprintf(fr, "Date of Work Work Hours Break Hours\n");
1095 for (a = 0; a < 7; a++)
1097 for (b = 0; b < 14; b++)
1099 strcpy(reportpunch[b].userid, " ");
1100 reportpunch[b].action = 0;
1101 reportpunch[b].month = 0;
1102 reportpunch[b].day = 0;
1103 reportpunch[b].year = 0;
1104 reportpunch[b].hour = 0;
1105 reportpunch[b].minute = 0;
1106 reportpunch[b].second = 0;
1107 reporttimes[b] = 0.0;
1109 if ((fq = fopen(usefile, "r")) != NULL)
1113 fscanf(fq, "%s %02d%02d%02d%04d%02d%02d%02d\n", testuserid2, &testaction, &testmonth, &testday, &testyear, &testhour, &testminute, &testsecond);
1114 e = strcmp(testuserid1, testuserid2);
1115 f = (filedates[a].month == testmonth ? 0 : 1);
1116 c = (filedates[a].day == testday ? 0 : 1);
1117 d = (filedates[a].year == testyear ? 0 : 1);
1118 y = ((e == 0 && f == 0 && c == 0 && d == 0) ? 0 : 1);
1121 strcpy(reportpunch[testaction].userid, testuserid2);
1122 reportpunch[testaction - 1].action = testaction;
1123 reportpunch[testaction - 1].month = testmonth;
1124 reportpunch[testaction - 1].day = testday;
1125 reportpunch[testaction - 1].year = testyear;
1126 reportpunch[testaction - 1].hour = testhour;
1127 reportpunch[testaction - 1].minute = testminute;
1128 reportpunch[testaction - 1].second = testsecond;
1129 reporttimes[testaction - 1] = (float)(testhour) + (float)(testminute/60.0);
1130 reporttimes[testaction - 1] = (((int)(reporttimes[testaction - 1]*100) % 1 >= 5) ? (((reporttimes[testaction - 1]*100)+ 1)/100.0) : (((reporttimes[testaction - 1]*100)+ 0)/100.0));
1134 breaktime = (reporttimes[7]-reporttimes[6]) + (reporttimes[9]-reporttimes[8]) + (reporttimes[11]-reporttimes[10]) + (reporttimes[13]-reporttimes[12]);
1135 worktime = (reporttimes[5]-reporttimes[0]) - (reporttimes[2]-reporttimes[1]) - (reporttimes[4]-reporttimes[3]);
1136 fprintf(fr, " %02d/%02d/%04d %9.2f %10.2f\n", filedates[a].month, filedates[a].day, filedates[a].year, worktime, breaktime);
1145 int administrator(char userid[4], int usertype, int weekends)
1148 printf("\n\nAdministrator Functions");
1149 printf("\n\nPress <ENTER> to exit\n");
1154 void clearscreen(void)
1157 for (c = 0; c <= 100; c++)
1159 for (d = 0; d <= 200; d++)