|
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <!--#include file="dwzUpload/DefineVariable.asp" -->
<!--#include file="Connections/pet.asp" --> <% '********************************* '* * '* INSERT RECORD AND UPLOAD * '* http://www.DwZone.it * '* * '********************************* server.ScriptTimeout = 5400
Dim RG_altVal, RG_columns, RG_Cong, RG_dbValues, RG_dbValuesTmp, RG_delim, RG_editCmd, RG_editQuery, RG_editQueryTmp, RG_emptyVal, RG_Ext, RG_Extensions, RG_fields, RG_FieldValueTmp, RG_FileDel, RG_FileExt, RG_formVal, RG_FS, RG_i, RG_L, RG_Len, RG_Max, RG_Name, RG_New, RG_newName, RG_Num, RG_Path, RG_Rec, RG_ret, RG_Save, RG_tableValues, RG_tableValuesTmp, RG_tst, RG_typeArray, RG_z, UploadStatus, NumFile Dim RG_Connection, RG_editColumn, RG_recordId, Form, editAction, editRedirectUrl, RG_Files, RG_formName, UploadType, ParamVal, ParamList, MaxFieldNumber, TmpVal, x, y, Key, ProgressBar, newFileName Dim tmpField_Name(), tmpValue_Name(), tmpField_Size(), tmpValue_Size(), tmpField_Thumb(), tmpValue_Thumb(), QtyRecord, TotalFileSize, valueToRedirectSend Set Form = New ASPForm Dim UploadID UploadID = Form.NewUploadID ProgressBar = "LittleBar2" TotalFileSize = "" editRedirectUrl = "yourdetails.asp" RG_Connection = MM_pet_STRING RG_editTable = "Competition" RG_Files = "Photos;1;;jpg, gif, png;;0;Photo;1;;;;0;1500;;;Thumbs;1;;1;Photo@_@_@1@_@_@0@_@_@-1;440;;80;-1;60;;70;-1;_thumb;-1;1;0;;;80;0;_small;0@_@_@./" RG_formName = "form1" UploadType="Insert" UploadStatus = "" valueToRedirectSend = "Description|Petname|Specie|UserID" NumFile = 0
if len(Request.QueryString("UploadID"))>0 then Form.UploadID = Request.QueryString("UploadID") end if if (Request.QueryString <> "") Then editAction = CStr(Request.ServerVariables("SCRIPT_NAME")) & "?" & Request.QueryString & "&UploadID=" & UploadID else editAction = CStr(Request.ServerVariables("SCRIPT_NAME")) & "?UploadID=" & UploadID End If Const fsCompletted = 0
If Form.State = fsCompletted Then if Form.State = 0 then
Set ParamVal = CreateObject("Scripting.Dictionary") tmp = split(RG_Files,"@_@_@") ParamList = split(tmp(0),"|") MaxFieldNumber = ubound(ParamList) for x=0 to Ubound(ParamList) TmpVal = Split(ParamList(x),";") for y=0 to ubound(TmpVal) Key = right("00" & cstr(x),3) & cstr(y) ParamVal.add Key, TmpVal(y) next next Form.Files.Save
RG_fieldsStr = "Petname|value|UserID|value|Specie|value|Description|value" RG_columnsStr = "Petname|',none,''|UserID|none,none,NULL|Specie|',none,''|Description|',none,''" Form.Files.DataBaseInsert
response.write(getRedirect()) response.end End If ElseIf Form.State > 10 then response.write "<br><Font Color=red>Some form error.<br>Error code: " & Form.State & "<br>Error List:<br>0 Form was successfully processed. <br>1 Request method is NOT post <br>2 Zero length request (there are no data in a source form) <br>3 Form is in a middle of process. <br>5 Initial form state <br>11 Boundary of multipart/form-data is not specified. <br>12 Unknown source form (Content-type must be multipart/form-data) <br>15 Client was disconnected before upload was completted.<br>16 Unexpected error from Request.BinaryRead method (ASP error).<br></Font><br>" End If
function GetFolderName(str): GetFolderName = Ris : end function
function myGetFileName(str): myGetFileName = Ris : end function %> <% Dim rsuserdetails__varUserID rsuserdetails__varUserID = "-1" If (Session("MM_UserID") <> "") Then rsuserdetails__varUserID = Session("MM_UserID") End If %>
<% ' *** Restrict Access To Page: Grant or deny access to this page MM_authorizedUsers="2" MM_authFailedURL="login.asp?Action=NoAccess" MM_grantAccess=false If Session("MM_Username") <> "" Then If (false Or CStr(Session("MM_UserAuthorization"))="") Or _ (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then MM_grantAccess = true End If End If If Not MM_grantAccess Then MM_qsChar = "?" If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&" MM_referrer = Request.ServerVariables("URL") if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString() MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer) Response.Redirect(MM_authFailedURL) End If %> <% Dim rsuserdetails Dim rsuserdetails_cmd Dim rsuserdetails_numRows
Set rsuserdetails_cmd = Server.CreateObject ("ADODB.Command") rsuserdetails_cmd.ActiveConnection = MM_pet_STRING rsuserdetails_cmd.CommandText = "SELECT UserID FROM Entries WHERE UserID = ?" rsuserdetails_cmd.Prepared = true rsuserdetails_cmd.Parameters.Append rsuserdetails_cmd.CreateParameter("param1", 5, 1, -1, rsuserdetails__varUserID) ' adDouble
Set rsuserdetails = rsuserdetails_cmd.Execute rsuserdetails_numRows = 0 %> <html> <head> <title>Competition entry</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="Author" content="Floris Kruger"> <meta name="Description" content="PetsPub is a privately owned organisations with its prime focus that of animal welfare and the promotion of pet awareness"> <meta name="KeyWords" content="animal, rescue, welfare, lost, found, adopting, dogs, cats, animals, rehoming, pets, advice, dog, cat, stolen, animal sanctuary, animal shelter, humane society, animal welfare, animal rescue, animals and society, pet rescue, pet overpopulation, no kill, no-kill, pets, animals, dogs, cats, horses, rabbits, sheep, birds, goats, burros, wildlife, wildlife rehabilitation, feral cats, ferals, stray pets, stray animals, homeless pets, homeless animals, humane, pet adoption, animal adoption, adoption, choosing a pet, humane education, spay, neuter, spay/neuter, kindness to animals, pet competitions, pet stardom, prizes, animal welfare organisations"> <meta name="Classification" CONTENT="Animals"> <meta name="ROBOTS" CONTENT="ALL"> <link href="formstyle.css" rel="stylesheet" type="text/css"> <link href="buttonstyle.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!--
.tabel { border: 0.3px solid #000000; } body { margin-top: 5px; scrollbar-face-color: #3664F2; scrollbar-shadow-color: #010347; scrollbar-highlight-color: #6F8FF5; scrollbar-3dlight-color: #6F8FF5; scrollbar-darkshadow-color: #010217; scrollbar-track-color: #B7C8FF; scrollbar-arrow-color: #FFFFFF; } .style22 { color: #FFFFFF; font-weight: bold; font-size: 14px; } .style36 { color: #000000; font-size: 12px; font-family: Arial, Helvetica, sans-serif; } --> </style>
</head> <body topmargin="9" onLoad="javascript:{if(parent.frames[0]&&parent.frames['topFrame'].Go)parent.frames['topFrame'].Go()}"> <table width="100%" border="0" cellpadding="6" cellspacing="0" bordercolor="#999999"> <tr> <td width="20%" valign="top"> <table width="100%" height="120" border="1" cellpadding="2" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF" class="tabel"> <tr> <td height="118" align="center" valign="middle"><p><a href="advertise.asp"><img src="images/advertise.gif" width="160" height="115" border="0"></a></p></td> </tr> </table> <br> <table width="100%" height="120" border="1" cellpadding="2" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF" class="tabel"> <tr> <td height="118" align="center" valign="middle"><p><a href="advertise.asp"><img src="images/advertise.gif" width="160" height="115" border="0"></a></p></td> </tr> </table> </td> <td width="60%" valign="top"><table width="90%" border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td height="26" colspan="2" bgcolor="#3664F2"><div align="center" class="style22"><font face="Arial, Helvetica, sans-serif">ENTER COMPETITION DETAILS</font></div></td> </tr> <tr> <td width="96%" height="260" colspan="2" valign="top"> <form ACTION="<%=editAction%>" enctype="multipart/form-data" method="post" onSubmit="return ProgressBar()" name="form1"> <table width="100%" cellspacing="0" cellpadding="2"> <tr> <td height="36" colspan="2"> <div align="center"><font color="#990000" size="2" face="Arial, Helvetica, sans-serif"><strong>Each member is allowed one entry to the competition.</strong></font></div></td> </tr> <tr> <td width="31%"> <div align="right"><strong><font size="2" face="Arial, Helvetica, sans-serif">Pet name:</font></strong></div></td> <td width="69%"> <input name="Petname" type="text" id="Petname"> <input name="UserID" type="hidden" id="UserID" value="<%= Session("MM_UserID") %>"></td> </tr> <tr> <td> <div align="right"><strong><font size="2" face="Arial, Helvetica, sans-serif">Specie:</font></strong></div></td> <td> <input name="Specie" type="text" id="Specie"></td> </tr> <tr> <td> <div align="right"><strong><font size="2" face="Arial, Helvetica, sans-serif">Description:</font></strong></div></td> <td> <textarea name="Description" id="Description"></textarea></td> </tr> <tr> <td colspan="2"><div align="center" class="style36">Your photo should be either JPG or GIF, have a width of between 450 pixels and 1000 pixels and no bigger in size than 200kb.</div></td> </tr> <tr> <td> <div align="right"><strong><font size="2" face="Arial, Helvetica, sans-serif">Upload photo:</font></strong></div></td> <td><input name="Photo" type="file" id="Photo" onChange="dwz_setEvent(this,'change')" onClick="dwz_setEvent(this,'click')" value=""></td> </tr> <tr> <td> <div align="right"></div></td> </tr> <tr> <td colspan="2"> <div align="center"> <input name="dwzSubmit" type="submit" class="buttonstyle" value="Submit"> </div></td> </tr> </table> <input type="hidden" name="MM_insert" value="form1"> </form> </td> </tr> </table></td> <td width="20%" valign="top"> <table width="100%" height="120" border="1" cellpadding="2" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF" class="tabel"> <tr> <td height="118" align="center" valign="middle"><p><a href="advertise.asp"><img src="images/advertise.gif" width="160" height="115" border="0"></a></p></td> </tr> </table> <br> <table width="100%" height="120" border="1" cellpadding="2" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF" class="tabel"> <tr> <td height="118" align="center" valign="middle"><p><a href="advertise.asp"><img src="images/advertise.gif" width="160" height="115" border="0"></a></p></td> </tr> </table> <p> </p> <p> </p> <p> </p> <p> </p></td> </tr> </table> </body> </html> <% rsuserdetails.Close() Set rsuserdetails = Nothing %> <!--#include file="dwzUpload/Upload.asp" --> <!--#include file="dwzUpload/UploadAdvanced.asp" --> <!--#include file="dwzUpload/Resize.asp" --> <% '********************************* '* * '* ADD WATERMARK * '* http://www.DwZone.it * '* * '********************************* function getWatermarkValue(img) select case img case "Big" getWatermarkValue = "watermark.png" case "Thumb1" getWatermarkValue = "" case "Thumb2" getWatermarkValue = "" end select end function function getWatermarkPosition() getWatermarkPosition = "Bottom_right" end function '********************************* '* * '* ADD WATERMARK * '* http://www.DwZone.it * '* * '********************************* %>
|
|
|
|
|