PDA

View Full Version : Set Appointments


MKelly
04-07-2010, 08:19 PM
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

mangofreak
04-07-2010, 11:48 PM
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.

edbr
04-08-2010, 05:23 AM
might pay to look for an event calendar there may , though may be a long shot , something that would suit your purpose.

MKelly
04-09-2010, 02:01 PM
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

mangofreak
04-09-2010, 05:36 PM
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?

MKelly
04-09-2010, 06:00 PM
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?

mangofreak
04-09-2010, 07:15 PM
You could compare if the appointment date you are inputing is already in use:

<%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.

MKelly
04-09-2010, 07:21 PM
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

mangofreak
04-09-2010, 07:25 PM
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.

MKelly
04-09-2010, 08:06 PM
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.

edbr
04-10-2010, 01:18 AM
i moved this post here as it is now clearly an asp item

mangofreak
04-12-2010, 09:25 PM
MKelly, I have been thinking about your problem and I see it this way.

You should have 2 tables: one for the users and one for the dates

the users would have an additional field, lets say datesID to stablish a relation with the dates.

The dates would also feed the list of dates.

So when the users inputs the date he wants, then you don't save the whole date but only the dateID.

What I'm trying to do is that, since the dates are been fed from the dates table, when someone books a date, that one is not listed anymore. I have not got it to work completely yet. However, I thought that perhaps you should consider the approach. Unless of course you solved the problem. In that case... cheers. :D

love123
04-24-2017, 04:36 AM
Get help from around the world.












maxbet (https://sbobetgoals.com/maxbet.html)

Bill Goldberg
04-24-2017, 08:20 AM
Thank you very much to all for sharing these information.