<%Server.ScriptTimeOut = 90000%> <% response.buffer=false %> <%if session("conect") <> 3 then session("conect") = 0 response.write "







VOCÊ NÃO TEM PERMISSÃO PARA ACESSAR ESTA PÁGINA.
" response.end end if if session("categoria") <> 1 and session("categoria") <> 0 then session("conect") = 0 response.write "







VOCÊ NÃO TEM PERMISSÃO PARA ACESSAR ESTA PÁGINA.
" response.end end if bloq = 1 xload = "" 'Set Conn = Server.CreateObject("ADODB.Connection") 'Set RS = Server.CreateObject("ADODB.Recordset") 'Conn.Open caminho 'rs.open "Select * From gfarma_prevsaude", conn, 3 'ncampos = cstr(rs.recordcount) 'response.write ncampos 'response.write "
" 'contador = 0 'while not rs.eof ' contador = contador + 1 ' response.write contador&") "&rs("usuario")&"
" ' rs.movenext 'wend 'response.write "
" 'rs.close 'conn.close 'set rs=nothing 'set conn=nothing 'response.end %> Área Restrita "" then%>onLoad="peri();"<%end if%>>

Escolha o Associado:
<%if request.form("assocon") = "" then response.end%>
<% ''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'if xnove = "PINGUELOW" then ''''''''''''''''''''''''''''''''''''''''''''''''''''''''' numero_1 = "00" dia = day(now) xdia = Cdbl(numero_1) + Cdbl(dia) xdia = Right(Cstr(xdia + 1000000000000),Len(numero_1)) numero_1 = "00" mes = month(now) xmes = Cdbl(numero_1) + Cdbl(mes) xmes = Right(Cstr(xmes + 1000000000000),Len(numero_1)) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'if bosta="sim" then ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Set Conn = Server.CreateObject("ADODB.Connection") Set RS = Server.CreateObject("ADODB.Recordset") Conn.Open caminho rs.open "Select * From gfarma_prevsaude WHERE cod_associado = "&request.form("assocon")&" ORDER BY usuario ", conn, 3 numcampos = rs.recordcount if rs.eof then rs.close conn.close set rs = nothing set conn = nothing strHTML = "" strHTML = "O Associado Código "&request.form("assocon")&".

Não possui usuários cadastrados.



" strHTML = strHTML & "Data: " & date & "
Hora: " & time & "



" strHTML = strHTML & "

Grupofarma - www.grupofarma.com.br

" Set Mailer = CreateObject("CDONTS.NewMail") Mailer.From = "grupofarma@grupofarma.com.br" ' e-mail de quem esta enviando a mensagem Mailer.To = "webmaster@grupofarma.com.br" ' e-mail de quem vai receber a mensagem Mailer.BodyFormat = 0 ' parametro de formatação Mailer.MailFormat = cdoMailFormatHTML ' parametro de formatação Mailer.Subject = "Clientes do Associado Código: "&request.form("assocon") Mailer.Body = strHTML Mailer.Send Set Mailer = Nothing response.write "







