Version 15.66

This commit is contained in:
Antonio Cañas Vargas 2015-12-14 12:13:41 +01:00
parent 3b3cddb5d3
commit 3681e3281c
11 changed files with 106 additions and 80 deletions

View File

@ -708,18 +708,22 @@ static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr)
Ctr->NumCrss);
/***** Number of teachers in courses of this centre *****/
/*
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
"%u"
"</td>",
TxtClassNormal,BgColor,
Ctr->NumTchs);
*/
/***** Number of students in courses of this centre *****/
/*
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
"%u"
"</td>",
TxtClassNormal,BgColor,
Ctr->NumStds);
*/
/***** Number of users in courses of this centre *****/
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
@ -906,8 +910,8 @@ void Ctr_GetListCentres (long InsCod)
/* Get number of users in courses of this centre */
Ctr->NumUsrs = Usr_GetNumUsrsInCrssOfCtr (Rol_UNKNOWN,Ctr->CtrCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
Ctr->NumTchs = Usr_GetNumUsrsInCrssOfCtr (Rol_TEACHER,Ctr->CtrCod);
Ctr->NumStds = Usr_GetNumUsrsInCrssOfCtr (Rol_STUDENT,Ctr->CtrCod);
// Ctr->NumTchs = Usr_GetNumUsrsInCrssOfCtr (Rol_TEACHER,Ctr->CtrCod);
// Ctr->NumStds = Usr_GetNumUsrsInCrssOfCtr (Rol_STUDENT,Ctr->CtrCod);
}
}
else
@ -940,8 +944,8 @@ bool Ctr_GetDataOfCentreByCod (struct Centre *Ctr)
Ctr->NumDegs = 0;
Ctr->NumCrss = 0;
Ctr->NumUsrs = 0;
Ctr->NumTchs = 0;
Ctr->NumStds = 0;
// Ctr->NumTchs = 0;
// Ctr->NumStds = 0;
/***** Check if centre code is correct *****/
if (Ctr->CtrCod > 0)
@ -1005,8 +1009,8 @@ bool Ctr_GetDataOfCentreByCod (struct Centre *Ctr)
/* Get number of users in courses of this centre */
Ctr->NumUsrs = Usr_GetNumUsrsInCrssOfCtr (Rol_UNKNOWN,Ctr->CtrCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
Ctr->NumTchs = Usr_GetNumUsrsInCrssOfCtr (Rol_TEACHER,Ctr->CtrCod);
Ctr->NumStds = Usr_GetNumUsrsInCrssOfCtr (Rol_STUDENT,Ctr->CtrCod);
// Ctr->NumTchs = Usr_GetNumUsrsInCrssOfCtr (Rol_TEACHER,Ctr->CtrCod);
// Ctr->NumStds = Usr_GetNumUsrsInCrssOfCtr (Rol_STUDENT,Ctr->CtrCod);
/* Set return value */
CtrFound = true;
@ -1399,16 +1403,20 @@ static void Ctr_ListCentresForEdition (void)
fprintf (Gbl.F.Out,"</td>");
/* Number of teachers */
/*
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%u"
"</td>",
Ctr->NumTchs);
*/
/* Number of degrees */
/*
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%u"
"</td>",
Ctr->NumDegs);
*/
/* Centre status */
StatusTxt = Ctr_GetStatusTxtFromStatusBits (Ctr->Status);
@ -1559,7 +1567,8 @@ void Ctr_RemoveCentre (void)
/***** Check if this centre has teachers *****/
if (Ctr.NumDegs ||
Ctr.NumTchs) // Centre has degrees or teachers ==> don't remove
Ctr.NumUsrsWhoClaimToBelongToCtr ||
Ctr.NumUsrs) // Centre has degrees or users ==> don't remove
Lay_ShowAlert (Lay_WARNING,Txt_To_remove_a_centre_you_must_first_remove_all_degrees_and_teachers_in_the_centre);
else // Centre has no teachers ==> remove it
{
@ -2225,12 +2234,12 @@ static void Ctr_PutHeadCentresForSeeing (bool OrderSelectable)
"<th class=\"LEFT_MIDDLE\">"
"%s"
"</th>"
"<th class=\"LEFT_MIDDLE\">"
"%s"
"</th>"
"<th class=\"LEFT_MIDDLE\">"
"%s"
"</th>"
// "<th class=\"LEFT_MIDDLE\">"
// "%s"
// "</th>"
// "<th class=\"LEFT_MIDDLE\">"
// "%s"
// "</th>"
"<th class=\"LEFT_MIDDLE\">"
"%s+<br />%s"
"</th>"
@ -2241,8 +2250,8 @@ static void Ctr_PutHeadCentresForSeeing (bool OrderSelectable)
Txt_Place,
Txt_Degrees_ABBREVIATION,
Txt_Courses_ABBREVIATION,
Txt_Teachers_ABBREVIATION,
Txt_Students_ABBREVIATION,
// Txt_Teachers_ABBREVIATION,
// Txt_Students_ABBREVIATION,
Txt_Teachers_ABBREVIATION,
Txt_Students_ABBREVIATION,
Txt_Status);
@ -2560,7 +2569,7 @@ unsigned Ctr_ListCtrsFound (const char *Query)
/* Number of centres found */
fprintf (Gbl.F.Out,"<tr>"
"<th colspan=\"7\" class=\"CENTER_MIDDLE\">");
"<th colspan=\"8\" class=\"CENTER_MIDDLE\">");
if (NumCtrs == 1)
fprintf (Gbl.F.Out,"1 %s",Txt_centre);
else

