Virtual U.org
Get Personal Training on VU Today
    
Top shadow
 
 register/help
User Name:

Password:

Ofac_sum.cpp Source File
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Ofac_sum.cpp

Go to the documentation of this file.
00001 //Filename    : OFAC_SUM.CPP
00002 //Description : Faculty Report
00003 
00004 #include <KEY.H>
00005 #include <OVGA.H>
00006 #include <OFONT.H>
00007 #include <OWORLD.H>
00008 #include <OSYS.H>
00009 #include <OBOX.H>
00010 #include <OHELP.H>
00011 #include <OPSCHOOL.H>
00012 #include <OINFO.H>
00013 #include <OIFACE.H>
00014 #include <OBUTTON.H>
00015 #include <OTEXT.H>
00016 #include <ODEPT.H>
00017 #include <OFINANCE.H>
00018 #include <OGAMESTR.H>
00019 #include <OFACULTY.H>
00020 #include <OFACURES.H>
00021 #include <OGRPHYR.H>
00022 #include <OGRPHMTH.H>
00023 #include <OPIECHRT.H>
00024 #include <OGRPH_PY.H>
00025 #include <OGRPH_PM.H>
00026 #include <OGRPH_PT.H>
00027 #include <OGRPDYR.H>
00028 #include <OGRPDMTH.H>
00029 #include <OVALSLDR.H>
00030 #include <ORADIO.H>
00031 #include <OMOUSE.H>
00032 
00033 //---------- Define constant ------------//
00034 
00035 enum {
00036     REPORT_X1 = ZOOM_X1+15,
00037     REPORT_Y1 = ZOOM_Y1+15,
00038     REPORT_X2 = ZOOM_X2-15,
00039     REPORT_Y2 = ZOOM_Y2-40,
00040 };
00041 
00042 enum { BUTTON_Y1=REPORT_Y2+10 };
00043 enum { BUTTON_WIDTH=80, BUTTON_HEIGHT=20 };
00044 
00045 enum { REPORT_TYPE_LIST, REPORT_TYPE_DETAIL, REPORT_RETIRE };
00046 enum { FACULTY_REC_HEIGHT = 84, RESEARCH_REC_HEIGHT = 16 };
00047 
00048 //--------- Define report modes ----------//
00049 
00050 enum {                                            // the bg image id
00051     BG_PIC_ID = 13
00052 };
00053 
00054 #if(GAME_VERSION>=200)
00055 enum { FAC_SUM_REPORT_TYPE_COUNT = 14 };
00056 
00057 enum {
00058     REPORT_TYPE_DEPARTMENT_PROFILE1,
00059     REPORT_TYPE_DEPARTMENT_PROFILE2,
00060     REPORT_TYPE_DEPARTMENT_ACTIVITIES,
00061     REPORT_TYPE_DEPARTMENT_RESEARCH,
00062     REPORT_TYPE_DEPARTMENT_HIRING,
00063     REPORT_TYPE_DEPARTMENT_DIRECTORY,
00064     REPORT_TYPE_DEPARTMENT_TURNOVER,
00065     REPORT_TYPE_INSTITUTION_PROFILE1,
00066     REPORT_TYPE_INSTITUTION_PROFILE2,
00067     REPORT_TYPE_INSTITUTION_ACTIVITIES,
00068     REPORT_TYPE_INSTITUTION_RESEARCH,
00069     REPORT_TYPE_INSTITUTION_SALARY,
00070     REPORT_TYPE_INSTITUTION_PROMOTION,
00071     REPORT_TYPE_INSTITUTION_TURNOVER,
00072     REPORT_TYPE_DEPARTMENT_TURNOVER_DETAIL,
00073 };
00074 
00075 enum {
00076     FACULTY_LISTS,
00077     FACULTY_DETAILS,
00078 };
00079 
00080 #else
00081 enum { FAC_SUM_REPORT_TYPE_COUNT = 12 };
00082 
00083 enum {
00084     REPORT_TYPE_DEPARTMENT_PROFILE1,
00085     REPORT_TYPE_DEPARTMENT_PROFILE2,
00086     REPORT_TYPE_DEPARTMENT_ACTIVITIES,
00087     REPORT_TYPE_DEPARTMENT_RESEARCH,
00088     REPORT_TYPE_DEPARTMENT_DIRECTORY,
00089     REPORT_TYPE_DEPARTMENT_HIRING,
00090     REPORT_TYPE_INSTITUTION_PROFILE1,
00091     REPORT_TYPE_INSTITUTION_PROFILE2,
00092     REPORT_TYPE_INSTITUTION_ACTIVITIES,
00093     REPORT_TYPE_INSTITUTION_RESEARCH,
00094     REPORT_TYPE_INSTITUTION_SALARY,
00095     REPORT_TYPE_INSTITUTION_PROMOTION,
00096 };
00097 #endif
00098 
00099 enum { REPORT_MODE_COUNT = 2 };
00100 enum { REPORT_MODE_INSTITUTION, REPORT_MODE_DEPARTMENT};
00101 
00102 enum {
00103     BOTTOM_BUTTON_X1 = REPORT_X1+90,
00104     BOTTOM_BUTTON_Y1 = REPORT_Y2-20,
00105     BOTTOM_BUTTON_TAB1 = 400,
00106     BOTTOM_BUTTON_X2 = REPORT_X2-20,
00107     BOTTOM_BUTTON_Y2 = REPORT_Y2+10
00108 };
00109 
00110 #if(GAME_VERSION>=200)
00111 enum {
00112     BOTTOM_BUTTON_WIDTH = 74,
00113     BOTTOM_BUTTON_WIDTH2 = 78,
00114     BOTTOM_BUTTON_HEIGHT = 22,
00115     BOTTOM_BUTTON_DISTANCE
00116     = (BOTTOM_BUTTON_X2-BOTTOM_BUTTON_X1-BOTTOM_BUTTON_WIDTH2*7)/8
00117 };
00118 #else
00119 enum {
00120     BOTTOM_BUTTON_WIDTH = 87,
00121     BOTTOM_BUTTON_WIDTH2 = 80,
00122     BOTTOM_BUTTON_HEIGHT = 22,
00123     BOTTOM_BUTTON_DISTANCE
00124     = (BOTTOM_BUTTON_X2-BOTTOM_BUTTON_X1-BOTTOM_BUTTON_WIDTH2*6)/7
00125 };
00126 #endif
00127 
00128 static ButtonGroup type_button_group(FAC_SUM_REPORT_TYPE_COUNT);
00129 //static short *type_button_up_bitmap[FAC_SUM_REPORT_TYPE_COUNT];
00130 //static short *type_button_down_bitmap[FAC_SUM_REPORT_TYPE_COUNT];
00131 
00132 #if(GAME_VERSION>=200)
00133 enum {
00134     TAB1=20,
00135     TAB2=200,
00136     TAB3=210,
00137     TAB4=480,
00138     TAB5=500,
00139     TAB6=610,
00140     TAB7=80,
00141     VTAB1=22,
00142     VTAB2=160,
00143     VTAB3=180,
00144     VTAB4=310,
00145     VTAB5=420,
00146     VTAB6=22,
00147 };
00148 #else
00149 enum {
00150     TAB1=20,
00151     TAB2=200,
00152     TAB3=210,
00153     TAB4=450,
00154     TAB5=500,
00155     TAB6=610,
00156     VTAB1=5,
00157     VTAB2=160,
00158     VTAB3=180,
00159     VTAB4=310,
00160     VTAB5=420,
00161 };
00162 #endif
00163 
00164 enum { MONTHLY=0,ANNUALLY=1 };
00165 
00166 static short *text_refresh_bitmap1;
00167 
00168 static Department* cur_dept_ptr;
00169 // the department whose faculty we are looking at
00170 
00171 #if(GAME_VERSION>=200)
00172 static char* fac_avg_salary_label[] ={ "Avg. Salary", "# of", "% of", "initial" };
00173 #endif
00174 
00175 static char* reportModeStrArray[] = { "Summary 1", "Summary 2" };
00176 static char* fac_sum_rank_label[] = {
00177     "Assistant professor",
00178     "Associate professor",
00179     "Full professor",
00180     "Long-term adjunct",
00181     "Short-term adjunct",
00182     "Total",
00183 };
00184 
00185 static char* fac_sum_ge_label[] = {
00186     "Male nonminority",
00187     "Female nonminority",
00188     "Male minority",
00189     "Female minority",
00190     "Total",
00191     "Total",
00192 };
00193 static char* fac_sum_title[] = {
00194     "Faculty Distribution by Rank",
00195     "Faculty Distribution by Gender and Ethnicity",
00196 #if(GAME_VERSION>=200)
00197     "Faculty Changes & Adjustments",
00198 #endif
00199 };
00200 
00201 static char* std_sum_title2[] = {
00202     "Talent\t\t\tPerformance",
00203     "The number of degrees awarded",
00204 };
00205 
00206 static char* std_sum_label2[] = {
00207     "Teaching","Scholarship","Research","Normal Teaching load","Course preparation",
00208     "Out-of-class student contact","Educational development",
00209     "Research","Scholarship","Institutional and public service","Average faculty work hours per week",
00210     "Morale","Percent and regular faculty who currently have active research projects"
00211 };
00212 
00213 #if(GAME_VERSION>=200)
00214 static char* hire_report_label1[] = {
00215     "","Prior year","","","Promotions",
00216     "Current year","Click for",
00217 };
00218 static char* hire_report_label2[] = { "Department","total","Departures","New hires","to tenure","total","detail", };
00219 static char* hire_report_label3[] = {  "", "Prior year", "", "", "Promotions", "", };
00220 static char* hire_report_label4[] = {  "Year", "total", "Departures", "New hires", "to tenure", "Year total", };
00221 #endif
00222 
00223 static char current_report_mode=REPORT_MODE_DEPARTMENT;
00224 static char current_graph_mode=ANNUALLY;
00225 
00226 static GraphMonth mode_fac_sum_graphmonth1;
00227 static GraphMonth mode_fac_sum_graphmonth2;
00228 static GraphDoubleBarYear mode_fac_sum_doublebar_y;
00229 static GraphDoubleBarMonth mode_fac_sum_doublebar_m;
00230 
00231 static PieChart fac_sum_rank_piechart;
00232 static PieChart fac_sum_gender_ethnic_piechart;
00233 static char     report_init_flag=0;
00234 
00235 #if(GAME_VERSION>=200)
00236 static Button mode_fac_hire_button;
00237 static Button mode_fac_next_button;
00238 static Button mode_fac_detail_button[MAX_DEPARTMENT];
00239 static char* reportTypeStrArray[]
00240 = {
00241     "Ranks", "Profiles","Activities","Research","Hiring","Directory","Changes ",
00242     "Ranks", "Profiles","Activities","Research","Salary","Promotion","Changes",
00243 };
00244 #else
00245 static char* reportTypeStrArray[]
00246 = {
00247     "Ranks", "Profiles","Activities","Research","Directory","Hiring",
00248     "Ranks", "Profiles","Activities","Research","Salary","Promotion"
00249 };
00250 #endif
00251 
00252 // screen Hiring setting
00253 static char *mode_fac_sum_rblabel[]= {
00254     "Low",
00255     "Medium",
00256     "High",
00257 };
00258 static char *mode_fac_sum_rblabel2[]= {
00259     "Don't hire",
00260     "Medium",
00261     "High",
00262 };
00263 
00264 static char *mode_fac_sum_rblabel3[]= {
00265     /*  "Don't do it",
00266         "Doesn't matter",
00267         "Important",
00268         "Very important",
00269   */
00270   /*
00271     "Nil",
00272     "Medium",
00273     "High",
00274     "Top",
00275   */
00276     "","","","",
00277 };
00278 
00279 static char *mode_fac_sum_rblabel4[]= {
00280     /*  "Not at all important",
00281         "Moderately important",
00282         "Important",
00283         "Very important",
00284         "Nil",                                          */
00285     "Medium",
00286     "High",
00287     "Top",
00288 };
00289 
00290 // radio button object
00291 static RadioButton mode_fac_sum_rb1;
00292 static RadioButton mode_fac_sum_rb2;
00293 static RadioButton mode_fac_sum_rb3;
00294 static RadioButton mode_fac_sum_rb4;
00295 static RadioButton mode_fac_sum_rb5;
00296 static RadioButton mode_fac_sum_rb6;
00297 static RadioButton mode_fac_sum_rb7;
00298 static RadioButton mode_fac_sum_rb8;
00299 static RadioButton mode_fac_sum_rb9;
00300 static RadioButton mode_fac_sum_rb10;
00301 
00302 // Text Object
00303 static Text mode_fac_sum_text1;
00304 
00305 // Button Object
00306 static Button mode_fac_sum_button;
00307 static ButtonGroup mode_fac_sum_buttongroup(2);
00308 
00309 // Graph Icon Object
00310 static GraphPerformanceIndicatorYear mode_fac_sum_graphicon_y[6];
00311 static GraphPerformanceIndicatorTrimester mode_fac_sum_graphicon_t[16];
00312 static GraphPerformanceIndicatorMonth mode_fac_sum_graphicon_m[1];
00313 
00314 // Data Text
00315 static Text mode_fac_sum_data1[16];
00316 static Text mode_fac_sum_data2[4];
00317 static Text mode_fac_sum_data3[MAX_DEPARTMENT];
00318 static Text mode_fac_sum_data4[7];
00319 
00320 // ValueSlider
00321 static ValueSlider mode_fac_sum_valueslider[MAX_DEPARTMENT];
00322 static ValueSlider mode_fac_sum_valueslider2[MAX_DEPARTMENT];
00323 static ValueSlider mode_fac_sum_valueslider3[MAX_DEPARTMENT];
00324 
00325 #if(GAME_VERSION>=200)
00326 // new graph
00327 static GraphPerformanceIndicatorYear department_equity_graph;
00328 static GraphPerformanceIndicatorYear gender_ethnic_equity_graph;
00329 static GraphPerformanceIndicatorYear rank_equity_graph;
00330 static Text department_equity_text;
00331 static Text gender_ethnic_equity_text;
00332 static Text rank_equity_text;
00333 #endif
00334 
00335 //----- Begin of Summary Report 1 ------//
00336 void FacultyRes::summary_report_1(int refreshFlag) {
00337     static int percentDataArray[MAX_STUDENT_LEVEL_N_TOTAL];
00338     static int xStart = 1991, xEnd = 1998;          //*** temporary ***//
00339 
00340     int deptRecno=1;
00341     int rankLevelCount[MAX_STUDENT_LEVEL_N_TOTAL];
00342 
00343     // #####  Begin MArco ##### //
00344 #if(GAME_VERSION>=200)
00345     int initialRankLevelCount[MAX_STUDENT_LEVEL_N_TOTAL];
00346 #endif
00347     // ##### End MArco ##### //
00348 
00349     static int data_num=HISTORY_YEAR_COUNT;
00350     static int *dataArray[MAX_STUDENT_LEVEL_N_TOTAL];
00351 
00352     // ##### Begin Marco ##### //
00353 #if(GAME_VERSION>=200)
00354     //  static int *initialDataArray[MAX_STUDENT_LEVEL_N_TOTAL];
00355     int initialDataArray[MAX_STUDENT_LEVEL_N_TOTAL];//NEW
00356     //  memset( initialRankLevelCount,0, sizeof(initialRankLevelCount) );
00357 #endif
00358     // ##### End Marco ##### //
00359 
00360     memset( rankLevelCount,0, sizeof(rankLevelCount) );
00361 
00362 #if(GAME_VERSION>=200)
00363     float avgSalary[MAX_STUDENT_LEVEL_N_TOTAL];
00364     float sumSalary[MAX_STUDENT_LEVEL_N_TOTAL];
00365     int totalStaff[MAX_STUDENT_LEVEL_N_TOTAL];
00366 
00367     for ( int j=0; j<MAX_STUDENT_LEVEL_N_TOTAL; j++ ) {
00368         avgSalary[j] = 0.0;
00369         sumSalary[j] = 0.0;
00370         totalStaff[j] = 0;
00371     }
00372 #endif
00373 
00374     //---- determine the department for display the faculty records ----//
00375     if(current_report_mode==REPORT_MODE_DEPARTMENT) {
00376         if( department_array.selected_recno )
00377             deptRecno = department_array.selected_recno;
00378         cur_dept_ptr = department_array[deptRecno];
00379 
00380         //-- department wide --//
00381         for(int i=0;i<MAX_STUDENT_LEVEL_N_TOTAL;i++) {
00382             dataArray[i]=cur_dept_ptr->faculty_level_history[i];
00383             rankLevelCount[i]=dataArray[i][data_num-1];
00384 
00385             // ##### Begin Marco ##### //
00386 #if(GAME_VERSION>=200)
00387             initialDataArray[i]=cur_dept_ptr->initial_faculty_level[i];
00388             //                  initialRankLevelCount[i]=initialDataArray[i][data_num-1];
00389             initialRankLevelCount[i]=initialDataArray[i];
00390 #endif
00391             // ##### End Marco ##### //
00392         }
00393 
00394 #if(GAME_VERSION>=200)
00395         // calculate average salary
00396         for ( i=1; i<=cur_dept_ptr->faculty_array.size(); i++ ) {
00397             if ( cur_dept_ptr->faculty_array.is_deleted(i) )
00398                 continue;
00399 
00400             Faculty* facultyPtr = (Faculty*) cur_dept_ptr->faculty_array.get(i);
00401 
00402             sumSalary[facultyPtr->rank_level] += facultyPtr->salary;
00403         }
00404 
00405         for ( i=0; i<MAX_STUDENT_LEVEL_N_TOTAL-1; i++ ) {
00406             if ( rankLevelCount[i] == 0 )
00407                 avgSalary[i] = 0;
00408             else
00409                 avgSalary[i] = sumSalary[i] / rankLevelCount[i];
00410 
00411             avgSalary[MAX_STUDENT_LEVEL_N_TOTAL-1] += sumSalary[i];
00412         }
00413 
00414         // calculate average in whole institution
00415         int sumLevelCount=0;
00416         for ( i=0; i<MAX_STUDENT_LEVEL_N_TOTAL-1; i++ ) {
00417             sumLevelCount += rankLevelCount[i];
00418         }
00419         avgSalary[MAX_STUDENT_LEVEL_N_TOTAL-1] /= sumLevelCount;
00420 #endif
00421     }
00422     else {
00423         //      cur_dept_ptr->faculty_array.faculty_count;
00424 #if(GAME_VERSION>=200)
00425         for ( int j=1; j<=department_array.size(); j++ ) {
00426             Department* deptPtr = department_array[j];
00427 
00428             if ( !deptPtr )
00429                 continue;
00430 
00431             for ( int k=1; k<=deptPtr->faculty_array.size(); k++ ) {
00432                 Faculty* facultyPtr = deptPtr->faculty_array[k];
00433 
00434                 if ( !facultyPtr )
00435                     continue;
00436 
00437                 sumSalary[facultyPtr->rank_level] += facultyPtr->salary;
00438                 totalStaff[facultyPtr->rank_level]++;
00439             }
00440         }
00441 
00442         for ( int k=0; k<MAX_STUDENT_LEVEL_N_TOTAL; k++ ) {
00443             dataArray[k]=department_array.faculty_level_history[k];
00444             rankLevelCount[k]=dataArray[k][data_num-1];
00445         }
00446 
00447         for ( k=0; k<MAX_STUDENT_LEVEL_N_TOTAL-1; k++ ) {
00448             if ( totalStaff[k] == 0 )
00449                 avgSalary[k] = 0;
00450             else
00451                 avgSalary[k] = sumSalary[k] / rankLevelCount[k];
00452 
00453             avgSalary[MAX_STUDENT_LEVEL_N_TOTAL-1] += avgSalary[k]*rankLevelCount[k];
00454             totalStaff[MAX_STUDENT_LEVEL_N_TOTAL-1] += rankLevelCount[k];
00455         }
00456 
00457         // calculate average salary in the institution
00458         avgSalary[MAX_STUDENT_LEVEL_N_TOTAL-1] /= totalStaff[MAX_STUDENT_LEVEL_N_TOTAL-1];
00459 #endif
00460 
00461         //-- Institution wide --//
00462         for(int i=0;i<MAX_STUDENT_LEVEL_N_TOTAL;i++) {
00463             dataArray[i]=department_array.faculty_level_history[i];
00464             rankLevelCount[i]=dataArray[i][data_num-1];
00465 
00466             // ##### Begin Marco ##### //
00467 #if(GAME_VERSION>=200)
00468             initialDataArray[i]=department_array.initial_faculty_level[i];
00469             //                  initialRankLevelCount[i]=initialDataArray[i][data_num-1];
00470             initialRankLevelCount[i]=initialDataArray[i];
00471 #endif
00472             // ##### End Marco ##### //
00473         }
00474     }
00475 
00476     //  if(rankLevelCount[MAX_STUDENT_LEVEL_N_TOTAL-1]>1e-9)
00477     //          for(int i=0;i<MAX_STUDENT_LEVEL_N_TOTAL;i++)
00478     //                          percentDataArray[i]=(rankLevelCount[i]*100)/rankLevelCount[MAX_STUDENT_LEVEL_N_TOTAL-1];
00479 
00480     int sum=0;
00481     for(int i=0;i<MAX_STUDENT_LEVEL_N_TOTAL-1;i++)
00482         sum+=rankLevelCount[i];
00483     rankLevelCount[MAX_STUDENT_LEVEL_N_TOTAL-1]=sum;
00484 
00485     // ##### Begin Marco ##### //
00486 #if(GAME_VERSION>=200)
00487     int initialSum=0;
00488     for(i=0;i<MAX_STUDENT_LEVEL_N_TOTAL-1;i++)
00489         initialSum+=initialRankLevelCount[i];
00490     initialRankLevelCount[MAX_STUDENT_LEVEL_N_TOTAL-1]=initialSum;
00491 #endif
00492     // ##### End MArco ##### //
00493 
00494     if(sum!=0) {
00495         int diff=200;
00496         for(i=0;i<MAX_STUDENT_LEVEL_N_TOTAL;i++) {
00497             percentDataArray[i]=(rankLevelCount[i]*100)/sum;
00498             diff-=percentDataArray[i];
00499         }
00500         int maxpercent=percentDataArray[0],maxi=0;
00501         for(i=1;i<MAX_STUDENT_LEVEL_N_TOTAL-1;i++) {
00502             if(percentDataArray[i]>maxpercent) {
00503                 maxpercent=percentDataArray[i];
00504                 maxi=i;
00505             }
00506         }
00507         percentDataArray[maxi]+=diff;
00508     }
00509     else
00510         for(i=0;i<MAX_STUDENT_LEVEL_N_TOTAL;i++)
00511             percentDataArray[i]=0;
00512 
00513     //------ paint the background -------//
00514     vga.use_back();
00515     if( refreshFlag == INFO_REPAINT ) {
00516         if( report_init_flag )                        // deinit it first if it has already been initialized
00517             summary_report_deinit();
00518         report_init_flag = 1;
00519 
00520         user_interface.bg_img(BG_PIC_ID, &vga_back);
00521         user_interface.brighten(
00522             REPORT_X1+TAB1,
00523             REPORT_Y1+VTAB1+20,
00524             REPORT_X1+TAB2,
00525             REPORT_Y1+VTAB4
00526             );
00527         user_interface.brighten(
00528             REPORT_X1+TAB2,
00529             REPORT_Y1+VTAB1+20,
00530             REPORT_X2,
00531             REPORT_Y1+VTAB4);
00532 
00533         user_interface.rect(
00534             REPORT_X1+TAB2-2,
00535             REPORT_Y1+VTAB1+20,
00536             REPORT_X2,
00537             REPORT_Y1+VTAB4,1);
00538 
00539         // top title
00540         user_interface.brighten(REPORT_X1+100,REPORT_Y1-13,REPORT_X1+630,REPORT_Y1+10);
00541         user_interface.rect(REPORT_X1+100,REPORT_Y1-13,REPORT_X1+630,REPORT_Y1+10,1);
00542         font_charts.put(REPORT_X1+250,REPORT_Y1-7,fac_sum_title[0]);
00543 
00544         //----- initialize the bottom sub-menus buttons -----//
00545 
00546         text_refresh_bitmap1=NULL;
00547         text_refresh_bitmap1=vga_back.save_area(
00548             REPORT_X1+TAB4,
00549             REPORT_Y1+VTAB1,
00550             REPORT_X2-100,
00551             REPORT_Y1+VTAB4,
00552             text_refresh_bitmap1);
00553 
00554         short x = BOTTOM_BUTTON_X1;
00555         short y = BOTTOM_BUTTON_Y1;
00556 
00557         font_chartsm.put(REPORT_X1,y+2,"    Department :");
00558         font_chartsm.put(REPORT_X1,y+30,"      Institution :");
00559 
00560 #if(GAME_VERSION>=200)
00561         for (int i = 0; i < 7; i++, x+=BOTTOM_BUTTON_WIDTH+BOTTOM_BUTTON_DISTANCE)
00562 #else
00563             for (int i = 0; i < 6; i++, x+=BOTTOM_BUTTON_WIDTH+BOTTOM_BUTTON_DISTANCE)
00564 #endif
00565                 type_button_group[i].create_text(x, y,x+BOTTOM_BUTTON_WIDTH, y+BOTTOM_BUTTON_HEIGHT,reportTypeStrArray[i]);
00566         x = BOTTOM_BUTTON_X1;
00567         y = BOTTOM_BUTTON_Y1+28;
00568 #if(GAME_VERSION>=200)
00569         for (i = 7; i < 14; i++, x+=BOTTOM_BUTTON_WIDTH+BOTTOM_BUTTON_DISTANCE)
00570 #else
00571             for (i = 6; i < 12; i++, x+=BOTTOM_BUTTON_WIDTH+BOTTOM_BUTTON_DISTANCE)
00572 #endif
00573                 type_button_group[i].create_text(x, y,x+BOTTOM_BUTTON_WIDTH, y+BOTTOM_BUTTON_HEIGHT,reportTypeStrArray[i]);
00574         /*
00575           user_interface.create_button_bitmap(x, y,
00576           x+BOTTOM_BUTTON_WIDTH, y+BOTTOM_BUTTON_HEIGHT,
00577           reportTypeStrArray[i], &type_button_up_bitmap[i],
00578           &type_button_down_bitmap[i], &vga_back);
00579           type_button_group[i].create_bitmapW(x, y,
00580           x+BOTTOM_BUTTON_WIDTH, y+BOTTOM_BUTTON_HEIGHT,
00581           ((i == current_report_type) ? type_button_down_bitmap[i] : type_button_up_bitmap[i])+4);
00582           }
00583 
00584           {
00585           user_interface.create_button_bitmap(x, y,
00586           x+BOTTOM_BUTTON_WIDTH, y+BOTTOM_BUTTON_HEIGHT,
00587           reportTypeStrArray[i], &type_button_up_bitmap[i],
00588           &type_button_down_bitmap[i], &vga_back);
00589           type_button_group[i].create_bitmapW(x, y,
00590           x+BOTTOM_BUTTON_WIDTH, y+BOTTOM_BUTTON_HEIGHT,
00591           ((i == current_report_type) ? type_button_down_bitmap[i] : type_button_up_bitmap[i])+4);
00592           }
00593         */
00594         /*              i=10;
00595                         user_interface.create_button_bitmap(x, y,
00596                         x+BOTTOM_BUTTON_WIDTH*2, y+BOTTOM_BUTTON_HEIGHT,
00597                         reportTypeStrArray[i], &type_button_up_bitmap[i],
00598                         &type_button_down_bitmap[i], &vga_back);
00599                         type_button_group[i].create_bitmapW(x, y,
00600                         x+BOTTOM_BUTTON_WIDTH*2, y+BOTTOM_BUTTON_HEIGHT,
00601                         ((i == current_report_type) ? type_button_down_bitmap[i] : type_button_up_bitmap[i])+4);
00602         */
00603         report_init_flag = 1;
00604 
00605         fac_sum_rank_piechart.init(
00606             REPORT_X1+TAB1,
00607             REPORT_Y1+VTAB1+20,
00608             REPORT_X1+TAB2,
00609             REPORT_Y1+VTAB4,5, rankLevelCount, &xStart,&xEnd,
00610             NULL, NULL, NULL, 1, 1, 0, 3);
00611 
00612 #if(GAME_VERSION>=200)
00613         // print the labels on top
00614         font_chartsm.right_put( REPORT_X1+TAB4-20,
00615                                 REPORT_Y1+VTAB1+23,
00616                                 fac_avg_salary_label[0] );
00617 
00618         font_chartsm.right_put( REPORT_X1+TAB4+60-30,
00619                                 REPORT_Y1+VTAB1+23,
00620                                 fac_avg_salary_label[1] );
00621 
00622         font_chartsm.right_put( REPORT_X1+TAB5+57,
00623                                 REPORT_Y1+VTAB1+23,
00624                                 fac_avg_salary_label[2] );
00625 
00626         font_chartsm.right_put( REPORT_X1+TAB4+118,
00627                                 REPORT_Y1+VTAB1+23,
00628                                 fac_avg_salary_label[3] );
00629 #endif
00630 
00631         //-------- draw the legend --------------//
00632 
00633         for(i=0;i<MAX_STUDENT_LEVEL_N_TOTAL;i++) {
00634             font_chartsm.put(
00635                 REPORT_X1+TAB3+60,
00636                 REPORT_Y1+VTAB1+i*43+43,
00637                 fac_sum_rank_label[i]);
00638 
00639 #if(GAME_VERSION>=200)
00640             // print out average salary
00641             font_chartsm.right_put( REPORT_X1+TAB4-20,
00642                                     REPORT_Y1+VTAB1+i*43+43,
00643                                     m.format( avgSalary[i], 2 ) );
00644 #endif
00645 
00646             /*****************Begin marco**********************/
00647 #if(GAME_VERSION>=200)
00648             // print out count
00649             font_chartsm.right_put(
00650                 REPORT_X1+TAB4+60-30,
00651                 REPORT_Y1+VTAB1+i*43+43,
00652                 m.format(rankLevelCount[i],4));
00653 
00654             // print out %
00655             font_chartsm.right_put(
00656                 REPORT_X1+TAB5+60,
00657                 REPORT_Y1+VTAB1+i*43+43,
00658                 m.format(percentDataArray[i],29));
00659 
00660             // print out initial value
00661             font_chart_purple_sm.right_put(
00662                 REPORT_X1+TAB4+113,
00663                 REPORT_Y1+VTAB1+i*43+43,
00664                 m.format(initialRankLevelCount[i],4));
00665 #else
00666             font_chartsm.right_put(
00667                 REPORT_X1+TAB4+60,
00668                 REPORT_Y1+VTAB1+i*43+43,
00669                 m.format(rankLevelCount[i],4));
00670             font_chartsm.right_put(
00671                 REPORT_X1+TAB5+60,
00672                 REPORT_Y1+VTAB1+i*43+43,
00673                 m.format(percentDataArray[i],3));
00674 #endif
00675             /****************End Marco**********************/
00676             mode_fac_sum_graphicon_y[i].init(
00677                 REPORT_X1+TAB6,
00678                 REPORT_Y1+VTAB1+i*43+30,
00679                 REPORT_X1+TAB6+80,
00680                 REPORT_Y1+VTAB1+i*43+69,
00681                 1 ,&data_num ,dataArray[i] , 1, 0, 3);
00682             mode_fac_sum_graphicon_y[i].paint();
00683             if(i!=MAX_STUDENT_LEVEL_N_TOTAL-1) {
00684                 user_interface.darken(
00685                     REPORT_X1+TAB3+30,
00686                     REPORT_Y1+VTAB1+43+i*43,
00687                     REPORT_X1+TAB3+43,
00688                     REPORT_Y1+VTAB1+57+i*43);
00689 
00690                 user_interface.bar(
00691                     REPORT_X1+TAB3+30,
00692                     REPORT_Y1+VTAB1+43+i*43,
00693                     REPORT_X1+TAB3+41,
00694                     REPORT_Y1+VTAB1+55+i*43,
00695                     ((fac_sum_rank_piechart.series_color)[i]));
00696             }
00697         }
00698 
00699         fac_sum_rank_piechart.refresh();
00700     }
00701     else {
00702         fac_sum_rank_piechart.refresh();
00703         vga_back.rest_area(text_refresh_bitmap1,0,0);
00704 
00705 #if(GAME_VERSION>=200)
00706         // print the labels on top
00707         font_chartsm.right_put( REPORT_X1+TAB4-20,
00708                                 REPORT_Y1+VTAB1+23,
00709                                 fac_avg_salary_label[0] );
00710 
00711         font_chartsm.right_put( REPORT_X1+TAB4+60-30,
00712                                 REPORT_Y1+VTAB1+23,
00713                                 fac_avg_salary_label[1] );
00714 
00715         font_chartsm.right_put( REPORT_X1+TAB5+57,
00716                                 REPORT_Y1+VTAB1+23,
00717                                 fac_avg_salary_label[2] );
00718 
00719         font_chartsm.right_put( REPORT_X1+TAB4+118,
00720                                 REPORT_Y1+VTAB1+23,
00721                                 fac_avg_salary_label[3] );
00722 #endif
00723 
00724         for(int i=0;i<MAX_STUDENT_LEVEL_N_TOTAL;i++) {
00725             /*****************Begin Marco**********************/
00726 #if(GAME_VERSION>=200)
00727             // print out average salary
00728             font_chartsm.right_put( REPORT_X1+TAB4-20,
00729                                     REPORT_Y1+VTAB1+i*43+43,
00730                                     m.format( avgSalary[i], 2 ) );
00731 
00732             // print out count
00733             font_chartsm.right_put(
00734                 REPORT_X1+TAB4+60-30,
00735                 REPORT_Y1+VTAB1+i*43+43,
00736                 m.format(rankLevelCount[i],4));
00737 
00738             // print out %
00739             font_chartsm.right_put(
00740                 REPORT_X1+TAB5+60,
00741                 REPORT_Y1+VTAB1+i*43+43,
00742                 m.format(percentDataArray[i],29));
00743 
00744             // print out initial value
00745             font_chart_purple_sm.right_put(
00746                 REPORT_X1+TAB4+113,
00747                 REPORT_Y1+VTAB1+i*43+43,
00748                 m.format(initialRankLevelCount[i],4));
00749 #else
00750             font_chartsm.right_put(
00751                 REPORT_X1+TAB4+60,
00752                 REPORT_Y1+VTAB1+i*43+43,
00753                 m.format(rankLevelCount[i],4));
00754             font_chartsm.right_put(
00755                 REPORT_X1+TAB5+60,
00756                 REPORT_Y1+VTAB1+i*43+43,
00757                 m.format(percentDataArray[i],3));
00758 #endif
00759             /*****************End Marco**********************/
00760             mode_fac_sum_graphicon_y[i].refresh();
00761         }
00762     }
00763 
00764     //----------- paint the summary button group ---------//
00765     type_button_group.paint(current_report_type);
00766 
00767     vga.blt_buf(ZOOM_X1, ZOOM_Y1, ZOOM_X2, ZOOM_Y2);
00768     //##trevor 2807
00769     vga.use_front();
00770     //##trevor 2807
00771 }
00772 
00773 //----- End of Summary Report 1 ------//
00774 
00775 //----- Begin of Summary Report 2 ------//
00776 void FacultyRes::summary_report_2(int refreshFlag) {
00777     static int percentDataArray2[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL];
00778     static int xStart = 1991, xEnd = 1998;          //*** temporary ***//
00779 
00780     int deptRecno=1;
00781 
00782     int genderEthnicGroupCount[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL];
00783     static int data_num=HISTORY_YEAR_COUNT;
00784     static int *dataArray[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL];
00785 
00786     memset( genderEthnicGroupCount,0, sizeof(genderEthnicGroupCount) );
00787 
00788     // ##### Begin MArco ##### //
00789 #if(GAME_VERSION>=200)
00790     int initialGenderEthnicGroupCount[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL];
00791     //  static int *initialDataArray[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL];
00792     //NEW
00793     int initialDataArray[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL];
00794 
00795     memset( initialGenderEthnicGroupCount,0, sizeof(initialGenderEthnicGroupCount) );
00796 #endif
00797     // ##### End Marco ##### //
00798 
00799 #if(GAME_VERSION>=200)
00800     float avgSalary[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL];
00801     float sumSalary[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL];
00802     int totalStaff[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL];
00803 
00804     for ( int j=0; j<GENDER_ETHNIC_TYPE_COUNT_N_TOTAL; j++ ) {
00805         avgSalary[j] = 0.0;
00806         sumSalary[j] = 0.0;
00807         totalStaff[j] = 0;
00808     }
00809 #endif
00810 
00811     //---- determine the department for display the faculty records ----//
00812     if(current_report_mode==REPORT_MODE_DEPARTMENT) {
00813         if(department_array.selected_recno)
00814             deptRecno = department_array.selected_recno;
00815         cur_dept_ptr = department_array[deptRecno];
00816 
00817 #if(GAME_VERSION>=200)
00818         // calculate the total salary
00819         for ( int k=1; k<=cur_dept_ptr->faculty_array.size(); k++ ) {
00820             Faculty* facultyPtr = cur_dept_ptr->faculty_array[k];
00821 
00822             if ( !facultyPtr )
00823                 continue;
00824 
00825             sumSalary[facultyPtr->gender_ethnic_group] += facultyPtr->salary;
00826         }
00827 #endif
00828 
00829         //-- department wide --//
00830         for(int i=0;i<GENDER_ETHNIC_TYPE_COUNT_N_TOTAL;i++) {
00831             dataArray[i]=cur_dept_ptr->faculty_gender_history[i];
00832             genderEthnicGroupCount[i]=dataArray[i][data_num-1];
00833 
00834             // ##### Begin Marco ##### //
00835 #if(GAME_VERSION>=200)
00836             initialDataArray[i]=cur_dept_ptr->initial_faculty_gender[i];
00837             //                  initialGenderEthnicGroupCount[i]=initialDataArray[i][data_num-1];
00838             initialGenderEthnicGroupCount[i]=initialDataArray[i];
00839 #endif
00840             // ##### End MArco ##### //
00841         }
00842 
00843 #if(GAME_VERSION>=200)
00844         // calculate average salary
00845         for ( i=0; i<GENDER_ETHNIC_TYPE_COUNT_N_TOTAL-1; i++ ) {
00846             if ( genderEthnicGroupCount[i] == 0 )
00847                 avgSalary[i] = 0;
00848             else
00849                 avgSalary[i] = sumSalary[i] / genderEthnicGroupCount[i];
00850 
00851             avgSalary[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL-1] += avgSalary[i]*genderEthnicGroupCount[i];
00852         }
00853 
00854         avgSalary[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL-1] /= genderEthnicGroupCount[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL-1];
00855 #endif
00856     }
00857     else {
00858         //-- Institution wide --//
00859         for(int i=0;i<GENDER_ETHNIC_TYPE_COUNT_N_TOTAL;i++) {
00860             dataArray[i]=department_array.faculty_gender_history[i];
00861             genderEthnicGroupCount[i]=dataArray[i][data_num-1];
00862 
00863             // ##### Begin Marco ##### //
00864 #if(GAME_VERSION>=200)
00865             initialDataArray[i]=department_array.initial_faculty_gender[i];
00866             //                  initialGenderEthnicGroupCount[i]=initialDataArray[i][data_num-1];
00867             initialGenderEthnicGroupCount[i]=initialDataArray[i];
00868 #endif
00869             // ##### End Marco ##### //
00870         }
00871 
00872 #if(GAME_VERSION>=200)
00873         // calculate total salary
00874         for ( i=1; i<=department_array.size(); i++ ) {
00875             Department* deptPtr = department_array[i];
00876 
00877             if ( !deptPtr )
00878                 continue;
00879 
00880             for ( int j=1; j<=deptPtr->faculty_array.size(); j++ ) {
00881                 Faculty* facultyPtr = (Faculty*) deptPtr->faculty_array[j];
00882 
00883                 if ( !facultyPtr )
00884                     continue;
00885 
00886                 sumSalary[facultyPtr->gender_ethnic_group] += facultyPtr->salary;
00887             }
00888         }
00889 
00890         // calculate average salary
00891         for ( i=0; i<GENDER_ETHNIC_TYPE_COUNT_N_TOTAL-1; i++ ) {
00892             if ( genderEthnicGroupCount[i] == 0 )
00893                 avgSalary[i] = 0;
00894             else
00895                 avgSalary[i] = sumSalary[i] / genderEthnicGroupCount[i];
00896 
00897             avgSalary[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL-1] += avgSalary[i]*genderEthnicGroupCount[i];
00898         }
00899 
00900         // calculate average salary in whole institution
00901         avgSalary[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL-1] /=  genderEthnicGroupCount[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL-1];
00902 #endif
00903 
00904     }
00905 
00906     //  if(genderEthnicGroupCount[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL-1]>1e-9)
00907     //          for(int i=0;i<GENDER_ETHNIC_TYPE_COUNT_N_TOTAL;i++)
00908     //                  percentDataArray2[i]=(genderEthnicGroupCount[i]*100)/genderEthnicGroupCount[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL-1];
00909 
00910     int sum=0;
00911     for(int i=0;i<GENDER_ETHNIC_TYPE_COUNT_N_TOTAL-1;i++)
00912         sum+=genderEthnicGroupCount[i];
00913     genderEthnicGroupCount[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL-1]=sum;
00914 
00915     // ##### Begin Marco ##### //
00916 #if(GAME_VERSION>=200)
00917     int initialSum=0;
00918     for(i=0;i<GENDER_ETHNIC_TYPE_COUNT_N_TOTAL-1;i++)
00919         initialSum+=initialGenderEthnicGroupCount[i];
00920     initialGenderEthnicGroupCount[GENDER_ETHNIC_TYPE_COUNT_N_TOTAL-1]=initialSum;
00921 #endif
00922     // ##### End Marco ##### //
00923 
00924     if(sum!=0) {
00925         int diff=200;
00926         for(i=0;i<GENDER_ETHNIC_TYPE_COUNT_N_TOTAL;i++) {
00927             percentDataArray2[i]=(genderEthnicGroupCount[i]*100)/sum;
00928             diff-=percentDataArray2[i];
00929         }
00930         int maxpercent=percentDataArray2[0],maxi=0;
00931         for(i=1;i<GENDER_ETHNIC_TYPE_COUNT_N_TOTAL-1;i++) {
00932             if(percentDataArray2[i]>maxpercent) {
00933                 maxpercent=percentDataArray2[i];
00934                 maxi=i;
00935             }
00936         }
00937         percentDataArray2[maxi]+=diff;
00938     }
00939     else
00940         for(i=0;i<GENDER_ETHNIC_TYPE_COUNT_N_TOTAL;i++)
00941             percentDataArray2[i]=0;
00942 
00943     //------ paint the background -------//
00944     vga.use_back();
00945     if( refreshFlag == INFO_REPAINT ) {
00946         if( report_init_flag )                        // deinit it first if it has already been initialized
00947             summary_report_deinit();
00948 
00949         user_interface.bg_img(BG_PIC_ID, &vga_back);
00950         user_interface.brighten(
00951             REPORT_X1+TAB1,
00952             REPORT_Y1+VTAB1+20,
00953             REPORT_X1+TAB2,
00954             REPORT_Y1+VTAB4
00955             );
00956 
00957         user_interface.brighten(
00958             REPORT_X1+TAB2,
00959             REPORT_Y1+VTAB1+20,
00960             REPORT_X2,
00961             REPORT_Y1+VTAB4);
00962         user_interface.rect(
00963             REPORT_X1+TAB2-2,
00964             REPORT_Y1+VTAB1+20,
00965             REPORT_X2,
00966             REPORT_Y1+VTAB4,1);
00967         /*
00968           user_interface.brighten(
00969           REPORT_X1+TAB2+45,
00970           REPORT_Y1+VTAB1-15,
00971           REPORT_X1+TAB2+375,
00972           REPORT_Y1+VTAB1+8);
00973 
00974           user_interface.rect(
00975           REPORT_X1+TAB2+45,
00976           REPORT_Y1+VTAB1-15,
00977           REPORT_X1+TAB2+375,
00978           REPORT_Y1+VTAB1+8);
00979 
00980           font_charts.put(
00981           REPORT_X1+TAB2+60,
00982           REPORT_Y1+VTAB1-15,
00983           fac_sum_title[1]);
00984         */
00985         // top title
00986         user_interface.brighten(REPORT_X1+100,REPORT_Y1-13,REPORT_X1+630,REPORT_Y1+10);
00987         user_interface.rect(REPORT_X1+100,REPORT_Y1-13,REPORT_X1+630,REPORT_Y1+10,1);
00988         font_charts.put(REPORT_X1+230,REPORT_Y1-7,fac_sum_title[1]);
00989 
00990         //----- initialize the bottom sub-menus buttons -----//
00991 
00992         text_refresh_bitmap1=NULL;
00993         text_refresh_bitmap1=vga_back.save_area(
00994             REPORT_X1+TAB4,
00995             REPORT_Y1+VTAB1,
00996             REPORT_X2-100,
00997             REPORT_Y1+VTAB4,
00998             text_refresh_bitmap1);
00999 
01000         fac_sum_gender_ethnic_piechart.init(
01001             REPORT_X1+TAB1,
01002             REPORT_Y1+VTAB1+20,
01003             REPORT_X1+TAB2,
01004             REPORT_Y1+VTAB4,
01005             4, genderEthnicGroupCount, &xStart,&xEnd,
01006             NULL, NULL, NULL, 1, 1, 0, 3);
01007 
01008         short x = BOTTOM_BUTTON_X1;
01009         short y = BOTTOM_BUTTON_Y1;
01010 
01011         font_chartsm.put(REPORT_X1,y+2,"    Department :");
01012         font_chartsm.put(REPORT_X1,y+30,"      Institution :");
01013 
01014 #if(GAME_VERSION>=200)
01015         for (int i = 0; i < 7; i++, x+=BOTTOM_BUTTON_WIDTH+BOTTOM_BUTTON_DISTANCE)
01016 #else
01017             for (int i = 0; i < 6; i++, x+=BOTTOM_BUTTON_WIDTH+BOTTOM_BUTTON_DISTANCE)
01018 #endif
01019                 type_button_group[i].create_text(x, y,x+BOTTOM_BUTTON_WIDTH, y+BOTTOM_BUTTON_HEIGHT,reportTypeStrArray[i]);
01020         x = BOTTOM_BUTTON_X1;
01021         y = BOTTOM_BUTTON_Y1+28;
01022 #if(GAME_VERSION>=200)
01023         for (i = 7; i < 14; i++, x+=BOTTOM_BUTTON_WIDTH+BOTTOM_BUTTON_DISTANCE)
01024 #else
01025             for (i = 6; i < 12; i++, x+=BOTTOM_BUTTON_WIDTH+BOTTOM_BUTTON_DISTANCE)
01026 #endif
01027                 type_button_group[i].create_text(x, y,x+BOTTOM_BUTTON_WIDTH, y+BOTTOM_BUTTON_HEIGHT,reportTypeStrArray[i]);
01028         /*
01029           for (int i = 0; i < 6; i++, x+=BOTTOM_BUTTON_WIDTH+BOTTOM_BUTTON_DISTANCE)
01030           {
01031           user_interface.create_button_bitmap(x, y,
01032           x+BOTTOM_BUTTON_WIDTH, y+BOTTOM_BUTTON_HEIGHT,
01033           reportTypeStrArray[i], &type_button_up_bitmap[i],
01034           &type_button_down_bitmap[i], &vga_back);
01035           type_button_group[i].create_bitmapW(x, y,
01036           x+BOTTOM_BUTTON_WIDTH, y+BOTTOM_BUTTON_HEIGHT,
01037           ((i == current_report_type) ? type_button_down_bitmap[i] : type_button_up_bitmap[i])+4);
01038           }
01039 
01040           x = BOTTOM_BUTTON_X1;
01041           y = BOTTOM_BUTTON_Y1+28;
01042 
01043           for (i = 6; i < 12; i++, x+=BOTTOM_BUTTON_WIDTH+BOTTOM_BUTTON_DISTANCE)
01044           {
01045           user_interface.create_button_bitmap(x, y,
01046           x+BOTTOM_BUTTON_WIDTH, y+BOTTOM_BUTTON_HEIGHT,
01047           reportTypeStrArray[i], &type_button_up_bitmap[i],
01048           &type_button_down_bitmap[i], &vga_back);
01049           type_button_group[i].create_bitmapW(x, y,
01050           x+BOTTOM_BUTTON_WIDTH, y+BOTTOM_BUTTON_HEIGHT,
01051           ((i == current_report_type) ? type_button_down_bitmap[i] : type_button_up_bitmap[i])+4);
01052           }
01053         */
01054         report_init_flag = 1;
01055 
01056 #if(GAME_VERSION>=200)
01057         // print the labels on top
01058         font_chartsm.right_put( REPORT_X1+TAB4-20,
01059                                 REPORT_Y1+VTAB1+23,
01060                                 fac_avg_salary_label[0] );
01061 
01062         font_chartsm.right_put( REPORT_X1+TAB4+60-30,
01063                                 REPORT_Y1+VTAB1+23,
01064                                 fac_avg_salary_label[1] );
01065 
01066         font_chartsm.right_put( REPORT_X1+TAB5+57,
01067                                 REPORT_Y1+VTAB1+23,
01068                                 fac_avg_salary_label[2] );
01069 
01070         font_chartsm.right_put( REPORT_X1+TAB4+118,
01071                                 REPORT_Y1+VTAB1+23,
01072                                 fac_avg_salary_label[3] );
01073 #endif
01074 
01075         //-------- draw the legend --------------//
01076 
01077         for(i=0;i<GENDER_ETHNIC_TYPE_COUNT_N_TOTAL;i++) {
01078 #if(GAME_VERSION>=200)
01079             font_chartsm.right_put( REPORT_X1+TAB4-20,
01080                                     REPORT_Y1+VTAB1+i*47+43,
01081                                     m.format( avgSalary[i], 2 ) );
01082 #endif
01083             font_chartsm.put(
01084                 REPORT_X1+TAB3+60,
01085                 REPORT_Y1+VTAB1+i*47+43,
01086                 fac_sum_ge_label[i]);
01087             // ##### Begin Marco ##### //
01088 #if(GAME_VERSION>=200)
01089             font_chartsm.right_put(
01090                 REPORT_X1+TAB4+60-30,
01091                 REPORT_Y1+VTAB1+i*47+43,
01092                 m.format(genderEthnicGroupCount[i],4));
01093 #else
01094             font_chartsm.right_put(
01095                 REPORT_X1+TAB4+60,
01096                 REPORT_Y1+VTAB1+i*47+43,
01097                 m.format(genderEthnicGroupCount[i],4));
01098 #endif
01099 #if(GAME_VERSION>=200)
01100             // print out %
01101             font_chartsm.right_put(
01102                 REPORT_X1+TAB5+60,
01103                 REPORT_Y1+VTAB1+i*47+43,
01104                 m.format(percentDataArray2[i],29));
01105 
01106             // print out initial value
01107             font_chart_purple_sm.right_put(
01108                 REPORT_X1+TAB4+113,
01109                 REPORT_Y1+VTAB1+i*47+43,
01110                 m.format(initialGenderEthnicGroupCount[i],4));
01111 #else
01112             font_chartsm.right_put(
01113                 REPORT_X1+TAB5+60,
01114                 REPORT_Y1+VTAB1+i*47+43,
01115                 m.format(percentDataArray2[i],3));
01116 #endif
01117             // ##### End Marco ##### //
01118             mode_fac_sum_graphicon_y[i].init(
01119                 REPORT_X1+TAB6,
01120                 REPORT_Y1+VTAB1+i*47+30,
01121                 REPORT_X1+TAB6+80,
01122                 REPORT_Y1+VTAB1+i*47+72,
01123                 1 ,&data_num ,dataArray[i] , 1, 0, 3);
01124             mode_fac_sum_graphicon_y[i].paint();
01125             if(i!=GENDER_ETHNIC_TYPE_COUNT_N_TOTAL-1) {
01126                 user_interface.darken(
01127                     REPORT_X1+TAB3+30,
01128                     REPORT_Y1+VTAB1+43+i*47,
01129                     REPORT_X1+TAB3+43,
01130                     REPORT_Y1+VTAB1+57+i*47
01131                     );
01132                 user_interface.bar(
01133                     REPORT_X1+TAB3+30,
01134                     REPORT_Y1+VTAB1+43+i*47,
01135                     REPORT_X1+TAB3+41,
01136                     REPORT_Y1+VTAB1+55+i*47,
01137                     ((fac_sum_gender_ethnic_piechart.series_color)[i]));
01138             }
01139         }
01140     }
01141     else {
01142         vga_back.rest_area(text_refresh_bitmap1,0,0);
01143 
01144 #if(GAME_VERSION>=200)
01145         // print the labels on top
01146         font_chartsm.right_put( REPORT_X1+TAB4-20,
01147                                 REPORT_Y1+VTAB1+23,
01148                                 fac_avg_salary_label[0] );
01149 
01150         font_chartsm.right_put( REPORT_X1+TAB4+60-30,
01151                                 REPORT_Y1+VTAB1+23,
01152                                 fac_avg_salary_label[1] );
01153 
01154         font_chartsm.right_put( REPORT_X1+TAB5+57,
01155                                 REPORT_Y1+VTAB1+23,
01156                                 fac_avg_salary_label[2] );
01157 
01158         font_chartsm.right_put( REPORT_X1+TAB4+118,
01159                                 REPORT_Y1+VTAB1+23,
01160                                 fac_avg_salary_label[3] );
01161 #endif
01162 
01163         for(int i=0;i<GENDER_ETHNIC_TYPE_COUNT_N_TOTAL;i++) {
01164             // ##### Begin Marco ##### //
01165 #if(GAME_VERSION>=200)
01166             font_chartsm.right_put(
01167                 REPORT_X1+TAB4+60-30,
01168                 REPORT_Y1+VTAB1+i*47+43,
01169                 m.format(genderEthnicGroupCount[i],4));
01170 #else
01171             font_chartsm.right_put(
01172                 REPORT_X1+TAB4+60,
01173                 REPORT_Y1+VTAB1+i*47+43,
01174                 m.format(genderEthnicGroupCount[i],4));
01175 #endif
01176 #if(GAME_VERSION>=200)
01177             // print out %
01178             font_chartsm.right_put(
01179                 REPORT_X1+TAB5+60,
01180                 REPORT_Y1+VTAB1+i*47+43,
01181                 m.format(percentDataArray2[i],29));
01182 
01183             // print out initial value
01184             font_chart_purple_sm.right_put(
01185                 REPORT_X1+TAB4+113,
01186                 REPORT_Y1+VTAB1+i*47+43,
01187                 m.format(initialGenderEthnicGroupCount[i],4));
01188 #else
01189             font_chartsm.right_put(
01190                 REPORT_X1+TAB5+60,
01191                 REPORT_Y1+VTAB1+i*47+43,
01192                 m.format(percentDataArray2[i],3));
01193 #endif
01194             // ##### End Marco ##### //
01195             mode_fac_sum_graphicon_y[i].refresh();
01196         }
01197     }
01198 
01199     fac_sum_gender_ethnic_piechart.refresh();
01200     //----------- paint the summary button group ---------//
01201     type_button_group.paint(current_report_type);
01202 
01203     vga.blt_buf(ZOOM_X1, ZOOM_Y1, ZOOM_X2, ZOOM_Y2);
01204     vga.use_front();
01205 }
01206 
01207 //----- End of Summary Report 2 ------//
01208 
01209 //----- Begin of Summary Report 3 ------//  (activities)
01210 void FacultyRes::summary_report_3(int refreshFlag) {
01211     int tab1=REPORT_X1+0;
01212     int tab2=REPORT_X1+150;
01213     int tab3=REPORT_X1+190;
01214     int tab4=REPORT_X1+280;
01215     int tab5=REPORT_X1+320;
01216     int tab6=REPORT_X1+410;
01217     int tab7=REPORT_X1+450;
01218     int tab8=REPORT_X1+540;
01219     int tab9=REPORT_X1+710;
01220     int tab11=REPORT_X1+5;
01221     int tab12=REPORT_X1+210;
01222     int tab13=REPORT_X1+260;
01223     int tab14=REPORT_X1+350;
01224     int tab15=REPORT_X1+580;
01225     int tab16=REPORT_X1+620;
01226     int tab17=REPORT_X1+710;
01227 
01228     int vtab1=REPORT_Y1+10;
01229     int vtab2=REPORT_Y1+25;
01230     int vtab3=REPORT_Y1+100;
01231     int vtab4=REPORT_Y1+105;
01232     int vtab5=REPORT_Y1+340;
01233 
01234     static int data_num1=HISTORY_TRIMESTER_COUNT;
01235     static int data_num2=HISTORY_MONTH_COUNT;
01236     /*  static int v1[3]={12,32,21};
01237         static int v2[3]={14,42,26};
01238         static float v3[4]={52,33,23,31};
01239         static float v4[4]={52,33,12,31};
01240         static float v5;
01241         //      static int v6=21;
01242 
01243         static int v7[8]={5,5,5,5,5,5,5,5};
01244     */
01245     // ##### Begin Marco ####### //
01246     static float v1[3]={12,32,21};
01247     static float v2[3]={14,42,26};
01248     static float v3[4]={52,33,23,31};
01249 #if(GAME_VERSION>=200)
01250     static float v4[5]={52,33,12,31,31};
01251 #else
01252     static float v4[4]={52,33,12,31};
01253 #endif
01254     static float v5;
01255     //  static int v6=21;
01256 
01257     static int v7[8]={5,5,5,5,5,5,5,5};
01258     // ##### End Marco ####### //
01259     static float dataArray1[7][HISTORY_TRIMESTER_COUNT];
01260 
01261     static float dataArray2[1][HISTORY_MONTH_COUNT];
01262     static float dataArray3[DISCRETIONARY_TYPE_COUNT_N_TOTAL+1][HISTORY_TRIMESTER_COUNT];
01263     static int xStart = 1991, xEnd = 1998;          //*** temporary ***//
01264 
01265     // ##### Begin Marco ##### //
01266 #if(GAME_VERSION>=200)
01267     //  static int initialv1[3]={12,32,21};
01268     //  static int initialv2[3]={14,42,26};
01269     static float initialv1[3]={12,32,21};
01270     static float initialv2[3]={14,42,26};
01271     static float initialv3[4]={52,33,23,31};
01272     static float initialv4[5]={52,33,12,31,31};
01273     static float initialv5;
01274     //  static int v6=21;
01275     //  static int initialv7[8]={5,5,5,5,5,5,5,5};
01276     static float initialv7[8]={5,5,5,5,5,5,5,5};
01277     //  static float initialDataArray3[DISCRETIONARY_TYPE_COUNT_N_TOTAL+1][HISTORY_TRIMESTER_COUNT];
01278 #endif
01279     // ##### End Marco ##### //
01280 
01281     int deptRecno=1;
01282 
01283     memset( dataArray1,0, sizeof(dataArray1) );
01284     memset( dataArray2,0, sizeof(dataArray2) );
01285     memset( dataArray3,0, sizeof(dataArray3) );
01286 
01287     // ##### Begin Marco ##### //
01288 #if(GAME_VERSION>=200)
01289     //  memset( initialDataArray3,0, sizeof(initialDataArray3) );
01290 #endif
01291     // ##### End Marco ##### //
01292 
01293     //---- determine the department for display the faculty records ----//
01294     if(current_report_mode==REPORT_MODE_DEPARTMENT) {
01295         if( department_array.selected_recno )
01296             deptRecno = department_array.selected_recno;
01297 
01298         cur_dept_ptr = department_array[deptRecno];
01299 
01300         //-- department wide --//
01301         for(int i=0;i<HISTORY_TRIMESTER_COUNT;i++) {
01302             dataArray1[0][i]=(int)cur_dept_ptr->faculty_array.talent_teaching[i];
01303             dataArray1[1][i]=(int)cur_dept_ptr->faculty_array.talent_scholarship[i];
01304             dataArray1[2][i]=(int)cur_dept_ptr->faculty_array.talent_research[i];
01305             dataArray1[3][i]=(int)cur_dept_ptr->faculty_array.performance_teaching[i];
01306             dataArray1[4][i]=(int)cur_dept_ptr->faculty_array.performance_scholarship[i];
01307             dataArray1[5][i]=(int)cur_dept_ptr->faculty_array.performance_research[i];
01308         }
01309 #if(GAME_VERSION>=200)
01310         initialv1[0]=cur_dept_ptr->faculty_array.initial_talent_teaching;
01311         initialv1[1]=cur_dept_ptr->faculty_array.initial_talent_scholarship;
01312         initialv1[2]=cur_dept_ptr->faculty_array.initial_talent_research;
01313         initialv2[0]=cur_dept_ptr->faculty_array.initial_performance_teaching;
01314         initialv2[1]=cur_dept_ptr->faculty_array.initial_performance_scholarship;
01315         initialv2[2]=cur_dept_ptr->faculty_array.initial_performance_research;
01316 #endif
01317 
01318         for(i=0;i<HISTORY_MONTH_COUNT;i++) {
01319             dataArray2[0][i]=cur_dept_ptr->p_faculty_morale_history[i];
01320         }
01321 #if(GAME_VERSION>=200)
01322         initialv5=cur_dept_ptr->initial_p_faculty_morale;
01323 #endif
01324