Subversion Repositories svn1-original

Rev

Rev 95 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 95 Rev 162
Line 22... Line 22...
22
 
22
 
23
#include    "consts.h"
23
#include    "consts.h"
24
#include    "structs.h"
24
#include    "structs.h"
25
#include    "proto.h"
25
#include    "proto.h"
26
 
26
 
27
menu_table  dsq_menu[] = {
27
//menu_table  dsq_menu[] = {
28
    { '1', "Disqualify a team", ds_team },
28
//    { '1', "Disqualify a team", ds_team },
29
    { '2', "Flag a non-equestrian team", ds_non_equestrian },
29
//    { '2', "Flag a non-equestrian team", ds_non_equestrian },
30
    { '3', "Re-qualify a team", ds_requal },
30
//    { '3', "Re-qualify a team", ds_requal },
31
    { '4', "Display disqualified and non-equestrian teams", ds_displ },
31
//    { '4', "Display disqualified and non-equestrian teams", ds_displ },
32
    { '5', "Delete a team entry", del_team },
32
//    { '5', "Delete a team entry", del_team },
33
    { 'q', "Return to main menu", 0 },
33
//    { 'q', "Return to main menu", 0 },
34
    { '\0' }
34
//    { '\0' }
35
};
35
//};
36
 
36
 
37
 
37
 
38
/*========================================================================
38
///*========================================================================
39
 *
39
// *
40
 *  Disqualification menu
40
// *  Disqualification menu
41
 *
41
// *
42
 *  Purpose:
42
// *  Purpose:
43
 *      This function is called to display the Disqualification operations
43
// *      This function is called to display the Disqualification operations
44
 *
44
// *
45
 *  Parameters:
45
// *  Parameters:
46
 *      None
46
// *      None
47
 *
47
// *
48
 *  Returns:
48
// *  Returns:
49
 *      Nothing
49
// *      Nothing
50
 *
50
// *
51
 *========================================================================*/
51
// *========================================================================*/
52
 
52
 
53
void f_disqualify(void)
53
//void f_disqualify(void)
54
{
54
//{
55
    do_menu( "Disqualification operations", "Select option", dsq_menu );
55
//    do_menu( "Disqualification operations", "Select option", dsq_menu );
56
}
56
//}
57
 
57
 
58
/*========================================================================
58
/*========================================================================
59
 *
59
 *
60
 *  Disqualify teams
60
 *  Disqualify teams
61
 *
61
 *
Line 69... Line 69...
69
 *  Returns:
69
 *  Returns:
70
 *      Nothing
70
 *      Nothing
71
 *
71
 *
72
 *========================================================================*/
72
 *========================================================================*/
73
 
73
 
74
void ds_team(void)
74
//void ds_team(void)
75
{
75
//{
76
    while( g_tnum( 0, n_lines - 10, "Enter team to disqualify" ) )
76
//    while( g_tnum( 0, n_lines - 10, "Enter team to disqualify" ) )
77
    {
77
//    {
78
        printf( "\n" );
78
//        printf( "\n" );
79
        console_clreol();
79
//        //console_clreol();
80
        if( g_record( team, &team_buf ) )
80
//        if( g_record( team, &team_buf ) )
81
            if( team_buf.flags.disqualified && ! team_buf.flags.non_equestrian )
81
//            if( team_buf.flags.disqualified && ! team_buf.flags.non_equestrian )
82
            {
82
//            {
83
                printf( "Team %d already disqualified\n", team );
83
//                printf( "Team %d already disqualified\n", team );
84
                beep();
84
//                beep();
85
            }
85
//            }
86
            else
86
//            else
87
            {
87
//            {
88
                team_buf.flags.disqualified = TRUE;
88
//                team_buf.flags.disqualified = TRUE;
89
                team_buf.flags.non_equestrian = FALSE;
89
//                team_buf.flags.non_equestrian = FALSE;
90
                put_team_record( team, &team_buf );
90
//                put_team_record( team, &team_buf );
91
                printf( "Team %d now disqualified\n", team );
91
//                printf( "Team %d now disqualified\n", team );
92
            }
92
//            }
93
        else
93
//        else
94
        {
94
//        {
95
            printf( "Team %d not defined\n", team );
95
//            printf( "Team %d not defined\n", team );
96
            beep();
96
//            beep();
97
        }
97
//        }
98
    }
98
//    }
99
}
99
//}
100
 
100
 
