Subversion Repositories svn1-original

Rev

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

Rev 76 Rev 79
Line 110... Line 110...
110
    "Eleventh"
110
    "Eleventh"
111
};
111
};
112
 
112
 
113
int         sort_leg;
113
int         sort_leg;
114
int         sort_mode;
114
int         sort_mode;
115
bool        report_html = FALSE;
115
report_type report_html = text;
116
bool        report_all = FALSE;
116
bool        report_all = FALSE;
117
 
117
 
118
/* Parameters used by the sort routine to govern its actions */
118
/* Parameters used by the sort routine to govern its actions */
119
 
119
 
120
#define S_L     1                                /* Elasped times */
120
#define S_L     1                                /* Elasped times */
Line 172... Line 172...
172
 *
172
 *
173
 *========================================================================*/
173
 *========================================================================*/
174
 
174
 
175
void report(void)
175
void report(void)
176
{
176
{
177
    report_html = FALSE;
177
    report_html = text;
178
    if( load_report_data() )
178
    if( load_report_data() )
179
        do_menu( "Report generation", "Select option", rpt_menu );
179
        do_menu( "Report generation", "Select option", rpt_menu );
180
 
180
 
181
    if( sort_data )
181
    if( sort_data )
182
        free( ( char * ) sort_data );
182
        free( ( char * ) sort_data );
Line 243... Line 243...
243
        {
243
        {
244
            /*
244
            /*
245
            **  If printing an HTML report then we need to mark
245
            **  If printing an HTML report then we need to mark
246
            **  the entry with a reference so that we can link to it
246
            **  the entry with a reference so that we can link to it
247
            */
247
            */
248
            if ( report_html )
248
            if ( report_html == html )
249
            {
249
            {
250
                print( "<A NAME=\"Team_%04d\">",team_buf.numb );
250
                print( "<A NAME=\"Team_%04d\">",team_buf.numb );
251
                print( "</A>" );
251
                print( "</A>" );
252
            }
252
            }
253
 
253
 
Line 256... Line 256...
256
            **      - Team number - with Xref back to full result
256
            **      - Team number - with Xref back to full result
257
            **      - Full team name
257
            **      - Full team name
258
            **      - Full categoray name - with Xref to category results
258
            **      - Full categoray name - with Xref to category results
259
            **      - Country name
259
            **      - Country name
260
            */
260
            */
261
            if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "finish" ,"html")), team_buf.numb );
261
            if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "finish" ,"html")), team_buf.numb );
262
            print( "%4d",       team_buf.numb );
262
            print( "%4d",       team_buf.numb );
263
            if ( report_html ) print( "</A>" );
263
            if ( report_html == html ) print( "</A>" );
264
 
264
 
265
            print( " %-*s ",     MAX_TM_NAME, team_buf.name );
265
            print( " %-*s ",     MAX_TM_NAME, team_buf.name );
266
 
266
 
267
            if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">",url_encode(p_filename(filebase, config.team_class[team_buf.class - 1].abr ,"html")), team_buf.numb );
267
            if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">",url_encode(p_filename(filebase, config.team_class[team_buf.class - 1].abr ,"html")), team_buf.numb );
268
            print( "%-*s",     LEN_CLASS_NAME, team_buf.class == 0 ? "" : config.team_class[team_buf.class - 1].full_name );
268
            print( "%-*s",     LEN_CLASS_NAME, team_buf.class == 0 ? "" : config.team_class[team_buf.class - 1].full_name );
269
            if ( report_html ) print( "</A>" );
269
            if ( report_html == html ) print( "</A>" );
270
 
270
 
271
            print( " %-*s",     config.num_countries == 0 ? 1 : LEN_CNTRY_NAME,
271
            print( " %-*s",     config.num_countries == 0 ? 1 : LEN_CNTRY_NAME,
272
                                config.num_countries == 0
272
                                config.num_countries == 0
273
                                || team_buf.country ==
273
                                || team_buf.country ==
274
                                0 ? "" : config.country_name[team_buf.country - 1].full_name );
274
                                0 ? "" : config.country_name[team_buf.country - 1].full_name );
Line 415... Line 415...
415
    for( k = 1; k <= sort_num_data; k++, ptr++ )
415
    for( k = 1; k <= sort_num_data; k++, ptr++ )