View File

@ -71,8 +71,8 @@ struct Centre
unsigned NumDegs; // Number of degrees in this centre
unsigned NumCrss; // Number of courses in this centre
unsigned NumUsrs; // Number of users in courses of this centre
unsigned NumTchs; // Number of teachers in courses of this centre
unsigned NumStds; // Number of students in courses of this centre
// unsigned NumTchs; // Number of teachers in courses of this centre
// unsigned NumStds; // Number of students in courses of this centre
};
typedef enum

View File

@ -114,17 +114,19 @@
// TODO: Reply to all
// TODO: Reply icons should appear without text
// TODO: Link to remove messages is too wide. For example: "Remove these X messages".
// TODO: Remove old files in briefcase!!!!! Disk almost full!!!!!
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.65.1 (2015/12/14)"
#define Log_PLATFORM_VERSION "SWAD 15.66 (2015/12/14)"
#define CSS_FILE "swad15.65.1.css"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/*
Version 15.66: Dec 14, 2015 Number of teachers and number of students removed from list of countries, institutions and centres by reasons of speed. (187057 lines)
Version 15.65.1: Dec 14, 2015 Changes in layout of profile. (187031 lines)
Version 15.65: Dec 13, 2015 Change in layout of contextual links. (187009 lines)
Version 15.64.18: Dec 13, 2015 Code refactoring in contextual links. (187004 lines)

View File