101
/*========================================================================
101
/*========================================================================
102
 *
102
 *
103
 *  Non Equestrian Teams
103
 *  Non Equestrian Teams
104
 *
104
 *
Line 112... Line 112...
112
 *  Returns:
112
 *  Returns:
113
 *      Nothing
113
 *      Nothing
114
 *
114
 *
115
 *========================================================================*/
115
 *========================================================================*/
116
 
116
 
117
void ds_non_equestrian(void)
117
//void ds_non_equestrian(void)
118
{
118
//{
119
    while( g_tnum( 0, n_lines - 10, "Enter team to mark Non-Equestrian" ) )
119
//    while( g_tnum( 0, n_lines - 10, "Enter team to mark Non-Equestrian" ) )
120
    {
120
//    {
121
        printf( "\n" );
121
//        printf( "\n" );
122
        console_clreol();
122
//        //console_clreol();
123
        if( g_record( team, &team_buf ) )
123
//        if( g_record( team, &team_buf ) )
124
            if( team_buf.flags.non_equestrian )
124
//            if( team_buf.flags.non_equestrian )
125
            {
125
//            {
126
                printf( "Team %d already marked Non-Equestrian\n", team );
126
//                printf( "Team %d already marked Non-Equestrian\n", team );
127
                beep();
127
//                beep();
128
            }
128
//            }
129
            else
129
//            else
130
            {
130
//            {
131
                team_buf.flags.disqualified = TRUE;
131
//                team_buf.flags.disqualified = TRUE;
132
                team_buf.flags.non_equestrian = TRUE;
132
//                team_buf.flags.non_equestrian = TRUE;
133
                put_team_record( team, &team_buf );
133
//                put_team_record( team, &team_buf );
134
                printf( "Team %d now marked Non-Equestrian\n", team );
134
//                printf( "Team %d now marked Non-Equestrian\n", team );
135
            }
135
//            }
136
        else
136
//        else
137
        {
137
//        {
138
            printf( "Team %d not defined\n", team );
138
//            printf( "Team %d not defined\n", team );
139
            beep();
139
//            beep();
140
        }
140
//        }
141
    }
141
//    }
142
}
142
//}
143
/*========================================================================
143
/*========================================================================
144
 *
144
 *
145
 *  Re-qualify teams
145
 *  Re-qualify teams
146
 *
146
 *
147
 *  Purpose:
147
 *  Purpose:
Line 154... Line 154...
154
 *  Returns:
154
 *  Returns:
155
 *      Nothing
155
 *      Nothing
156
 *
156
 *
157
 *========================================================================*/
157
 *========================================================================*/
158
 
158
 
159
void ds_requal(void)
159
//void ds_requal(void)
160
{
160
//{
161
    while( g_tnum( 0, n_lines - 10, "Enter team to re-qualify" ) )
161
//    while( g_tnum( 0, n_lines - 10, "Enter team to re-qualify" ) )
162
    {
162
//    {
163
        printf( "\n" );
163
//        printf( "\n" );
164
        console_clreol();
164
//        //console_clreol();
165
        if( g_record( team, &team_buf ) )
165
//        if( g_record( team, &team_buf ) )
166
            if( !team_buf.flags.disqualified )
166
//            if( !team_buf.flags.disqualified )
167
            {
167
//            {
168
                printf( "Team %d not disqualified\n", team );
168
//                printf( "Team %d not disqualified\n", team );
169
                beep();
169
//                beep();
170
            }
170
//            }
171
            else
171
//            else
172
            {
172
//            {
173
                team_buf.flags.disqualified = FALSE;
173
//                team_buf.flags.disqualified = FALSE;
174
                team_buf.flags.non_equestrian = FALSE;
174
//                team_buf.flags.non_equestrian = FALSE;
175
                put_team_record( team, &team_buf );
175
//                put_team_record( team, &team_buf );
176
                printf( "Team %d now re-qualified\n", team );
176
//                printf( "Team %d now re-qualified\n", team );
177
            }
177
//            }
178
        else
178
//        else
179
        {
179
//        {
180
            printf( "Team %d not defined\n", team );
180
//            printf( "Team %d not defined\n", team );
181
            beep();
181
//            beep();
182
        }
182
//        }
183
    }
183
//    }
184
}
184
//}
185
 
185
 
186
/*========================================================================
186
/*========================================================================
187
 *
187
 *
188
 *  Display disqualified teams
188
 *  Display disqualified teams
189
 *
189
 *
Line 197... Line 197...
197
 *  Returns:
197
 *  Returns:
198
 *      Nothing
198
 *      Nothing
199
 *
199
 *
200
 *========================================================================*/