416
    {
416
    {
417
        print( "%-*s", MAX_TM_NAME + 5, ptr->name );
417
        print( "%-*s", MAX_TM_NAME + 5, ptr->name );
418
        print( " " );
418
        print( " " );
419
        
419
        
420
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "finish" ,"html")), ptr->team );
420
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "finish" ,"html")), ptr->team );
421
        print( "%-*d", 6, ptr->leg + 1 );
421
        print( "%-*d", 6, ptr->leg + 1 );
422
        if ( report_html ) print( "</A>" );
422
        if ( report_html == html ) print( "</A>" );
423
        print( " " );
423
        print( " " );
424
 
424
 
425
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), ptr->team );
425
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), ptr->team );
426
        print( "%-*d", 5, ptr->team );
426
        print( "%-*d", 5, ptr->team );
427
        if ( report_html ) print( "</A>" );
427
        if ( report_html == html ) print( "</A>" );
428
        print( " " );
428
        print( " " );
429
 
429
 
430
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">",(p_filename(filebase, config.team_class[ptr->class - 1].abr ,"html")), ptr->team );
430
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">",(p_filename(filebase, config.team_class[ptr->class - 1].abr ,"html")), ptr->team );
431
        print( "%-*s", LEN_CLASS_NAME, ptr->class == 0 ? "" : config.team_class[ptr->class - 1].abr );
431
        print( "%-*s", LEN_CLASS_NAME, ptr->class == 0 ? "" : config.team_class[ptr->class - 1].abr );
432
        if ( report_html ) print( "</A>" );
432
        if ( report_html == html ) print( "</A>" );
433
        print( " " );
433
        print( " " );
434
 
434
 
435
        if ( ptr->multi ) print( "* ");
435
        if ( ptr->multi ) print( "* ");
436
        print( "\n" );
436
        print( "\n" );
437
    }
437
    }
Line 898... Line 898...
898
void pri_final_html(void)
898
void pri_final_html(void)
899
{
899
{
900
    /*
900
    /*
901
    **  Generate ALL results with HTML tags
901
    **  Generate ALL results with HTML tags
902
    */
902
    */
903
    report_html = TRUE;
903
    report_html = html;
904
    pri_final();
904
    pri_final();
-
 
905
    report_html = printed;
-
 
906
    pri_final();
905
    report_html = FALSE;
907
    report_html = text;
906
}
908
}
907
 
909
 
908
 
910
 
909
/*========================================================================
911
/*========================================================================
910
 *
912
 *
Line 927... Line 929...
927
    unsigned    i;
929
    unsigned    i;
928
    int         j, last_class;
930
    int         j, last_class;
929
    char        suppress_classes;                /* Boolean. Printout class files too */
931
    char        suppress_classes;                /* Boolean. Printout class files too */
930
    char        *report_title;
932
    char        *report_title;
931
    bool        class_done[MAX_CLASS+1];
933
    bool        class_done[MAX_CLASS+1];
-
 
934
    int         lcount;
932
 
935
 
933
    cur( 0, 5 );
936
    cur( 0, 5 );
934
    printf( "Generate final result printouts\n" );
937
    printf( "Generate final result printouts\n" );
935
    if( ck_data( -1, C_ELAPSED ) )
938
    if( ck_data( -1, C_ELAPSED ) )
-
 
939
        return;
936
        return;                                  /* check data for all legs */
940
                                     /* check data for all legs */
937
 
941
 
938
    /*
942
    /*
939
    **  If a non HTML report then ask if the user want to supress the class
943
    **  If a non HTML report then ask if the user want to supress the class
940
    **  printout. For an HTML report always do the class reports as the two
944
    **  printout. For an HTML report always do the class reports as the two
941
    **  are interlinked
945
    **  are interlinked
Line 969... Line 973...
969
     */
973
     */
970
    print_class_header( -1, TRUE );                      /* Print the header */
974
    print_class_header( -1, TRUE );                      /* Print the header */
971
 
975
 
972
    ptr = sort_data;
976
    ptr = sort_data;
973
    sort_team_data( 0, S_L );                     /* Re-sort on elapsed time */
977
    sort_team_data( 0, S_L );                     /* Re-sort on elapsed time */
-
 
978
    lcount = 0;
974
    for( ptr = sort_data, i = 0; i < sort_num; i++, ptr++ )
979
    for( ptr = sort_data, i = 0; i < sort_num; i++, ptr++ )
