Example #1
0
        public string drawClassroomSchedule(int g, Schedule p)
        {
            Classroom G = p.getRoomByNo(g);
            string s = "<html><head><style type='text/css'>" +
                       "body{margin:50px 0px; padding:0px;	text-align:center;}" +
                       "table, td, th{	border: 1px solid black;	border-collapse:collapse;}" +
                       "td{font-size:10pt; text-align:center;}" +
                       " td.full{background-color=#CCCCFF}</style></head><body><h3>";
            s += (G.getID() + "</h3><table border='2'>");
            s += "<tr><th WIDTH='70'>SAT</th><th WIDTH='150'>PONEDJELJAK</th>" +
                 "<th WIDTH='150'>UTORAK</th><th WIDTH='150'>SRIJEDA</th>" +
                 "<th WIDTH='150'>CETVRTAK</th><th WIDTH='150'>PETAK</th></tr>";

            for (int i = 0; i < 12; i++)
            {
                s += ("<tr style='height:40px'><td WIDTH='70'>" +
                     (i + 8).ToString() + "<sup>00</sup> - " +
                     (i + 9).ToString() + "<sup>00</sup></td>");

                for (int j = 0; j < 5; j++)
                {
                    if (sobe[g, j, i] == 0)
                        s += "<td WIDTH='150'>&nbsp;</td>";
                    else
                    {
                        Event t = p.getEventByID(sobe[g, j, i]);
                        if (i == 0 || sobe[g, j, i - 1] != sobe[g, j, i])
                        {
                            s += ("<td  class='full'rowspan='" +
                                 t.Duration.ToString() + "' WIDTH='150'>" +
                                 t.getCourse().getName() + " " + "<br />" +
                                 p.findLecturer(eventi[t.Id, 0]).getName()/*t.getLecturer().getName()*/ +
                                 "</td>");
                        }
                    }
                }
                s += "</tr>";
            }
            s += "</table></body></html>";
            return s;
        }