Subversion Repositories svn1-original

Rev

Rev 59 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 59 Rev 60
Line 56... Line 56...
56
#endif
56
#endif
57
#include    "consts.h"
57
#include    "consts.h"
58
#include    "structs.h"
58
#include    "structs.h"
59
#include    "proto.h"
59
#include    "proto.h"
60
 
60
 
-
 
61
void pri_awards_html(void);
61
void pri_awards(void);
62
void pri_awards(void);
62
void pri_master_index(void);
63
void pri_master_index(void);
63
char *placing ( int place );
64
char *placing ( int place );
64
void pri_name_index(void);
65
void pri_name_index(void);
65
void pri_name_index_body( void );
66
void pri_name_index_body( void );
Line 77... Line 78...
77
    { '5', "Print final results(All-HTML)", pri_final_html },
78
    { '5', "Print final results(All-HTML)", pri_final_html },
78
    { '6', "Print Interim results", pri_interim },
79
    { '6', "Print Interim results", pri_interim },
79
    { '7', "Update event and class placings", srt_place },
80
    { '7', "Update event and class placings", srt_place },
80
    { '8', "Display summary information", display_summary },
81
    { '8', "Display summary information", display_summary },
81
    { '9', "Print summary information", pri_summary },
82
    { '9', "Print summary information", pri_summary },
82
    { 'a', "Print Awards only", pri_awards },
83
    { 'a', "Print Awards only", pri_awards_html },
83
    { 'b', "Print Master Index only", pri_master_index },
84
    { 'b', "Print Master Index only", pri_master_index },
84
    { 'c', "Print Name Index only", pri_name_index },
85
    { 'c', "Print Name Index only", pri_name_index },
85
    { 'e', "Export CSV Report Data", pri_csv_data },
86
    { 'e', "Export CSV Report Data", pri_csv_data },
86
    { 'z', "Print all reports", pri_all_reports },
87
    { 'z', "Print all reports", pri_all_reports },
87
    
88
    
Line 1184... Line 1185...
1184
    **  Generate the awards report.
1185
    **  Generate the awards report.
1185
    **  This is only available as an HTML report
1186
    **  This is only available as an HTML report
1186
    */
1187
    */
1187
    if ( report_html )
1188
    if ( report_html )
1188
    {
1189
    {
1189
        pri_awards();
1190
        pri_awards_html();
1190
    }
1191
    }
1191
 
1192
 
1192
    /*
1193
    /*
1193
    **  Generate the master index page
1194
    **  Generate the master index page
1194
    */
1195
    */
Line 1238... Line 1239...
1238
 *
1239
 *
1239
 *  Returns:
1240
 *  Returns:
1240
 *      Nothing
1241
 *      Nothing
1241
 *
1242
 *
1242
 *========================================================================*/
1243
 *========================================================================*/
-
 
1244
void pri_awards_html(void)
-
 
1245
{
-
 
1246
    /*
-
 
1247
    **  Generate ALL results with HTML tags
-
 
1248
    */
-
 
1249
    report_html = TRUE;
-
 
1250
    pri_awards();
-
 
1251
    report_html = FALSE;
-
 
1252
}
-
 
1253
 
-
 
1254
/*========================================================================
-
 
1255
 *
-
 
1256
 *  Print award results
-
 
1257
 *
-
 
1258
 *  Purpose:
-
 
1259
 *      This function is called to Print award results
-
 
1260
 *      Keep the page to 80 cols, so that it can be pronted on A4
-
 
1261
 *
-
 
1262
 *  Parameters:
-
 
1263
 *      None
-
 
1264
 *
-
 
1265
 *  Returns:
-
 
1266
 *      Nothing
-
 
1267
 *
-
 
1268
 *========================================================================*/