975
    {
980
    {
976
        if ( ptr->class == config.nonequestrian_class )
981
        if ( ptr->class == config.nonequestrian_class )
977
            continue;
982
            continue;
978
 
983
 
Line 980... Line 985...
980
 
985
 
981
        /*
986
        /*
982
        **  If printing an HTML report then we need to mark
987
        **  If printing an HTML report then we need to mark
983
        **  the entry with a reference so that we can link to it
988
        **  the entry with a reference so that we can link to it
984
        */
989
        */
985
        if ( report_html )
990
        if ( report_html == html )
986
        {
991
        {
987
            print( "<A NAME=\"Team_%04d\"></A>",team_buf.numb );
992
            print( "<A NAME=\"Team_%04d\"></A>",team_buf.numb );
988
        }
993
        }
989
 
994
 
990
        /*
995
        /*
991
        **  Print the basics (Finishing order)
996
        **  Print the basics (Finishing order)
992
        **      - Place within complete field
997
        **      - Place within complete field
993
        **      - Team number - with HTML reference to team file
998
        **      - Team number - with HTML reference to team file
994
        **      - Class
999
        **      - Class
995
        */
1000
        */
-
 
1001
        if ( report_html == printed && lcount %5 == 4 ) print_underline( TRUE );
996
        print( "%4.4s ", pr_place( team_buf.leg[0].l_place, ptr->flags.bad_times ) );
1002
        print( "%4.4s ", pr_place( team_buf.leg[0].l_place, ptr->flags.bad_times ) );
997
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), team_buf.numb );
1003
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), team_buf.numb );
998
        print( "%4d",  team_buf.numb );
1004
        print( "%4d",  team_buf.numb );
999
        if ( report_html ) print( "</A>" );
1005
        if ( report_html == html ) print( "</A>" );
1000
 
1006
 
1001
        print( " %-*s", 3, team_buf.class == 0 ? "" : config.team_class[team_buf.class - 1].abr );
1007
        print( " %-*s", 3, team_buf.class == 0 ? "" : config.team_class[team_buf.class - 1].abr );
1002
 
1008
 
1003
        /*
1009
        /*
1004
        **  Print the per-leg data
1010
        **  Print the per-leg data
Line 1031... Line 1037...
1031
        **      - Category place - with reference to category file
1037
        **      - Category place - with reference to category file
1032
        */
1038
        */
1033
//        print( "  %-8s ",  time_a( team_buf.leg[0].elapsed ) );
1039
//        print( "  %-8s ",  time_a( team_buf.leg[0].elapsed ) );
1034
        print( "  %-8s ", time_a( ptr->lege[0] ) );
1040
        print( "  %-8s ", time_a( ptr->lege[0] ) );
1035
        
1041
        
1036
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">",url_encode(p_filename(filebase, config.team_class[team_buf.class - 1].abr ,"html")), team_buf.numb );
1042
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">",url_encode(p_filename(filebase, config.team_class[team_buf.class - 1].abr ,"html")), team_buf.numb );
1037
        print( "%-4.4s", pr_place_ne( team_buf.leg[0].lc_place, ptr->flags.bad_times, ptr->flags.non_equestrian ) );
1043
        print( "%-4.4s", pr_place_ne( team_buf.leg[0].lc_place, ptr->flags.bad_times, ptr->flags.non_equestrian ) );
1038
        if ( report_html ) print( "</A>" );
1044
        if ( report_html == html ) print( "</A>" );
1039
 
-
 
-
 
1045
        if ( report_html == printed && lcount %5 == 4 ) print_underline( FALSE );
-
 
1046
        lcount++;
1040
        print( "\n" );
1047
        print( "\n" );
1041
    }
1048
    }
1042
 
1049
 
1043
    print_class_stats( -1, TRUE );              /* Print statistics */
1050
    print_class_stats( -1, TRUE );              /* Print statistics */
1044
    print_legend(-1, 1 );                       /* Print the legend */
1051
    print_legend(-1, 1 );                       /* Print the legend */
Line 1085... Line 1092...
1085
 
1092
 
1086
            /*
1093
            /*
1087
            **  Mark the class as done
1094
            **  Mark the class as done
1088
            */
1095
            */
1089
            class_done[ptr->class] = TRUE;
1096
            class_done[ptr->class] = TRUE;
-
 
1097
            lcount = 0;
1090
        }
1098
        }
1091
 
1099
 
1092
        /*
1100
        /*
1093
        **  Now read in the team record
1101
        **  Now read in the team record
1094
        */
