Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

chocomilki

Mostrar somente aulas do Mê atual

Recommended Posts

Olá Amigos, 

 

Estou com uma dificuldade em minha consulta.. preciso que ao informar o nome do Professor ela me mostre somente as aulas que ele deu no atual mês , mas ele mostra todos.. 

 

Tentei usar a função abaixo sem sucesso :

 

	<%
	varMesAtual = month(date())

strSQL = "Select * from Aulas where MONTH(ven)="& varMesAtual

 
 Set ObjRs = cnnSearch.Execute(strSQL)

%>

Segue o código completo:

 

<%

Dim strURL     

Dim cnnSearch 
Dim rstSearch  
Dim strDBPath  

Dim strSQL    
Dim strSearch  
inicio = Timer

'#Função que tira todos os acentos das palavras
function TiraAcento(StrAcento)
 for i = 1 to len(StrAcento) 
  Letra = mid(StrAcento, i, 1)
  Select Case Letra
   Case "á","Á","à","À","ã","Ã","â","Â","â","ä","Ä"
   Letra = "A"
   Case "é","É","ê","Ê","Ë","ë","È","è"
   Letra = "E"
   Case "í","Í","ï","Ï","Ì","ì"
   Letra = "I"
   Case "ó","Ó","ô","Ô","õ","Õ","ö","Ö","ò","Ò"
   Letra = "O"
   Case "ú","Ú","Ù","ù","ú","û","ü","Ü","Û"
   Letra = "U"
   Case "ç","Ç"
   Letra = "C"
   Case "ñ"
   Letra = "N"
  End Select
  texto = texto & Letra
 next
 TiraAcento = texto
end function 


strURL = Request.ServerVariables("URL")

strSearch = Request.QueryString("search")

%>

 <title>WEB ADMIN</title>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<body bgcolor="#FFFFFF">
<link rel="stylesheet" media="screen" href="style.css" />


<table width="1" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F2FFF2">
  <tr>
    <td bgcolor="#FFFFFF" width="812">
    <table width="515" border="0" cellpadding="2" style="border-collapse: collapse" height="1">
<tr>
          <td bgcolor="#FFFFFF" height="4" colspan="2" width="667">
            <p align="left">
            <span style="font-size: 14pt">Relação de&nbsp; Aulas por Professor</span></td>
        </tr>            
<tr>
          <td bgcolor="#FFFFFF" valign="middle" height="1" width="569">
            <form action="<%= strURL %>" method="get">
              <div align="left"> 
                <b><font face="Arial" style="font-size: 8pt">&nbsp;</font></b><b><font face="Arial" style="font-size: 8pt"><br>
                <br>
                &nbsp;Informe o Professor </font>
                </b> 
                <span style="font-size: 11pt; font-weight: 400"><input type="text" placeholder="Categoria" size="55" name="search" value="<%= strSearch %>"></span><span style="font-size: 8pt"><font face="Arial" color="#008000">
                </font>
                </span>
                <font face="Arial" color="#008000">
                <input name="submit" type="submit" value="busca" style="font-size: 8 pt; font-weight: bold; background-color: #00699C; color:#FFFFFF; " /><span style="font-size: 8pt">
                </span>
                </font>
              </div>
            </form>
            <p align="center"> 
                <font face="Arial" style="font-size: 8pt"> 
              
                
                <%
If strSearch <> "" Then
	
       	strDBPath = Server.MapPath("Noticias.mdb")
        
Const adUseClient = 3
	
	Set cnnSearch = Server.CreateObject("ADODB.Connection")
	
cnnSearch.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"
cnnSearch.CursorLocation = adUseClient

	
	varMesAtual = month(date())

strSQL = "Select * from Aulas where MONTH(ven)="& varMesAtual

 
 Set ObjRs = cnnSearch.Execute(strSQL)


	



strSQL = "SELECT nome,data,horario,unidade,ven,id " _
		& "FROM Aulas " _
		& "WHERE nome LIKE '%" & TiraAcento(Replace(strSearch, "'", "''")) & "%' " _
		& "OR ven LIKE '%" & TiraAcento(Replace(strSearch, "'", "''")) & "%' " _
		& "ORDER BY id;"

	Set rstSearch = cnnSearch.Execute(strSQL)
