home *** CD-ROM | disk | FTP | other *** search
- /*****************************************************************************/
- /* THECASE.C */
- /*****************************************************************************/
- #include "microlib.h"
-
- typedef struct {
- char deleted;
- char code[7];
- char surname[20];
- char group[4];
- char surnamekey[20];
- char startdate[8];
- char cascateg[4];
- char procedure[4];
- char client[7];
- char opponent[7];
- char employee[7];
- char o_lawyer[7];
- char judge[7];
- char court[4];
- char cl_status[1];
- char casstat[4];
- char notes1[50];
- char notes2[50];
- char notes3[50];
- } REC;
-
- int thecase()
- {
- REC *cr;
- int case_wref; /* Window Reference. */
-
- int count, i; /* Counters. */
-
- int seek_val; /* Returned Values. */
- int read_val;
- int key_val;
-
- int code_len; /* Length of frequently used fields ... */
- int surn_len;
-
- char *slash_p; /* Pointer of slash "/" character in string. */
-
- char tmp_code[8]; /* Temporary storage of CODE field entry (with NULL) */
- char tmp_surname[21];/* Temporary storage of SURNAMEKEY (with NULL) */
-
- F4FIELD *fields[3]; /* filtering... */
-
- D4DATA *db_case;
- D4DATA *db_client;
- D4DATA *db_oppo;
-
- X4FILTER filter;
- FILTER_INFO_BASIC info;
-
-
- /* Allocate memory for my record buffer */
- if( (cr = (REC *) malloc(sizeof(REC))) == NULL ) {
- w4display(mes[MT], mes[ME+1], (char *) 0);
- w4exit(1);
- }
-
- code_len = sizeof(cr->code);
- surn_len = sizeof(cr->surnamekey);
-
- /* Define, activate and clear Data Entry screen. */
- case_wref = w4define(1, 0, 22, 79);
- w4popup();
- w4memory();
- w4border(SINGLE, custom[MAIN_N]);
- w4title(0, 1, mes[MT+13], custom[MAIN_N]);
- w4attribute(custom[MAIN_N]);
- w4activate(case_wref);
- w4clear(0);
-
-
- /* Load screen from disk and get field coordinates */
- if(screen_file(screens(13), 19, 78)) /* O_LAWYER.SC */
- w4exit(1);
- if(get_input_positions(screens(13)))
- w4exit(1);
-
-
- /* Open Databases and select the proper Tags... */
- if( search_code[0] != 'T' )
- db_case = d4open(&set, files(19) ); /* CASE.DBF */
- else
- db_case = gl_dbfile;
-
- db_client = d4open(&set, files(1) ); /* CLIENT.DBF */
- db_oppo = d4open(&set, files(8) ); /* OPPONENT.DBF */
-
-
- d4tag_select(db_client, d4tag(db_client, "CODE_T"));
- d4tag_select(db_oppo, d4tag(db_oppo, "CODE_T"));
-
- if( search_code[0] != 'T' ) {
- /* Show only The Cases */
- info.field1 = d4field(db_case, "CODE");
- info.field2 = d4field(db_case, "SURNAMEKEY");
- strcpy(info.find_info1, "T");
- info.compare_len1 = 1;
- info.compare_len2 = 0;
- x4init(&filter, db_case, filter_basicfiles, &info);
- }
-
- g4attribute (custom[MAIN_I]); /* Set input attribute. */
-
- /* Main append, scan, edit and delete loop. */
- for(;;) { /* ==L1== */
- /* Blank my record buffer and display it. */
- memset(cr, (int) ' ', sizeof(REC));
-
- display_fields(cr);
-
- statline(mes[MS]);
- helpline(mes[MH]);
- g4delimiter("[]");
- w4num_att(srow[4],scol[4]-1, "[ ]",\
- 22, custom[MAIN_N]);
-
- /* Get code or any other user input. */
- read_val =0;
- while(read_val != ESC && read_val != F5 && read_val != RETURN\
- && read_val != TAB && read_val != F1) {
- if(search_code[0] != 'T') {
- g4(srow[1], scol[1], cr->code); g4picture("T999999");
- read_val = g4read();
- }
- else {
- memcpy(cr->code, search_code, 7);
- read_val = RETURN;
- }
- }
- /* If Function Keys */
- if(read_val == ESC)
- break; /* Out of ==L1== */
- if(read_val == F1) {
- help("CASE_QUERY");
- continue;
- }
- if(read_val == F5) {
- append(db_case, cr);
- continue;
- }
-
- /* If ENTER was pressed and CODE field is blank... */
- if(! memcmp(cr->code+1, space(code_len-1),code_len-1)) {
- statline(mes[MS+7]);
- helpline(mes[MH+22]);
- read_val = 0;
- while(read_val !=RETURN && read_val !=ESC && read_val !=TAB ) {
- g4(srow[4], scol[4], cr->surnamekey); g4width(surn_len, surn_len);
- read_val = g4read();
- if(read_val == F1)
- help("CASE_QUERY");
- }
- if( !memcmp(cr->surnamekey, space(surn_len), surn_len))
- continue;
- for(count=0; count<=surn_len -1; count ++)
- cr->surnamekey[count] = gtoupper(cr->surnamekey[count]);
-
- d4tag_select(db_case , d4tag(db_case, "SURNAMEKEY_T"));
- memcpy(tmp_surname, cr->surnamekey, surn_len);
- tmp_surname[surn_len] = '\0';
-
- if((slash_p= (char *) memchr(tmp_surname, CUT_KEY,surn_len)) !=NULL){
- *slash_p = ' ';
- c4trim_n(tmp_surname, surn_len+1);
- }
-
- seek_val = x4seek(&filter, tmp_surname);
- d4unlock_index(db_case);
- if(seek_val == r4after || seek_val == r4eof) {
- w4display("", mes[ME+2], (char *) 0);
- continue;
- }
- else { /* If found ... */
- info.field1 = d4field(db_case, "CODE");
- info.field2 = d4field(db_case, "SURNAMEKEY");
- strcpy(info.find_info1, "T");
- strcpy(info.find_info2, tmp_surname);
- info.compare_len1 = 1;
- info.compare_len2 = strlen(info.find_info2);
- if(info.compare_len2 > f4len(info.field2))
- info.compare_len2 = f4len(info.field2);
- x4init(&filter, db_case, filter_basicfiles, &info);
-
- if(x4skip(&filter, 1) != 3) {
- x4top(&filter);
- d4unlock_index(db_case);
- fields[0] = d4field(db_case,"CODE");
- fields[1] = d4field(db_case,"SURNAME");
- fields[2] = d4field(db_case,"CL_STATUS");
- browse(5, 3, 14, mes[MT+3], db_case, filter, fields, 3);
- }
- else
- x4top(&filter);
-
- d4unlock_index(db_case);
- /* Return to the previous filter. */
- /* Show only Clients Companies */
- info.field1 = d4field(db_case, "CODE");
- info.field2 = d4field(db_case, "SURNAMEKEY");
- strcpy(info.find_info1, "T");
- info.compare_len1 = 1;
- info.compare_len2 = 0;
- x4init(&filter, db_case, filter_basicfiles, &info);
- } /*==if found==*/
- }
- else { /* If CODE field is not empty... */
- /* Zerofill and show the entered CODE. */
- zerofill(cr->code+1, code_len-1);
- w4attribute(custom[MAIN_I]);
- w4num(srow[1], scol[1], cr->code, code_len);
- w4attribute(custom[MAIN_N]);
-
- if( search_code[0] != 'T') {
- /* Select the correct TAG and seek for the CODE. */
- d4tag_select(db_case , d4tag(db_case, "CODE_T"));
- }
-
- /* Copy code and add NULL. */
- memcpy(tmp_code, cr->code, code_len);
- tmp_code[code_len] = '\0';
-
- if( search_code[0] != 'T')
- seek_val = x4seek(&filter, tmp_code);
- else
- seek_val = x4seek(&gl_filter, tmp_code);
- d4unlock_index(db_case);
- if (seek_val == r4eof || seek_val == r4after) {
- w4display("", mes[ME+2], (char *) 0);
- continue; /* ==L1== */
- }
- }
- /* If CODE or SURNAMEKEY was found display the record and let the */
- /* user to skip through the records, edit, delete, change to */
- /* the second screen or ask for help. */
-
- memcpy(cr, (REC *) d4record(db_case), sizeof(REC));
-
- helpline(mes[MH+33]); /* Show new available keys. */
- statline(mes[MS+8]);
-
- /* Clear delimiters from CODE and SURNAME field */
- w4num(srow[1], scol[1] -1, space(code_len +2), code_len +2);
- w4num(srow[4], scol[4] -1, space(surn_len +2), surn_len +2);
-
- display_fields(cr); /* First time. */
- drel(srow[8], scol[8] + 9, db_case, "CLIENT", db_client, "SURNAME");
- drel(srow[10], scol[10] + 9, db_case, "OPPONENT", db_oppo, "SURNAME");
- display_relations(db_case, db_client, db_oppo);
-
- for(;;) { /* ==L2== */
- key_val = g4char();
- if(key_val != PGUP && key_val != PGDN && key_val != ESC &&
- key_val != F1 && key_val != RETURN &&
- key_val != F2 && key_val != F3 && key_val != F6 &&
- key_val != F7 && key_val != F8 && key_val != F4)
- continue;
-
- if(key_val == PGUP) {
- if( search_code[0] != 'T') {
- if(x4skip(&filter, -1) == r4bof)
- x4bottom(&filter);
- }
- else {
- if(x4skip(&gl_filter, -1) == r4bof)
- x4bottom(&gl_filter);
- }
- }
- if(key_val == PGDN) {
- if( search_code[0] != 'T') {
- if(x4skip(&filter, 1) == r4eof)
- x4top(&filter);
- }
- else {
- if(x4skip(&gl_filter, 1) == r4eof)
- x4top(&gl_filter);
- }
- }
- if(key_val == F1) {
- help("CASE_ROLL");
- continue;
- }
- if(key_val == ESC) {
- if(screen_file(screens(13), 19, 78)) /* O_LAWYER.SC */
- w4exit(1);
- break; /* ==L2 ==*/
- }
- if(key_val == F2) {
- display_relations(db_case, db_client, db_oppo);
- edit(db_case, cr);
- display_fields(cr);
- drel(srow[8], scol[8] + 9, db_case, "CLIENT", db_client, "SURNAME");
- drel(srow[10], scol[10] + 9, db_case, "OPPONENT", db_oppo, "SURNAME");
- display_relations(db_case, db_client, db_oppo);
- }
- if(key_val == RETURN) {
- display_relations(db_case, db_client, db_oppo);
- }
- if(key_val == F6) {
- strcpy(tmp_code,f4str(d4field(db_case, "CODE")));
- kw(srow[17], scol[17], 9, tmp_code );
- helpline(mes[MH+33]); /* Show new available keys. */
- statline(mes[MS+8]);
- key_val = RETURN;
- }
- if(key_val == F7) {
- strcpy(tmp_code,f4str(d4field(db_case, "CODE")));
- actions(tmp_code);
- if(get_input_positions(screens(13)))
- w4exit(1);
- helpline(mes[MH+33]); /* Show new available keys. */
- statline(mes[MS+8]);
- continue;
- }
- if(key_val == F4) {
- strcpy(tmp_code,f4str(d4field(db_case, "CODE")));
- caseeco(tmp_code);
- if(get_input_positions(screens(13)))
- w4exit(1);
- helpline(mes[MH+33]); /* Show new available keys. */
- statline(mes[MS+8]);
- continue;
- }
- if(key_val == F8) {
- if( search_code[0] != 'T')
- delete(db_case, filter);
- else
- delete(db_case, gl_filter);
- }
- d4unlock_index(db_case);
- memcpy(cr, (REC *) d4record(db_case), sizeof(REC));
- if(key_val != RETURN && key_val != F2) {
- display_fields(cr);
- drel(srow[8], scol[8] + 9, db_case, "CLIENT", db_client, "SURNAME");
- drel(srow[10], scol[10] + 9, db_case, "OPPONENT", db_oppo, "SURNAME");
- }
- } /* ==L2== */
- if( search_code[0] == 'T')
- break;
- } /* ==L1== */
-
-
- if( search_code[0] != 'T') {
- statline(mes[MS+2]);
- helpline(mes[MH+3]);
- d4close_all(&set);
- }
- else {
- d4close(db_client); /* CLIENT.DBF */
- d4close(db_oppo); /* OPPONENT.DBF */
- }
- free(cr);
- w4deactivate(case_wref);
- w4close(case_wref);
- /* Return the menu item to be selected. */
- return(2);
- }
-
- /************************************************************************/
- /* Append a record */
- /************************************************************************/
- static int append(dbfile, cr)
- D4DATA *dbfile;
- REC *cr;
- {
- REC *rec_buffer;
- D4DATA *dbcodes; /* File to get last code. */
- int count; /* Counter. */
- int read_val; /* Returned value. */
-
- char old_code[7];
- char tmp_code[7]; /* Temporary storage of CODE field */
- /* because when I clear my buffer I lose */
- /* the next available code. */
- int code_len; /* Length of frequently used fields ... */
- int surn_len;
- int someone_used_the_code;
-
- someone_used_the_code = FALSE;
- code_len = sizeof(cr->code);
- surn_len = sizeof(cr->surnamekey);
-
- d4tag_select(dbfile , d4tag(dbfile, "CODE_T"));
-
- /* Main Append Loop (where next code number is given etc.). */
- for(;;) { /* ==L1== */
- /* Read the last code used from CODES file. */
- dbcodes = d4open(&set, files(5));
- d4tag_select(dbcodes, d4tag(dbcodes, "CODE_T"));
- d4lock_file(dbcodes);
- d4lock_index(dbcodes);
- if( d4seek(dbcodes, "T") != 0 ) {
- d4close_all(&set);
- w4display(mes[MT+1], mes[ME+9], (char *) 0);
- w4exit(1);
- }
- memcpy(cr->code, f4str(d4field(dbcodes, "CODE")), code_len);
- memcpy(old_code, cr->code, code_len);
- old_code[7]='\0';
- d4close(dbcodes);
-
- /* The character field is converted to numeric , */
- /* the value is increased by 1 and then the result */
- /* is converted again to character. */
- /* At the numeric-->character conversion I use a */
- /* negative length in order to "zerofill" the result. */
- c4ltoa(c4atol(cr->code+1, code_len-1) + 1, cr->code+1, -6);
-
- /* Save the next available code. */
- memcpy(tmp_code, cr->code, code_len);
- tmp_code[7]='\0';
-
- /* Show next available code, clear buffer, restore the next */
- /* available code. Show the screen file and prepare gets. */
-
- w4attribute(custom[MAIN_I]);
- w4num(srow[1], scol[1], cr->code, code_len);
- w4attribute(custom[MAIN_N]);
- memset(cr, (int) ' ', sizeof(REC));
- memcpy(cr->code, tmp_code, code_len);
-
- if(get_input_positions(screens(13)))
- w4exit(1);
- prepare_fields(cr);
-
- /* Entry Loop */
- for(;;) { /* ==L2== */
- helpline(mes[MH+4]);
- statline(mes[MS+4]);
- read_val = g4read();
-
- if(read_val == ESC) {
- if(warning(mes[MH+6])) {
- if(screen_file(screens(13), 19, 78))
- w4exit(1);
- return(0);
- }
- }
-
- else if(read_val == F1)
- help("CASE_APPEND");
-
- else if (read_val == F10) {
- if(! memcmp(cr->client, space(7), 7)) {
- w4display("", mes[ME+32], mes[MH+16], (char *)0);
- }
- else if(! memcmp(cr->employee, space(7), 7)) {
- w4display("", mes[ME+32], mes[MH+16], (char *)0);
- }
- else if( warning(mes[MH+7])) {
- /* Update codes file. */
- dbcodes = d4open(&set, files(5));
- d4tag_select(dbcodes, d4tag(dbcodes, "CODE_T"));
- d4lock_file(dbcodes);
- d4lock_index(dbcodes);
- if( d4seek(dbcodes, old_code) != 0 ) {
- if( d4seek(dbcodes, "T") != 0 ) {
- d4close_all(&set);
- w4display(mes[MT+1], mes[ME+9], (char *) 0);
- w4exit(1);
- }
- memcpy(cr->code, f4str(d4field(dbcodes, "CODE")), code_len);
- c4ltoa(c4atol(cr->code+1, code_len-1) + 1, cr->code+1, -6);
- memcpy(tmp_code, cr->code, code_len);
- tmp_code[7]='\0';
- f4assign(d4field(dbcodes, "CODE"), tmp_code);
- #ifndef SOL_DEMO
- memcpy(&chksn[33], tmp_code, 7);
- update_solchk();
- #endif
- d4close(dbcodes);
- someone_used_the_code = TRUE;
- }
- else { /* If CODE is still the same. */
- f4assign(d4field(dbcodes, "CODE"), tmp_code);
- #ifndef SOL_DEMO
- memcpy(&chksn[33], tmp_code, 7);
- update_solchk();
- #endif
- d4close(dbcodes);
- }
-
- for(count=0; count<= surn_len -1; count ++)
- cr->surnamekey[count] = gtoupper(cr->surname[count]);
- rec_buffer = (REC *) d4record(dbfile);
- d4append_start(dbfile, 0);
- d4blank(dbfile);
- memcpy(rec_buffer, cr, sizeof(REC));
- d4append(dbfile);
- d4flush_all(dbfile);
- d4unlock_all_data(dbfile);
- d4unlock_index(dbfile);
- if(someone_used_the_code) {
- w4display("", mes[ME+10], mes[ME+11], tmp_code, (char *) 0);
- someone_used_the_code = FALSE;
- }
- if(screen_file(screens(13), 19, 78))
- w4exit(1);
- break;
- } /* ==If warning== */
- } /*== IF F10 ==*/
- prepare_fields(cr);
- } /* ==L2== */
- } /* ==L1== */
- }
-
-
- /************************************************************************/
- /* Edit a record */
- /************************************************************************/
- static int edit(dbfile, cr)
- D4DATA *dbfile;
- REC *cr;
- {
- REC *rec_buffer;
- D4DATA *db_chistory;
- D4DATA *db_credit;
-
- int read_val; /* Returned Value. */
- int count; /* Counter. */
- int surn_len; /* Length of frequently used field ... */
-
- char tmp_client[7+1];
-
- memcpy(tmp_client, cr->client, 7);
- tmp_client[7] = '\0';
-
- surn_len = sizeof(cr->surnamekey);
-
- prepare_fields(cr);
-
- /* Main Edit Loop... */
- for(;;) { /* ==L1== */
- helpline(mes[MH+4]);
- statline(mes[MS+4]);
-
- read_val = g4read();
-
- if(read_val == ESC) {
- if(warning(mes[MH+17]))
- break;
- }
- else if(read_val == F1)
- help("CASE_EDIT");
-
- else if(read_val == F10) {
- /* If client not the same */
- if(memcmp(tmp_client, cr->client, 7)) {
- db_chistory = d4open(&set, files(27));
- d4tag_select(db_chistory, d4tag(db_chistory, "CASE_T"));
- /* If that person is found in a case do not delete the record */
- if(d4seek(db_chistory, f4str(d4field(dbfile, "CODE"))) == 0) {
- d4close(db_chistory);
- w4display("", mes[ME+33], mes[ME+34], " ", mes[MH+16], (char*) 0);
- prepare_fields(cr);
- continue;
- }
- d4close(db_chistory);
- db_credit = d4open(&set, files(30));
- d4tag_select(db_credit, d4tag(db_credit, "CASE_T"));
- /* If that person is found in a case do not delete the record */
- if(d4seek(db_credit, f4str(d4field(dbfile, "CODE"))) == 0) {
- d4close(db_credit);
- w4display("", mes[ME+33], mes[ME+34], " ", mes[MH+16], (char*) 0);
- prepare_fields(cr);
- continue;
- }
- d4close(db_credit);
- }
- if( warning(mes[MH+7])) {
- for(count=0; count<= surn_len -1; count ++)
- cr->surnamekey[count] = gtoupper(cr->surname[count]);
- rec_buffer = (REC *) d4record(dbfile);
- d4blank(dbfile); /* Set "record changed" flag to true. */
- memcpy(rec_buffer, cr, sizeof(REC));
- d4flush_all(dbfile);
- d4unlock_all_data(dbfile);
- d4unlock_index(dbfile);
- break;
- }
- }
- prepare_fields(cr);
- } /* ==L1==*/
- if(screen_file(screens(13), 19, 78))
- w4exit(1);
- helpline(mes[MH+33]);
- statline(mes[MS+8]);
- }
-
-
- /************************************************************************/
- /* Delete a record */
- /************************************************************************/
- static int delete(dbfile, filter)
- D4DATA *dbfile;
- X4FILTER filter;
- {
- D4DATA* db_chistory;
- D4DATA* db_credit;
- D4DATA* db_kwcasdoc;
-
- /* If that case is found in a chistory or credit DBF do not delete the record */
- db_chistory = d4open(&set, files(27));
- d4tag_select(db_chistory, d4tag(db_chistory, "CASE_T"));
- if(d4seek(db_chistory, f4str(d4field(dbfile, "CODE"))) == 0) {
- d4close(db_chistory);
- w4display("", mes[ME+29], mes[ME+31], " ", mes[MH+16], (char*) 0);
- return(0);
- }
- d4close(db_chistory);
-
- db_credit = d4open(&set, files(30));
- d4tag_select(db_credit, d4tag(db_credit, "CASE_T"));
- if(d4seek(db_credit, f4str(d4field(dbfile, "CODE"))) == 0) {
- d4close(db_credit);
- w4display("", mes[ME+29], mes[ME+31], " ", mes[MH+16], (char*) 0);
- return(0);
- }
- d4close(db_credit);
-
- if(warning(mes[MH+5])) {
- db_kwcasdoc = d4open(&set, files(25));
- d4tag_select(db_kwcasdoc, d4tag(db_kwcasdoc, "CODE_T"));
-
- while(d4seek(db_kwcasdoc, f4str(d4field(dbfile, "CODE"))) == 0) {
- d4delete(db_kwcasdoc);
- d4flush_all(db_kwcasdoc);
- d4unlock_all_data(db_kwcasdoc);
- d4unlock_index(db_kwcasdoc);
- }
- d4close(db_kwcasdoc);
-
- d4delete(dbfile);
- d4flush_all(dbfile);
- d4unlock_all_data(dbfile);
- d4unlock_index(dbfile);
- x4top(&filter);
- d4unlock_index(dbfile);
- }
- }
-
- /************************************************************************/
- /* Display Relations. */
- /************************************************************************/
- static display_relations(db_case)
- D4DATA *db_case;
- {
- D4DATA *db_group;
- D4DATA *db_court;
- D4DATA *db_cascateg;
- D4DATA *db_procedure;
- D4DATA *db_casstat;
- D4DATA *db_employee;
- D4DATA *db_lawyer;
- D4DATA *db_judge;
-
- db_group = d4open(&set, files(20) ); /* CASGROUP.DBF */
- db_court = d4open(&set, files(12) ); /* COURT.DBF */
- db_cascateg = d4open(&set, files(22) ); /* CASCATEG.DBF */
- db_procedure= d4open(&set, files(24) ); /* PROCED.DBF */
- d4tag_select(db_group, d4tag(db_group, "GROUP_T"));
- d4tag_select(db_cascateg,d4tag(db_cascateg, "CASCATEG_T"));
- d4tag_select(db_procedure,d4tag(db_procedure, "PROCEDURE_T"));
- drel(srow[2], scol[2] + 6, db_case, "GROUP", db_group, "DESC");
- drel(srow[13], scol[13] + 6, db_case, "COURT", db_court, "DESC");
- drel(srow[5], scol[5] + 6, db_case, "CASCATEG", db_cascateg, "DESC");
- drel(srow[16], scol[16] + 6, db_case, "PROCEDURE", db_procedure,"DESC");
- d4close(db_group); /* CASGROUP.DBF */
- d4close(db_court); /* COURT.DBF */
- d4close(db_cascateg); /* CASCATEG.DBF */
- d4close(db_procedure); /* PROCED.DBF */
-
- db_casstat = d4open(&set, files(21) ); /* CASSTAT.DBF */
- db_employee = d4open(&set, files(18) ); /* EMPLOYEE.DBF */
- db_lawyer = d4open(&set, files(14) ); /* O_LAWYER.DBF */
- db_judge = d4open(&set, files(10) ); /* JUDGE.DBF */
- d4tag_select(db_casstat, d4tag(db_casstat, "CASSTAT_T"));
- d4tag_select(db_employee,d4tag(db_employee, "CODE_T"));
- d4tag_select(db_lawyer, d4tag(db_lawyer, "CODE_T"));
- d4tag_select(db_judge, d4tag(db_judge, "CODE_T"));
- drel(srow[14], scol[14] + 6, db_case, "CASSTAT", db_casstat, "DESC");
- drel(srow[9], scol[9] + 9, db_case, "EMPLOYEE", db_employee, "SURNAME");
- drel(srow[11], scol[11] + 9, db_case, "O_LAWYER", db_lawyer, "SURNAME");
- drel(srow[12], scol[12] + 9, db_case, "JUDGE", db_judge, "SURNAME");
- d4close(db_casstat); /* CASSTAT.DBF */
- d4close(db_employee); /* EMPLOYEE.DBF */
- d4close(db_lawyer); /* O_LAWYER.DBF */
- d4close(db_judge); /* JUDGE.DBF */
- }
-
- /************************************************************************/
- /* Display Fields */
- /************************************************************************/
- static display_fields(cr)
- REC *cr;
- {
- char result_ptr[9]; /* Temporary storage of a4format() conversion. */
-
- w4attribute(custom[MAIN_I]);
- w4num(srow[1], scol[1], cr->code,7);
- w4num(srow[2], scol[2], cr->group, 4);
- w4num(srow[2], scol[2] + 6, space(10), 10); /* Clear relation field. */
- w4num(srow[4], scol[4], cr->surname, 20);
- w4num(srow[5], scol[5], cr->cascateg, 4);
- w4num(srow[5], scol[5] + 6, space(20), 20); /* Clear relation field. */
- w4num(srow[16], scol[16], cr->procedure, 4);
- w4num(srow[16], scol[16] + 6, space(30), 30); /* Clear relation field. */
- a4format(cr->startdate, result_ptr, "DD/MM/YY");
- w4num(srow[6], scol[6], result_ptr, 8);
- w4num(srow[7], scol[7], cr->cl_status, 1);
- w4num(srow[8], scol[8], cr->client, 7);
- w4num(srow[8], scol[8] + 9, space(50), 50); /* Clear relation field. */
- w4num(srow[9], scol[9], cr->employee, 7);
- w4num(srow[9], scol[9] + 9, space(20), 20); /* Clear relation field. */
- w4num(srow[10], scol[10], cr->opponent, 7);
- w4num(srow[10], scol[10] + 9, space(50), 50); /* Clear relation field. */
- w4num(srow[11], scol[11], cr->o_lawyer, 7);
- w4num(srow[11], scol[11] + 9, space(20), 20); /* Clear relation field. */
- w4num(srow[12], scol[12], cr->judge, 7);
- w4num(srow[12], scol[12] + 9, space(20), 20); /* Clear relation field. */
- w4num(srow[13], scol[13], cr->court, 4);
- w4num(srow[13], scol[13] + 6, space(40), 40); /* Clear relation field. */
- w4num(srow[14], scol[14], cr->casstat, 4);
- w4num(srow[14], scol[14] + 6, space(20), 20); /* Clear relation field. */
- w4num(srow[15], scol[15], cr->notes1, 50);
- w4num(srow[18], scol[18], cr->notes2, 50);
- w4num(srow[19], scol[19], cr->notes3, 50);
-
- w4attribute(custom[MAIN_N]);
- }
-
-
- /************************************************************************/
- /* Prepare Gets. */
- /************************************************************************/
- static prepare_fields(cr)
- REC *cr;
- {
- w4attribute(custom[MAIN_I]);
- w4num(srow[1], scol[1], cr->code,7);
- w4attribute(custom[MAIN_N]);
-
- g4(srow[2], scol[2], cr->group); g4width(4, 4);
- g4call( gfb_help, 20 );
- g4(srow[4], scol[4], cr->surname); g4width(20,20);
- g4date(srow[6], scol[6], cr->startdate); g4picture("DD/MM/YY");
- g4(srow[5], scol[5], cr->cascateg); g4width(4,4);
- g4call( gfb_help, 22);
- g4(srow[16], scol[16], cr->procedure); g4width(4,4);
- g4call( gfb_help, 24);
- g4(srow[14], scol[14], cr->casstat); g4width(4,4);
- g4call( gfb_help, 21 );
- g4(srow[13], scol[13], cr->court); g4width(4,4);
- g4call( gfb_help, 12);
- g4(srow[7], scol[7], cr->cl_status); g4width(1,1);
- g4call( gcl_status, 0 );
- g4(srow[8], scol[8], cr->client);g4width(7,7);
- g4call( gfmaster_help, 1);
- g4(srow[9], scol[9], cr->employee); g4width(7,7);
- g4call( gfmaster_help, 18);
- g4(srow[10], scol[10], cr->opponent); g4width(7,7);
- g4call( gfmaster_help, 8);
- g4(srow[11], scol[11], cr->o_lawyer);g4width(7,7);
- g4call( gfmaster_help, 14);
- g4(srow[12], scol[12], cr->judge); g4width(7,7);
- g4call( gfmaster_help, 10);
- g4(srow[15], scol[15], cr->notes1); g4width(50,50);
- g4(srow[18], scol[18], cr->notes2); g4width(50,50);
- g4(srow[19], scol[19], cr->notes3); g4width(50,50);
-
- }
-
-