1102
        */
Line 1096... Line 1104...
1096
 
1104
 
1097
        /*
1105
        /*
1098
        **  If printing an HTML report then we need to mark
1106
        **  If printing an HTML report then we need to mark
1099
        **  the entry with a reference so that we can link to it
1107
        **  the entry with a reference so that we can link to it
1100
        */
1108
        */
1101
        if ( report_html )
1109
        if ( report_html == html )
1102
            print( "<A NAME=\"Team_%04d\"></A>",team_buf.numb );
1110
            print( "<A NAME=\"Team_%04d\"></A>",team_buf.numb );
1103
 
1111
 
1104
        /*
1112
        /*
1105
        **  Print the basics
1113
        **  Print the basics
1106
        **      - Place within the class
1114
        **      - Place within the class
1107
        **      - Team number - with HTML reference to team file
1115
        **      - Team number - with HTML reference to team file
1108
        **      - Class
1116
        **      - Class
1109
        */
1117
        */
1110
 
1118
 
-
 
1119
        if ( report_html == printed && lcount %5 == 4 ) print_underline( TRUE );
1111
        print( "%4.4s ", pr_place( team_buf.leg[0].lc_place, ptr->flags.bad_times ) );
1120
        print( "%4.4s ", pr_place( team_buf.leg[0].lc_place, ptr->flags.bad_times ) );
1112
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), team_buf.numb );
1121
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), team_buf.numb );
1113
        print( "%4d",  team_buf.numb );
1122
        print( "%4d",  team_buf.numb );
1114
        if ( report_html ) print( "</A>" );
1123
        if ( report_html == html ) print( "</A>" );
1115
        print( " %-*s", 3, team_buf.class == 0 ? "" : config.team_class[team_buf.class - 1].abr );
1124
        print( " %-*s", 3, team_buf.class == 0 ? "" : config.team_class[team_buf.class - 1].abr );
1116
 
1125
 
1117
        for( j = 1; j <= config.num_legs; j++ )
1126
        for( j = 1; j <= config.num_legs; j++ )
1118
        {
1127
        {
1119
            /*
1128
            /*
Line 1137... Line 1146...
1137
        **      - Overall place - with reference to overall place file
1146
        **      - Overall place - with reference to overall place file
1138
        */
1147
        */
1139
        /* print( "  %-8s ", time_a( team_buf.leg[0].elapsed ) ); */
1148
        /* print( "  %-8s ", time_a( team_buf.leg[0].elapsed ) ); */
1140
        print( "  %-8s ", time_a( ptr->lege[0] ) );
1149
        print( "  %-8s ", time_a( ptr->lege[0] ) );
1141
 
1150
 
1142
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "finish" ,"html")), team_buf.numb );
1151
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "finish" ,"html")), team_buf.numb );
1143
        print( "%4.4s", pr_place( team_buf.leg[0].l_place, ptr->flags.bad_times || (ptr->class == config.nonequestrian_class)));
1152
        print( "%4.4s", pr_place( team_buf.leg[0].l_place, ptr->flags.bad_times || (ptr->class == config.nonequestrian_class)));
1144
        if ( report_html ) print( "</A>" );
1153
        if ( report_html == html ) print( "</A>" );
1145
 
1154
 
-
 
1155
        if ( report_html == printed && lcount %5 == 4 ) print_underline( FALSE );
-
 
1156
        lcount++;
1146
        print( "\n" );
1157
        print( "\n" );
1147
    }
1158
    }
1148
 
1159
 
1149
    print_class_stats( last_class, TRUE );
1160
    print_class_stats( last_class, TRUE );
1150
    print_legend(last_class,1);
1161
    print_legend(last_class,1);
Line 1197... Line 1208...
1197
    {
1208
    {
1198
        pri_master_index();
1209
        pri_master_index();
1199
    }
1210
    }
1200
 
1211
 
1201
    pri_name_index_body();
1212
    pri_name_index_body();
1202
 
-
 
1203
}
1213
}
1204
 
1214
 
1205
/*========================================================================
1215
/*========================================================================
1206
 *
1216
 *
1207
 *  Place to text
1217
 *  Place to text
Line 1241... Line 1251...
1241
 *      Nothing
1251
 *      Nothing
1242
 *
1252
 *
1243
 *========================================================================*/
1253
 *========================================================================*/