@ -536,12 +536,12 @@ void Cty_ListCountries2 (void)
"<th class=\"RIGHT_MIDDLE\">"
"%s"
"</th>"
"<th class=\"RIGHT_MIDDLE\">"
"%s"
"</th>"
"<th class=\"RIGHT_MIDDLE\">"
"%s"
"</th>"
// "<th class=\"RIGHT_MIDDLE\">"
// "%s"
// "</th>"
// "<th class=\"RIGHT_MIDDLE\">"
// "%s"
// "</th>"
"<th class=\"RIGHT_MIDDLE\">"
"%s+<br />%s"
"</th>"
@ -550,8 +550,8 @@ void Cty_ListCountries2 (void)
Txt_Centres_ABBREVIATION,
Txt_Degrees_ABBREVIATION,
Txt_Courses_ABBREVIATION,
Txt_Teachers_ABBREVIATION,
Txt_Students_ABBREVIATION,
// Txt_Teachers_ABBREVIATION,
// Txt_Students_ABBREVIATION,
Txt_Teachers_ABBREVIATION,
Txt_Students_ABBREVIATION);
@ -587,12 +587,12 @@ void Cty_ListCountries2 (void)
"<td class=\"DAT RIGHT_MIDDLE %s\">"
"%u"
"</td>"
"<td class=\"DAT RIGHT_MIDDLE %s\">"
"%u"
"</td>"
"<td class=\"DAT RIGHT_MIDDLE %s\">"
"%u"
"</td>"
// "<td class=\"DAT RIGHT_MIDDLE %s\">"
// "%u"
// "</td>"
// "<td class=\"DAT RIGHT_MIDDLE %s\">"
// "%u"
// "</td>"
"<td class=\"DAT RIGHT_MIDDLE %s\">"
"%u"
"</td>"
@ -602,8 +602,8 @@ void Cty_ListCountries2 (void)
BgColor,Gbl.Ctys.Lst[NumCty].NumCtrs,
BgColor,Gbl.Ctys.Lst[NumCty].NumDegs,
BgColor,Gbl.Ctys.Lst[NumCty].NumCrss,
BgColor,Gbl.Ctys.Lst[NumCty].NumTchs,
BgColor,Gbl.Ctys.Lst[NumCty].NumStds,
// BgColor,Gbl.Ctys.Lst[NumCty].NumTchs,
// BgColor,Gbl.Ctys.Lst[NumCty].NumStds,
BgColor,Gbl.Ctys.Lst[NumCty].NumUsrs);
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
}
@ -635,12 +635,12 @@ void Cty_ListCountries2 (void)
"<td class=\"DAT RIGHT_MIDDLE\">"
"%u"
"</td>"
"<td class=\"DAT RIGHT_MIDDLE\">"
"%u"
"</td>"
"<td class=\"DAT RIGHT_MIDDLE\">"
"%u"
"</td>"
// "<td class=\"DAT RIGHT_MIDDLE\">"
// "%u"
// "</td>"
// "<td class=\"DAT RIGHT_MIDDLE\">"
// "%u"
// "</td>"
"<td class=\"DAT RIGHT_MIDDLE\">"
"%u"
"</td>"
@ -651,8 +651,8 @@ void Cty_ListCountries2 (void)
Ctr_GetNumCtrsInCty (0),
Deg_GetNumDegsInCty (0),
Crs_GetNumCrssInCty (0),
Usr_GetNumUsrsInCrssOfCty (Rol_UNKNOWN,0),
Usr_GetNumUsrsInCrssOfCty (Rol_STUDENT,0),
// Usr_GetNumUsrsInCrssOfCty (Rol_UNKNOWN,0),
// Usr_GetNumUsrsInCrssOfCty (Rol_STUDENT,0),
Usr_GetNumUsrsInCrssOfCty (Rol_TEACHER,0));
/***** Write users and institutions with unknown country *****/
@ -675,12 +675,12 @@ void Cty_ListCountries2 (void)
"<td class=\"DAT RIGHT_MIDDLE\">"
"%u"
"</td>"
"<td class=\"DAT RIGHT_MIDDLE\">"
"0"
"</td>"
"<td class=\"DAT RIGHT_MIDDLE\">"
"0"
"</td>"
// "<td class=\"DAT RIGHT_MIDDLE\">"
// "0"
// "</td>"
// "<td class=\"DAT RIGHT_MIDDLE\">"
// "0"
// "</td>"
"<td class=\"DAT RIGHT_MIDDLE\">"
"0"
"</td>"
@ -1020,7 +1020,8 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData)
}
Cty->NumUsrsWhoClaimToBelongToCty = 0;
Cty->NumInss = Cty->NumCtrs = Cty->NumDegs = Cty->NumCrss = 0;
Cty->NumUsrs = Cty->NumTchs = Cty->NumStds = 0;
// Cty->NumUsrs = Cty->NumTchs = Cty->NumStds = 0;
Cty->NumUsrs = 0;
/* Get the name of the country in current language */
strcpy (Cty->Name[Gbl.Prefs.Language],row[2]);
@ -1053,8 +1054,8 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData)
/* Get number of users in courses of this country */
Cty->NumUsrs = Usr_GetNumUsrsInCrssOfCty (Rol_UNKNOWN,Cty->CtyCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
Cty->NumStds = Usr_GetNumUsrsInCrssOfCty (Rol_STUDENT,Cty->CtyCod);
Cty->NumTchs = Usr_GetNumUsrsInCrssOfCty (Rol_TEACHER,Cty->CtyCod);
// Cty->NumStds = Usr_GetNumUsrsInCrssOfCty (Rol_STUDENT,Cty->CtyCod);
// Cty->NumTchs = Usr_GetNumUsrsInCrssOfCty (Rol_TEACHER,Cty->CtyCod);
break;
}
}
@ -1181,8 +1182,8 @@ bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraD
}
Cty->NumUsrsWhoClaimToBelongToCty = 0;
Cty->NumUsrs = 0;
Cty->NumStds = 0;
Cty->NumTchs = 0;
// Cty->NumStds = 0;
// Cty->NumTchs = 0;
Cty->NumInss = 0;
/***** Check if country code is correct *****/
@ -1280,8 +1281,8 @@ bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraD
/* Get number of user in courses of this institution */
Cty->NumUsrs = Usr_GetNumUsrsInCrssOfCty (Rol_UNKNOWN,Cty->CtyCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
Cty->NumStds = Usr_GetNumUsrsInCrssOfCty (Rol_STUDENT,Cty->CtyCod);
Cty->NumTchs = Usr_GetNumUsrsInCrssOfCty (Rol_TEACHER,Cty->CtyCod);
// Cty->NumStds = Usr_GetNumUsrsInCrssOfCty (Rol_STUDENT,Cty->CtyCod);
// Cty->NumTchs = Usr_GetNumUsrsInCrssOfCty (Rol_TEACHER,Cty->CtyCod);
/* Get number of institutions in this country */
Cty->NumInss = Ins_GetNumInssInCty (Cty->CtyCod);

View File

@ -53,8 +53,8 @@ struct Country
unsigned NumDegs;
unsigned NumCrss;
unsigned NumUsrs; // Number of users in courses of the institution
unsigned NumStds; // Number of students in courses of the institution
unsigned NumTchs; // Number of teachers in courses of the institution
// unsigned NumStds; // Number of students in courses of the institution
// unsigned NumTchs; // Number of teachers in courses of the institution
};
typedef enum