intContador = rstSearch.RecordCount



	%> 
	
	 
		</font>
            </p></td>
          <td bgcolor="#FFFFFF" valign="top" height="1" width="94">
            <p align="center">
            <font face="Arial" style="font-size: 8pt"><a title="Imprimir" href="a">
            <script language="JavaScript1.2">
<!--
function DoPrinting(){
if (!window.print){
alert("Use o Netscape  ou Internet Explorer \n nas versões 4.0 ou superior!")
return
}
window.print()
}
//-->
            </script>
            </a>

            </font></td>
        </tr>
      </table>
      <p align="left">
        <font face="Century Gothic" style="font-size: 8pt"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#6E9F4D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#1D2447">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( Foram encontradas&nbsp;<%=intContador%> 
        ocorrências )</font></b></font></p>
      <div align="center" style="width: 502; height: 246"> 
        <table width="690" border="0" cellpadding="4" cellspacing="0" bgcolor="#FFFFFF" style="border-collapse: collapse" bordercolor="#111111" height="1">
<tr> 
            <th width="39" bgcolor="#525252" align="left" style="border-bottom-style: none; border-bottom-width: medium" bordercolor="#99B5C0" height="21"><strong>
            <font face="Arial" style="font-size: 8pt" color="#FFFFFF">Cod</font></strong></th>
            <th width="627" bgcolor="#525252" align="left" style="border-bottom-style: none; border-bottom-width: medium" bordercolor="#99B5C0" height="21">
            <strong><font color="#FFFFFF"><span style="font-size: 8pt">Nome do 
            Professor</span></font></strong></th>
            <th width="627" bgcolor="#525252" align="left" style="border-bottom-style: none; border-bottom-width: medium" bordercolor="#99B5C0" height="21">
            <strong><font color="#FFFFFF"><span style="font-size: 8pt">Data</span></font></strong></th>
            <th width="627" bgcolor="#525252" align="left" style="border-bottom-style: none; border-bottom-width: medium" bordercolor="#99B5C0" height="21">
            <strong><font color="#FFFFFF"><span style="font-size: 8pt">Horário</span></font></strong></th>
            <th width="627" bgcolor="#525252" align="left" style="border-bottom-style: none; border-bottom-width: medium" bordercolor="#99B5C0" height="21">
            <strong><font color="#FFFFFF"><span style="font-size: 8pt">Núcleo</span></font></strong></th>
            <th width="184" bgcolor="#FFFFFF" align="left" style="border-bottom-style: none; border-bottom-width: medium" bordercolor="#99B5C0" height="21">&nbsp;</th>
          </tr>

          
          <%
      
	Do While Not rstSearch.EOF
		%><font face="Century Gothic" style="font-size: 8pt"> </font>
          <tr>
          <%
          
          	id = Trim(rstSearch.Fields("id"))
              	Response.Write "<TR style='cursor=hand;' id="& id&" onclick=""consultarClick('"&id&"')""; class='"&fundo&"' "
		Response.Write " onmouseover=""this.className='inputMouse';"" "
		Response.Write " onmouseout=""this.className='"&fundo&"';"">"
		%><font face="Century Gothic" style="font-size: 8pt"> </font> 
            <td width="39" align="left" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; border-bottom-style:solid; border-bottom-width:1" bordercolor="#6E9F4D" bgcolor="#FFFFFF" height="1"><font size="1" face="Arial"><%= rstSearch.Fields("id").Value %></font></td>
            <td width="627" align="left" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; border-bottom-style:solid; border-bottom-width:1" bordercolor="#6E9F4D" bgcolor="#FFFFFF" height="1"><font size="1" face="Arial"><%= rstSearch.Fields("nome").Value %></font></td>
            <td width="627" align="left" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; border-bottom-style:solid; border-bottom-width:1" bordercolor="#6E9F4D" bgcolor="#FFFFFF" height="1"><font size="1" face="Arial"><%= rstSearch.Fields("ven").Value %></font></td>
            <td width="627" align="left" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; border-bottom-style:solid; border-bottom-width:1" bordercolor="#6E9F4D" bgcolor="#FFFFFF" height="1"><font size="1" face="Arial"><%= rstSearch.Fields("horario").Value %></font></td>
            <td width="627" align="left" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; border-bottom-style:solid; border-bottom-width:1" bordercolor="#6E9F4D" bgcolor="#FFFFFF" height="1"><font size="1" face="Arial"><%= rstSearch.Fields("unidade").Value %></font></td>
            <td width="184" align="left" style="border-style: none; border-width: medium; " bordercolor="#6E9F4D" height="1">
              &nbsp;</td>
          </tr>
          <%

		rstSearch.MoveNext
	Loop
	%><font face="Century Gothic" style="font-size: 8pt"> </font>
        </table>
        <p align="left">
            <font face="Arial" style="font-size: 8pt">

            <input type="image" src="ico_imprimir.jpg" border="0" OnClick="javascript:DoPrinting()" name="I1" alt="Imprimir"></font><p align="left"><b>
        <font face="Century Gothic" style="font-size: 8pt" color="#1D2447">Sua busca foi processada em 
        <%response.write FormatNumber( Timer - inicio, 2 )%>
        segundos.</font><font face="Century Gothic" style="font-size: 8pt" color="#6E9F4D"><br>
        </font></b>
        <font face="Century Gothic" style="font-size: 8pt">
        <%
	
	rstSearch.Close
	Set rstSearch = Nothing
	cnnSearch.Close
	Set cnnSearch = Nothing