1244
void pri_awards_html(void)
1254
void pri_awards_html(void)
1245
{
1255
{
1246
    bool saved = report_html;
1256
    report_type saved = report_html;
1247
    /*
1257
    /*
1248
    **  Generate ALL results with HTML tags
1258
    **  Generate ALL results with HTML tags
1249
    */
1259
    */
1250
    report_html = TRUE;
1260
    report_html = html;
1251
    pri_awards();
1261
    pri_awards();
1252
    report_html = saved;
1262
    report_html = saved;
1253
}
1263
}
1254
 
1264
 
1255
/*========================================================================
1265
/*========================================================================
Line 1294... Line 1304...
1294
 
1304
 
1295
    /*
1305
    /*
1296
    **  Generate an index for this page
1306
    **  Generate an index for this page
1297
    */
1307
    */
1298
    print( "\n");
1308
    print( "\n");
1299
    if ( report_html )
1309
    if ( report_html == html )
1300
    {
1310
    {
1301
        print( "<hr>" );
1311
        print( "<hr>" );
1302
        print( "<A NAME=\"%s\"></A>",url_encode("INDEX"));
1312
        print( "<A NAME=\"%s\"></A>",url_encode("INDEX"));
1303
    }
1313
    }
1304
    print( "Award Categories");
1314
    print( "Award Categories");
Line 1320... Line 1330...
1320
                winmax = valid;
1330
                winmax = valid;
1321
        }
1331
        }
1322
 
1332
 
1323
        print( "\n");
1333
        print( "\n");
1324
        print( "    ");
1334
        print( "    ");
1325
        if ( report_html ) print( "<A HREF=\"#%s\">",url_encode(config.team_class[j-1].full_name));
1335
        if ( report_html == html ) print( "<A HREF=\"#%s\">",url_encode(config.team_class[j-1].full_name));
1326
        print( "%s",  tprintf( "%-*s", LEN_CLASS_NAME ,config.team_class[j-1].full_name ));
1336
        print( "%s",  tprintf( "%-*s", LEN_CLASS_NAME ,config.team_class[j-1].full_name ));
1327
        if ( report_html ) print( "</A>" );
1337
        if ( report_html == html ) print( "</A>" );
1328
        print( "  %3d Awards", winmax );
1338
        print( "  %3d Awards", winmax );
1329
        if ( config.class_winners[j-1] != winmax )
1339
        if ( config.class_winners[j-1] != winmax )
1330
            print( " from a maximum of %3d", config.class_winners[j-1] );
1340
            print( " from a maximum of %3d", config.class_winners[j-1] );
1331
 
1341
 
1332
    }
1342
    }
Line 1334... Line 1344...
1334
    /*
1344
    /*
1335
    **  Manual entries
1345
    **  Manual entries
1336
    */
1346
    */
1337
    print( "\n");
1347
    print( "\n");
1338
    print( "    ");
1348
    print( "    ");
1339
    if ( report_html ) print( "<A HREF=\"#%s\">",url_encode("Hall Of Fame"));
1349
    if ( report_html == html ) print( "<A HREF=\"#%s\">",url_encode("Hall Of Fame"));
1340
    print( "%s",  "Hall Of Fame" );
1350
    print( "%s",  "Hall Of Fame" );
1341
    if ( report_html ) print( "</A>" );
1351
    if ( report_html == html ) print( "</A>" );
1342
 
1352
 
1343
    print( "\n");
1353
    print( "\n");
1344
    print( "    ");
1354
    print( "    ");
1345
    if ( report_html ) print( "<A HREF=\"#%s\">",url_encode("FASTEST"));
1355
    if ( report_html == html ) print( "<A HREF=\"#%s\">",url_encode("FASTEST"));
1346
    print( "%s",  "FASTEST" );
1356
    print( "%s",  "FASTEST" );
1347
    if ( report_html ) print( "</A>" );
1357
    if ( report_html == html ) print( "</A>" );
1348
 
1358
 
1349
    /*
1359
    /*
1350
    **  Sort the data by class
1360
    **  Sort the data by class
1351
    */
1361
    */
1352
    sort_team_data( 0, S_LC );      /* Generate class placement data */
1362
    sort_team_data( 0, S_LC );      /* Generate class placement data */