View File

@ -3057,7 +3057,7 @@ unsigned Crs_ListCrssFound (const char *Query)
/* Number of courses found */
fprintf (Gbl.F.Out,"<tr>"
"<th colspan=\"7\" class=\"CENTER_MIDDLE\">");
"<th colspan=\"6\" class=\"CENTER_MIDDLE\">");
if (NumCrss == 1)
fprintf (Gbl.F.Out,"1 %s",Txt_course);
else

View File

@ -3953,7 +3953,7 @@ unsigned Deg_ListDegsFound (const char *Query)
/* Number of degrees found */
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"10\" class=\"CENTER_MIDDLE\"\">");
"<td colspan=\"8\" class=\"CENTER_MIDDLE\"\">");
if (NumDegs == 1)
fprintf (Gbl.F.Out,"1 %s",Txt_degree);
else

View File

@ -214,8 +214,9 @@ void Gbl_InitializeGlobals (void)
Gbl.CurrentIns.Ins.ShortName[0] = '\0';
Gbl.CurrentIns.Ins.FullName[0] = '\0';
Gbl.CurrentIns.Ins.WWW[0] = '\0';
Gbl.CurrentIns.Ins.NumStds = Gbl.CurrentIns.Ins.NumTchs = Gbl.CurrentIns.Ins.NumUsrs =
// Gbl.CurrentIns.Ins.NumStds = Gbl.CurrentIns.Ins.NumTchs = Gbl.CurrentIns.Ins.NumUsrs =
Gbl.CurrentIns.Ins.NumCtrs = Gbl.CurrentIns.Ins.NumDpts = Gbl.CurrentIns.Ins.NumDegs = 0;
Gbl.CurrentIns.Ins.NumUsrs = 0;
Gbl.CurrentCtr.Ctr.CtrCod = -1L;
Gbl.CurrentCtr.Ctr.InsCod = -1L;
@ -243,8 +244,9 @@ void Gbl_InitializeGlobals (void)
Gbl.Inss.EditingIns.ShortName[0] = '\0';
Gbl.Inss.EditingIns.FullName[0] = '\0';
Gbl.Inss.EditingIns.WWW[0] = '\0';
Gbl.Inss.EditingIns.NumStds = Gbl.Inss.EditingIns.NumTchs = Gbl.Inss.EditingIns.NumUsrs =
// Gbl.Inss.EditingIns.NumStds = Gbl.Inss.EditingIns.NumTchs = Gbl.Inss.EditingIns.NumUsrs =
Gbl.Inss.EditingIns.NumCtrs = Gbl.Inss.EditingIns.NumDpts = Gbl.Inss.EditingIns.NumDegs = 0;
Gbl.Inss.EditingIns.NumUsrs = 0;
Gbl.Ctys.Num = 0;
Gbl.Ctys.Lst = NULL;

