1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
int main()
{
int eight_set_begin[] = {7, 8, 1, 2, 4, 4, 4, 5, 5, 5, 5, 5, 5, 7, 8, 8, 8, 10, 11, 13, /* Eight Hour Set */
13, 13, 14, 14, 14, 14, 14, 16, 16, 16, 17, 17, 17, 17, 17, 17,
17, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 21, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23};
int eight_set_end[] = {8, 9, 2, 3, 4, 4, 5, 5, 5, 5, 5, 5, 6, 8, 8, 8, 9, 11, 11, 13, 13, /* Eight Hour Set */
14, 14, 14, 14, 14, 15, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 19,
19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
21, 21, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23, 23, 23, 23, 24};
<snip>
MusicInfo *start = NULL; /* linked list */
MusicInfo *current = NULL;
int option = 0;
char statement[10000], hd[] = "A";
do
{
cout << "Select an option : " << endl;
cout << " 0. Exit program" << endl;
cout << " 1. Get info from database" << endl;
cout << " 2. Delete first employee in list" << endl;
cout << " 3. Delete last employee in list" << endl;
cout << " 4. Move to next employee" << endl;
cout << " 5. Move to previous employee" << endl;
cout << " 6. Display list" << endl;
//cout << " 2. Search for employee" << endl;
cout << endl;
cin >> option;
switch(option)
{
case 1:
strcpy(statement, create_statement(hd, eight_set_begin, eight_set_end));
querydb_and_populate(start, statement, TRUE);
memset(statement, '\0', sizeof(statement));
break;
<snip>
}
}
while(option != 0);
free_data(start);
return 0;
}
|