Line 1360... Line 1370...
1360
    {
1370
    {
1361
        /*
1371
        /*
1362
        **  Tail for previous entry
1372
        **  Tail for previous entry
1363
        */
1373
        */
1364
        if ( j != 1 )
1374
        if ( j != 1 )
1365
            if ( report_html ) print( "<A HREF=\"#%s\">Awards Index</A>",url_encode("INDEX"));
1375
            if ( report_html == html ) print( "<A HREF=\"#%s\">Awards Index</A>",url_encode("INDEX"));
1366
 
1376
 
1367
        if ( j > config.num_class  )
1377
        if ( j > config.num_class  )
1368
            break;
1378
            break;
1369
 
1379
 
1370
        /*
1380
        /*
1371
        **  Header for the class
1381
        **  Header for the class
1372
        */
1382
        */
1373
        print( "\n");
1383
        print( "\n");
1374
        if ( report_html )
1384
        if ( report_html == html )
1375
        {
1385
        {
1376
            print( "<hr>" );
1386
            print( "<hr>" );
1377
            print( "<A name=\"%s\"></A>",url_encode(config.team_class[j-1].full_name));
1387
            print( "<A name=\"%s\"></A>",url_encode(config.team_class[j-1].full_name));
1378
        }
1388
        }
1379
        else
1389
        else
1380
        {
1390
        {
1381
            print( "%s\n", solid_line);
1391
            print( "%s\n", solid_line);
1382
        }
1392
        }
1383
        print( "Category: ");
1393
        print( "Category: ");
1384
        if ( report_html ) print( "<A HREF=\"%s\">",url_encode(p_filename(filebase, config.team_class[j - 1].abr ,"html")));
1394
        if ( report_html == html ) print( "<A HREF=\"%s\">",url_encode(p_filename(filebase, config.team_class[j - 1].abr ,"html")));
1385
        print( "%s",  config.team_class[j-1].full_name );
1395
        print( "%s",  config.team_class[j-1].full_name );
1386
        if ( report_html ) print( "</A>" );
1396
        if ( report_html == html ) print( "</A>" );
1387
 
1397
 
1388
        if ( config.class_winners[j-1] <= 0 )
1398
        if ( config.class_winners[j-1] <= 0 )
1389
        {
1399
        {
1390
            print( "\n");
1400
            print( "\n");
1391
            print( "No winners awarded" );
1401
            print( "No winners awarded" );
Line 1427... Line 1437...
1427
                /*
1437
                /*
1428
                **  If printing an HTML report then we need to mark
1438
                **  If printing an HTML report then we need to mark
1429
                **  the entry with a reference so that we can link to it
1439
                **  the entry with a reference so that we can link to it
1430
                */
1440
                */
1431
                print( "\n");
1441
                print( "\n");
1432
                if ( report_html )
1442
                if ( report_html == html )
1433
                {
1443
                {
1434
                    print( "<A NAME=\"Team_%04d\">",team_buf.numb );
1444
                    print( "<A NAME=\"Team_%04d\">",team_buf.numb );
1435
                    print( "</A>" );
1445
                    print( "</A>" );
1436
                }
1446
                }
1437
 
1447
 
Line 1442... Line 1452...
1442
                **      - Full categoray name
1452
                **      - Full categoray name
1443
                */
1453
                */
1444
                print( "%s", placing(windex) );
1454
                print( "%s", placing(windex) );
1445
 
1455
 
1446
                print( "  Team Name: ");
1456
                print( "  Team Name: ");
1447
                if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), team_buf.numb );
1457
                if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), team_buf.numb );
1448
                print( "%-*s ",     MAX_TM_NAME, team_buf.name );
1458
                print( "%-*s ",     MAX_TM_NAME, team_buf.name );
1449
                    if ( report_html ) print( "</A>" );
1459
                    if ( report_html == html ) print( "</A>" );
1450
 
1460
 
1451
                print( "  Number: ");
1461
                print( "  Number: ");
1452
                if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "finish" ,"html")), team_buf.numb );
1462
                if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "finish" ,"html")), team_buf.numb );
1453
                print( "%4d",       team_buf.numb );
1463
                print( "%4d",       team_buf.numb );
1454
                if ( report_html ) print( "</A>" );
1464
                if ( report_html == html ) print( "</A>" );
1455
 
1465
 
1456
 
1466
 
1457
                for( k = 0; k < MAX_MEMB; k++ )
1467
                for( k = 0; k < MAX_MEMB; k++ )
