I am using a simple php/html form to accept vacation change requests from my co-workers. This has proven to be very reliable and popular. Recently other shifts asked if they too can use this form. I added in a variable field for the 3 shifts. Currently all requests go to all 3 shift stewards. Can something be setup so that each shift field selection will be sent to a differant steward?
I am also having an issue with the timestamp, since my host upgraded to the newer php my timestamp is off by an hour for half the year. I'm thinking it has something to do with daylight saving time but we do not use DST, our clocks never have to be adjusted. Any ideas?
<?php
$date = date("y/m/d HⓂs ");
if(isset($Submit))
{
if($name != "" && $email != "" && $shift != "")
{
$message = "AV Change Request<br><br>
Name: $name<br>
Email: $email<br>
Shift: $shift<br>
Sent: $date<br><br>
Requested Week 1: $rqone<br>
Requested Week 2: $rqtwo<br> <br>
Relinquished Week 1: $rlone<br>
Relinquished Week 2: $rltwo<br><br>
Comments: $comments";
$headers = "Content-Type: text/html\n";
$headers .= "From: $email\n";
mail("example1@example.com,example2@example.com,$email","AV Change Request",$message,$headers);
header("Location: avresp.htm");
}
else
{
$error = "y";
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>AV Change Request</title>
<link rel="stylesheet" type="text/css" href="/BLE_510.css">
<meta name="Description" content="AV Change Request">
<meta name="Author" content="Attila">
</head>
<body>
<h2> AV Change Request</h2>
<p> Use this form to submit an AV change request.<br>
Fields marked with an asterisk () must be filled in.</p>
<?php
if($error == "y")
{
echo "<h2>You must fill in your Name, Email, and Shift.</h2>";exit;
}
?>
<form name="avch.php" action="avch.php" method="post">
<table width="460" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="120"> Name</td>
<td width="50"> </td>
<td width="120">E-mail</td>
<td width="50"> </td>
<td width="120">Shift</td>
</tr>
<tr>
<td> <input type="text" name="name" size="20"></td>
<td> </td>
<td><input type="text" name="email" size="20"></td>
<td> </td>
<td><select name="shift">
<option value=""></option>
<option value="Days">Days</option>
<option value="Evenings">Evenings</option>
<option value="Nights">Nights</option></select></td>
</tr>
</table><br>
<table width="500" border="0" cellpadding="0" cellspacing="5">
<tr>
<td width="300"> Week(s) Requested</td>
<td width="16"><input type="text" name="rqone" size="1"></td>
<td width="16"><input type="text" name="rqtwo" size="1"></td>
</tr>
<tr>
<td colspan="7"> </td>
</tr>
<tr>
<td> Week(s) Renounced</td>
<td><input type="text" name="rlone" size="1"></td>
<td><input type="text" name="rltwo" size="1"></td>
</tr>
</table><br>
<table width="440" border="0" cellpadding="0" cellspacing="0">
<tr>
<td> Comments</td>
</tr>
<tr>
<td> <textarea rows="5" name="comments" cols="50"></textarea></td>
</tr>
</table>
<table width="440" border="0" cellpadding="30" cellspacing="0">
<tr>
<td><div align="left"><input type="submit" value="Submit" name="Submit" class="button"></div></td>
<td><div align="left"><input type="reset" name="Reset" value="Reset" class="button"></div></td>
<td><input type="button" value="Week #'s" class="button" onClick="window.open('/bids/avwn.htm','','scrollbars=yes,resizable=yes,width=500,height=500')"></td>
</tr>
</table>
<p class="SmallText"> copyright © 2005</p>
</form>
</body>
</html>