End If

%> </font>
      </div></td>
  </tr>
</table>
<p align="left">&nbsp;</p>

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ola,

strSQL = "Select * from Aulas where MONTH(ven)="& varMesAtual

strSQL - " ...." o que tiver fora ...tipo & varMesAtual não é levado em conta !
 

tenta:

strSQL = "Select * from Aulas where MONTH(ven)=&varMesAtual"

 

Veja se isso ajuda 
 

month(Date()) 2
 
day(Date()) 15
 
year(Date()) 2018
 
month(Now()) 2
 
day(Now()) 15
 
year(Now()) 2018
 

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olá,

 

Coloquei desta forma e não retornou erro:

 

strSQL = "Select * from Aulas where MONTH(data)='"&varMesAtual&"'"

Porém ele mostra independente do nome que digitar na pesquisa ela mostra todos que estão cadastrados dentro da tabela no mês de fevereiro.. e não o nome de quem eu pesquisar....

 

Att

Compartilhar este post


Link para o post
Compartilhar em outros sites
Em 12/02/2018 at 23:27, chocomilki disse:

<% varMesAtual = month(date())

strSQL = "Select * from Aulas where MONTH(ven)="& varMesAtual

Set ObjRs = cnnSearch.Execute(strSQL) %>

esse trecho esta correto porem só retornará fevereiro e quando estivermos em março só retornará março... a questão é essa linha...
varMesAtual = month(date())

 

deveria pelo menos assim:

varMesAtual = request("campomes") ' nesse campo colocaria o número direto ou faria um combo com os meses com o value com os numeros...

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ola Gustavo, 

 

Então na verdade ele está mostrando pra mim todos que estão no Mês Atual , mas o problema não é esse é que após incluir o código qualquer nome que digite na minha busca ele retorna todos os nomes e não o que eu digito.. ou seja se Digitar Lucas ele deveria mostrar todas as aulas de Lucas no mês de Fevereiro.. e está mostrando todos os Alunos do Mês de Fevereiro 

 

Abs

Compartilhar este post


Link para o post
Compartilhar em outros sites

Entendi... então está faltando mais um parametro...

 

strSQL = "Select * from Aulas where MONTH(ven)="& varMesAtual & " and nomealuno='Lucas*'

 

OBS1: sendo base access ou SQL SERVER  utilize * para busca qualquer Lucas se for Postgresql utilize % 

 

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

Gustavo 

 

Acrescentei o parâmetro retornou erro interno..

 

O servidor encontrou um erro interno ou configuração incorreta e não pôde completar sua solicitação. Entre em contato com o administrador do servidor para informar a hora em que ocorreu o erro e de qualquer coisa que você tenha feito que possa ter causado o erro. Mais informações sobre esse erro podem estar disponíveis no registro de erros do servidor.

 

Compartilhar este post


Link para o post
Compartilhar em outros sites
do jeito que está vai dar erro mas se estivesse correto retornaria todos os alunos...
Tente assim:
strSQL = "Select * from Aulas where MONTH(data)="& varMesAtual & " and nome Like 'Lucas*'"