1458
                {
1468
                {
1459
 
1469
 
Line 1492... Line 1502...
1492
 
1502
 
1493
    /*
1503
    /*
1494
    **  Generate the Hall of Fame information
1504
    **  Generate the Hall of Fame information
1495
    */
1505
    */
1496
    print( "\n");
1506
    print( "\n");
1497
    if ( report_html )
1507
    if ( report_html == html )
1498
    {
1508
    {
1499
        print( "<hr>" );
1509
        print( "<hr>" );
1500
        print( "<A name=\"%s\"></A>",url_encode("Hall Of Fame"));
1510
        print( "<A name=\"%s\"></A>",url_encode("Hall Of Fame"));
1501
    }
1511
    }
1502
    else
1512
    else
Line 1515... Line 1525...
1515
    }
1525
    }
1516
    else
1526
    else
1517
    {
1527
    {
1518
        printf( "\n    There are no new stars for the Hall of Fame");
1528
        printf( "\n    There are no new stars for the Hall of Fame");
1519
    }
1529
    }
1520
    if ( report_html ) print( "\n");
1530
    if ( report_html == html ) print( "\n");
1521
    if ( report_html ) print( "<A HREF=\"#%s\">Awards Index</A>",url_encode("INDEX"));
1531
    if ( report_html == html ) print( "<A HREF=\"#%s\">Awards Index</A>",url_encode("INDEX"));
1522
 
1532
 
1523
    /*
1533
    /*
1524
    **  Generate the FASTEST information
1534
    **  Generate the FASTEST information
1525
    */
1535
    */
1526
    print( "\n" );
1536
    print( "\n" );
1527
    print( "\n");
1537
    print( "\n");
1528
    if ( report_html )
1538
    if ( report_html == html )
1529
    {
1539
    {
1530
        print( "<hr>" );
1540
        print( "<hr>" );
1531
        print( "<A name=\"%s\"></A>",url_encode("FASTEST"));
1541
        print( "<A name=\"%s\"></A>",url_encode("FASTEST"));
1532
    }
1542
    }
1533
    else
1543
    else
Line 1547... Line 1557...
1547
        g_record( stats.fast.team[i][0], &team_buf );
1557
        g_record( stats.fast.team[i][0], &team_buf );
1548
 
1558
 
1549
        print( "\n");
1559
        print( "\n");
1550
        print( "    %-13s ", config.leg_name[i - 1] );
1560
        print( "    %-13s ", config.leg_name[i - 1] );
1551
        print( "  Name: ");
1561
        print( "  Name: ");
1552
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), team_buf.numb );
1562
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), team_buf.numb );
1553
        print( "%-*s", MAX_PERSON_NAME, team_buf.members[i-1].name );
1563
        print( "%-*s", MAX_PERSON_NAME, team_buf.members[i-1].name );
1554
        if ( report_html ) print( "</A>" );
1564
        if ( report_html == html ) print( "</A>" );
1555
        print( "  Team :");
1565
        print( "  Team :");
1556
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "finish" ,"html")), team_buf.numb );
1566
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "finish" ,"html")), team_buf.numb );
1557
        print( "%4d" , stats.fast.team[i][0] );
1567
        print( "%4d" , stats.fast.team[i][0] );
1558
        if ( report_html ) print( "</A> " );
1568
        if ( report_html == html ) print( "</A> " );
1559
        print( "Time:%s ", time_a( stats.fast.time[i][0] ) );
1569
        print( "Time:%s ", time_a( stats.fast.time[i][0] ) );
1560
 
1570
 
1561
    }
1571
    }
1562
 
1572
 
1563
    if ( report_html ) print( "\n");
1573
    if ( report_html == html ) print( "\n");
1564
    if ( report_html ) print( "<A HREF=\"#%s\">Awards Index</A>",url_encode("INDEX"));
1574
    if ( report_html == html ) print( "<A HREF=\"#%s\">Awards Index</A>",url_encode("INDEX"));
1565
    print( "\n");
1575
    print( "\n");
1566
    close_printer();
1576
    close_printer();
1567
}
1577
}
1568
 
1578
 
