den code er en del af en længere side..
jeg poster lige begge sider.. Jeg kan ikke lige pointen med det du mener phineas_phreak... hvis du vil uddybe det.!
---vissag.asp--
<!--#include file="../../../top.asp"-->
<!--#include file="..\..\..\connect.asp"-->
<%
SQL = "select * from sager where id ='" & Request.QueryString("sagid") & "'"
set RS = Conn.execute(SQL)
Kunde = "select * from Kunder where telefon ='" & RS("telefon") & "'"
set KundeRS = Conn.execute(kunde)
arbejder ="Select * from personale where aktiv=0"
set personale = Conn.execute(arbejder)
'Skal finde ud af hvordan man laver en BOF så "RS"arbejder kan bruges
arbejderele ="Select * from personale"
set personaleele = Conn.execute(arbejder)
medarbejder ="Select * from personale where id ='" & RS("paasagen") & "'"
set RSmedarbejder = Conn.execute(medarbejder)
sagelementer ="Select * from sagelementer where sagid ='" & Request.QueryString("sagid") & "'"
set RSsagelementer = Conn.execute(sagelementer)
SQLlilleservice = "Select id from lilleservice where sagid ='" & Request.QueryString("sagid") & "'"
set RSlilleservice = conn.execute(SQLlilleservice)
SQLstortservice = "Select id from stortservice where sagid ='" & Request.QueryString("sagid") & "'"
set RSstortservice = conn.execute(SQLstortservice)
SQLsynsrapport = "Select id from synsrapport where sagid ='" & Request.QueryString("sagid") & "'"
set RSsynsrapport = conn.execute(SQLsynsrapport)
%>
<form name="create" method="post" action="redir/opdater.asp?sagid=<%response.write (Request.QueryString("sagid"))%>">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><%Response.Write( "RepNummer : " & RS ("id") )%></td>
<td>Status : Færdig
<input name="afsluttet" type="checkbox" value="1" <% if (RS("afsluttet"))="1" then response.write ("checked")end if%>>
<% if (RS("afsluttet"))="1" then %>
Afventer
<input name="afventer" type="checkbox" value="0">
<%Else%>
Afventer
<input name="afventer" type="checkbox" value="1" <% if (RS("afventer"))="1" then Response.write ("checked")end if%>>
<%end if%>
<% if (RS("afsluttet"))="1" then %>
Igang
<input name="igang" type="checkbox" value="0">
<%Else%>
Igang
<input name="igang" type="checkbox" value="1" <% if (RS("igang"))="1" then response.write ("checked")end if%>>
<%end if%>
<%if (RS("afsluttet"))="1" then
%>
<a href="../../Regnskab/lavfakturer.asp?sagid=<%Response.write(request.QueryString("sagid"))%>" target="_blank">Lav
Fakturer</a>
<% end if%>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="46%"><input name="submit" type="submit" value="opdater">
<%
Response.write ("<br>" & "<br>" & KundeRS("telefon") & "<br>"& "<br>")
Response.write (KundeRS("name") & "<br>")
Response.write (KundeRS("gadenavnognr") & "<br>")
if not KundeRS("stednavn") = "" then
Response.write (KundeRS("stednavn") & "<br>")
end if
Response.write (KundeRS("postnr") & "<br>")
Response.write (KundeRS("bynavn") & "<br>")
%>
<a href ="../../kunder/viskunde.asp?telefon=<%=KundeRS("telefon")%>">Klik her for at ændre kunde</a> </td>
<td width="54%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Regnr. :</td>
<td><%response.write ("<input type=""text"" value=""" & RS("regnr") & """ name=""regnr"">")%>
</td>
</tr>
<tr>
<td>Mærke :</td>
<td><%response.write ("<input type=""text"" Value=""" & RS("maerke") & """ name=""maerke"">")%>
</td>
</tr>
<tr>
<td>Model :</td>
<td><%response.write ("<input type=""text"" Value=""" & RS("model") & """ name=""model"">")%>
</td>
</tr>
<tr>
<td>Årgang :</td>
<td><%response.write ("<input type=""text"" Value=""" & RS("aargang") & """ name=""aargang"">")%>
</td>
</tr>
<tr>
<td>Ltr :</td>
<td><%response.write ("<input type=""text"" Value=""" & RS("ltr") & """ name=""ltr"">")%>
</td>
</tr>
<tr>
<td>Km : </td>
<td><%response.write ("<input type=""text"" Value=""" & RS("km") & """ name=""km"">")%>
</td>
</tr>
<tr>
<td>Stelnr :</td>
<td><%response.write ("<input type=""text"" Value=""" & RS("stelnr") & """ name=""stelnr"">")%>
</td>
</tr>
</table>
</td>
</tr>
</table><br>
<table width="100%" border="0" cellspacing="2" cellpadding="0">
<tr>
<td width="46%"><%
if not RS("inddato")="" then
Response.write ("Indleveret af kunde d.: ")
response.write ("<input type=""text"" Value=""" & RS("inddato") & """ name=""inddato"">")
Else %>
Indleveret af kunde:
<input name="inddato" type="checkbox" value="<%=now%>">
<% End if %>
</td>
<td width="54%"><%
if not RS("uddato")="" then
Response.write ("Afhentet af kunde d.: ")
response.write ("<input type=""text"" Value=""" & RS("uddato") & """ name=""uddato"">")
Else %>
Afleveret til kunde:
<input name="uddato" type="checkbox" value="<%=now%>">
<% End if %>
</td>
</tr>
<tr>
<td>Anslåettid :
<%Response.write ("<input type=""text"" Value=""" & RS("anslaaettid") & """ name=""anslaaettid"">")%>
</td>
<td><strong><a href="../../kalender/kalender.asp?sagid=<% Response.write (RS("id"))%>">Tilføj
til Kalender</a></strong>
</td>
</tr>
</table>
<br>
<table>
<tr><td> <%if RSlilleservice.eof then%>
<a href="../synogservice/opretlilleservice.asp?sagid=<%=Request.QueryString("sagid")%>">Opret Lille service</a><br>
<%else%>
<a href="../synogservice/aendrelilleservice.asp?sagid=<%=Request.QueryString("sagid")%>">Ændre Lille service</a><br>
<%end if%>
</td>
<td> <%if RSstortservice.eof then%>
<a href="../synogservice/opretstortservice.asp?sagid=<%=Request.QueryString("sagid")%>">Opret Stort service</a><br>
<%else%>
<a href="../synogservice/aendrestortservice.asp?sagid=<%=Request.QueryString("sagid")%>">Ændre Stort service</a><br>
<%end if%>
</td>
<td> <%if RSsynsrapport.eof then%>
<a href="../synogservice/opretsynsrapport.asp?sagid=<%=Request.QueryString("sagid")%>">Opret Synsrapport</a><br>
<%else%>
<a href="../synogservice/aendresynsrapport.asp?sagid=<%=Request.QueryString("sagid")%>">Ændre Synsrapport</a><br>
<%end if%>
</td>
<td><a target="_blank" href="
http://147.29.112.249/discoverer5i/topti?eul=DMADMIN&qp_Registreringsnr=<%=RS("regnr")%>&ac=webuser~40sbil.world&db=sbil.world&wsk=16&nlsl=da-dk&wbk=TOPTI&pg=1&_po=10001000001100101101000&us=webuser">Top 10 på bilsyn</a></td>
<td><a target="_blank" href="
http://147.29.112.249/discoverer6i/synsrapport?eul=DMADMIN&qp_Registreringsnr=<%=RS("regnr")%>&ac=webuser~40sbil.world&_act=~20Vis~20synsrapport&db=sbil.world&wsk=7&nlsl=da-dk&wbk=SYNSRAPPORT&pg=1&_po=10001000001100101101000&us=webuser">Sidste synsraport på bilsyn</a></td>
</tr></table>
Arbejder på sagen :
<select name="person">
<%if personale.eof then
%>
<option value="">Ingen arbejder i Databasen</option>
<%
else
do while not personale.eof
%>
<option value="<%=personale ("id")%>"
<% if personale("id") = RS("paasagen") then
response.write "selected"
end if %>
><%=personale ("navn")%></option>
<%
personale.movenext
loop
end if
if (RSmedarbejder.bof and RSmedarbejder.eof)then
%>
<option value="" selected>Ingen</option>
<% end if
%>
</select>
<% if (RSmedarbejder.bof and RSmedarbejder.eof) then
Response.write ("Der er Ingen på sagen")
else
end if
%>
<br>
</p><br>
Arbejde:<br>
<%response.write ("<textarea style=""width:300; height:200"" name=""arbejde"">" & RS("arbejde") & "</textarea>")%>
<br>
Bemærkninger:<br>
<%response.Write ("<textarea style=""width:300; height:125"" name=""bemaerk"">" & RS("bemaerk") & "</textarea><br>")%>
</p>
</p>
<table>
<tr>
<td>Enhed</td><td>apris</td><td>antal</td><td>timer</td><br>
</tr>
<tr>
<td><input name="enhed" type="text" value=""></td>
<td><input name="apris" type="text" value="" size="5"></td>
<td><input name="antal" type="text" value="" size="2"></td>
<td><input name="timer" type="text" value="" size="5"></td>
<td>
<select name="personele">
<%
if personaleele.eof then
%>
<option value="">Ingen arbejder i Databasen</option>
<%
else
do while not personaleele.eof
%>
<option value="<%=personaleele ("id")%>"
<% if personaleele("id") = RS("paasagen") then
response.write "selected"
end if %>
><%=personaleele ("navn")%></option>
<%
personaleele.movenext
loop
end if
%>
</select>
</td>
<td> <input type="submit" value="opdater"></td>
</tr>
<%
if RSsagelementer.eof then
else
totalpris = 0
totaltimer = 0
do while not RSsagelementer.eof
%>
<tr>
<td><input name="enhedS" type="text" value="<%response.write(RSsagelementer("enhed"))%>"></td>
<td><input name="aprisS" type="text" value="<%response.write(RSsagelementer("apris"))%>" size="5"></td>
<td><input name="antalS" type="text" value="<%response.write(RSsagelementer("antal"))%>" size="2"></td>
<td><input name="timerS" type="text" value="<%response.write(RSsagelementer("timer"))%>" size="5"></td>
<input name="idS" type="hidden" Value="<%Response.write(RSsagelementer("id"))%>">
<%personele ="Select * from personale where id ='" & (RSsagelementer("person")) & "'"
set RSpersonele = Conn.execute(personele)
%>
<td><%Response.write(RSpersonele("navn"))%></td>
</tr>
<%
totalpris = totalpris + (RSsagelementer("apris") * RSsagelementer("antal"))
totaltimer = totaltimer + (RSsagelementer("timer"))
RSsagelementer.movenext
loop
end if
%>
<tr>
<td></td><td><hr></td><td></td><td><hr></td>
</tr>
<td></td><td><%response.write(totalpris)%></td><td></td><td><%response.Write(totaltimer)%></td>
</table>
<br><br>
</form>
<!--#include file="../../../bund.asp"-->
--opdater.asp--
<!--#include file="..\..\..\..\connect.asp"-->
<%
'SQL = "UPDATE kunder SET name='" & Request.Form("name") & "', adresse='" & Request.Form("adresse") & "', telefon= '" & Request.Form("telefon") & "' WHERE telefon='" & Request.Form("telefon") & "'"
SAG = "UPDATE sager SET maerke='" & Request.Form("maerke") & "', arbejde='" & Request.Form("arbejde") & "', bemaerk='" & Request.Form("bemaerk") & "' , km='" & Request.Form("km") & "' , paasagen='" & Request.Form("person") & "', afventer= '" & Request.form("afventer") & "', igang= '" & Request.form("igang") & "', afsluttet= '" & Request.form("afsluttet") & "', anslaaettid = '" & Request.form("anslaaettid") & "', uddato = '" & Request.Form("uddato") & "', inddato = '" & Request.Form("inddato") & "', model = '" & Request.Form("model") & "', aargang = '" & Request.Form("aargang") & "', ltr = '" & Request.Form ("ltr") & "', stelnr = '" & Request.Form ("stelnr") & "', regnr = '" & Request.Form ("regnr") & "' WHERE id='" & Request.QueryString("sagid") & "'"
'Finde en anden måde at få den til at Updatere de felter, da denne poster oven ihianden'
UPELE = "UPDATE sagelementer SET enhed='" & Request.Form ("enhedS") & "', apris='" & Request.Form ("aprisS") & "',antal='" & Request.Form("antalS") & "' WHERE id='" & Request.Form("idS") & "'"
if not request.form("enhed") = "" then
ELE = "INSERT INTO sagelementer (sagid, enhed, apris, antal, timer, sat, person) VALUES ('" & Request.QueryString("sagid") & "','" & Request.Form("enhed") & "','" & Request.Form("apris") & "','" & Request.Form("antal") & "','" & Request.Form("timer") & "',1,'" & Request.Form("personele") &"' )"
Conn.Execute(ELE)
end if
'Conn.Execute(SQL)
Conn.Execute(SAG)
Conn.Execute(UPELE)
'Conn.Execute(ELES)
Response.Redirect("../vissag.asp?sagid=" & Request.QueryString("sagid") & "")
%>