Detalhe: tem que ter lucas no cadastro... rsrs...

Compartilhar este post


Link para o post
Compartilhar em outros sites

Agora não retornou erro , porém mostra independe se é mês  Fevereiro , Janeiro etc.. rsssss

 

varMesAtual = month(date())

strSQL = "Select * from Aulas where MONTH(data)="& varMesAtual & " and nome Like 'Kleber*'"

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

coloque o mes fixo... e vamos colocar o ano também... senão pode pegar dos anos anteriores também...

 

strSQL = "Select * from Aulas where MONTH(data)=2 and year(data)=2018 and nome Like 'Kleber*'"

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olha como ficou ele completo

 

 <%
If strSearch <> "" Then
	
       	strDBPath = Server.MapPath("Noticias.mdb")
        
Const adUseClient = 3
	
	Set cnnSearch = Server.CreateObject("ADODB.Connection")
	
cnnSearch.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"
cnnSearch.CursorLocation = adUseClient

varMesAtual = month(date())

strSQL = "Select * from Aulas where MONTH(data)=2 and year(data)=2018 and nome Like 'Kleber*'"


strSQL = "SELECT nome,data,horario,unidade,ven,id " _
		& "FROM Aulas " _
		& "WHERE nome LIKE '%" & TiraAcento(Replace(strSearch, "'", "''")) & "%' " _
		& "OR nome LIKE '%" & TiraAcento(Replace(strSearch, "'", "''")) & "%' " _
		& "ORDER BY id;"


	

	Set rstSearch = cnnSearch.Execute(strSQL)
intContador = rstSearch.RecordCount




	

	%> 

E mostra mês anterior tb.. rssss

 

Compartilhar este post


Link para o post
Compartilhar em outros sites
3 minutos atrás, chocomilki disse:

strSQL = "Select * from Aulas where MONTH(data)=2 and year(data)=2018 and nome Like 'Kleber*'"

 

strSQL = "SELECT nome,data,horario,unidade,ven,id " _ & "FROM Aulas " _ & "WHERE nome LIKE '%" & TiraAcento(Replace(strSearch, "'", "''")) & "%' " _ & "OR nome LIKE '%" & TiraAcento(Replace(strSearch, "'", "''")) & "%' " _ & "ORDER BY id;"

 

 

a variavel strSQL só pode ter uma instrução antes da execução senão somente a última que é feita...  remova essa..
strSQL = "SELECT nome,data,horario,unidade,ven,id " _ & "FROM Aulas " _ & "WHERE nome LIKE '%" & TiraAcento(Replace(strSearch, "'", "''")) & "%' " _ & "OR nome LIKE '%" & TiraAcento(Replace(strSearch, "'", "''")) & "%' " _ & "ORDER BY id;"

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

Gustavo, 

 

Mas este trecho é  o que pesquisa o nome do Aluno...

 

strSQL = "SELECT nome,data,horario,unidade,ven,id " _ & "FROM Aulas " _ & "WHERE nome LIKE '%" &TiraAcento(Replace(strSearch, "'", "''")) & "%' " _ & "OR nome LIKE '%" & TiraAcento(Replace(strSearch, "'", "''")) & "%' " _ & "ORDER BY id;"

 

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

desse jeito não pode... na sql 
strSQL = "Select * from Aulas where MONTH(data)=2 and year(data)=2018 and nome Like 'Kleber*'"

já tem o mês e o nome que você quer... não precisa de uma outra e mesmo se precisasse não seria desse jeito... remova essa segunda e rode a página...

Compartilhar este post


