<%@LANGUAGE="VBSCRIPT"%> <% Response.Buffer = true %> NEWS
 
 
 
 

NEWS MAPLA
<% modec=request.querystring("mode") if modec="" then set news = Server.CreateObject("ADODB.Recordset") news.ActiveConnection = MM_gbservice_STRING news.Source = "SELECT * FROM news ORDER BY data DESC" news.CursorType = 0 news.CursorLocation = 2 news.LockType = 3 news.Open() news_numRows = 0 if news.eof or news.bof then %>
Nessuna news
<% else %>
<% news.movefirst while not news.eof %>
<%=news("data")%> <%=news("titolo")%>
<%=news("testo")%>

<% news.movenext wend %> <% end if ' end if news.eof %>


Area Privata
<% news.Close() end if ' end modec="" if modec="login" then st=request.querystring("st") session("utente")="" %>
<% if st="err" then %> <% end if %>
username o password non validi
User-id
Password
 
<% end if ' end modec="login" if modec="checklogin" then set utente = Server.CreateObject("ADODB.Recordset") utente.ActiveConnection = MM_gbservice_STRING utente.Source = "SELECT * FROM utenti WHERE userid = '" & request("userid") & "' AND password = '" & request("pass") & "'" utente.CursorType = 0 utente.CursorLocation = 2 utente.LockType = 3 utente.Open() utente_numRows = 0 if utente.eof or utente.bof then response.redirect("news.asp?mode=login&st=err") else session("utente")="gbserviceok" response.redirect("news.asp?mode=gest") end if utente.close() end if ' end modec="checklogin" if modec="logout" then session("utente")="" response.redirect("news.asp") end if ' end modec="logout" if modec="gest" then if session("utente")<>"gbserviceok" then response.redirect("news.asp?mode=login") end if set news = Server.CreateObject("ADODB.Recordset") news.ActiveConnection = MM_gbservice_STRING news.Source = "SELECT * FROM news ORDER BY data DESC" news.CursorType = 0 news.CursorLocation = 2 news.LockType = 3 news.Open() news_numRows = 0 %>
Nuova news Gestione news Gestione foto Gestione utenza Esci
<% if news.eof or news.bof then %> <% else %>

<% news.movefirst while not news.eof %> <% news.movenext wend %>
Data Titolo  
nessuna news
    <%=news("data")%>         <%=news("titolo")%>     " class="links">modifica " class="links">elimina  
<% end if ' end if news.eof news.close() end if ' end modec="gest" if modec="save" then id=request.querystring("id") if session("utente")<>"gbserviceok" then response.redirect("news.asp?mode=login") end if query="SELECT * FROM news" if id<>"" then query=query & " WHERE id_news = " & id end if set news = Server.CreateObject("ADODB.Recordset") news.ActiveConnection = MM_gbservice_STRING news.Source =query & " ORDER BY data DESC" news.CursorType = 0 news.CursorLocation = 2 news.LockType = 3 news.Open() news_numRows = 0 if not isdate(request("data")) then response.write("data non valida

") response.write("Torna indietro") else if news.eof or news.bof or id="" then news.addnew end if ' end if news.eof news("data")=request("data") news("titolo")=request("titolo") news("testo")=request("newstxt") news.update response.redirect("news.asp?mode=gest") end if news.close() end if ' end modec="new" if modec="del" then id=request.querystring("id") if session("utente")<>"gbserviceok" then response.redirect("news.asp?mode=login") end if set news = Server.CreateObject("ADODB.Recordset") news.ActiveConnection = MM_gbservice_STRING news.Source ="SELECT * FROM news WHERE id_news = " & id news.CursorType = 0 news.CursorLocation = 2 news.LockType = 3 news.Open() news_numRows = 0 news.delete news.close() response.redirect("news.asp?mode=gest") end if ' end modec="del" if modec="utenza" then st=request.querystring("st") set utente = Server.CreateObject("ADODB.Recordset") utente.ActiveConnection = MM_gbservice_STRING utente.Source = "SELECT * FROM utenti" utente.CursorType = 0 utente.CursorLocation = 2 utente.LockType = 3 utente.Open() utente_numRows = 0 %>
Nuova news Gestione news Gestione foto Gestione utenza Esci
<% if st="err1" then %> <% end if if st="err2" then %> <% end if %>
le password non corrispondono

valori non validi

User-id " class="links">
Password " class="links">
Conferma
password
" class="links">
 
<% utente.close() end if ' end modec="utenza" if modec="saveutenza" then if request("userid")="" or request("pass1")="" then response.redirect("news.asp?mode=utenza&st=err2") end if if request("pass1")<>request("pass2") then response.redirect("news.asp?mode=utenza&st=err1") end if set utente = Server.CreateObject("ADODB.Recordset") utente.ActiveConnection = MM_gbservice_STRING utente.Source = "SELECT * FROM utenti" utente.CursorType = 0 utente.CursorLocation = 2 utente.LockType = 3 utente.Open() utente_numRows = 0 utente("userid")=request("userid") utente("password")=request("pass1") utente.update utente.close() response.redirect("news.asp?mode=gest") end if ' end modec="saveutenza" if modec="foto" then if session("utente")<>"gbserviceok" then response.redirect("news.asp?mode=login") end if set foto = Server.CreateObject("ADODB.Recordset") foto.ActiveConnection = MM_gbservice_STRING foto.Source = "SELECT * FROM foto ORDER BY path ASC" foto.CursorType = 0 foto.CursorLocation = 2 foto.LockType = 3 foto.Open() foto_numRows = 0 %>
Nuova news Gestione news Gestione foto Gestione utenza Esci
<% if foto.eof or foto.bof then %> <% else foto.movefirst while not foto.eof %> <% foto.movenext wend end if foto.close() %>
Nome foto
Nessuna foto
" target="foto_gb" class="links2"><%=foto("path")%> " class="links">Elimina
<% end if ' end foto if modec="delfoto" then id=request.querystring("id") if session("utente")<>"gbserviceok" then response.redirect("news.asp?mode=login") end if set foto = Server.CreateObject("ADODB.Recordset") foto.ActiveConnection = MM_gbservice_STRING foto.Source = "SELECT * FROM foto WHERE id_foto = " & id foto.CursorType = 0 foto.CursorLocation = 2 foto.LockType = 3 foto.Open() foto_numRows = 0 foto.delete foto.close() response.redirect("news.asp?mode=foto") end if ' end modec="delfoto" %>