1243
void pri_awards(void)
1269
void pri_awards(void)
1244
{
1270
{
1245
    int j;
1271
    int j;
1246
    int i;
1272
    int i;
1247
    int k;
1273
    int k;
1248
    int windex;
1274
    int windex;
1249
    ty_s_data  *ptr;
1275
    ty_s_data  *ptr;
1250
    int         last_class;
1276
    int         last_class;
1251
 
1277
 
1252
    report_html = 1;
-
 
1253
    if( !open_printer( "", "awards", 80, report_html, "Prizes and Awards" ) )
1278
    if( !open_printer( "", "awards", 80, report_html, "Prizes and Awards" ) )
1254
        return;
1279
        return;
1255
 
1280
 
1256
    /*
1281
    /*
1257
    **  Generate an index for this page
1282
    **  Generate an index for this page
1258
    */
1283
    */
1259
    print( "\n");
1284
    print( "\n");
-
 
1285
    if ( report_html )
-
 
1286
    {
1260
    print( "<hr>" );
1287
        print( "<hr>" );
1261
    print( "<A NAME=\"%s\"></A>","INDEX");
1288
        print( "<A NAME=\"%s\"></A>","INDEX");
-
 
1289
    }
1262
    print( "Award Categories");
1290
    print( "Award Categories");
1263
 
1291
 
1264
    for( j = 1; j <= config.num_class; j++ )
1292
    for( j = 1; j <= config.num_class; j++ )
1265
    {
1293
    {
1266
        /*
1294
        /*
Line 1268... Line 1296...
1268
        */
1296
        */
1269
        if ( config.class_winners[j-1] <= 0 )
1297
        if ( config.class_winners[j-1] <= 0 )
1270
            continue;
1298
            continue;
1271
 
1299
 
1272
        print( "\n");
1300
        print( "\n");
-
 
1301
        print( "    ");
1273
        print( "    <A HREF=\"#%s\">",config.team_class[j-1].full_name);
1302
        if ( report_html ) print( "<A HREF=\"#%s\">",config.team_class[j-1].full_name);
1274
        print( "%s",  config.team_class[j-1].full_name );
1303
        print( "%s",  config.team_class[j-1].full_name );
1275
        print( "</A>" );
1304
        if ( report_html ) print( "</A>" );
1276
    }
1305
    }
1277
 
1306
 
1278
    /*
1307
    /*
1279
    **  Manual entries
1308
    **  Manual entries
1280
    */
1309
    */
1281
    print( "\n");
1310
    print( "\n");
-
 
1311
    print( "    ");
1282
    print( "    <A HREF=\"#%s\">","Hall Of Fame");
1312
    if ( report_html ) print( "<A HREF=\"#%s\">","Hall Of Fame");
1283
    print( "%s",  "Hall Of Fame" );
1313
    print( "%s",  "Hall Of Fame" );
1284
    print( "</A>" );
1314
    if ( report_html ) print( "</A>" );
1285
 
1315
 
1286
    print( "\n");
1316
    print( "\n");
-
 
1317
    print( "    ");
1287
    print( "    <A HREF=\"#%s\">","FASTEST");
1318
    if ( report_html ) print( "<A HREF=\"#%s\">","FASTEST");
1288
    print( "%s",  "FASTEST" );
1319
    print( "%s",  "FASTEST" );
1289
    print( "</A>" );
1320
    if ( report_html ) print( "</A>" );
1290
 
1321
 
1291
    /*
1322
    /*
1292
    **  Sort the data by class
1323
    **  Sort the data by class
1293
    */
1324
    */
1294
    sort_team_data( 0, S_LC );      /* Generate class placement data */
1325
    sort_team_data( 0, S_LC );      /* Generate class placement data */
Line 1301... Line 1332...
1301
    {
1332
    {
1302
        /*
1333
        /*
1303
        **  Tail for previous entry
1334
        **  Tail for previous entry
1304
        */
1335
        */
1305
        if ( j != 1 )
1336
        if ( j != 1 )
1306
            print( "<A HREF=\"#%s\">Awards Index</A>","INDEX");
1337
            if ( report_html ) print( "<A HREF=\"#%s\">Awards Index</A>","INDEX");
1307
 
1338
 
1308
        if ( j > config.num_class  )
1339
        if ( j > config.num_class  )
1309
            break;
1340
            break;
1310
 
1341
 
1311
        /*
1342
        /*
1312
        **  Header for the class
1343
        **  Header for the class
1313
        */
1344
        */
1314
        print( "\n");
1345
        print( "\n");
-
 
1346
        if ( report_html )
-
 
1347
        {
1315
        print( "<hr>" );
1348
            print( "<hr>" );
1316
        print( "<A name=\"%s\"></A>",config.team_class[j-1].full_name);
1349
            print( "<A name=\"%s\"></A>",config.team_class[j-1].full_name);
-
 
1350
        }
-
 
1351
        else
-
 
1352
        {
-
 
1353
            print( "\n");
-
 
1354
        }
-
 
1355
        print( "Category: ");
1317
        print( "<A HREF=\"%s\">",p_filename(filebase, config.team_class[j - 1].abr ,"html"));
1356
        if ( report_html ) print( "<A HREF=\"%s\">",p_filename(filebase, config.team_class[j - 1].abr ,"html"));
1318
        print( "%s",  config.team_class[j-1].full_name );
1357
        print( "%s",  config.team_class[j-1].full_name );
1319
        print( "</A>" );
1358
        if ( report_html ) print( "</A>" );
1320
 
1359
 
1321
                if ( config.class_winners[j-1] <= 0 )
1360
        if ( config.class_winners[j-1] <= 0 )
1322
        {
1361
        {
1323
            print( "\n");
1362
            print( "\n");
1324
            print( "No winners awarded" );
1363
            print( "No winners awarded" );
1325
            continue;
1364
            continue;
1326
        }
1365
        }
Line 1346... Line 1385...
1346
                /*
1385
                /*
1347
                **  If printing an HTML report then we need to mark
1386
                **  If printing an HTML report then we need to mark
1348
                **  the entry with a reference so that we can link to it
1387
                **  the entry with a reference so that we can link to it
1349
                */
1388
                */
1350
                print( "\n");
1389
                print( "\n");
-
 
1390
                if ( report_html )
-
 
1391
                {
1351
                print( "<A NAME=\"Team_%04d\">",team_buf.numb );
1392
                    print( "<A NAME=\"Team_%04d\">",team_buf.numb );
1352
                print( "</A>" );
1393
                    print( "</A>" );
-
 
1394
                }
1353
 
1395
 
1354
                /*
1396
                /*
1355
                **  Basic information
1397
                **  Basic information
1356
                **      - Team number - with Xref back to full result
1398
                **      - Team number - with Xref back to full result
1357
                **      - Full team name
1399
                **      - Full team name
1358
                **      - Full categoray name
1400
                **      - Full categoray name
1359
                */
1401
                */
1360
                print( "%s", placing(windex) );
1402
                print( "%s", placing(windex) );
1361
 
1403
 
-
 
1404
                print( "  Team Name: ");
1362
                print( "  Team Name: <A HREF=\"%s#Team_%04d\">", p_filename(filebase, "name" ,"html"), team_buf.numb );
1405
                if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", p_filename(filebase, "name" ,"html"), team_buf.numb );
1363
                print( "%-*s ",     MAX_TM_NAME, team_buf.name );
1406
                print( "%-*s ",     MAX_TM_NAME, team_buf.name );
1364
                print( "</A>" );
1407
                    if ( report_html ) print( "</A>" );
1365
 
1408
 
-
 
1409
                print( "  Number: ");
1366
                print( "  Number: <A HREF=\"%s#Team_%04d\">", p_filename(filebase, "finish" ,"html"), team_buf.numb );
1410
                if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", p_filename(filebase, "finish" ,"html"), team_buf.numb );
1367
                print( "%4d",       team_buf.numb );
1411
                print( "%4d",       team_buf.numb );
1368
                print( "</A>" );
1412
                if ( report_html ) print( "</A>" );
1369
 
1413
 
1370
 
1414
 
1371
                for( k = 0; k < MAX_MEMB; k++ )
1415
                for( k = 0; k < MAX_MEMB; k++ )
1372
                {
1416
                {
1373
 
1417
 
Line 1406... Line 1450...
1406
 
1450
 
1407
    /*
1451
    /*
1408
    **  Generate the Hall of Fame information
1452
    **  Generate the Hall of Fame information
1409
    */
1453
    */
1410
    print( "\n");
1454
    print( "\n");
-
 
1455
    if ( report_html )
-
 
1456
    {
1411
    print( "<hr>" );
1457
        print( "<hr>" );
1412
    print( "<A name=\"%s\"></A>","Hall Of Fame");
1458
        print( "<A name=\"%s\"></A>","Hall Of Fame");
-
 
1459
    }
1413
    print( "%s",  "Hall of Fame" );
1460
    print( "%s",  "Hall of Fame" );
1414
 
1461
 
1415
    if ( config.num_fame  )
1462
    if ( config.num_fame  )
1416
    {
1463
    {
1417
        for( i = 1; i <= config.num_fame; i++ )
1464
        for( i = 1; i <= config.num_fame; i++ )
1418
        {
1465
        {
-
 
1466
            print( "\n");
1419
            print( "\n    %-*s", MAX_PERSON_NAME, config.hall_fame[i-1] );
1467
            print( "    %-*s", MAX_PERSON_NAME, config.hall_fame[i-1] );
1420
        }
1468
        }
1421
    }
1469
    }
1422
    else
1470
    else
1423
    {
1471
    {
1424
        printf( "\n    There are no new stars for the Hall of Fame");
1472
        printf( "\n    There are no new stars for the Hall of Fame");
1425
    }
1473
    }
1426
    print( "<p><A HREF=\"#%s\">Awards Index</A>","INDEX");
1474
    if ( report_html ) print( "<p><A HREF=\"#%s\">Awards Index</A>","INDEX");
1427
 
1475
 
1428
    /*
1476
    /*
1429
    **  Generate the FASTEST information
1477
    **  Generate the FASTEST information
1430
    */
1478
    */
-
 
1479
    print( "\n" );
-
 
1480
    if ( report_html )
-
 
1481
    {
1431
    print( "<hr>" );
1482
        print( "<hr>" );
1432
    print( "<A name=\"%s\"></A>","FASTEST");
1483
        print( "<A name=\"%s\"></A>","FASTEST");
-
 
1484
    }
-
 
1485
    else
-
 
1486
    {
-
 
1487
        print( "\n" );
-
 
1488
    }
1433
    print( "%s",  "FASTEST" );
1489
    print( "%s",  "FASTEST" );
1434
 
1490
 
1435
    /*
1491
    /*
1436
    **  Sort the data and then generate the stats - again
1492
    **  Sort the data and then generate the stats - again
1437
    */
1493
    */
Line 1442... Line 1498...
1442
    {
1498
    {
1443
        g_record( stats.fast.team[i][0], &team_buf );
1499
        g_record( stats.fast.team[i][0], &team_buf );
1444
 
1500
 
1445
        print( "\n");
1501
        print( "\n");
1446
        print( "    %-13s ", config.leg_name[i - 1] );
1502
        print( "    %-13s ", config.leg_name[i - 1] );
-
 
1503
        print( "  Name: ");
1447
        print( "  Name: <A HREF=\"%s#Team_%04d\">", p_filename(filebase, "name" ,"html"), team_buf.numb );
1504
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", p_filename(filebase, "name" ,"html"), team_buf.numb );
1448
        print( "%-*s", MAX_PERSON_NAME, team_buf.members[i-1].name );
1505
        print( "%-*s", MAX_PERSON_NAME, team_buf.members[i-1].name );
-
 
1506
        if ( report_html ) print( "</A>" );
1449
        print( "</A>" );
1507
        print( "  Team :");
1450
        print( "  Team :<A HREF=\"%s#Team_%04d\">", p_filename(filebase, "finish" ,"html"), team_buf.numb );
1508
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", p_filename(filebase, "finish" ,"html"), team_buf.numb );
1451
        print( "%4d" , stats.fast.team[i][0] );
1509
        print( "%4d" , stats.fast.team[i][0] );
1452
        print( "</A> " );
1510
        if ( report_html ) print( "</A> " );
1453
        print( "Time:%s ", time_a( stats.fast.time[i][0] ) );
1511
        print( "Time:%s ", time_a( stats.fast.time[i][0] ) );
1454
 
1512
 
1455
    }
1513
    }
1456
 
1514
 
1457
 
-
 
1458
 
-
 
1459
 
-
 
1460
    print( "<p><A HREF=\"#%s\">Awards Index</A>","INDEX");
1515
    if ( report_html ) print( "<p><A HREF=\"#%s\">Awards Index</A>","INDEX");
-
 
1516
    print( "\n");
1461
    close_printer();
1517
    close_printer();
1462
}
1518
}
1463
 
1519
 
1464
/*========================================================================
1520
/*========================================================================
1465
 *
1521
 *
Line 1937... Line 1993...
1937
 
1993
 
1938
    pri_final();
1994
    pri_final();
1939
    pri_final_html();
1995
    pri_final_html();
1940
    pri_csv_data();
1996
    pri_csv_data();
1941
    pri_summary();
1997
    pri_summary();
-
 
1998
    pri_awards_html();
1942
    pri_awards();
1999
    pri_awards();
1943
    pri_master_index();
2000
    pri_master_index();
1944
   
2001
   
1945
    report_all = FALSE;
2002
    report_all = FALSE;
1946
}
2003
}