View File

@ -639,16 +639,20 @@ static void Ins_ListOneInstitutionForSeeing (struct Institution *Ins,unsigned Nu
TxtClassNormal,BgColor,Ins->NumDpts);
/* Number of teachers in courses of this institution */
/*
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
"%u"
"</td>",
TxtClassNormal,BgColor,Ins->NumTchs);
*/
/* Number of students in courses of this institution */
/*
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
"%u"
"</td>",
TxtClassNormal,BgColor,Ins->NumStds);
*/
/* Number of users in courses of this institution */
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
@ -723,12 +727,12 @@ static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable)
"<th class=\"RIGHT_MIDDLE\">"
"%s"
"</th>"
"<th class=\"RIGHT_MIDDLE\">"
"%s"
"</th>"
"<th class=\"RIGHT_MIDDLE\">"
"%s"
"</th>"
// "<th class=\"RIGHT_MIDDLE\">"
// "%s"
// "</th>"
// "<th class=\"RIGHT_MIDDLE\">"
// "%s"
// "</th>"
"<th class=\"RIGHT_MIDDLE\">"
"%s+<br />%s"
"</th>"
@ -740,8 +744,8 @@ static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable)
Txt_Degrees_ABBREVIATION,
Txt_Courses_ABBREVIATION,
Txt_Departments_ABBREVIATION,
Txt_Teachers_ABBREVIATION,
Txt_Students_ABBREVIATION,
// Txt_Teachers_ABBREVIATION,
// Txt_Students_ABBREVIATION,
Txt_Teachers_ABBREVIATION,
Txt_Students_ABBREVIATION,
Txt_Status);
@ -892,7 +896,8 @@ void Ins_GetListInstitutions (long CtyCod,Ins_GetExtraData_t GetExtraData)
case Ins_GET_BASIC_DATA:
Ins->NumUsrsWhoClaimToBelongToIns = 0;
Ins->NumCtrs = Ins->NumDegs = Ins->NumCrss = Ins->NumDpts = 0;
Ins->NumUsrs = Ins->NumTchs = Ins->NumStds = 0;
Ins->NumUsrs = 0;
// Ins->NumUsrs = Ins->NumTchs = Ins->NumStds = 0;
break;
case Ins_GET_EXTRA_DATA:
/* Get number of users who claim to belong to this institution (row[7]) */
@ -913,8 +918,8 @@ void Ins_GetListInstitutions (long CtyCod,Ins_GetExtraData_t GetExtraData)
/* Get number of users in courses */
Ins->NumUsrs = Usr_GetNumUsrsInCrssOfIns (Rol_UNKNOWN,Ins->InsCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
Ins->NumTchs = Usr_GetNumUsrsInCrssOfIns (Rol_TEACHER,Ins->InsCod);
Ins->NumStds = Usr_GetNumUsrsInCrssOfIns (Rol_STUDENT,Ins->InsCod);
// Ins->NumTchs = Usr_GetNumUsrsInCrssOfIns (Rol_TEACHER,Ins->InsCod);
// Ins->NumStds = Usr_GetNumUsrsInCrssOfIns (Rol_STUDENT,Ins->InsCod);
break;
}
}
@ -945,7 +950,8 @@ bool Ins_GetDataOfInstitutionByCod (struct Institution *Ins,
Ins->ShortName[0] =
Ins->FullName[0] =
Ins->WWW[0] = '\0';
Ins->NumStds = Ins->NumTchs = Ins->NumUsrs =
// Ins->NumStds = Ins->NumTchs = Ins->NumUsrs =
Ins->NumUsrs =
Ins->NumCtrs = Ins->NumDpts = Ins->NumDegs = 0;
/***** Check if institution code is correct *****/
@ -1000,8 +1006,8 @@ bool Ins_GetDataOfInstitutionByCod (struct Institution *Ins,
/* Get number of users in courses of this institution */
Ins->NumUsrs = Usr_GetNumUsrsInCrssOfIns (Rol_UNKNOWN,Ins->InsCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
Ins->NumStds = Usr_GetNumUsrsInCrssOfIns (Rol_STUDENT,Ins->InsCod);
Ins->NumTchs = Usr_GetNumUsrsInCrssOfIns (Rol_TEACHER,Ins->InsCod);
// Ins->NumStds = Usr_GetNumUsrsInCrssOfIns (Rol_STUDENT,Ins->InsCod);
// Ins->NumTchs = Usr_GetNumUsrsInCrssOfIns (Rol_TEACHER,Ins->InsCod);
}
}
else
@ -2186,7 +2192,7 @@ unsigned Ins_ListInssFound (const char *Query)
/* Number of institutions found */
fprintf (Gbl.F.Out,"<tr>"
"<th colspan=\"10\" class=\"CENTER_MIDDLE\">");
"<th colspan=\"9\" class=\"CENTER_MIDDLE\">");
if (NumInss == 1)
fprintf (Gbl.F.Out,"1 %s",Txt_institution);
else

