[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

02/15/2007 at 08:16AM PST, ID: 22391657
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Passing information between iframe and main form

Asked by cooperrd in Active Server Pages (ASP)

Tags: iframe, information, passing

I am working with an update form that includes an iframe.  What I am trying to do is is pass three values from the ifame into the main body of the form. You can see a screen shot of the form here. http://www.coopnet.com/images/addeditscreenshot.jpg  

The flow is – that a Patient is selected (this is a select box populated from the db).  Then a location is selected (These radio buttons are built from the db).  Once the radio button is selected then the available dates are supposed to be displayed in the calendar (I plane to use an onclick event here – I don’t have that working yet).  Then when the date is clicked I want all the info; patientID, LocationID, and Date to be passed into the main form where a query will be done to retrieve other relative information like Patient Name, Location Name, tech Name, etc.

I am using a previous post that Fritz responded to (07/06/2005 - 02:34PM CDT, ID: 21482427) as a guide. I am trying to use the Iframe1.asp and the Iframe2.asp that Fritz wrote. The primary function is below:

<script language="JavaScript">
<!--
function PassValues(){
      document.forms['frmControlLedger'].elements['datStart'].value = document.frames('IFrame1').document.forms['frmDates'].elements['datStart'].value;
      document.forms['frmControlLedger'].elements['datEnd'].value = document.frames('IFrame1').document.forms['frmDates'].elements['datEnd'].value;
}
//-->
</script>

I normally post a form back to itself with an action and additional variables to achive what I want.  In this case I need the iframe to query the db upon selecting a radio button to display the available dates, then when the date is clicked to pass that info to the main form in such a manner that the main form will query the db and retrive the proper informaion. At the same time I want the Iframe to retain the values that were selected.

The code for these forms is rather lenghly but I am posting it for both forms.

If I were writing to Dear Abby I would sign this “Confused”

Code Below:

'*************************** Main Form ******************************

<!-- #include file="../functions.asp" -->
<script language="JavaScript">
<!--
function PassValues(){
document.forms['frmMain'].elements['EventPatientID'].value = document.frames('techDate').document.forms['frmMainIframe'].elements['EventPatientID'].value;
document.forms['frmMain'].elements['PrimaryEventDepartment'].value = document.frames('techDate').document.forms['frmMainIframe'].elements['PrimaryEventDepartment'].value;
}
//-->
</script>
<%

'Department_On = True
'Category_On = True

'If (Session("StaffID") < 1) Then
'      Response.Redirect("../Login.asp")
'End If  

function CoalesceDate(sDate)
RetVal = "NULL"
if sDate > "" then
if isDate(sDate) then
RetVal = "'" & cStr(cDate(sDate)) & "'"
end if
end if
CoalesceDate = RetVal
end function

Dim iCustomID, edit_EvntName, edit_ReferringPhysician, edit_id, sql, _
edit_EvntBegin, edit_EvntEnd, edit_EvntContactLast, _
edit_EvntContactFirst, edit_InterpretingPhysician, edit_EvntContactPhone, edit_EvntContactFax, _
sProcedureType, edit_EvntPublic, edit_EvntUrl, edit_EvntSource

edit_id = Request("id")
sAction = Trim(Request("action"))
sPage = "Appointment Information"
ishowtop = Request("showtop")

If (sAction = "Update Appointment") Then  
'----- For this application, it is best to DELETE all occurences of the event then
'-----   do an INSERT (instead of UPDATE)
edit_id    = SQLFilter(Request.Form("edit_id"))
DBConnect "DELETE FROM Events WHERE EvntID = " & edit_id
DBConnect "DELETE FROM Events WHERE Event_MasterID = " & edit_id
DBConnect "DELETE FROM EventCategoryRT WHERE EventCategoryRT_evntID = " & edit_id
InsertEvent
edit_EvntBegin = SQLFilter(Request.Form("edit_EvntBegin"))
iMonth = DatePart("m", CDate(edit_EvntBegin))
iYear = DatePart("yyyy", CDate(edit_EvntBegin))
Response.Redirect("list.asp?month=" + CStr(iMonth) + "&year=" + CStr(iYear))

ElseIf (sAction = "Add Appointment") Then
InsertEvent
edit_EvntBegin = SQLFilter(Request.Form("edit_EvntBegin"))
iMonth = DatePart("m", CDate(edit_EvntBegin))
iYear = DatePart("yyyy", CDate(edit_EvntBegin))
If ishowtop <> "no" Then
Response.Write("<SCRIPT language='javascript'>window.close();opener.location.reload();</SCRIPT>")
Else
Response.Redirect("list.asp?month=" + CStr(iMonth) + "&year=" + CStr(iYear))
End If
ElseIf (sAction = "Update1") Then
If (edit_id > 0) Then
sSQL = "SELECT * FROM Events WHERE EvntID=" & edit_id
DBConnect sSQL
If Not objRS.EOF Then
sEvntID = objRS("EvntID")
edit_id = objRS("EvntID")
edit_EvntBegin = objRS("EvntBegin")
edit_EventTime = objRS("Event_Time")
edit_EvntEnd = objRS("EvntEnd")
sEventPatientID = objRS("EventPatientID")
edit_EvntName = objRS("EvntName")
edit_ReferringPhysicianID = objRS("ReferringPhysicianID")
edit_ReferringPhysician  = objRS("ReferringPhysician")
sEvntDescription = objRS("EvntDescription")
edit_EvntContactLast = objRS("EvntContactLast")
edit_EvntContactFirst = objRS("EvntContactFirst")
edit_InterpretingPhysician = objRS("InterpretingPhysician")
edit_EvntContactPhone = objRS("EvntContactPhone")
edit_EvntContactFax = objRS("EvntContactFax")
sProcedureType = objRS("ProcedureType")
iPrimaryProc = objRS("ProcedureType")
sEvntConfirmed = objRS("EvntConfirmed")
sEvntConfDate = objRS("EvntConfDate")
sEventConfBy = objRS("EventConfBy")
edit_EvntPublic = objRS("EvntPublic")
edit_EvntRecurringType = objRS("Event_RecurringType")
edit_EvntMasterID = objRS("Event_MasterID")
edit_EvntUrl = objRS("Event_Url")
sFileName = objRS("Event_PDF")
edit_EvntSource = objRS("Event_Source")
DBClose                  
sButtonLabel = "Update Appointment"
Else
Response.Redirect("addeditNew.asp")
End If

'*************************************************************
'----- Get the primary Department for this event
sSQL = "SELECT * FROM EventCategoryRT WHERE EventCategoryRT_evntID=" & edit_id
DBConnect sSQL
If Not objRS.EOF Then
iPrimaryDept = objRS("EventCategoryRT_EventDepartmentID")
DBClose
End If            


'****************************************************

'----- Get the primary event category for this event
sSQL = "SELECT * FROM EventCategoryRT WHERE EventCategoryRT_evntID=" & edit_id
DBConnect sSQL
If Not objRS.EOF Then
iPrimaryCat = objRS("EventCategoryRT_EventCategoryID")
DBClose
End If

'*************************************************************
IF (Procezzdure_On = "True") Then
'----- Get the primary Procedure for this event
sSQL = "SELECT * FROM EventProcedure WHERE EventCategoryRT_evntID=" & edit_id & " AND EventCategoryRT_Primary=1;"
DBConnect sSQL
If Not objRS.EOF Then
iPrimaryDept = objRS("EventCategoryRT_EventDepartmentID")
DBClose
End If      
End If            
'****************************************************
sSQL = "SELECT * FROM Patients WHERE PatientID=" & sEventPatientID & ";"
DBConnect sSQL
If Not objRS.EOF Then
iedit_EvntName = CStr(objRS.Fields("Title").Value) + " " + CStr(objRS.Fields("FirstName").Value) + " " + CStr(objRS.Fields("LastName").Value)
DBClose
End If
'****************************************************
Else
Response.Redirect("addeditNew.asp")
End If
'****** End of Update1 ****************************************
Else  'Insert1
sButtonLabel = "Add Appointment"
End If

Sub InsertEvent
sEvntID = Request.Form("edit_id")
edit_EvntBegin = SQLFilter(Request.Form("edit_EvntBegin"))
edit_EvntEnd = SQLFilter(Request.Form("edit_EvntEnd"))
If (Len(edit_EvntEnd) < 3) Then
edit_EvntEnd = edit_EvntBegin
End If
edit_EventTime = SQLFilter(Request.Form("edit_EventTime"))
sEventPatientID = SQLFilter(Request.Form("EventPatientID"))
edit_EvntName = SQLFilter(Request.Form("edit_EvntName"))
sRefPhysicanID = SQLFilter(Request.Form("edit_ReferringPhysicianID"))
edit_ReferringPhysician  = SQLFilter(Request.Form("edit_ReferringPhysician"))
edit_InterpretingPhysician = SQLFilter(Request.Form("edit_InterpretingPhysician"))
sProcedureType= Trim(Request.Form("sProcedureType"))
If (Request.Form("EvntConfirmed") = "1") Then
sEvntConfirmed = True
Else
sEvntConfirmed = False
End If
sEvntConfDate= Trim(Request.Form("EvntConfDate"))
sEventConfBy= Trim(Request.Form("EventConfBy"))      

'If (EvntBegin  = "") then Response.Redirect("../error.asp")

sSQL =       "INSERT INTO Events (EventPatientID, EvntName, EvntBegin, Event_Time, " + _
"EvntEnd, ReferringPhysicianID, ReferringPhysician, InterpretingPhysician, EvntConfirmed, " + _
"EvntConfDate, EventConfBy, ProcedureType) " + _
"VALUES ('" + CStr(sEventPatientID) + "', " + _
"'" + CStr(edit_EvntName) + "', " + _
"'" + CStr(edit_EvntBegin) + "', " + _
"'" + CStr(edit_EventTime) + "', " + _
"'" + CStr(edit_EvntEnd) + "', " + _
"'" + CStr(sRefPhysicanID) + "', " + _
"'" + CStr(edit_ReferringPhysician) + "', " + _
"'" + CStr(edit_InterpretingPhysician) + "', " + _
"" + CStr(sEvntConfirmed) + ", " + _
"" + CoalesceDate(sEvntConfDate) + ", " + _
"'" + CStr(sEventConfBy) + "', " + _
"'" + CStr(sProcedureType) + "')"

'Response.Write("<br>sSQL: " + sSQL)
'Response.end
DBConnect sSQL

'----- Get the ID of the master event just added
sSQL = "SELECT evntID FROM Events ORDER BY evntID DESC;"
'sSQL = "SELECT evntID FROM Events WHERE " + _
'         "EvntName='" + CStr(edit_EvntName) + "' AND " + _
'         "EvntBegin=#" + CStr(edit_EvntBegin) + "#;"
DBConnect sSQL
If Not objRS.EOF Then
edit_id = objRS("evntID")
End If
DBClose
If (sAction = "Update Appointment") Then
sSQL =  "UPDATE Notations SET Note_AppointmentID='" + CStr(edit_id) + "' " + _      
"WHERE Note_AppointmentID=" + CStr(sEvntID) + ";"
'Response.write ssql
'response.end
DBConnect sSQL
End If

'----- Primary Event Category stuff
sPrimaryDept = SQLFilter(Request.Form("PrimaryEventDepartment"))
sPrimaryCat = SQLFilter(Request.Form("PrimaryEventCategory"))
sSQL = "INSERT INTO EventCategoryRT (EventCategoryRT_EventDepartmentID, EventCategoryRT_EventCategoryID, EventCategoryRT_evntID, EventCategoryRT_Primary) VALUES (" + _
CStr(sPrimaryDept) + ", " + _
CStr(sPrimaryCat) + ", " + _
CStr(edit_id) + ", " + _
"1);"
'Response.Write("<br>" + sSQL)
DBConnect sSQL

End Sub

'----- Sub to load Primary Department Box ------- This the Locations
Sub LoadPrimaryDeptCombo(iPrimaryDept)
Dim sSQL, rsData, sTemp, iTemp

sSQL = "SELECT EventDepartment_ID, EventDepartment_Name FROM EventDepartment ORDER BY EventDepartment_Name; "
DBConnect sSQL
Response.Write("<OPTION selected value='0'>Select Location</OPTION>")
While Not objRS.EOF
sTemp = CStr(objRS.Fields("EventDepartment_Name").Value)
iTemp = CInt(objRS.Fields("EventDepartment_ID").Value)

if (CInt(iPrimaryDept) = iTemp) then
Response.Write("<OPTION selected value='" & iTemp & "'>" & sTemp & "</OPTION>")
else
Response.Write("<OPTION value='" & iTemp & "'>" & sTemp & "</OPTION>")
end if
objRS.MoveNext
wend
DBClose
End Sub

'----- Sub to load Primary Catagory Box ---------- This is the Techs
Sub LoadPrimaryCombo(iPrimaryCat)
Dim sSQL, rsData, sTemp, iTemp

sSQL = "SELECT EventCategory_ID, EventCategory_Name FROM EventCategory ORDER BY EventCategory_Name "
DBConnect sSQL
Response.Write("<OPTION selected value='0'>Select Technician</OPTION>")
While Not objRS.EOF
sTemp = CStr(objRS.Fields("EventCategory_Name").Value)
iTemp = CInt(objRS.Fields("EventCategory_ID").Value)

if (CInt(iPrimaryCat) = iTemp) then
Response.Write("<OPTION selected value='" & iTemp & "'>" & sTemp & "</OPTION>")
else
Response.Write("<OPTION value='" & iTemp & "'>" & sTemp & "</OPTION>")
end if
objRS.MoveNext
wend
DBClose
End Sub

'----- Sub to load Primary Procedure Box
Sub LoadPrimaryProcCombo(iPrimaryProc)
Dim sSQL, rsData, sTemp, iTemp

sSQL = "SELECT EventProcedure_ID, EventProcedure_Name FROM EventProcedure ORDER BY EventProcedure_Name; "
DBConnect sSQL
Response.Write("<OPTION selected value='0'>Select Procedure</OPTION>")
While Not objRS.EOF
sTemp = CStr(objRS.Fields("EventProcedure_Name").Value)
iTemp = CInt(objRS.Fields("EventProcedure_ID").Value)

if (CInt(iPrimaryProc) = iTemp) then
Response.Write("<OPTION selected value='" & iTemp & "'>" & sTemp & "</OPTION>")
else
Response.Write("<OPTION value='" & iTemp & "'>" & sTemp & "</OPTION>")
end if
objRS.MoveNext
wend
DBClose
End Sub
'****************************************************
If Request.QueryString("pid")<>"" Then
sSQL = "SELECT * FROM Patients WHERE PatientID=" & Request.QueryString("pid") & ";"
DBConnect sSQL
If Not objRS.EOF Then
iedit_EvntName = CStr(objRS.Fields("Title").Value) + " " + CStr(objRS.Fields("FirstName").Value) + " " + CStr(objRS.Fields("LastName").Value)
iRefPhysicanID  = objRS("Patient_RefPhysicanID")
iInterpreterID = objRS("patient_InterpreterID")
DBClose
End If
sSQL = "SELECT Physicians_ID, Physicians_Salutation, Physicians_FirstName, Physicians_LastName FROM Physicians WHERE Physicians_ID=" & iInterpreterID & ";"
DBConnect sSQL
If Not objRS.EOF Then
edit_InterpretingPhysician = CStr(objRS.Fields("Physicians_Salutation").Value) + " " + CStr(objRS.Fields("Physicians_FirstName").Value) + " " + CStr(objRS.Fields("Physicians_LastName").Value)
DBClose
End If
sSQL = "SELECT Physicians_ID, Physicians_Salutation, Physicians_FirstName, Physicians_LastName FROM Physicians WHERE Physicians_ID=" & iRefPhysicanID & ";"
DBConnect sSQL
If Not objRS.EOF Then
edit_ReferringPhysicianID = CStr(objRS.Fields("Physicians_ID").Value)
edit_ReferringPhysician = CStr(objRS.Fields("Physicians_Salutation").Value) + " " + CStr(objRS.Fields("Physicians_FirstName").Value) + " " + CStr(objRS.Fields("Physicians_LastName").Value)
DBClose
End If
End If
'****************************************************


%>

<%If ishowtop <> "no" Then %>
<!-- #include file="../tabmenu.asp" -->
<%Else%>
<link rel="stylesheet" href="<%=sAbsolutePath%>editmenu.css" type="text/css">
<%End If%>


<script language="JavaScript" src="datepicker/ts_picker4.js"></script>

<form name="frmMain" action="addeditNew.asp" method="post">
<input type="hidden" name="edit_id" value="<%=edit_id%>">
<input type="hidden" name="edit_EvntName" value="<%=iedit_EvntName%>">
<input type="hidden" name="edit_ReferringPhysicianID" value="<%=edit_ReferringPhysicianID%>">
<table Class="ID2" border="0" width="600" cellpadding="0" cellspacing="0" align="center">
<tr>
<td class="title_new" colspan="4" align=center>
<%=sButtonLabel%>
</td>
</tr>
<tr>
<td class="text_new" colspan="4" align=center>
<table>
<tr>
<td align=right>
<IFRAME SRC="../calendar/techCalendar_inc.asp?Cid=<%=iDept%>" ID="techIframe" Name="techIframe" SCROLLING="no" HSPACE="0" VSPACE="0" FRAMEBORDER="no" MARGINHEIGHT="0" ALIGN="MIDDLE" MARGINWIDTH="0" WIDTH="600" HEIGHT="200"><font color='003366'></IFRAME>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<input type="button" value="Set Date" onClick="PassValues()">
</td>
</tr>
<tr>
<td valign=top align=left>
<table Class="ID3" border="1" width="300" cellpadding="0" cellspacing="0" align="center">
<tr>
<td class="text_new">
Patient Name:
<!-- #include file="../patients/Pat_inc.asp" -->
</td>
</tr>
<tr>
<td class="text_new">
Appt. Date:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Appt. Time:&nbsp;&nbsp;&nbsp;<!-- Public -->
<br>
<input type="text" size=10 maxlength=255 name="edit_EvntBegin" value="<%=edit_EvntBegin%>">
<a href="javascript:show_calendar4('document.frmMain.edit_EvntBegin', document.frmMain.edit_EvntBegin.value);"><img src="datepicker/cal.gif" width="16" height="16" border="0" alt="Click here to choose date"></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" size=10 maxlength="100" name="edit_EventTime" value="<%=edit_EventTime%>">
&nbsp;&nbsp;&nbsp;&nbsp;<!-- <INPUT id="EvntPublic=" type="checkbox" name="edit_EvntPublic" value="1" <% If edit_EvntPublic Then %>checked<% ElseIf (sAction = "") Then %>checked<% End If %>> --><br>
<span class="smalltext">(i.e. "10:00AM - 4:00PM", "all day", "9:00 PM - ???")</span>
</td>
</tr>

<%IF (Department_On = "True") Then%>
<tr>
<td class="text_new">
Appointment Location:
</td>
</tr>
<tr>      
<td align="left">
<select name="PrimaryEventDepartment" size="1" style="WIDTH: 150px">
<% LoadPrimaryDeptCombo iPrimaryDept %>
</select>
<%If (Session("AccessLevel") > 7) Then%>
<a href="EventDepartment/default.asp">Add Loc.</a>
<%End IF%>
</td>
</tr>
<tr>
<td class="text_new">
Technician:
</td>
</tr>
<tr>
<td align="left">
<select name="PrimaryEventCategory" size="1" style="WIDTH: 150px">
<% LoadPrimaryCombo iPrimaryCat %>
</select>
<%If (Session("AccessLevel") > 7) Then%>
<a href="EventCategory/default.asp">Add Tech.</a>
<%End IF%>
</td>
</tr>
<%End IF%>
</table>
</td>
<td valign=top align=left>
<table Class="ID3" border="1" width="300" cellpadding="0" cellspacing="0" align="left">
<tr>      
<td class="text_new">
Ref_Physician:
</td>
<td class="text_new">
<input type="text" readonly size=30 maxlength="50" name="edit_ReferringPhysician" value="<%=edit_ReferringPhysician%>">
</td>
</tr>
<tr>
<td class="text_new">
Inter_Physician:
</td>
<td class="text_new">
<input type="text" readonly size=30 maxlength="50" name="edit_InterpretingPhysician" value="<%=edit_InterpretingPhysician%>" ID="Text3">
</td>
</tr>
<tr>
<td class="text_new">
Procedure Type:
</td>
<td class="text_new">
<select name="sProcedureType" size="1" style="WIDTH: 110px">
<% LoadPrimaryProcCombo iPrimaryProc %>
</select>
<%If (Session("AccessLevel") > 7) Then%>
<a href="EventProcedure/default.asp">Add Proc.</a>
<%End IF%>
</td>
</tr>
<tr>
<td>
Appt. Confirmed  :
</td>
<td>
<INPUT id="EvntConfirmed=" type="checkbox" name="EvntConfirmed" value="1" <% If sEvntConfirmed Then %>checked<% End If %>>
</td>
</tr>
<tr>
<td class="cttext">
Confirm Date  :
</td>
<td>
<input type="text" size=10 maxlength=20 name="EvntConfDate" value="<%=sEvntConfDate%>">
<a href="javascript:show_calendar4('document.frmMain.EvntConfDate', document.frmMain.EvntConfDate.value);"><img src="datepicker/cal.gif" width="16" height="16" border="0" alt="Click here to choose date"></a>
</td>
</tr>
<tr>
<td class="text_new">
Confirmed_By:
</td>
<td class="text_new">
<input type="text" size=30 maxlength="50" name="EventConfBy" value="<%=sEventConfBy%>" ID="Text1">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=4>
<table border="0" BGColor="#6089c7" width="600" cellpadding="2" cellspacing="0" align="center">
<tr>
<td align="left">
<%
iMonth = DatePart("m", CDate(edit_EvntBegin))
iYear = DatePart("yyyy", CDate(edit_EvntBegin))
sLink = "list.asp?month=" + CStr(iMonth) + "&year=" + CStr(iYear)
%>
<input type="button" name="btnCancel" value="Cancel" onclick="location.href='<%=sLink%>';" ID="Button1">
</td>
<td align="right">
<input type="submit" name="action" value="<%=sButtonLabel%>" ID="Submit1">
</td>
</tr>
</table>
</td>
</tr>
<%If (sAction <> "New") Then%>
<%If (Session("AccessLevel") > 6) Then%>
<tr>
<td height=10 colspan=1>
<font size=1 face=Verdana><b>Notations:</b></font>
</td>
<td align="right" height=10 colspan=1>
<font size=1 face=Verdana><b><a href="../notations/addeditNew.asp?showtop=no&aid=<%=sEvntID%>&pid=<%=sEventPatientID%>" onclick="NewWindow(this.href,'popup','650','200','no','center');return false" onfocus="this.blur()">Add Notation:</a></b></font>
</td>
</tr>
<tr>
<td height=10 bgcolor="#6089c7" colspan=4></td>
</tr>

<tr>
<td colspan="4" align="center" height="100">
<IFRAME SRC="../notations/notations_i.asp?aid=<%=sEvntID%>" Name="Notations" SCROLLING="AUTO" HSPACE="0" VSPACE="0" FRAMEBORDER="0" MARGINHEIGHT="5" ALIGN="MIDDLE" MARGINWIDTH="5" WIDTH="100%" HEIGHT="150"><font color='003366'></IFRAME>
</td>
</tr>
<%
End IF
End If
%>
</table>

</form>
</body>
</html>

'*************************** Form in Iframe ******************************

<!-- #include file="../functions.asp" -->      
<%

If (Session("StaffID") < 1) Then
'Response.Redirect("../Login.asp")
End If

Department_On = True 'Switch for Department_On
Category_On = False 'Switch for Category_On

sPage = "techCalendar_inc"
Session("AdminLevel") = "full"
iStaffID = Session("StaffID")
sTdHeight = 15
Dim Repeat1__numRows, Repeat1__index, iEvent, iClick

iDept =14
'iDept = Request.Form("edit_Department_ID")
iEvent = Request.Form("edit_EventCategory_ID")

If Request("iDate") <> "" Then
iDate = DateValue(Request("iDate"))
Else
iDate = date
End if

set rsEventsDay = Server.CreateObject("ADODB.Recordset")
rsEventsDay.ActiveConnection = "DSN=" & dsn


IF (iEvent = 0) And (iDept = 0 )Then ' If no Dept or Cat is selected
rsEventsDay.Source =  "SELECT * FROM TechSchd ORDER BY TechSchdDate"

Else                      
rsEventsDay.Source =  "select * from TechSchd " + _
"where TechSchdLocID =" & iDept & " " + _
"ORDER BY TechSchdDate ASC;"                                         

End IF
rsEventsDay.CursorType = 0
rsEventsDay.CursorLocation = 2
rsEventsDay.LockType = 3
rsEventsDay.Open()


rsEventsDay_numRows = 0
Repeat1__numRows = -1
Repeat1__index = 0
rsEventsDay_numRows = rsEventsDay_numRows + Repeat1__numRows

sAction = Request("action")

IF (sAction = "Go") Then
iEvent = Request.Form("edit_EventCategory_ID")
iDept = Request.Form("edit_Department_ID")
sMonth = Request.Form("sMonth")
syear = Request.Form("sYear")
iDate =DateSerial(sYear, sMonth, 1)
End IF

IF (sAction = "Today") Then
iDate = date
End if

Sub getColor2(cEvent)

sSQL =       "SELECT * FROM EventCategoryRT WHERE EventCategoryRT_evntID =" & cEventID & " "
DBConnect sSQL
IF Not objRS.EOF Then
sEventCatID = objRS("EventCategoryRT_EventCategoryID")      
End IF
DBClose
IF (sEventCatID <> "") Then
sSQL = "SELECT EventCategory_Color FROM EventCategory WHERE EventCategory_ID =" & sEventCatID & " "
DBConnect sSQL
IF Not objRS.EOF Then
sEventCatColor = objRS("EventCategory_Color")      
End IF
DBClose
End IF
End Sub

Sub getColor(cEvent)

sSQL =       "SELECT * FROM EventCategoryRT WHERE EventCategoryRT_evntID =" & cEventID & " "
DBConnect sSQL
IF Not objRS.EOF Then
sEventCatID = objRS("EventCategoryRT_EventCategoryID")      
End IF
DBClose
IF (sEventCatID <> "") Then
sSQL = "SELECT EventCategory_Color FROM EventCategory WHERE EventCategory_ID =" & sEventCatID & " "
DBConnect sSQL
IF Not objRS.EOF Then
sEventCatColor = objRS("EventCategory_Color")      
End IF
DBClose
End IF
End Sub

Sub LoadCombo(iEvent)

sSQL = "SELECT EventCategory_ID, EventCategory_Name FROM EventCategory ORDER BY EventCategory_Name; "
DBConnect sSQL
Response.Write("<OPTION selected value='0'>Show All</OPTION>")
While Not objRS.EOF
iTemp = CInt(objRS("EventCategory_ID"))
IF (CInt(iEvent) = iTemp) Then
Response.Write("<OPTION selected value='" & iTemp & "'>" & objRS("EventCategory_Name") & "</OPTION>")
Else
Response.Write("<OPTION value='" & iTemp & "'>" & objRS("EventCategory_Name") & "</OPTION>")
End IF
objRS.MoveNext
Wend
DBClose
End Sub

Sub LoadCombo2(iDept)
sSQL = "SELECT EventDepartment_ID, EventDepartment_Name FROM EventDepartment ORDER BY EventDepartment_Name; "
DBConnect sSQL
Response.Write("<OPTION selected value='0'>Show All</OPTION>")
While Not objRS.EOF
iTemp1 = CInt(objRS("EventDepartment_ID"))
IF (CInt(iDept) = iTemp1) Then
Response.Write("<OPTION selected value='" & iTemp1 & "'>" & objRS("EventDepartment_Name") & "</OPTION>")
Else
Response.Write("<OPTION value='" & iTemp1 & "'>" & objRS("EventDepartment_Name") & "</OPTION>")
End IF
objRS.MoveNext
Wend
DBClose
End Sub

CurrentMonth = Month(iDate)
CurrentMonthName = MonthName(CurrentMonth)
CurrentYear = Year(iDate)

FirstDayDate = DateSerial(CurrentYear, CurrentMonth, 1)
FirstDay = WeekDay(FirstDayDate, 0)
CurrentDay = FirstDayDate

%>
<!-- #inzzclude file="../tabmenu.asp" -->
<script language="JavaScript">
var popupwidth = 150;
var popupheight = 100;
function showpopup(popupid,defaultpr)
{

var obj = MM_findObj(popupid);    
var helptext = 'Desc: '+defaultpr;
obj.innerText = helptext;
obj.style.left = eval(event.x + document.body.scrollLeft - popupwidth);
obj.style.top = eval(event.y + document.body.scrollTop - (popupheight/2));
if (document.all) { document.all(popupid).style.visibility = "visible" }
else { document[popupid].visibility = "show" }
}

function hidepopup(popupid)
{
if (document.all) { document.all(popupid).style.visibility = "hidden" }
else { document[popupid].visibility = "hide" }
}

function MM_findObj(n, d) { //v4.01
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
</script>

<link rel="stylesheet" href="<%=sAbsolutePath%>editmenu.css" type="text/css">
<div class = "links">
<form name="frmMainIframe" action="techCalendar_inc.asp" method="post">
<table width="600" align=center border="0" cellpadding="2" cellspacing="1" bgcolor="#cccccc">
<tr>
<td colspan=2>
Patient Name:
<!-- #include file="../patients/Pat_inc.asp" -->
</td>
</tr>
<tr>
<td>
<table width="250" align=center border="0" cellpadding="2" cellspacing="1" bgcolor="#cccccc">
<tr>
<td>
<!-- #include file="loc_inc.asp" -->
</td>
</tr>
</table>
</td>
<td>
<table width="250" align=center border="1" cellpadding="2" cellspacing="1" bgcolor="#cccccc">
<tr>
<td class="bgMonthListing" align="center" colspan="7">

<table width="100%" align=center border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="bgMonthListing">
<!-- This is the Left Arrow for Month -->
&laquo; <A Href="techCalendar_inc.asp?iDate=<%= Server.URLEncode(DateAdd("m",-1, iDate))%>&sAction=""&iEvent="edit_EventCategory_ID""><%= UCASE(Left(MonthName(Month(DateAdd("m", -1, CurrentDay))),3)) %></a>
<!-- This is the Selection for Month -->
<select class="cal5" name="sMonth" ID="Select1">
<option value="1" <%If CurrentMonth="1" Then%>selected<%End If%>>January</option>
<option value="2" <%If CurrentMonth="2" Then%>selected<%End If%>>February</option>
<option value="3" <%If CurrentMonth="3" Then%>selected<%End If%>>March</option>
<option value="4" <%If CurrentMonth="4" Then%>selected<%End If%>>April</option>
<option value="5" <%If CurrentMonth="5" Then%>selected<%End If%>>May</option>
<option value="6" <%If CurrentMonth="6" Then%>selected<%End If%>>June</option>
<option value="7" <%If CurrentMonth="7" Then%>selected<%End If%>>July</option>
<option value="8" <%If CurrentMonth="8" Then%>selected<%End If%>>August</option>
<option value="9" <%If CurrentMonth="9" Then%>selected<%End If%>>September</option>
<option value="10" <%If CurrentMonth="10" Then%>selected<%End If%>>October</option>
<option value="11" <%If CurrentMonth="11" Then%>selected<%End If%>>November</option>
<option value="12" <%If CurrentMonth="12" Then%>selected<%End If%>>December</option>

</select>
<!-- This is the Selection for Year -->
<select class="cal5" name="sYear" ID="Select2">
<option value="2004" <%If CurrentYear="2004" Then%>selected<%End If%>>2004</option>
<option value="2005" <%If CurrentYear="2005" Then%>selected<%End If%>>2005</option>
<option value="2006" <%If CurrentYear="2006" Then%>selected<%End If%>>2006</option>
<option value="2007" <%If CurrentYear="2007" Then%>selected<%End If%>>2007</option>
<option value="2008" <%If CurrentYear="2008" Then%>selected<%End If%>>2008</option>
<option value="2009" <%If CurrentYear="2009" Then%>selected<%End If%>>2009</option>
<option value="2010" <%If CurrentYear="2010" Then%>selected<%End If%>>2010</option>
<option value="2011" <%If CurrentYear="2011" Then%>selected<%End If%>>2011</option>
<option value="2012" <%If CurrentYear="2012" Then%>selected<%End If%>>2012</option>
<option value="2013" <%If CurrentYear="2013" Then%>selected<%End If%>>2013</option>
<option value="2014" <%If CurrentYear="2014" Then%>selected<%End If%>>2014</option>
</select>
<input type="submit" value="Go" name="action">
<!-- This is the Right Arrow for Month -->
<A Href="techCalendar_inc.asp?iDate=<%= Server.URLEncode(DateAdd("m",1,iDate))%>&sAction="""><%= UCASE(Left(MonthName(Month(DateAdd("m", 1, CurrentDay))),3)) %></a> &raquo;
</td>
</tr>
</table>

</td>

</tr>
<tr>
<% For DayLoop = 1 to 7 %>
<td width="100"  align="center" valign="middle" class="bgDayListing">
<%= WeekDayName(Dayloop, True, 0)%>
</td>
<% Next%>
</tr>
<tr align="center" valign="middle">
<%
If FirstDay <> 1 Then
i = FirstDay - 1
Do While i > 0
%>
<TD height="<%=sTdHeight%>" align="right" valign="top" class="bgGrey">
<%=Day(CurrentDay - i)%>
</td>
<%
i = i - 1
Loop
%>
<%
End if
DayCounter = FirstDay
CorrectMonth = True

Do While CorrectMonth = True

%>
<TD height="<%=sTdHeight%>"  align="right" valign="top" bgcolor="##F0FFFF" class="text_cal">
<%IF (iDept = 0 )Then ' If no Location is selected%>
<%'=Day(CurrentDay)%>
<%Else%>
<!--<A Href="addeditTech.asp?action=New&iLID=<%=iDept%>&iCID=<%=0%>&iDate=<%= Server.URLEncode(CurrentDay)%>"" onclick="NewWindow(this.href,'popup','350','125','no','center');return false" onfocus="this.blur()"><%=Day(CurrentDay)%></A>-->
<%End If%>

<%
rsEventsDay.Filter = "TechSchdDate = #" & CurrentDay & "#"
If not rsEventsDay.EOF Or not rsEventsDay.BOF Then  
While ((Repeat1__numRows <> 0) AND (NOT rsEventsDay.EOF))
cEventID = rsEventsDay("TechSchdID")

sSQL =       "SELECT * FROM TechSchd WHERE TechSchdID =" & cEventID & " "
DBConnect sSQL
IF Not objRS.EOF Then
sEventCatID = objRS("TechSchdTechID")
sDeptCatID = objRS("TechSchdLocID")
End IF
DBClose

IF (sEventCatID <> "") Then
sSQL = "SELECT EventCategory_Name, EventCategory_Color FROM EventCategory WHERE EventCategory_ID =" & sEventCatID & " "
DBConnect sSQL
IF Not objRS.EOF Then
sEventCatName = objRS("EventCategory_Name")
sEventCatColor = objRS("EventCategory_Color")      
End IF
DBClose
End IF

IF (sDeptCatID <> "") Then
sSQL = "SELECT EventDepartment_Name, EventDepartment_Color FROM EventDepartment WHERE EventDepartment_ID =" & sDeptCatID & " "
DBConnect sSQL
IF Not objRS.EOF Then
sEventDeptName = objRS("EventDepartment_Name")
sEventDeptColor = objRS("EventDepartment_Color")
End IF
DBClose
End IF
%>
<%'getColor%>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<TD height="<%=sTdHeight%>"  align="right" valign="top" bgcolor="<%=sEventDeptColor%>" class="text_cal">
<a style="color:<%=sEventDeptColor%>;" href="addeditNew.asp?iTID=<%=(rsEventsDay.Fields.Item("TechSchdID").Value)%>&iCID=<%= (rsEventsDay.Fields.Item("TechSchdTechID").Value)%>&iLID=<%=(rsEventsDay.Fields.Item("TechSchdLocID").Value)%>&iDate=<%= Server.URLEncode(CurrentDay)%>"><%=Day(CurrentDay)%></a>
</td>
</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsEventsDay.MoveNext()
Wend
End If
%>
</TD>
<%
DayCounter = DayCounter + 1
If DayCounter > 7 then
DayCounter = 1 %>
</TR>
<tr align="center" valign="middle">
<%
End if

CurrentDay = DateAdd("d", 1, CurrentDay)

If Month(CurrentDay) <> CurrentMonth then
CorrectMonth = False
End if
Loop

If DayCounter <> 1 Then
i = 0
Do While i < 8 - DayCounter
%>
<TD height="<%=sTdHeight%>" align="right" valign="top" class="bgGrey"><%= i + 1 %></TD>
<%
i = i + 1
Loop
End if

%>
</TR>
<tr>
<td colspan=7>

</td>
</tr>
</table>
</td>
</tr>
</table>
</form>

</div>
<div id="EventDesc" contenteditable="true" style="position:absolute;
width:<%=popupwidth%>px; height:<%=popupheight%>px; z-index:1;
visibility: hidden; background-color: #ffff99; border-width: 1;
border-style : solid ; border-color : #b4ceec" ></div>            
[+][-]02/16/07 02:13 AM, ID: 18547205

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Tags: iframe, information, passing
Sign Up Now!
Solution Provided By: AndyBridges
Participating Experts: 1
Solution Grade: A
 
 
[+][-]02/16/07 02:14 AM, ID: 18547215

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91