<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Dim rs_providersadmin__MMColParam rs_providersadmin__MMColParam = "999" If (Request.QueryString("DOC_ID") <> "") Then rs_providersadmin__MMColParam = Request.QueryString("DOC_ID") End If %> <% Dim rs_department Dim rs_department_numRows Set rs_department = Server.CreateObject("ADODB.Recordset") rs_department.ActiveConnection = MM_connChristie_STRING rs_department.Source = "SELECT departments_contact.DEPT_ID, departments_contact.LOC_ID, departments.DEPT_TITLE, locations.LOC_NAME FROM departments, departments_contact, locations WHERE ((departments_contact.DEPT_ID = departments.DEPT_ID) AND (departments_contact.LOC_ID = locations.LOC_ID)) ORDER BY DEPT_TITLE ASC" rs_department.CursorType = 0 rs_department.CursorLocation = 2 rs_department.LockType = 1 rs_department.Open() rs_department_numRows = 0 %> <% Dim rs_providersadmin Dim rs_providersadmin_numRows Set rs_providersadmin = Server.CreateObject("ADODB.Recordset") rs_providersadmin.ActiveConnection = MM_connChristie_STRING rs_providersadmin.Source = "SELECT doctors.DOC_ID, doctors.DOC_LASTNAME, doctors.DOC_FIRSTNAME, doctors.DOC_TITLE, doctors.DOC_SPECIALTY, doctors.DOC_SCHOOL, doctors.DOC_MEDSCHOOL, doctors.DOC_INTERNSHIP, doctors.DOC_RESIDENCY, doctors.DOC_FELLOWSHIP, doctors.DOC_CERTIFIED, doctors.DOC_PHOTO FROM doctors WHERE doctors.DOC_ID = " + Replace(rs_providersadmin__MMColParam, "'", "''") + "" rs_providersadmin.CursorType = 0 rs_providersadmin.CursorLocation = 2 rs_providersadmin.LockType = 1 rs_providersadmin.Open() rs_providersadmin_numRows = 0 %> <% Dim rs_department_name__MMColParam rs_department_name__MMColParam = "141" If (Request.QueryString("DOC_ID") <> "") Then rs_department_name__MMColParam = Request.QueryString("DOC_ID") End If %> <% Dim rs_department_name Dim rs_department_name_numRows Set rs_department_name = Server.CreateObject("ADODB.Recordset") rs_department_name.ActiveConnection = MM_connChristie_STRING rs_department_name.Source = "SELECT doctor_matrix.DOC_ID, departments_contact.DEPTCONTACT_ID, departments_contact.DEPT_ID, departments_contact.LOC_ID, departments_contact.LOCFLOOR_ID, departments.DEPT_TITLE, locations.LOC_NAME FROM departments_contact, doctor_matrix, departments, locations_floor, locations WHERE ((departments_contact.DEPTCONTACT_ID = doctor_matrix.DEPTCONTACT_ID) AND (departments_contact.DEPT_ID = departments.DEPT_ID) AND (departments_contact.LOC_ID = locations.LOC_ID) AND (doctor_matrix.DOC_ID = " + Replace(rs_department_name__MMColParam, "'", "''") + ") AND (departments_contact.LOCFLOOR_ID = locations_floor.LOCFLOOR_ID))" rs_department_name.CursorType = 0 rs_department_name.CursorLocation = 2 rs_department_name.LockType = 1 rs_department_name.Open() rs_department_name_numRows = 0 %> <% '*** Pure ASP File Upload 2.1.7 Dim GP_uploadAction,UploadQueryString PureUploadSetup If (CStr(Request.QueryString("GP_upload")) <> "") Then Dim pau_thePath,pau_Extensions,pau_Form,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout,pau_progressBar,pau_progressWidth,pau_progressHeight pau_thePath = """/images/doctors""" pau_Extensions = "GIF,JPG,JPEG" pau_Form = "providersAdd" pau_Redirect = "" pau_storeType = "file" pau_sizeLimit = "" pau_nameConflict = "over" pau_requireUpload = "false" pau_minWidth = "" pau_minHeight = "" pau_maxWidth = "" pau_maxHeight = "" pau_saveWidth = "" pau_saveHeight = "" pau_timeout = "600" pau_progressBar = "" pau_progressWidth = "300" pau_progressHeight = "100" Dim RequestBin, UploadRequest CheckPureUploadVersion 2.17 ProcessUpload pau_thePath,pau_Extensions,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout end if %> <% ' *** Edit Operations: (Modified for File Upload) declare variables Dim MM_editAction Dim MM_abortEdit Dim MM_editQuery Dim MM_editCmd Dim MM_editConnection Dim MM_editTable Dim MM_editRedirectUrl Dim MM_editColumn Dim MM_recordId Dim MM_fieldsStr Dim MM_columnsStr Dim MM_fields Dim MM_columns Dim MM_typeArray Dim MM_formVal Dim MM_delim Dim MM_altVal Dim MM_emptyVal Dim MM_i MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")) If (UploadQueryString <> "") Then MM_editAction = MM_editAction & "?" & Server.HTMLEncode(UploadQueryString) End If ' boolean to abort record edit MM_abortEdit = false ' query string to execute MM_editQuery = "" %> <% ' *** Update Record: (Modified for File Upload) set variables If (CStr(UploadFormRequest("MM_update")) = "providersAdd" And CStr(UploadFormRequest("MM_recordId")) <> "") Then MM_editConnection = MM_connChristie_STRING MM_editTable = "doctors" MM_editColumn = "DOC_ID" MM_recordId = "" + UploadFormRequest("MM_recordId") + "" MM_editRedirectUrl = "done.asp" MM_fieldsStr = "DOC_FIRSTNAME|value|DOC_LASTNAME|value|DOC_TITLE|value|DOC_SPECIALTY|value|DOC_SCHOOL|value|DOC_MEDSCHOOL|value|DOC_INTERNSHIP|value|DOC_RESIDENCY|value|DOC_FELLOWSHIP|value|DOC_CERTIFIED|value|DOC_PHOTO|value" MM_columnsStr = "DOC_FIRSTNAME|',none,''|DOC_LASTNAME|',none,''|DOC_TITLE|',none,''|DOC_SPECIALTY|',none,''|DOC_SCHOOL|',none,''|DOC_MEDSCHOOL|',none,''|DOC_INTERNSHIP|',none,''|DOC_RESIDENCY|',none,''|DOC_FELLOWSHIP|',none,''|DOC_CERTIFIED|',none,''|DOC_PHOTO|',none,''" 'toggle skip empty fields feature off if UploadFormRequest("delete_image") = "" then MM_columnsStr = FixColumnsForUpload(MM_fieldsStr,MM_columnsStr) MM_fieldsStr = FixFieldsForUpload(MM_fieldsStr,MM_columnsStr) end if ' create the MM_fields and MM_columns arrays MM_fields = Split(MM_fieldsStr, "|") MM_columns = Split(MM_columnsStr, "|") ' set the form values For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2 MM_fields(MM_i+1) = CStr(UploadFormRequest(MM_fields(MM_i))) Next ' append the query string to the redirect URL If (MM_editRedirectUrl <> "" And UploadQueryString <> "") Then If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And UploadQueryString <> "") Then MM_editRedirectUrl = MM_editRedirectUrl & "?" & UploadQueryString Else MM_editRedirectUrl = MM_editRedirectUrl & "&" & UploadQueryString End If End If End If %> <% Function newFileSystemObject() set newFileSystemObject=Server.CreateObject("Scripting.FileSystemObject") End Function %> <% Function fileExists(aFileSpec) fileExists=newFileSystemObject.fileExists(aFileSpec) End Function %> <% ' *** Update Record: (Modified for File Upload) construct a sql update statement and execute it If (CStr(UploadFormRequest("MM_update")) <> "" And CStr(UploadFormRequest("MM_recordId")) <> "") Then ' create the sql update statement MM_editQuery = "update " & MM_editTable & " set " For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2 MM_formVal = MM_fields(MM_i+1) MM_typeArray = Split(MM_columns(MM_i+1),",") MM_delim = MM_typeArray(0) If (MM_delim = "none") Then MM_delim = "" MM_altVal = MM_typeArray(1) If (MM_altVal = "none") Then MM_altVal = "" MM_emptyVal = MM_typeArray(2) If (MM_emptyVal = "none") Then MM_emptyVal = "" If (MM_formVal = "") Then MM_formVal = MM_emptyVal Else If (MM_altVal <> "") Then MM_formVal = MM_altVal ElseIf (MM_delim = "'") Then ' escape quotes MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'" Else MM_formVal = MM_delim + MM_formVal + MM_delim End If End If If (MM_i <> LBound(MM_fields)) Then MM_editQuery = MM_editQuery & "," End If MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal Next MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId If (Not MM_abortEdit) Then ' execute the update Set MM_editCmd = Server.CreateObject("ADODB.Command") MM_editCmd.ActiveConnection = MM_editConnection ' delete the file before we delete the record ' check to see if delete should run (the field N_Image in the first line should be your form's image field name) If UploadFormRequest("DOC_PHOTO") <> "" OR UploadFormRequest("delete_image") <> "" Then ' create file scripting object Set File = CreateObject("Scripting.FileSystemObject") ImagePath = Server.MapPath("\images\doctors") ImagePath = ImagePath & "\" & (rs_providersadmin.Fields.Item("DOC_PHOTO").Value) ' check if file exists and if true delete the file If fileExists(ImagePath) Then File.DeleteFile(ImagePath) End If End if ' end delete image code MM_editCmd.CommandText = MM_editQuery MM_editCmd.Execute MM_editCmd.ActiveConnection.Close If (MM_editRedirectUrl <> "") Then Response.Redirect(MM_editRedirectUrl) End If End If End If %> <% subLinkID = "providers" %> Christie Clinic | Control Panel

    <% If (rs_providersadmin.Fields.Item("DOC_PHOTO").Value) <> "" Then Response.Write("") Else Response.Write("") End if %> ">

PROVIDERS : EDIT

PERSONAL   (* - asterisk denotes required)

FIRST NAME* :

">

LAST NAME* :

">

TITLE* :

">

DEPARTMENT   (* - required)

PROFESSIONAL   (* - asterisk denotes required)

SPECIALTY* :

UNDERGRADUATE :

MEDICAL SCHOOL :

" size="40">

INTERNSHIP :

" size="40">

RESIDENCY :

" size="40">

FELLOWSHIP :

" size="40">

CERTIFICATION :

" size="40">

PHOTO (pictures are posted at 85 x 111 pixels; .JPG or .JPEG format is preferred)

PHOTO :

">

Existing Image

Delete Image?

<% rs_department_name.Close() Set rs_department_name = Nothing %> <% rs_providersadmin.Close() Set rs_providersadmin = Nothing %> <% rs_department.Close() Set rs_department = Nothing %>