View File

@ -69,9 +69,9 @@ struct Institution
unsigned NumDegs;
unsigned NumCrss;
unsigned NumDpts;
unsigned NumUsrs;
unsigned NumTchs;
unsigned NumStds;
unsigned NumUsrs; // Number of users in courses of this institution
// unsigned NumTchs; // Number of teachers in courses of this institution
// unsigned NumStds; // Number of students in courses of this institution
};
typedef enum

View File

@ -3408,6 +3408,8 @@ unsigned Usr_GetNumUsrsInCrssOfCtr (Rol_Role_t Role,long CtrCod)
" AND courses.CrsCod=crs_usr.CrsCod",
CtrCod);
else
// This query is very slow.
// It's a bad idea to get number of teachers or students for a big list of centres
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
" FROM degrees,courses,crs_usr"
" WHERE degrees.CtrCod='%ld'"
@ -3437,6 +3439,8 @@ unsigned Usr_GetNumUsrsInCrssOfIns (Rol_Role_t Role,long InsCod)
" AND courses.CrsCod=crs_usr.CrsCod",
InsCod);
else
// This query is very slow.
// It's a bad idea to get number of teachers or students for a big list of institutions
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
" FROM centres,degrees,courses,crs_usr"
" WHERE centres.InsCod='%ld'"
@ -3468,6 +3472,8 @@ unsigned Usr_GetNumUsrsInCrssOfCty (Rol_Role_t Role,long CtyCod)
" AND courses.CrsCod=crs_usr.CrsCod",
CtyCod);
else
// This query is very slow.
// It's a bad idea to get number of teachers or students for a big list of countries
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
" FROM institutions,centres,degrees,courses,crs_usr"
" WHERE institutions.CtyCod='%ld'"