200
 *========================================================================*/
201
 
201
 
202
void ds_displ(void)
202
//void ds_displ(void)
203
{
203
//{
204
    int     i, j, k;
204
//    int     i, j, k;
205
    int     non_equestrian_count = 0;
205
//    int     non_equestrian_count = 0;
206
 
206
 
207
    printf( "Scanning for disqualified and non-equestrian teams\n\n" );
207
//    printf( "Scanning for disqualified and non-equestrian teams\n\n" );
208
    flush_out();
208
//    flush_out();
209
    for( k = j = 0, i = config.min_team; i <= config.max_team; i++ )
209
//    for( k = j = 0, i = config.min_team; i <= config.max_team; i++ )
210
    {
210
//    {
211
        if( valid_field( i ) )
211
//        if( valid_field( i ) )
212
        {
212
//        {
213
            ( void ) g_record( i, &team_buf );
213
//            ( void ) g_record( i, &team_buf );
214
            if( team_buf.flags.valid && ( team_buf.flags.disqualified || team_buf.flags.non_equestrian ))
214
//            if( team_buf.flags.valid && ( team_buf.flags.disqualified || team_buf.flags.non_equestrian ))
215
            {
215
//            {
216
                printf( "%4d%c ", i, team_buf.flags.non_equestrian ? 'N' : ' ' );
216
//                printf( "%4d%c ", i, team_buf.flags.non_equestrian ? 'N' : ' ' );
217
                flush_out();
217
//                flush_out();
218
                k++;
218
//                k++;
219
                if( team_buf.flags.non_equestrian )
219
//                if( team_buf.flags.non_equestrian )
220
                    non_equestrian_count++;
220
//                    non_equestrian_count++;
221
                if( j++ > 10 )
221
//                if( j++ > 10 )
222
                {
222
//                {
223
                    printf( "\n" );
223
//                    printf( "\n" );
224
                    j = 0;
224
//                    j = 0;
225
                }
225
//                }
226
            }
226
//            }
227
        }
227
//        }
228
    }
228
//    }
229
    printf( "\n\n");
229
//    printf( "\n\n");
230
    printf ("Teams disqualified: %d\n", k );
230
//    printf ("Teams disqualified: %d\n", k );
231
    printf ("Non Equestrian teams: %d\n", non_equestrian_count );
231
//    printf ("Non Equestrian teams: %d\n", non_equestrian_count );
232
    printf ("\nAny key to continue");
232
//    printf ("\nAny key to continue");
233
    getinp();
233
//    getinp();
234
}
234
//}
235
 
235
 
236
/*========================================================================
236
/*========================================================================
237
 *
237
 *
238
 *  Delete a team
238
 *  Delete a team
239
 *
239
 *
Line 247... Line 247...
247
 *  Returns:
247
 *  Returns:
248
 *      Nothing
248
 *      Nothing
249
 *
249
 *
250
 *========================================================================*/
250
 *========================================================================*/
251
 
251
 
252
void del_team(void)
252
//void del_team(void)
253
{
253
//{
254
    while( g_tnum( 0, n_lines - 10, "Enter team to DELETE" ) )
254
//    while( g_tnum( 0, n_lines - 10, "Enter team to DELETE" ) )
255
    {
255
//    {
256
        printf( "\n" );
256
//        printf( "\n" );
257
        console_clreol();
257
//        //console_clreol();
258
        if( g_record( team, &team_buf ) )
258
//        if( g_record( team, &team_buf ) )
259
        {
259
//        {
260
            team_buf.flags.valid = FALSE;
260
//            team_buf.flags.valid = FALSE;
261
            team_buf.flags.disqualified = FALSE;
261
//            team_buf.flags.disqualified = FALSE;
262
            put_team_record( team, &team_buf );
262
//            put_team_record( team, &team_buf );
263
            printf( "Team %d now deleted\n", team );
263
//            printf( "Team %d now deleted\n", team );
264
        }
264
//        }
265
        else
265
//        else
266
        {
266
//        {
267
            printf( "Team %d not defined\n", team );
267
//            printf( "Team %d not defined\n", team );
268
            beep();
268
//            beep();
269
        }
269
//        }
270
    }
270
//    }
271
}
271
//}
272
 
272
 
273
/********************************* EOF ***********************************/
273
/********************************* EOF ***********************************/