File: D:/HostingSpaces/TWijnstra/wijnstra.com/dvd/nieuwedvdinvoeren.asp
<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit
Dim strSQL, rsDVDdetails, conDVD, Foutmelding
If Request("invoer") = 1 Then
If Request("title") = "" Then
Foutmelding = "Je moet altijd een titel invullen!"
ElseIf Request("runningtime") = ""Then
Foutmelding = "Je moet altijd de speelduur invullen!"
Else
Init
End If
End If %>
<html>
<head><title>Tjerk zijn DVD's (en van Hanneke)</title>
<link href="css/dvd.css" rel="STYLESHEET" type="text/css">
</head>
<body>
<table align="center" class="fullarea"><tr><td>
<!-- #include file="menu.asp" -->
<h1>Nieuwe dvd invoeren <span class="attention"><%= Foutmelding %></span></h1>
<form action="nieuwedvdinvoeren.asp" method="POST">
<input type="hidden" name="invoer" value="1">
<table class="tbl" align="center" cellpadding="0" cellspacing="0" border="0">
<tr>
<td VALIGN="TOP" align="right" class="donkerblauw"><STRONG><span class="attention"> *</span> Titel</STRONG></td>
<td VALIGN="TOP" class="blauw"><input type="text" name="title" value="<%= Request("title") %>" size="50"></td>
</tr>
<tr>
<TD VALIGN="TOP" align="right" class="donkerblauw"><STRONG>Omschrijving</STRONG></TD>
<TD VALIGN="TOP" class="geel"><textarea cols="100" rows="10" name="about"><%= Request("about") %></textarea></TD>
</tr>
<tr>
<td VALIGN="TOP" align="right" class="donkerblauw"><STRONG><span class="attention"> *</span> Speelduur</STRONG></td>
<TD VALIGN="TOP" class="geel">ca. <input type="text" value="<%= Request("runningtime") %>" name="runningtime" size="30"> minuten</TD>
</tr>
<tr>
<td VALIGN="TOP" align="right" class="donkerblauw"><STRONG>Regio code</STRONG></td>
<TD VALIGN="TOP" class="geel"><input type="text" value="<%= Request("regiocode") %>" name="regiocode" size="50"></TD>
</tr>
<tr>
<td VALIGN="TOP" align="right" class="donkerblauw"><STRONG>Genre</STRONG></td>
<TD VALIGN="TOP" class="geel"><input type="text" value="<%= Request("genre") %>" name="genre" size="50"></TD>
</tr>
<tr>
<td VALIGN="TOP" align="right" class="donkerblauw"><STRONG>Taal</STRONG></td>
<TD VALIGN="TOP" class="geel"><input type="text" value="<%= Request("language") %>" name="language" size="50"></TD>
</tr>
<tr>
<td VALIGN="TOP" align="right" class="donkerblauw"><STRONG>Ondertiteling</STRONG></td>
<TD VALIGN="TOP" class="geel"><input type="text" value="<%= Request("subtitling") %>" name="subtitling" size="50"></TD>
</tr>
<tr>
<td VALIGN="TOP" align="right" class="donkerblauw"><STRONG>Video aspect ratio</STRONG></td>
<TD VALIGN="TOP" class="geel"><input type="text" value="<%= Request("videoaspectratio") %>" name="videoaspectratio" size="50"> <span class="clsExplain">(2.35:1 / 16:9)</span></TD>
</tr>
<tr>
<td VALIGN="TOP" align="right" class="donkerblauw"><STRONG>Audio</STRONG></td>
<TD VALIGN="TOP" class="geel"><input type="text" value="<%= Request("audio") %>" name="audio" size="50"> <span class="clsExplain">(Dolby digital 5.1)</span></TD>
</tr>
<tr>
<td VALIGN="TOP" align="right" class="donkerblauw"><STRONG>Disctype</STRONG></td>
<TD VALIGN="TOP" class="geel"><input type="text" value="<%= Request("disctype") %>" name="disctype" size="50"></TD>
</tr>
<tr>
<td VALIGN="TOP" align="right" class="donkerblauw"><STRONG>Extra features</STRONG></td>
<TD VALIGN="TOP" class="geel"><textarea cols="100" rows="5" name="features"><%= Request("features") %></textarea></TD>
</tr>
<tr>
<td VALIGN="TOP" align="right" class="donkerblauw"><STRONG>Plaatje</STRONG></td>
<TD VALIGN="TOP" class="geel"><input type="text" value="<%= Request("picture") %>" name="picture" size="50"></TD>
</tr>
<tr>
<td VALIGN="TOP" align="right" class="donkerblauw"><STRONG>Eigenaar</STRONG></td>
<TD VALIGN="TOP" class="geel"><input type="text" value="Tjerk Wijnstra<%= Request("ownername") %>" name="ownername" size="50"></TD>
</tr>
</table><br>
<span class="attention"> *</span> = gesorteerd op
<div align="center"><input id="send" type="submit" name="add" value="Voeg toe"></div>
</form>
</td></tr></table></body></html>
<% Sub Init()
Dim rtime
If Request("runningtime") = "" Then
rtime = 0
Else
rtime = Request("runningtime")
End If
Dim devedezoneid, strtitle, strabout, strownername, strregiocode, strgenre, strlanguage, strsubtitling, strvideoaspectratio, straudio, strdisctype, strfeatures, strlonername, strpicture
devedezoneid = 10101
strtitle = replace(Request("title"),"'","''")
strabout = replace(Request("about"),"'","''")
strownername = replace(Request("ownername"),"'","''")
strregiocode = replace(Request("regiocode"),"'","''")
strgenre = replace(Request("genre"),"'","''")
strlanguage = replace(Request("language"),"'","''")
strsubtitling = replace(Request("subtitling"),"'","''")
strvideoaspectratio = replace(Request("videoaspectratio"),"'","''")
straudio = replace(Request("audio"),"'","''")
strdisctype = replace(Request("disctype"),"'","''")
strfeatures = replace(Request("features"),"'","''")
strlonername = "nietuitgeleend"
strpicture = replace(Request("picture"),"'","''")
SaveDVD devedezoneid, strtitle, strabout, strownername, rtime, strregiocode, strgenre, strlanguage, strsubtitling, strvideoaspectratio, straudio, strdisctype, strfeatures, strlonername, strpicture
End Sub
Function SaveDVD(lngdevedezoneid, strtitle, strabout, strownername, lngrunningtime, strregiocode, strgenre, strlanguage, strsubtitling, strvideoaspectratio, straudio, strdisctype, strfeatures, strlonername, strpicture)
Dim strSaveDVD, strGetID, rstItem %>
<!-- #include file="includeCon.asp" -->
<% strSaveDVD = " INSERT INTO tbl_dvd (dvdzoneID, title, about, ownername, runningtime, regiocode, genre, language, subtitling, videoaspectratio, audio, disctype, features, lonername, picture) "
strSaveDVD = strSaveDVD & "VALUES('" & lngdevedezoneid & "','" & strtitle & "','" & strabout & "','" & strownername & "'," & lngrunningtime & ",'" & strregiocode & "','" & strgenre & "','" & strlanguage & "','" & strsubtitling & "','" & strvideoaspectratio & "','" & straudio & "','" & strdisctype & "','" & strfeatures & "','" & strlonername & "','" & strpicture & "') "
conDVD.Execute(strSaveDVD)
strSaveDVD = ""
Close
' Weer ophalen van de bovenstaande weggeschreven ID %>
<!-- #include file="includeCon.asp" -->
<% strGetID = " SELECT dvdid FROM tbl_dvd WHERE title = '" & replace(Request("title"),"'","''") & "' AND runningtime = " & lngrunningtime & ""
Set rstItem = conDVD.Execute(strGetID)
strGetID = ""
' Bouw de url op voor de redirect
strGetID = "details.asp?dvdid=" & rstItem("dvdid")
Response.redirect strGetID
Close
End Function
Sub Close
conDVD.Close
Set conDVD = Nothing
End Sub %>