"
"✓",
Txt_Present);
else
fprintf (Gbl.F.Out,"ATT_CROSS\" title=\"%s\">"
"✗",
Txt_Absent);
HTM_DIV_End ();
}
/*****************************************************************************/
/**************** List the students with details and comments ****************/
/*****************************************************************************/
static void Att_ListStdsWithAttEventsDetails (unsigned NumUsrsInList,
long *LstSelectedUsrCods)
{
extern const char *Txt_Details;
struct UsrData UsrDat;
unsigned NumUsr;
/***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat);
/***** Start section with attendance details *****/
Lay_StartSection (Att_ATTENDANCE_DETAILS_ID);
/***** Start box and table *****/
Box_StartBoxTable (NULL,Txt_Details,NULL,
NULL,Box_NOT_CLOSABLE,2);
/***** List students with attendance details *****/
for (NumUsr = 0, Gbl.RowEvenOdd = 0;
NumUsr < NumUsrsInList;
NumUsr++)
{
UsrDat.UsrCod = LstSelectedUsrCods[NumUsr];
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS)) // Get from the database the data of the student
if (Usr_CheckIfICanViewAtt (&UsrDat))
{
UsrDat.Accepted = Usr_CheckIfUsrHasAcceptedInCurrentCrs (&UsrDat);
Att_ListAttEventsForAStd (NumUsr,&UsrDat);
}
}
/***** End table and box *****/
Box_EndBoxTable ();
/***** End section with attendance details *****/
Lay_EndSection ();
/***** Free memory used for user's data *****/
Usr_UsrDataDestructor (&UsrDat);
}
/*****************************************************************************/
/*************** Write list of attendance events for a student ***************/
/*****************************************************************************/
static void Att_ListAttEventsForAStd (unsigned NumUsr,struct UsrData *UsrDat)
{
extern const char *Txt_Today;
extern const char *Txt_Student_comment;
extern const char *Txt_Teachers_comment;
char PhotoURL[PATH_MAX + 1];
bool ShowPhoto;
unsigned NumAttEvent;
unsigned UniqueId;
bool Present;
bool ShowCommentStd;
bool ShowCommentTch;
char CommentStd[Cns_MAX_BYTES_TEXT + 1];
char CommentTch[Cns_MAX_BYTES_TEXT + 1];
/***** Write number of student in the list *****/
NumUsr++;
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"%s RM COLOR%u\"",
UsrDat->Accepted ? "DAT_N" :
"DAT",
Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"%u:",NumUsr);
HTM_TD_End ();
/***** Show student's photo *****/
HTM_TD_Begin ("colspan=\"2\" class=\"RM COLOR%u\"",Gbl.RowEvenOdd);
ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_ZOOM,false);
HTM_TD_End ();
/***** Write user's ID ******/
HTM_TD_Begin ("class=\"LM COLOR%u\"",Gbl.RowEvenOdd);
HTM_TABLE_Begin (NULL);
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"%s LM\"",
UsrDat->Accepted ? "DAT_N" :
"DAT");
ID_WriteUsrIDs (UsrDat,NULL);
HTM_TD_End ();
/***** Write student's name *****/
HTM_TD_Begin ("class=\"%s LM\"",
UsrDat->Accepted ? "DAT_SMALL_N" :
"DAT_SMALL");
fprintf (Gbl.F.Out,"%s",UsrDat->Surname1);
if (UsrDat->Surname2[0])
fprintf (Gbl.F.Out," %s",UsrDat->Surname2);
fprintf (Gbl.F.Out,", %s",UsrDat->FirstName);
HTM_TD_End ();
HTM_TR_End ();
HTM_TABLE_End ();
HTM_TD_End ();
HTM_TR_End ();
/***** List the events with students *****/
for (NumAttEvent = 0, UniqueId = 1;
NumAttEvent < Gbl.AttEvents.Num;
NumAttEvent++, UniqueId++)
if (Gbl.AttEvents.Lst[NumAttEvent].Selected)
{
/***** Get data of the attendance event from database *****/
Att_GetDataOfAttEventByCodAndCheckCrs (&Gbl.AttEvents.Lst[NumAttEvent]);
Att_GetNumStdsTotalWhoAreInAttEvent (&Gbl.AttEvents.Lst[NumAttEvent]);
/***** Get comments for this student *****/
Present = Att_CheckIfUsrIsPresentInAttEventAndGetComments (Gbl.AttEvents.Lst[NumAttEvent].AttCod,UsrDat->UsrCod,CommentStd,CommentTch);
ShowCommentStd = CommentStd[0];
ShowCommentTch = CommentTch[0] &&
(Gbl.Usrs.Me.Role.Logged == Rol_TCH ||
Gbl.AttEvents.Lst[NumAttEvent].CommentTchVisible);
/***** Write a row for this event *****/
HTM_TR_Begin (NULL);
HTM_TD_ColouredEmpty (1);
HTM_TD_Begin ("class=\"%s RT COLOR%u\"",
Present ? "DAT_GREEN" :
"DAT_RED",
Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"%u:",NumAttEvent + 1);
HTM_TD_End ();
HTM_TD_Begin ("class=\"BT%u\"",Gbl.RowEvenOdd);
Att_PutCheckOrCross (Present);
HTM_TD_End ();
HTM_TD_Begin ("class=\"DAT LT COLOR%u\"",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"
"
"
%s"
"",
NumUsr,UniqueId,
Gbl.AttEvents.Lst[NumAttEvent].Title,
NumUsr,UniqueId,
Gbl.AttEvents.Lst[NumAttEvent].TimeUTC[Att_START_TIME],
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End ();
HTM_TR_End ();
/***** Write comments for this student *****/
if (ShowCommentStd || ShowCommentTch)
{
HTM_TR_Begin (NULL);
HTM_TD_ColouredEmpty (2);
HTM_TD_Begin ("class=\"BT%u\"",Gbl.RowEvenOdd);
HTM_TD_End ();
HTM_TD_Begin ("class=\"DAT LM COLOR%u\"",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"
");
if (ShowCommentStd)
{
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
CommentStd,Cns_MAX_BYTES_TEXT,false);
fprintf (Gbl.F.Out,"- %s:
- %s
",
Txt_Student_comment,
CommentStd);
}
if (ShowCommentTch)
{
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
CommentTch,Cns_MAX_BYTES_TEXT,false);
fprintf (Gbl.F.Out,"- %s:
"
"- %s
",
Txt_Teachers_comment,
CommentTch);
}
fprintf (Gbl.F.Out,"
");
HTM_TD_End ();
HTM_TR_End ();
}
}
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
}