<%@ LANGUAGE="VBSCRIPT" %> Notas Net <% sub cabecalho() comandosql = "SELECT * FROM ESCOLAIN.TXT WHERE ESCOLA='"+unidade+"'" set bd = conn.execute(comandosql) while not bd.eof response.write("") if (bd("endereco") <> "") and (bd("cep") <> "") and (bd("municipio") <> "") and (bd("uf") <> "") then response.write("") end if response.write("
Unidade: "+bd("unidade")+"
Endereco: ") response.write(bd("endereco")+"
"+bd("cep")+"-"+bd("municipio")+"-"+bd("uf")+"

") bd.movenext wend set bd = nothing end sub sub detalhes() comandosql = "SELECT DISTINCT alunos.Escola, alunos.CODIGO, alunos.Nome, alunos.Nascimento, alunos.Curso," comandosql = comandosql+" alunos.Numero, alunos.Status, alunos.descricao, notasin.Escola, notasin.Curso, notasin.Periodo," comandosql = comandosql+" notasin.Materia, notasin.Status, notasin.Aluno, notasin.Nota1, notasin.Nota2, notasin.Nota3," comandosql = comandosql+" notasin.Nota4, notasin.Testao, notasin.Rb, notasin.Co1, notasin.Co2, notasin.Co3, notasin.Co4," comandosql = comandosql+" notasin.Cm, notasin.Pn1, notasin.Pn2, notasin.Pn3, notasin.Pn4, notasin.Ptestao, notasin.NotaES1, notasin.NotaRES1, notasin.NotaTC, notasin.FaltasBi," comandosql = comandosql+" notasin.Total, notasin.Media, notasin.Numero" comandosql = comandosql+" FROM "+chr(34)+"alunos.txt"+chr(34)+" alunos, "+chr(34)+"notasin.txt"+chr(34)+" notasin" comandosql = comandosql+" WHERE" comandosql = comandosql+" (alunos.Escola = '"+unidade+"')" comandosql = comandosql+" AND (alunos.Codigo = '"+aluno+"')" comandosql = comandosql+" AND (notasin.Escola = alunos.Escola)" comandosql = comandosql+" AND (notasin.Aluno = alunos.CODIGO)" comandosql = comandosql+" ORDER BY alunos.Escola, alunos.Nome, notasin.Periodo, notasin.Materia" set bd = conn.execute(comandosql) if not bd.eof then gcurso = bd("curso") response.write("") response.write("") response.write("
") response.write("") response.write("Notas de: "+bd("nome")) response.write("
") response.write("Curso: "+bd("descricao")) response.write("
") end if anterior = "" response.write("") response.write("") response.write(tdon1+"BIMESTRE"+tdoff1) response.write(tdon1+"MATÉRIA"+tdoff1) response.write(tdon1+"NOTA1"+tdoff1) response.write(tdon1+"NOTA2"+tdoff1) response.write(tdon1+"NOTA3"+tdoff1) response.write(tdon1+"NOTA4"+tdoff1) response.write(tdon1+"TESTÃO"+tdoff1) response.write(tdon1+"NES1"+tdoff1) response.write(tdon1+"NRES1"+tdoff1) response.write(tdon1+"NTC"+tdoff1) response.write(tdon1+"MD BIM"+tdoff1) response.write(tdon1+"RB"+tdoff1) response.write(tdon1+"MD APÓS RB"+tdoff1) response.write("") while not bd.eof if (anterior <> bd("periodo")) then response.write("") anterior = bd("periodo") end if if bd("total") > 0 then response.write("") response.write(tdon1) response.write(bd("periodo")) response.write(tdoff1) response.write(tdon1) response.write(bd("materia")) response.write(tdoff1) response.write(tdon2) response.write(bd("nota1")) response.write(tdoff1) response.write(tdon2) response.write(bd("nota2")) response.write(tdoff1) response.write(tdon2) response.write(bd("nota3")) response.write(tdoff1) response.write(tdon2) response.write(bd("nota4")) response.write(tdoff1) response.write(tdon2) response.write(bd("testao")) response.write(tdoff1) response.write(tdon2) response.write(bd("NotaES1")) response.write(tdoff1) response.write(tdon2) response.write(bd("NotaRES1")) response.write(tdoff1) response.write(tdon2) response.write(bd("NotaTC")) response.write(tdoff1) response.write(tdon2) response.write(bd("total")) response.write(tdoff1) response.write(tdon2) response.write(bd("rb")) response.write(tdoff1) response.write(tdon2) response.write(bd("media")) response.write(tdoff1) response.write("") end if bd.movenext wend response.write("

") set bd = nothing end sub sub estrutura() comandosql = "SELECT * FROM PERIODIN.TXT WHERE (ESCOLA='"+unidade+"') AND (CURSO='"+gcurso+"') ORDER BY PERIODO" set bd = conn.execute(comandosql) response.write("
Estrutura do ano letivo no curso:
") response.write("") response.write(tdon1+"PERIODO"+tdoff1) response.write(tdon1+"DATA DE INÍCIO"+tdoff1) response.write(tdon1+"DATA DE TÉRMINO"+tdoff1) response.write(tdon1+"PONTUAÇÃO MÁXIMA"+tdoff1) response.write(tdon1+"MÍNIMO P/ APROVAÇÃO"+tdoff1) response.write("") while not bd.eof response.write("") response.write(tdon1+bd("PERIODO")+tdoff1) response.write(tdon2+bd("datainicio")+tdoff1) response.write(tdon2+bd("datafim")+tdoff1) response.write(tdon2+bd("pontosmax")+tdoff1) response.write(tdon2+bd("mediareq")+tdoff1) response.write("") bd.movenext wend response.write("

") set bd = nothing end sub sub resumo() rem function g_media:string; rem begin rem if q1.fieldbyname('tnota').text = 'C' then rem result := '-.-' rem else rem result := fixn(q1.fieldbyname('mediag')) rem comandosql = "SELECT DISTINCT" rem comandosql = comandosql+" notasin.Escola, notasin.Curso, notasin.Materia, notasin.Aluno, mater1in.TNota, SUM(notasin.Media) AS MEDIAG" rem comandosql = comandosql+" FROM "+CHR(34)+"notasin.txt"+chr(34)+" notasin, "+chr(34)+"mater1in.txt"+chr(34)+" mater1in" rem comandosql = comandosql+" WHERE" rem comandosql = comandosql+" (notasin.Escola = '"+unidade+"')" rem comandosql = comandosql+" AND (notasin.Aluno = '"+aluno+"')" rem comandosql = comandosql+" AND (mater1in.Escola = notasin.Escola)" rem comandosql = comandosql+" AND (mater1in.Curso = notasin.Curso)" rem comandosql = comandosql+" AND (mater1in.Periodo = notasin.Periodo)" rem comandosql = comandosql+" AND (mater1in.Materia = notasin.Materia)" rem comandosql = comandosql+" GROUP BY notasin.Escola, notasin.Curso, notasin.Materia, notasin.Aluno, mater1in.TNota" rem comandosql = comandosql+" ORDER BY notasin.Escola, notasin.Curso, notasin.Materia, notasin.Aluno, mater1in.TNota" rem set bd = conn.execute(comandosql) comandosql = "SELECT DISTINCT" comandosql = comandosql+" notasin.Escola, notasin.Curso, notasin.Materia, notasin.Aluno, notasin.TNota, notasin.Media, notasin.MediaRb" comandosql = comandosql+" FROM "+CHR(34)+"media1in.txt"+chr(34)+" notasin, "+chr(34)+"mater1in.txt"+chr(34)+" mater1in" comandosql = comandosql+" WHERE" comandosql = comandosql+" (notasin.Escola = '"+unidade+"')" comandosql = comandosql+" AND (notasin.Aluno = '"+aluno+"')" comandosql = comandosql+" AND (mater1in.Escola = notasin.Escola)" comandosql = comandosql+" AND (mater1in.Curso = notasin.Curso)" REM comandosql = comandosql+" AND (mater1in.Periodo = notasin.Periodo)" comandosql = comandosql+" AND (mater1in.Materia = notasin.Materia)" comandosql = comandosql+" ORDER BY notasin.Escola, notasin.Curso, notasin.Materia, notasin.Aluno, notasin.TNota" set bd = conn.execute(comandosql) response.write("
") response.write("Resumo:
") response.write("") response.write("") response.write(tdon1+"MATÉRIA"+tdoff1) response.write(tdon1+"SOMATORIA ANUAL"+tdoff1+"") while not bd.eof response.write("") response.write(tdon1+bd("MATERIA")+tdoff1) if bd("TNota") = "N" then mediagstr = bd("MEDIA") + "  /  " + bd("MEDIARB") else mediagstr = "Conceito" end if response.write(tdon2+MEDIAGSTR+tdoff1+"") bd.movenext wend response.write("

") set bd = nothing end sub sub materias() comandosql = "SELECT DISTINCT" comandosql = comandosql+" Escola, Curso, Materia, TNota" comandosql = comandosql+" FROM mater1in.txt" comandosql = comandosql+" WHERE" comandosql = comandosql+" (Escola = '"+unidade+"')" comandosql = comandosql+" AND (Curso = '"+gcurso+"')" comandosql = comandosql+" ORDER BY Escola, Curso, Materia" set bd = conn.execute(comandosql) response.write("
") response.write("Particularidades das matérias no curso: ") response.write("
") response.write("") response.write("") response.write(tdon1+"MATÉRIA"+tdoff1) response.write(tdon1+"T.NOTA"+tdoff1+"") while not bd.eof response.write("") response.write(tdon1+bd("MATERIA")+tdoff1) response.write(tdon2+bd("TNOTA")+tdoff1+"") bd.movenext wend response.write("

") set bd = nothing end sub sub faltas() comandosql = "SELECT DISTINCT" comandosql = comandosql+" Escola, Curso, Periodo, Aluno, MAX(FaltasBi) as Faltas" comandosql = comandosql+" FROM notasin.txt" comandosql = comandosql+" WHERE" comandosql = comandosql+" (Aluno = '"+aluno+"')" comandosql = comandosql+" AND (Escola = '"+unidade+"')" comandosql = comandosql+" AND (FaltasBi > '0')" comandosql = comandosql+" GROUP BY Escola, Curso, Periodo, Aluno" comandosql = comandosql+" ORDER BY Escola, Curso, Periodo, Aluno" set bd = conn.execute(comandosql) response.write("
") response.write("Faltas bimestrais: ") response.write("
") response.write("") response.write("") response.write(tdon1+"BIMESTRE"+tdoff1) response.write(tdon1+"FALTAS"+tdoff1+"") while not bd.eof response.write("") response.write(tdon1+bd("periodo")+tdoff1) response.write(tdon2+bd("faltas")+tdoff1+"") bd.movenext wend response.write("

") Conn.Close set bd = nothing end sub sub responderconsulta() cabecalho() detalhes() REM estrutura() REM resumo() REM materias() faltas() end sub REM ===== TRATAMENTO DA REQUISICAO =========== unidade = ucase(request.querystring("unidade")+request.form("unidade")) aluno = request.querystring("codaluno")+request.form("codaluno") if unidade="AAAA" and aluno="99999" then response.write("") else if (unidade = "GXP1") or (unidade = "PAS1") or (unidade = "PAS2") or (unidade = "SSP1") or (unidade = "SSP2") or (unidade = "NHN0") then Set conn = Server.CreateObject("ADODB.Connection") //connstr = "Driver={Microsoft Text Driver (*.txt; *.csv)};" & "Dbq="+Server.MapPath(unidade)+"\;" & "Extensions=asc,csv,tab,txt;" & "Persist Security Info=False" connstr = "Driver={Microsoft Text Driver (*.txt; *.csv)};" & "Dbq="+"\home\objetivonhn.com.br\www\notasnet\"+unidade+"\;" & "Extensions=asc,csv,tab,txt;" & "Persist Security Info=False;" Conn.Open connStr tdon1 = "" tdon2 = "" tdoff1 = " " tborder = "border='0' cellspacing='0'" gcurso = "0000" responderconsulta() else response.write("Unidade inválida: " & unidade) end if end if %>