Link para o post
Compartilhar em outros sites

  • Conteúdo Similar

    • Por cesarhtc
      Boa tarde tenho uma aplicação que gera uma relação de dados como faço para exportar isso para pdf?
       
      Obrigado
    • Por vmenezes
      ola galera . tenho uma aplicação com asp  e utilizo javascript para bater foto do cliente . consigo apos a foto batida salvar no pc com o ID do cliente,
      porem gostaria que assim que a foto fosse batida salvasse na raiz do proprio site.
      tem como fazer isso ?
      obg
    • Por Negrito
      Olá,
       
      Estou quebrando a cabeça com o recurso Session_OnStart , pois eu gostaria que algumas paginas/arquivos .asp tivessem exceções.
       
      Criei o Global.ASA com o seguinte contexto:
       
      <SCRIPT RUNAT=Server Language="VBScript">
      Sub Session_OnStart
        startPage = "/default.asp"
        currentPage = Request.ServerVariables("SCRIPT_NAME")
        If strcomp(currentPage,startPage,1) then
          Response.Redirect("/default.asp")
        End If
      End Sub
      </SCRIPT>
       
      Ele funciona perfeitamente, quando tento acessar qualquer pagina ou subdiretorio diretamente pela URL, ele me joga para a pagina inicial.
       
      Porem, eu gostaria de ter exceções em alguns diretorios e paginas .ASP , onde eu gostaria de liberar o acesso direto ao digitar a URL.
       
      Alguem sabe me informar se é possivel ? 
       
      Obrigado.
       
       
    • Por Negrito
      Olá Pessoal, 
       
      Converti o banco de dados de uma app em ASP Classico de MSSQL para MySQL para redução de custos e percebi que alguns componentes ou recursos não estão mais funcionando devido a não compatibilidade com o MySQL , como por exemplo a função : RecordCount
       
      Já consegui converter e atualizar 95% de aplicação para rodar com o MySQL, mas tem 1 item que esta tirando meu sono e após dias pesquisando, resolvi pedir ajuda.
       
      Segue o meu codigo abaixo , onde estou com problema no resultado dessa operação:
       
      <%
      ...
      Set RS = Server.CreateObject("ADODB.Recordset")
      RS.CursorLocation = 3
      RS.CursorType = 3
      RS.ActiveConnection = Cn
      RS.Open strSQL, Cn, 3, 3
      RS.PageSize = 25
      RS.CacheSize = RS.PageSize
      intPageCount = RS.PageCount
      intRecordCount = RS.RecordCount
          If NOT (RS.BOF AND RS.EOF) Then
      If CInt(intPage) > CInt(intPageCount) Then intPage = intPageCount
          If CInt(intPage) <= 0 Then intPage = 1
              If intRecordCount > 0 Then
                  RS.AbsolutePage = intPage
                  intStart = RS.AbsolutePosition
                  If CInt(intPage) = CInt(intPageCount) Then
                      intFinish = intRecordCount
                  Else
                      intFinish = intStart + (RS.PageSize - 1)
                  End if
              End If
          If intRecordCount > 0 Then
              For intRecord = 1 to RS.PageSize
          QntExibicoes = QntExibicoes + Rs.fields("views")
      ...
      %>
       
       
      Já percebi que a função RecordCount não pode ser usada com o MySQL ou pelo menos não é compativel.
       
      A paginação esta funcionando ! 
      Porem , não consigo fazer ele calcular a quantidade de linhas (rows) do MySQL com a função RecordCount e acredito que possa ter alguma outra função que não esta compativel , mas como não conheço MySQL , não posso afirmar.
       
      Enfim, algum pode me dar uma luz ?
       
      Desde já agradeço pela atenção.
       
      Obrigado.
    • Por Person
      Estou fazendo um protótipo de e-commerce com aps clássico e sql server, na parte de administração, o usuário administrativo pode alterar o status do pedido,  para isso ele clica no botão de alterar na pagina principal e é redirecionado para um formulário onde tenho as options, para que ele mude o status, coloquei um botão para que ele passe os parâmetros  (id_pedido e id_status_pedido) para a pagina de manutenção, onde é feito o update e o envio de e-mail com as atualizações. Mas quero retirar esse botão e fazer com que, assim que eu clique em uma opção, ele altere, sem eu precisar ser redirecionado para a tela de manutenção, isso com o Ajax se possível.
       
      <body> <% call Abredb() cod = Request.QueryString("cod") evt = Request.QueryString("evt") if cod <> "" then cod = cint(cod) end if if ucase(evt) = "ALT" then sql = "exec SP_TR32_status_frm_SEL" 'Response.Write(sql) 'Response.End() set rs = dbWeb.execute(sql) estrato = rs("id_status_pedido") bot = "Alterar" end if %> <div class="container"> <div class="titulo">Formulario</div> <form action="manu_pedido.asp" method="post" enctype="multipart/form-data"> <div class="detalhes-formulario"> <div class="input-box"> <span class="detalhes">status</span> <select class="form-control" name = "status"> <% do while not rs.eof%> <option value="<%=rs("id_status_pedido")%>"><%=rs("descricao")%></option> <% rs.movenext loop rs.close set rs = nothing %> </select> </div> </div> <button><a href="/treinamento/Thau/mini_mercado/adm/manu_pedido.asp?evt=alt&cod="<%=cod%>"&estrato="<%rs("id_status_pedido")%> </form> </div> <br> </body> <%call Fechadb()%> </html> Abaixo está o código da minha pagina de manutenção, no qual acontece a alteração do status
      <% Function ZerosEsquerda(Num,tam) Dim Zero Num = Trim(Num) Zero = "" For i = Len(Num) To tam - 1 Zero = "0" & Zero Next ZerosEsquerda = Trim(Zero & Num) End Function byteCount = Request.TotalBytes RequestBin = Request.BinaryRead(byteCount) Set UploadRequest = CreateObject("Scripting.Dictionary") BuildUploadRequest RequestBin 'opc = request.QueryString("opc") 'if opc = "" then 'cod = UploadRequest.Item("hfcod").Item("Value") 'botao = UploadRequest.Item("botao").Item("Value") 'estrato = UploadRequest.Item("estrato").Item("Value") 'end if session.LCID = 1046 call Abredb() if botao = "Alterar" then ' ALTERANDO OS DADOS RECEBIDOS NA TABELA sql = "exec SP_TR32_pedido_UPD "&cod&", '"&estrato&"'" 'response.write sql 'response.end dbWeb.execute(sql) str_html = "" str_html = str_html & "<HTML><BODY BGCOLOR=#0000FF>" str_html = str_html & "<h1>produtos</h1>" sql ="SP_TR32_email__itens_sel "&cod&"" set rs = dbWeb.execute(sql) str_html = str_html & "<table>" str_html = str_html & "<thead>" str_html = str_html & " <tr>" str_html = str_html & "<th>Produtos</th>" str_html = str_html & "<th>quantidade</th>" str_html = str_html & " <th>Total</th>" str_html = str_html & "</tr>" str_html = str_html & " </thead>" str_html = str_html & "<tbody>" do while not rs.eof str_html = str_html & "<tr>" str_html = str_html & "<td >"&rs("produto")&"</td>" str_html = str_html & "<td >"&rs("quantidade")&"</td>" str_html = str_html & "<td >"&rs("total")&"</td>" str_html = str_html & "</tr>" rs.movenext loop rs.close set rs = nothing str_html = str_html & " </tbody>" str_html = str_html & "</table>" str_html = str_html & "</BODY></HTML>" sql = "SP_TR32_email_sel "&cod&"" set rs = dbWeb.execute(sql) if estrato<>"" then Set ObjMail = Server.CreateObject("Cdonts.Newmail") objMail.Subject = "Atualização de pedido" objMail.From = "Porto Dourado <contato@email.websupply.com.br>" objMail.To = "request("email")" objMail.BodyFormat = 0 objMail.MailFormat = 0 objMail.Body = "Olá"&" "&rs("nome")&" "&rs("sobrenome")&", </br> Houve uma atualização em seu pedido pedido: "&rs("id_pedido")&" </br> o status mudou para: "&rs("descricao")&" </br> endereço de entrega: "&rs("cep")&", "&rs("rua")&", "&rs("bairro")&", "&rs("numero")&", "&rs("cidade")&", "&rs("Uf")&" </br>Total pedido: "&rs("total_pedido")&" </br> "& str_html &" </br></br>"&" Atentamente,"&" </br> "&"Equipe Porto dourado"&" </br></br> "&"Para entrar em contato com a equipe de suporte, entre em contato com o email ou ligue para nossa central no numero " objMail.Send Set objMail = nothing envio = true %> <script> alert('email com alteração enviado com sucesso!'); </script> <% end if if estrato = 6 then sql = "exec SP_TR32_adm_data_envio_UPD "&cod&"" dbWeb.execute(sql) end if if estrato = 4 then sql = "exec SP_TR32_adm_data_entregue_UPD "&cod&"" dbWeb.execute(sql) end if %> <script> alert("Dados alterado com sucesso!") parent.location = "cst_pedido.asp" </script> <% end if %> <%call Fechadb()%>  
×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.