Subversion Repositories svn1-original

Rev

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

Rev 344 Rev 350
Line 739... Line 739...
739
    /*
739
    /*
740
    **  Generate ALL results with HTML tags
740
    **  Generate ALL results with HTML tags
741
    */
741
    */
742
    report_html = html;
742
    report_html = html;
743
    pri_final();
743
    pri_final();
-
 
744
    pri_final_teamOrder();
-
 
745
 
744
    report_html = printed;
746
    report_html = printed;
745
    pri_final();
747
    pri_final();
-
 
748
    pri_final_teamOrder();
746
    report_html = text;
749
    report_html = text;
747
}
750
}
748
 
751
 
749
 
752
 
750
/*========================================================================
753
/*========================================================================
Line 1075... Line 1078...
1075
    pri_name_index_body();
1078
    pri_name_index_body();
1076
}
1079
}
1077
 
1080
 
1078
/*========================================================================
1081
/*========================================================================
1079
 *
1082
 *
-
 
1083
 *  Print final results
-
 
1084
 *
-
 
1085
 *  Purpose:
-
 
1086
 *      This function is called to Print final results in Team Order
-
 
1087
 *
-
 
1088
 *  Parameters:
-
 
1089
 *      None
-
 
1090
 *
-
 
1091
 *  Returns:
-
 
1092
 *      Nothing
-
 
1093
 *
-
 
1094
 *========================================================================*/
-
 
1095
 
-
 
1096
void pri_final_teamOrder(void)
-
 
1097
{
-
 
1098
    ty_s_data  *ptr;
-
 
1099
    team_type   team_buf;
-
 
1100
    unsigned    i;
-
 
1101
    int         j;
-
 
1102
    int         lcount;
-
 
1103
 
-
 
1104
    if( ck_data( -1, C_ELAPSED ) )
-
 
1105
        return;
-
 
1106
    /*
-
 
1107
    **  Sort on every thing
-
 
1108
    **  Then generate all the stats too
-
 
1109
    */
-
 
1110
    do_big_sort();
-
 
1111
    gen_stats();
-
 
1112
 
-
 
1113
    /*
-
 
1114
     * Now print the data on the printer 
-
 
1115
     */
-
 
1116
    if( !open_printer( "", "team_order", 132, report_html, "Team Order" ) )
-
 
1117
        return;
-
 
1118
 
-
 
1119
    /*
-
 
1120
     * Print out the data 
-
 
1121
     */
-
 
1122
    print_class_header( -1, TRUE );                      /* Print the header */
-
 
1123
 
-
 
1124
    ptr = sort_data;
-
 
1125
    sort_team_data( 0, S_TEAM, true );                   /* Re-sort on team number */
-
 
1126
    lcount = 0;
-
 
1127
    for( ptr = sort_data, i = 0; i < sort_num; i++, ptr++ )
-
 
1128
    {
-
 
1129
        if ( ptr->teamclass == config.nonequestrian_class )
-
 
1130
            continue;
-
 
1131
 
-
 
1132
        g_record( ptr->team, &team_buf );
-
 
1133
 
-
 
1134
        /*
-
 
1135
        ** If this is a NE team then dummy up some of the data that hasn't been stored in team_buf
-
 
1136
        */
-
 
1137
        if (ptr->flags.non_equestrian)
-
 
1138
        {
-
 
1139
            team_buf.leg[0].l_place = sort_aux[ptr->team].leq_place[0];
-
 
1140
            team_buf.leg[0].lc_place = sort_aux[ptr->team].lq_place[0];;
-
 
1141
        }
-
 
1142
 
-
 
1143
        /*
-
 
1144
        **  If printing an HTML report then we need to mark
-
 
1145
        **  the entry with a reference so that we can link to it
-
 
1146
        */
-
 
1147
        if ( report_html == html )
-
 
1148
        {
-
 
1149
            print( "<A NAME=\"Team_%04d\"></A>",team_buf.numb );
-
 
1150
        }
-
 
1151
 
-
 
1152
        /*
-
 
1153
        **  Print the basics (Finishing order)
-
 
1154
        **      - Place within complete field
-
 
1155
        **      - Team number - with HTML reference to team file
-
 
1156
        **      - Class
-
 
1157
        */
-
 
1158
        if ( report_html == printed && lcount %5 == 4 ) print_underline( TRUE );
-
 
1159
        print( "%4.4s ", pn_place( team_buf.leg[0].l_place, ptr->flags.bad_times, ptr->flags.non_equestrian ) );
-
 
1160
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), team_buf.numb );
-
 
1161
        print( "%4d",  team_buf.numb );
-
 
1162
        if ( report_html == html ) print( "</A>" );
-
 
1163
 
-
 
1164
        print( " %-*s", 3, team_buf.teamclass == 0 ? "" : config.team_class[team_buf.teamclass - 1].abr );
-
 
1165
 
-
 
1166
        /*
-
 
1167
        **  Print the per-leg data
-
 
1168
        **      - Time
-
 
1169
        **      - Leg place
-
 
1170
        **      - End place
-
 
1171
        */
-
 
1172
        for( j = 1; j <= config.num_legs; j++ )
-
 
