logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > ASP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 04-07-2010, 08:19 PM   #1
MKelly
 
Join Date: Apr 2010
Posts: 5
Default Set Appointments

I am wondering if there is a way to create a form with a select list of dates/times for appointments with a database connected (this is already done) and once published on web when someone choses a date/time, that date/time will no longer be available to the next person that goes on the website.

Thanks for any help.

Michelle
MKelly is offline   Reply With Quote
Old 04-07-2010, 11:48 PM   #2
mangofreak
mangofreak's Avatar
 
Join Date: Jan 2006
Location: Toronto-Canada
Posts: 444
Default

Well, that's doable. However, we need to know what platform are you working on PHP/MySQL ASP/Access ASP/MSSQL

A quick way to do it would be to using conditional statements like:

if time X = 1 then display read only or not display. Plus you could affect it with CSS and change color.

More info would help.
__________________
J.
DW | FW | HTML | CSS | ASP | some PHP | Windows | Ubuntu
mangofreak is offline   Reply With Quote
Old 04-08-2010, 05:23 AM   #3
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,174
Default

might pay to look for an event calendar there may , though may be a long shot , something that would suit your purpose.
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is online now   Reply With Quote
Old 04-09-2010, 02:01 PM   #4
MKelly
 
Join Date: Apr 2010
Posts: 5
Default ASP/access

I am using Asp(Dreamweaver)/Access. I think an event calendar is more than what I need. I am very new to ASP/Access and have muttled my way through quite nicely. Every once in a while I get in over my head, that is where I am right now. Thanks for any help you can give. Let me know if you need any other information.

Michelle
MKelly is offline   Reply With Quote
Old 04-09-2010, 05:36 PM   #5
mangofreak
mangofreak's Avatar
 
Join Date: Jan 2006
Location: Toronto-Canada
Posts: 444
Default

ok. you could use a conditional statement that checks if the time slot is already booked.

I don't know the details of your db so it is hard to give you a clearer idea.

Can you elaborate more, what do you have so far? any code? How is the time divided, by the hour?
__________________
J.
DW | FW | HTML | CSS | ASP | some PHP | Windows | Ubuntu
mangofreak is offline   Reply With Quote
Old 04-09-2010, 06:00 PM   #6
MKelly
 
Join Date: Apr 2010
Posts: 5
Default

Here is my coding for Dw

<form name="SAsessions" method="post" action="Appointments.asp">
<fieldset>
<legend>International Services Appointment</legend>

<label for="UIN" class="required">UIN: <em>*</em></label>

<span id="sprytextfield1">
<input type="text" name="UIN" id="UIN" />
<span class="textfieldRequiredMsg">UIN is required.</span><span class="textfieldInvalidFormatMsg">UIN is 9 numbers begining with 814</span></span><br />
<label for="FirstName" class="required">First Name: <em>*</em></label>
<span id="sprytextfield2">
<input type="text" name="FirstName" id="FirstName" />
<span class="textfieldRequiredMsg">First Name is required.</span></span><br />
<label for="LastName" class="required">Last Name: <em>*</em></label>
<span id="sprytextfield3">
<input type="text" name="LastName" id="LastName" />
<span class="textfieldRequiredMsg">Last Name is required.</span></span><br />

<label for="Appointment" class="required">Appointment Time: <em>*</em></label>
<span id="spryselect1">
<select name="Appointment" id="Appointment">
<option value="">Select an Appointment Time</option>
<option value="Tuesday February 16th, 2:00-3:00 PM">Tuesday February 16th, 2:00-3:00 PM</option>
<option value="Tuesday March 16th, 1:00-2:00 PM">Tuesday March 16th, 1:00-2:00 PM</option>
<option value="Thursday April 1st, 4:00-5:00 PM">Thursday April 1st, 4:00-5:00 PM</option>
</select>
<span class="selectRequiredMsg">Please select an appointment time.</span></span><br />

</fieldset>
<div align="center"><input name="Submit" type="submit" value="Submit Registration" /></div>
</fieldset>
</form>
</div>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "custom", {pattern:"814000000", hint:"814######", useCharacterMasking:true, validateOn:["blur"]});
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {validateOn:["blur"]});
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "none", {validateOn:["blur"]});
var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {validateOn:["blur"]});
//-->
</script>
<% else %>
<h3 align="center">Thank you setting an appointment with International Services. We look forward to meeting with you.</h3>
<% end if %>
</body>
</html>

My database is simple. 4 fields: UIN, FirstName, LastName, Appointment. I have nothing else in the database. Does the coding take place in dreamweaver of in Access?
MKelly is offline   Reply With Quote
Old 04-09-2010, 07:15 PM   #7
mangofreak
mangofreak's Avatar
 
Join Date: Jan 2006
Location: Toronto-Canada
Posts: 444
Default

You could compare if the appointment date you are inputing is already in use:

Code:
<%Dim newDate

newDate = Request.Querystring("Appointment")

if newDate = (rsCategories.Fields.Item("Apointment")) then

response.write "this date is not available" 
else
end if

%>
However, more detail is required. Can you post some of your recordset code. Or your a link to see what you have.
__________________
J.
DW | FW | HTML | CSS | ASP | some PHP | Windows | Ubuntu
mangofreak is offline   Reply With Quote
Old 04-09-2010, 07:21 PM   #8
MKelly
 
Join Date: Apr 2010
Posts: 5
Default recordset code

I hope this what you need. Thanks for your help.


<!--#include virtual="includes/protect.asp"-->
<!--#include file="../connections/dbcon.asp"-->
<%

Submitted = False
if request.form("Submit") <> "" then
set rsRegistration = server.CreateObject("ADODB.Recordset")
rsRegistration.activeconnection = con
rsRegistration.cursorlocation = 3
rsRegistration.cursortype = 3
rsRegistration.locktype = 3
rsRegistration.source = "SELECT Top 1 * FROM Appointments"
rsRegistration.open
if rsRegistration.recordcount > 0 then
rsRegistration.addnew
for each obj in rsRegistration.fields
if obj.name <> "ID" then
rsRegistration(obj.name) = request.form(obj.name)
end if
Next
rsRegistration.update
Submitted = True
end if
rsRegistration.close
set rsRegistration = nothing
end if

Last edited by MKelly; 04-09-2010 at 07:24 PM.. Reason: didn't post correctly.
MKelly is offline   Reply With Quote
Old 04-09-2010, 07:25 PM   #9
mangofreak
mangofreak's Avatar
 
Join Date: Jan 2006
Location: Toronto-Canada
Posts: 444
Default

I hope so. As I said, It would help to know how the rest of your scheduling thing works. The code is not right, but you could test it adjusting the recordset name, the idea is there. It is not a solution though.
__________________
J.
DW | FW | HTML | CSS | ASP | some PHP | Windows | Ubuntu
mangofreak is offline   Reply With Quote
Old 04-09-2010, 08:06 PM   #10
MKelly
 
Join Date: Apr 2010
Posts: 5
Default

Basically all I want is a form where we provide days and times where students can sign up if they would like to meet with our Assistant Director. The Dw form that I have sent you works fine as far as being able to enter data on the web form and the data sending to the Access database. We need the form to be able to eliminate appointments that are already taken. I'm not sure what else to provide you to give you the information you need so that you can give me the information I need. Like I said, I am very new to all of this. I have felt very capable until today. I have only been working in Dw and asp coding for about 3 weeks and am completely self taught. I would be happy to give you what you need, I am just not sure what that is.

Thanks.
MKelly is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:56 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com