<%@LANGUAGE="VBSCRIPT"%> <% ' *** Redirect If Session Variable Does Not Exist ' *** MagicBeat Server Behavior - 2016 - by Jag S. Sidhu - www.magicbeat.com If Session("svAccess") = "" Then Response.Redirect("login_failed.asp") End If %> <% Dim rs_listing__MMColParam rs_listing__MMColParam = "1" if (Session("svAccess") <> "") then rs_listing__MMColParam = Session("svAccess") %> <% set rs_listing = Server.CreateObject("ADODB.Recordset") rs_listing.ActiveConnection = MM_connCapRes_STRING rs_listing.Source = "SELECT * FROM Property_Details WHERE ID = " + Replace(rs_listing__MMColParam, "'", "''") + "" rs_listing.CursorType = 0 rs_listing.CursorLocation = 2 rs_listing.LockType = 3 rs_listing.Open() rs_listing_numRows = 0 %> <% Dim rs_images__MMColParam rs_images__MMColParam = "1" if (Session("svAccess") <> "") then rs_images__MMColParam = Session("svAccess") %> <% set rs_images = Server.CreateObject("ADODB.Recordset") rs_images.ActiveConnection = MM_connCapRes_STRING rs_images.Source = "SELECT * FROM theImages WHERE owner = '" + Replace(rs_images__MMColParam, "'", "''") + "' ORDER BY description ASC" rs_images.CursorType = 0 rs_images.CursorLocation = 2 rs_images.LockType = 3 rs_images.Open() rs_images_numRows = 0 %> <% ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables ' set the record count rs_images_total = rs_images.RecordCount ' set the number of rows displayed on this page If (rs_images_numRows < 0) Then rs_images_numRows = rs_images_total Elseif (rs_images_numRows = 0) Then rs_images_numRows = 1 End If ' set the first and last displayed record rs_images_first = 1 rs_images_last = rs_images_first + rs_images_numRows - 1 ' if we have the correct record count, check the other stats If (rs_images_total <> -1) Then If (rs_images_first > rs_images_total) Then rs_images_first = rs_images_total If (rs_images_last > rs_images_total) Then rs_images_last = rs_images_total If (rs_images_numRows > rs_images_total) Then rs_images_numRows = rs_images_total End If %> <% ' *** Recordset Stats: if we don't know the record count, manually count them If (rs_images_total = -1) Then ' count the total records by iterating through the recordset rs_images_total=0 While (Not rs_images.EOF) rs_images_total = rs_images_total + 1 rs_images.MoveNext Wend ' reset the cursor to the beginning If (rs_images.CursorType > 0) Then rs_images.MoveFirst Else rs_images.Requery End If ' set the number of rows displayed on this page If (rs_images_numRows < 0 Or rs_images_numRows > rs_images_total) Then rs_images_numRows = rs_images_total End If ' set the first and last displayed record rs_images_first = 1 rs_images_last = rs_images_first + rs_images_numRows - 1 If (rs_images_first > rs_images_total) Then rs_images_first = rs_images_total If (rs_images_last > rs_images_total) Then rs_images_last = rs_images_total End If %> National Residence | Commission Free Property Sales | Sell my home with National Residence
National Residence - Property Sales and Letting - Sell Your House Privately
National Residence - Property Sales and Letting
Commission Free Property Sales
Sell My Home with National Residence
homeour servicesmortgagesedit_your_listingcontact us

Please select the details you would like to edit.
[Password] [Contact Details] [Property] [Photographs]

Your Property ID: CR<%=(rs_listing.Fields.Item("PID").Value)%>
You Have <%=((rs_images_total) + 1) %> out of a possible 10 Images Uploaded.

[Change My Image Positions]

<% if request.querystring("action") = "" then %><% Set Upload = Server.CreateObject("Persits.Upload") Upload.OverwriteFiles = False ' Capture files Upload.Save "d:\inetpub\wwwroot\capital-residence.com\upload" ' Obtain file object Set File = Upload.Files("theImage") If Not File Is Nothing Then ' Build ODBC connection string Connect = "Driver={Microsoft Access Driver (*.mdb)};DBQ=d:\datastore\capital-residence\capres.mdb" ' Build SQL INSERT statement 'SQL = "INSERT INTO theImages(filename, description, owner, filesize) VALUES('" 'SQL = SQL & File.Filename & "', '" 'SQL = SQL & Replace(Upload.Form("theDescription"), "'", "''") & "', " 'SQL = SQL & Replace(Upload.Form("theOwner"), "'", "''") & "', " 'SQL = SQL & File.Size & ")" ' Build SQL INSERT statement SQL = "INSERT INTO theImages(filename, description, owner) VALUES('" SQL = SQL & File.Filename & "', '" SQL = SQL & Replace(Upload.Form("theDescription"), "'", "''") & "', " SQL = SQL & Replace(Upload.Form("theOwner"), "'", "''") & ")" ' Save to database File.ToDatabase Connect, SQL Response.Write "File saved to database. You must now choose a position for your image. Click on 'Change My Image positions' above." Else Response.Write "Error: File not Selected/Saved." End If %><% end if %>

If you have problems uploading images please contact us for help. support@capital-residence.co.uk
AsOne new media Home | Our Services | Mortgages | Edit Your Listing
Contact National Residence

Terms & Conditions | Privacy Policy | Site Map
<% rs_listing.Close() %> <% rs_images.Close() %>