Subversion Repositories bacoAlunos

Rev

Rev 180 | Rev 185 | 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">
20
<table width="100%" align="center">
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>
41
            Se é docente da ESTG por favor confirme as suas unidades curriculares e informe caso seja detectado algum
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>
49
            obrigado pela disponibilidade
50
        </li>
51
    </ul>
52
</div>
53
<div class="portalContent">
184 jmachado 54
<p>Exemplo:</p>
55
<p>para o usuário NETPA: est12345 use: 12345</p>
56
<p>ou então o seu número de BI</p>
180 jmachado 57
<form action="units.jsp">
184 jmachado 58
    <p>Código de docente: <input type="text" name="sigesTeacherCode"> (Este usuário é o mesmo que usa para entrar no NETPA (SEM as letras) para introduzir os sumários)
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;
82
        if(code != null && code.trim().length()>0)
83
            teacher = DaoFactory.getTeacherDaoImpl().loadBySigesCode(Integer.parseInt(code));
84
        else
85
            teacher = DaoFactory.getTeacherDaoImpl().loadByBi(bi);
180 jmachado 86
 
87
 
88
 
184 jmachado 89
        if (teacher == null)
90
        {
91
%>
92
<div class="statusERROR">
93
    <p>Docente não encontrado</p>
94
</div>
95
<%
96
}
97
else
98
{
99
    teacher.setUnitCheck(true);
100
%>
101
<p>Docente: <%=teacher.getName()%>
102
</p>
103
 
104
<p>Email: <%=teacher.getEmail()%>
105
</p>
106
<%
107
    if (teacher.getTeachedUnits() == null || teacher.getTeachedUnits().size() == 0)
180 jmachado 108
    {
184 jmachado 109
%>
110
<div class="statusERROR">
111
    <p>Não tem quaisquer unidades curriculares associadas</p>
112
</div>
113
<%
114
}
115
else
116
{
117
%>
118
<table border="1">
119
    <tr>
120
        <th>
121
            Código de Curso
122
        </th>
123
        <th>
124
            Curso
125
        </th>
126
        <th>
127
            Unidade
128
        </th>
129
        <th>
130
            Semestre
131
        </th>
132
    </tr>
180 jmachado 133
    <%
184 jmachado 134
        for (CourseUnit cu : teacher.getTeachedUnits())
180 jmachado 135
        {
136
    %>
184 jmachado 137
    <tr>
138
        <td>
139
            <%=cu.getCourseCode()%>
140
        </td>
141
        <td>
142
            <%=cu.getCourseName()%>
143
        </td>
144
        <td>
145
            <%=cu.getName()%>
146
        </td>
147
        <td>
148
            <%=cu.getSemestre()%>
149
        </td>
150
    </tr>
180 jmachado 151
    <%
184 jmachado 152
        }
180 jmachado 153
    %>
184 jmachado 154
</table>
155
<%
180 jmachado 156
 
184 jmachado 157
        }
158
    }
159
 
160
}
161
catch (NumberFormatException e)
162
{
163
%>
164
<div class="statusERROR">
165
    <p>Por favor introduza um número</p>
166
</div>
167
<%
180 jmachado 168
            }
169
        }
170
 
184 jmachado 171
        AbstractDao.getCurrentSession().getTransaction().commit();
180 jmachado 172
    }
184 jmachado 173
    catch (Throwable e)
174
 
180 jmachado 175
    {
184 jmachado 176
        response.sendError(500);
180 jmachado 177
    }
184 jmachado 178
%>
180 jmachado 179
</div>
184 jmachado 180
<div class="statusERROR">
181
    <p>Por favor informe a equipa de desenvolvimento (<a href="mailto:bacodev@estgp.pt">bacoDev</a>) caso algum erro tenha sido detectado, em caso de estar tudo ok não é necessário feedback </p>
180 jmachado 182
</div>
184 jmachado 183
</div>
180 jmachado 184
 
185
</td>
186
</tr>
187
</table>
188
<div id="footer">
189
    <jsp:include page="layout/footer.jsp"/>
190
</div>
191
</div>
192
</td>
193
</tr>
194
</table>
195
</body>
196
</html:html>