Jump to content

Wondering if this is possible


steviemac

Recommended Posts

I have an on line registration for a trade school.  Eventually the classes become full and the students go to a  waiting list.  Here is my question.  If someone cancels a class, can I (with the help of code) take them from a waiting list table and and put them in the active table and then generate a email to let them know they are no longer on the waiting list and can attend the course? Even using one table with a form field that is "waiting" with a response in it.  Now if someone cancels their seat the first waiting person gets a auto email saying they are accepted to the course and the "waiting" field has a different response.  Something to either effect.

 

Thank you in advance for any input

Link to comment
Share on other sites

I dont know what your table structure looks like so its hard to answer. Basically what you need to do is when someone cancels, you take the 1st one in the waiting list and put him instead of him, and email him.

I know this sounds stupid and you probably thought about it yourself, but thats all I can do- you haven't supplied any code (show us the script that runs when someone cancels) or any other technical info like your table structure...

 

Orio.

Link to comment
Share on other sites

This is the script.  All it does is tell them they canceled and sends a email to the office manager.  The office manager then sends an email to the next on the waiting list.  I just wanted to ease the process and try toautomate it

 

<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
ini_set('track_errors', true);
//Connect to DB
$db = mysql_connect("localhost", "xxxxx", "xxxx");
mysql_select_db("xxxx");
if($_POST['submit']) {


     $result = mysql_query("DELETE FROM ".USERS_TABLE." WHERE id = '".$_POST['id']."'") or die(mysql_error()); 

    echo "Your course seat has been canceled";
} else {
    echo 'You didnt enter any data';
}
?>

 

email code here

Link to comment
Share on other sites

Again, I cant really help you since I dont know your table structure- Where are the names of the waiting and how are they stored, as well as what columns you got there? Same goes for USERS_TABLE- Whats in it and what columns you have there?

 

Orio.

Link to comment
Share on other sites

Since we do it manually everyone goes in the same table. The main reason is the courses repeat through out the year.  If they are on the waiting list in April they are given a seat at the next course, so we keep the info in the table of the course.  Hope it helps

This is the columns

mysql_query("CREATE TABLE $nametable(
id INT NOT NULL AUTO_INCREMENT, 
PRIMARY KEY(id),
registration VARCHAR(30),
Course VARCHAR(255),
Seats INT,
Student_1_Name VARCHAR(255),
Status_Student_1 VARCHAR(255),
doe_1 VARCHAR(255),///date of employment
Student_2_Name VARCHAR(255),
Status_Student_2 VARCHAR(255),
doe_2 VARCHAR(255),
Student_3_Name VARCHAR(255),
Status_Student_3 VARCHAR(255),
doe_3 VARCHAR(255),
Agency VARCHAR(255),
Contact_Person VARCHAR(255),
Agency_Phone VARCHAR(255),
fax VARCHAR(255),
email_address VARCHAR(255),
date  TIMESTAMP NOT NULL)")
or die(mysql_error());  

echo "Table Created!";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.