Esse Associado não tem nenhum Usuário Cadastrado.
" response.end end if associado = rs("associado") arquivo = "/grupofarma/login/txt/"&request.form("assocon")&"_"&xdia&xmes&right(year(now),2)&".txt" arquivo2 = "s:\home\gtamultimidia\web\grupofarma\login\txt\"&request.form("assocon")&"_"&xdia&xmes&right(year(now),2)&".txt" Dim conteudo conteudo = "" Dim fs, d, s Set fs = Server.CreateObject("Scripting.FileSystemObject") Set d = fs.CreateTextFile(server.MapPath(arquivo),true) while not rs.eof tamtemp = 16 cptemp = RTRIM(rs("cod_id_usuario")) lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 3 cptemp = RTRIM(rs("cod_associado")) lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&"0" next vartemp = vartemp&cstr(cptemp) conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 40 cptemp = RTRIM(rs("associado")) lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 15 cptemp = RTRIM(rs("associado_tel")) lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 40 cptemp = RTRIM(rs("usuario_old")) lentemp = tamtemp - len(cptemp) vartemp = "" if IsNull(cptemp) then cptemp = "" if IsNull(lentemp) then lentemp = tamtemp for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 25 cptemp = RTRIM(rs("usuario")) lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 15 cptemp = RTRIM(rs("logradouro")) lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 40 cptemp = RTRIM(rs("logradouro_end")) lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 40 cptemp = RTRIM(rs("logradouro_TXT")) lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 6 cptemp = RTRIM(rs("logradouro_n")) lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 20 cptemp = RTRIM(rs("complemento")) lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 30 cptemp = RTRIM(rs("bairro")) lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 30 cptemp = RTRIM(rs("cidade")) lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' conteudo = conteudo&rs("uf") ''''''''''''''''''''''''''''''''''''''''''''' conteudo = conteudo&rs("cep") ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 10 cptemp = RTRIM(rs("cep_txt")) lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' conteudo = conteudo&rs("sexo") ''''''''''''''''''''''''''''''''''''''''''''' numero_1 = "00000000" dt = rs("dt_nasc_TXT") xdt = Cdbl(numero_1) + Cdbl(dt) xdt = Right(Cstr(xdt + 10000000000000),Len(numero_1)) conteudo = conteudo&xdt ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 4 cptemp = RTRIM(rs("ddd")) lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 15 cptemp = rs("telefone_txt") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 10 cptemp = RTRIM(rs("rg")) lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 2 cptemp = rs("rg_uf") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 11 cptemp = RTRIM(rs("cpf")) lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp '''''''''''''''''''''''''''''''''''''''''''' tamtemp = 11 cptemp = RTRIM(rs("cpf_dep")) lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' conteudo = conteudo&rs("tipo_operacao") ''''''''''''''''''''''''''''''''''''''''''''' numero_1 = "00000000" dt = rs("dt_inativacao_TXT") xdt = Cdbl(numero_1) + Cdbl(dt) xdt = Right(Cstr(xdt + 10000000000000),Len(numero_1)) conteudo = conteudo&xdt ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 30 cptemp = RTRIM(rs("cod_id_titular")) lentemp = tamtemp - len(cptemp) if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 150 cptemp = RTRIM(rs("email")) lentemp = tamtemp - len(cptemp) vartemp = "" if IsNull(cptemp) then cptemp = "" if IsNull(lentemp) then lentemp = tamtemp for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 10 cptemp = RTRIM(rs("d_cad")) lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 10 cptemp = rs("d_alt") lentemp = tamtemp - len(cptemp) vartemp = "" if IsNull(cptemp) then cptemp = "" if IsNull(lentemp) then lentemp = tamtemp for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' conteudo = conteudo&rs("enviado_sn") ''''''''''''''''''''''''''''''''''''''''''''' conteudo = conteudo&rs("enviado_sn_petrone") ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 10 cptemp = RTRIM(rs("enviado_d")) lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 10 cptemp = RTRIM(rs("enviado_d_petrone")) lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 50 cptemp = RTRIM(rs("enviado_deta")) lentemp = tamtemp - len(cptemp) vartemp = "" if IsNull(cptemp) then cptemp = "" if IsNull(lentemp) then lentemp = tamtemp for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 100 cptemp = RTRIM(rs("obs")) lentemp = tamtemp - len(cptemp) vartemp = "" if IsNull(cptemp) then cptemp = "" if IsNull(lentemp) then lentemp = tamtemp for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' ' conteudo = conteudo&vbcrlf d.writeline(conteudo) conteudo = "" rs.movenext wend rs.close conn.close set rs = nothing set conn = nothing d.close() set f = nothing response.write "

1. ARQUIVO GERADO COM ÊXITO!

" ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' strHTML = "" strHTML = "Segue Anexo Arquivo (.TXT) dos Clientes do associado "&associado&".

Total de "&numcampos&" registros.



" strHTML = strHTML & "Data: " & date & "
Hora: " & time & "



" strHTML = strHTML & "

Grupofarma - www.grupofarma.com.br

" 'Set Mailer = CreateObject("CDONTS.NewMail") 'Mailer.From = "grupofarma@grupofarma.com.br" ' e-mail de quem esta enviando a mensagem 'Mailer.To = "webmaster@grupofarma.com.br" ' e-mail de quem vai receber a mensagem 'Mailer.BodyFormat = 0 ' parametro de formatação 'Mailer.MailFormat = cdoMailFormatHTML ' parametro de formatação 'Mailer.AttachFile arquivo2 'caso queira anexar algum arquivo ao seu e-mail 'Mailer.Subject = "Clientes do Associado: "&associado 'Mailer.Body = strHTML 'Mailer.Send 'Set Mailer = Nothing Set objCDOSYSMail = Server.CreateObject("CDO.Message") Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration") objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp2.locaweb.com.br" objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30 objCDOSYSCon.Fields.update Set objCDOSYSMail.Configuration = objCDOSYSCon objCDOSYSMail.From = "grupofarma@grupofarma.com.br" objCDOSYSMail.To = "webmaster@gtamultimidia.com.br" ' objCDOSYSMail.cc = "webmaster@grupofarma.com.br;grupofarma@grupofarma.com.br;valnessa@grupofarma.com.br" objCDOSYSMail.Subject = "Clientes do Associado: "&associado objCDOSYSMail.HtmlBody = strHTML '"Teste do componente CDOSYS" objCDOSYSMail.AddAttachment arquivo2 objCDOSYSMail.Send Set objCDOSYSMail = Nothing Set objCDOSYSCon = Nothing response.write "

2. ARQUIVO ENVIADO COM ÊXITO!

" response.write "


TODOS OS PROCEDIMENTOS FORAM REALIZADOS COM SUCESSO!

- "&associado&" -

" %>