Hi all,
As always thank you for all your assistance so far.
K firstly I will show my session information and my database table
{
$_SESSION['auth']="yes";
$logname=$_POST['lUsername'];
$_SESSION['logname'] = $logname;
$today = date("Y-m-d H:i:s");
header("Location: current.php");
$sql = "INSERT INTO Login (Username,LoginTime)
VALUES ('$logname','$today')";
mysql_query($sql) or die("Can't execute query");
}
K the session stores Today and Username
The table I need displaying (This is how it WILL BE created)
CREATE TABLE Available_Workload (
ID INT NOT NULL AUTO_INCREMENT,
StartDate DATE NOT NULL,
EndDate DATE NOT NULL,
Areas VARCHAR(255) NOT NULL,
Quantity INT(4) NOT NULL,
Available CHAR(3) NOT NULL DEFAULT "Yes",
PRIMARY KEY (ID) );
This will eventually store lots of info
I require a page that our distributors can view the available workload and select their own jobs. (1 row = 1 job)
So far I've been updating the page every month with table and form fields created in html.
Anyway Can The above information be pulled from the database (without ID) and displayed in a Table? The table would need to display only the available workload for Today AND the next 28 days from the stored session variable Today.
Also where the field "Available" is "Yes" I would like to have a Form field where the distributor can enter his Username. The distributor could select as many or as few as he/she decides. If the field "Available" is "No" then "No" should be displayed.
Once selected and "Submit" is pressed I need the available field to change to "No".
AND the selected fields to be emailed to our "info" address.
Finally once all that is done the distributor would be directed to success.htm
I do hope that makes sense and even more that it can be accomplished.
Additional questions. Is the above MySQL query correct? Should I use the ID field? Should I create a primary key?
Thank you all
Arnora