1569
/*========================================================================
1579
/*========================================================================
Line 1592... Line 1602...
1592
 
1602
 
1593
void pri_master_index(void)
1603
void pri_master_index(void)
1594
{
1604
{
1595
    int j;
1605
    int j;
1596
 
1606
 
1597
    report_html = 1;
1607
    report_html = html;
1598
    if( !open_printer( "", "index", 132, report_html, "Master Index" ) )
1608
    if( !open_printer( "", "index", 132, report_html, "Master Index" ) )
1599
        return;
1609
        return;
1600
 
1610
 
1601
    /*
1611
    /*
1602
    **  Names
1612
    **  Names
Line 2030... Line 2040...
2030
    for ( leg = 1; leg <= config.num_legs; leg ++ )
2040
    for ( leg = 1; leg <= config.num_legs; leg ++ )
2031
    {
2041
    {
2032
        pri_leg_body ( leg );
2042
        pri_leg_body ( leg );
2033
        pri_eleg_body ( leg );
2043
        pri_eleg_body ( leg );
2034
        
2044
        
2035
        report_html = TRUE;
2045
        report_html = html;
2036
        
2046
        
2037
        pri_leg_body ( leg );
2047
        pri_leg_body ( leg );
2038
        pri_eleg_body ( leg );        
2048
        pri_eleg_body ( leg );        
2039
        
2049
        
2040
        report_html = FALSE;
2050
        report_html = text;
2041
    }
2051
    }
2042
 
2052
 
2043
    pri_final();
2053
    pri_final();
2044
    pri_final_html();
2054
    pri_final_html();
2045
    pri_csv_data();
2055
    pri_csv_data();
Line 2175... Line 2185...
2175
                j = 0;                           /* Leg-0 last */
2185
                j = 0;                           /* Leg-0 last */
2176
            else
2186
            else
2177
                break;
2187
                break;
2178
        }
2188
        }
2179
 
2189
 
2180
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), stats.fast.team[j][c] );
2190
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), stats.fast.team[j][c] );
2181
        print( "%4d",  stats.fast.team[j][c] );
2191
        print( "%4d",  stats.fast.team[j][c] );
2182
        if ( report_html ) print( "</A>" );
2192
        if ( report_html == html ) print( "</A>" );
2183
        print( " %s  ", time_a( stats.fast.time[j][c] ) );
2193
        print( " %s  ", time_a( stats.fast.time[j][c] ) );
2184
    }
2194
    }
2185
    print( "\n" );
2195
    print( "\n" );
2186
 
2196
 
2187
    /*
2197
    /*
Line 2245... Line 2255...
2245
        **  creating the non-equestrian report.
2255
        **  creating the non-equestrian report.
2246
        */
2256
        */
2247
        if ( class != config.nonequestrian_class  && i == config.nonequestrian_class )
2257
        if ( class != config.nonequestrian_class  && i == config.nonequestrian_class )
2248
            continue;
2258
            continue;
2249
#endif
2259
#endif
2250
        if ( report_html ) print( "<A HREF=\"%s\">",url_encode(p_filename(filebase, config.team_class[i - 1].abr ,"html")) );
2260
        if ( report_html == html ) print( "<A HREF=\"%s\">",url_encode(p_filename(filebase, config.team_class[i - 1].abr ,"html")) );
2251
        print( "%-*s", 3, config.team_class[i - 1].abr );
2261
        print( "%-*s", 3, config.team_class[i - 1].abr );
2252
        if ( report_html ) print( "</A>" );
2262
        if ( report_html == html ) print( "</A>" );
2253
        print( " : %-*s  ", LEN_CLASS_NAME, config.team_class[i - 1].full_name );
2263
        print( " : %-*s  ", LEN_CLASS_NAME, config.team_class[i - 1].full_name );
2254
 
2264
 
2255
        if( !( ++count % 5 ) )
2265
        if( !( ++count % 5 ) )
2256
            print( "\n" );
2266
            print( "\n" );
2257
    }
2267
    }
2258
 
2268
 
2259
    /*
2269
    /*
2260
    **  Add link to the finish order report
2270
    **  Add link to the finish order report
2261
    */
2271
    */
2262
    if ( report_html )
2272
    if ( report_html == html )
2263
    {
2273
    {
2264
        print( "<A HREF=\"%s\">", url_encode(p_filename(filebase, "finish" ,"html")) );
2274
        print( "<A HREF=\"%s\">", url_encode(p_filename(filebase, "finish" ,"html")) );
2265
        print( "%-*s", 3, "All" );
2275
        print( "%-*s", 3, "All" );
2266
        print( "</A>" );
2276
        print( "</A>" );
2267
        print( " : %-*s  ", LEN_CLASS_NAME, "Finishing Order" );
2277
        print( " : %-*s  ", LEN_CLASS_NAME, "Finishing Order" );