Subversion Repositories bacoAlunos

Rev

Rev 1306 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
180 jmachado 1
<%@ page import="jomm.dao.impl.AbstractDao" %>
2
<%@ page import="pt.estgp.estgweb.domain.Teacher" %>
3
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
4
<%@ page import="pt.estgp.estgweb.domain.CourseUnit" %>
5
<%@ page contentType="text/html" %>
6
<%@ page pageEncoding="UTF-8" %>
7
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
8
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
9
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
10
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
11
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
12
<html:html locale="true">
13
<head>
14
    <title>Consulta de Unidades Curriculares</title>
15
    <link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/style.css"/>
16
 
17
</head>
18
<body class="small" marginwidth="0" marginheight="0" bgcolor="#ffffff" topmargin="0" leftmargin="0"
19
      style="text-align:center">
187 jmachado 20
<table align="center">
180 jmachado 21
<tr>
22
<td align="center">
23
<div id="body">
24
 
25
<table id="page">
26
<tr>
27
    <td>
28
        <div id="header">
29
            <jsp:include page="layout/header.jsp"/>
30
        </div>
31
    </td>
32
</tr>
33
<tr>
34
<td id="content">
35
<h1>Bem vindo à página de consulta de unidades curriculares</h1>
36
<br>
37
 
38
<div class="listCircleWhite">
39
    <ul>
40
        <li>
185 jmachado 41
            Por favor confirme as suas unidades curriculares e informe caso seja detectado algum
180 jmachado 42
            erro
43
        </li>
44
        <li>
45
            O objectivo desta consulta é identificar erros de importação do sistema SIGES na nova plataforma do sitio da
46
            ESTG
47
        </li>
48
        <li>
185 jmachado 49
            Obrigado pela disponibilidade
180 jmachado 50
        </li>
51
    </ul>
52
</div>
53
<div class="portalContent">
184 jmachado 54
<p>Exemplo:</p>
185 jmachado 55
<p>est12345</p>
184 jmachado 56
<p>ou então o seu número de BI</p>
180 jmachado 57
<form action="units.jsp">
185 jmachado 58
    <p>USERNAME NETPA: <input type="text" name="sigesTeacherCode">
180 jmachado 59
    <p>ou número de BI: <input type="text" name="bi"> </p>
60
    <p><input type="submit"/></p>
61
</form>
62
<div>
184 jmachado 63
<%
64
    try
65
    {
66
        AbstractDao.getCurrentSession().beginTransaction();
67
        String code = request.getParameter("sigesTeacherCode");
68
        String bi = request.getParameter("bi");
69
        if((code ==  null && code.length()  == 0) || ( bi == null &&  bi.length() == 0))
180 jmachado 70
        {
184 jmachado 71
%>
72
<div class="statusERROR">
73
    <p>Por favor coloque o código de docente ou o número de bilhete de identidade</p>
74
</div>
75
<%
76
}
77
else
78
{
79
    try
80
    {
81
        Teacher teacher;
185 jmachado 82
        if(code.startsWith("est"))
83
            code = code.substring(3);
184 jmachado 84
        if(code != null && code.trim().length()>0)
85
            teacher = DaoFactory.getTeacherDaoImpl().loadBySigesCode(Integer.parseInt(code));
86
        else
87
            teacher = DaoFactory.getTeacherDaoImpl().loadByBi(bi);
180 jmachado 88
 
89
 
90
 
184 jmachado 91
        if (teacher == null)
92
        {
93
%>
94
<div class="statusERROR">
95
    <p>Docente não encontrado</p>
96
</div>
97
<%
98
}
99
else
100
{
101
    teacher.setUnitCheck(true);
102
%>
103
<p>Docente: <%=teacher.getName()%>
104
</p>
105
 
106
<p>Email: <%=teacher.getEmail()%>
107
</p>
108
<%
109
    if (teacher.getTeachedUnits() == null || teacher.getTeachedUnits().size() == 0)
180 jmachado 110
    {
184 jmachado 111
%>
112
<div class="statusERROR">
113
    <p>Não tem quaisquer unidades curriculares associadas</p>
114
</div>
115
<%
116
}
117
else
118
{
119
%>
120
<table border="1">
121
    <tr>
122
        <th>
123
            Código de Curso
124
        </th>
125
        <th>
126
            Curso
127
        </th>
128
        <th>
129
            Unidade
130
        </th>
131
        <th>
132
            Semestre
133
        </th>
134
    </tr>
180 jmachado 135
    <%
184 jmachado 136
        for (CourseUnit cu : teacher.getTeachedUnits())
180 jmachado 137
        {
138
    %>
184 jmachado 139
    <tr>
140
        <td>
141
            <%=cu.getCourseCode()%>
142
        </td>
143
        <td>
144
            <%=cu.getCourseName()%>
145
        </td>
146
        <td>
147
            <%=cu.getName()%>
148
        </td>
149
        <td>
150
            <%=cu.getSemestre()%>
151
        </td>
152
    </tr>
180 jmachado 153
    <%
184 jmachado 154
        }
180 jmachado 155
    %>
184 jmachado 156
</table>
157
<%
180 jmachado 158
 
184 jmachado 159
        }
160
    }
161
 
162
}
163
catch (NumberFormatException e)
164
{
165
%>
166
<div class="statusERROR">
167
    <p>Por favor introduza um número</p>
168
</div>
169
<%
180 jmachado 170
            }
171
        }
172
 
184 jmachado 173
        AbstractDao.getCurrentSession().getTransaction().commit();
180 jmachado 174
    }
184 jmachado 175
    catch (Throwable e)
176
 
180 jmachado 177
    {
184 jmachado 178
        response.sendError(500);
180 jmachado 179
    }
184 jmachado 180
%>
180 jmachado 181
</div>
187 jmachado 182
<ul class="statusERROR" style="font-size:1.1em">
183
    <li>Por favor informe a equipa de desenvolvimento (<a href="mailto:jmachado@estgp.pt">jmachado@estgp.pt</a>) caso algum erro tenha sido detectado, em caso de estar tudo ok não é necessário feedback</li>
184
</ul>
180 jmachado 185
</div>
186
 
187
</td>
188
</tr>
189
</table>
190
<div id="footer">
191
    <jsp:include page="layout/footer.jsp"/>
192
</div>
193
</div>
194
</td>
195
</tr>
196
</table>
197
</body>
198
</html:html>