1173
        {
-
 
1174
            bool isEquestrianLeg = (j == config.equestrian_leg && team_buf.flags.non_equestrian);
-
 
1175
            bool afterEquestrianLeg = (team_buf.flags.non_equestrian && j > config.equestrian_leg);
-
 
1176
            /*
-
 
1177
            **  Ensure that non-equestrian leg data is not displayed
-
 
1178
            */
-
 
1179
            if ( isEquestrianLeg )
-
 
1180
            {
-
 
1181
                print( "  %-8s %4.4s %4.4s", "-- NE --", "NE","NE");
-
 
1182
            }
-
 
1183
            else
-
 
1184
            {
-
 
1185
                print( "  %-8s %4.4s %4.4s",
-
 
1186
                    time_a( team_buf.leg[j].elapsed ),
-
 
1187
                    pr_place( team_buf.leg[j].l_place, ptr->flags.bad_times ),
-
 
1188
                    pn_place( team_buf.leg[j].le_place,ptr->flags.bad_times, afterEquestrianLeg )
-
 
1189
                  );
-
 
1190
            }
-
 
1191
        }
-
 
1192
 
-
 
1193
       /*
-
 
1194
        **  Print the trailer (Finishing order)
-
 
1195
        **      - Total time
-
 
1196
        **      - Category place - with reference to category file
-
 
1197
        */
-
 
1198
//        print( "  %-8s ",  time_a( team_buf.leg[0].elapsed ) );
-
 
1199
        print( "  %-8s ", time_a( ptr->lege[0] ) );
-
 
1200
        
-
 
1201
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">",url_encode(p_filename(filebase, config.team_class[team_buf.teamclass - 1].abr ,"html")), team_buf.numb );
-
 
1202
        print( "%-4.4s", pn_place( team_buf.leg[0].lc_place, ptr->flags.bad_times, ptr->flags.non_equestrian && 0 ) );
-
 
1203
        if ( report_html == html ) print( "</A>" );
-
 
1204
        if ( report_html == printed && lcount %5 == 4 ) print_underline( FALSE );
-
 
1205
        lcount++;
-
 
1206
        print( "\n" );
-
 
1207
    }
-
 
1208
 
-
 
1209
    print_class_stats( -1, TRUE );              /* Print statistics */
-
 
1210
    print_legend(-1, 1 );                       /* Print the legend */
-
 
1211
    close_printer();                            /* Close the printer */
-
 
1212
 
-
 
1213
}
-
 
1214
 
-
 
1215
/*========================================================================
-
 
1216
 *
1080
 *  Place to text
1217
 *  Place to text
1081
 *
1218
 *
1082
 *  Purpose:
1219
 *  Purpose:
1083
 *      This function is called to convert a place to text
1220
 *      This function is called to convert a place to text
1084
 *
1221
 *
Line 1729... Line 1866...
1729
    */
1866
    */
1730
    print( "<TABLE border=0 align=center>" );
1867
    print( "<TABLE border=0 align=center>" );
1731
    pri_master_index_entry( "name", "Team list" );
1868
    pri_master_index_entry( "name", "Team list" );
1732
    pri_master_index_entry( "competitor", "Competitor list" );
1869
    pri_master_index_entry( "competitor", "Competitor list" );
1733
    pri_master_index_entry( "finish", "Finishing Order for all Teams" );
1870
    pri_master_index_entry( "finish", "Finishing Order for all Teams" );
-
 
1871
    pri_master_index_entry( "team_order", "All Teams with results" );
1734
    pri_master_index_entry( "awards", "Prizes and Awards" );
1872
    pri_master_index_entry( "awards", "Prizes and Awards" );
1735
    print( "<tr><td>\n" );
1873
    print( "<tr><td>\n" );
1736
 
1874
 
1737
    print( "\n" );
1875
    print( "\n" );
1738
    for( j = 1; j <= config.num_class; j++ )
1876
    for( j = 1; j <= config.num_class; j++ )
Line 1759... Line 1897...
1759
    print( "<TABLE border=0 align=center>" );
1897
    print( "<TABLE border=0 align=center>" );
1760
#if 1
1898
#if 1
1761
    pri_master_index_entry( "name", "Team list" );
1899
    pri_master_index_entry( "name", "Team list" );
1762
    pri_master_index_entry( "competitor", "Competitor list" );
1900
    pri_master_index_entry( "competitor", "Competitor list" );
1763
    pri_master_index_entry( "finish", "Finishing Order for all Teams" );
1901
    pri_master_index_entry( "finish", "Finishing Order for all Teams" );
-
 
1902
    pri_master_index_entry( "team_order", "All Teams with results" );
1764
    pri_master_index_entry( "awards", "Prizes and Awards" );
1903
    pri_master_index_entry( "awards", "Prizes and Awards" );
1765
    print( "<tr><td>\n" );
1904
    print( "<tr><td>\n" );
1766
 
1905
 
1767
    print( "\n" );
1906
    print( "\n" );
1768
    pri_master_index_entry( "summary", "Category Summary" );
1907
    pri_master_index_entry( "summary", "Category Summary" );
Line 2167... Line 2306...
2167
        
2306
        
2168
        report_html = text;
2307
        report_html = text;
2169
    }
2308
    }
2170
 
2309
 
2171
    pri_final();
2310
    pri_final();
-
 
2311
    pri_final_teamOrder();
2172
    pri_final_html();
2312
    pri_final_html();
2173
    pri_csv_data();
2313
    pri_csv_data();
2174
    pri_summary_html();
2314
    pri_summary_html();
2175
    pri_summary();
2315
    pri_summary();
2176
    pri_awards_html();
2316
    pri_awards_html();