I am trying to pass an array value into an outgoing email script to notify some one of confirmed/declined dates.
I don't have a good understanding of arrays. Any help would be greatly appreciated. I apologize in advance about the length of the posting.
I will attach the originating file but here are the "important" parts.
The table listed in this script successfully displays all of the date and time information. I can not get the vet_nogo.php3 script to recognize the array. bid_detail.php3
for($cnt = 0; $cnt < $num_bid; $cnt++) {
list($tmp_bid_login, $tmp_bid_job_id, $tmp_bid_sent, $bid[$cnt]['job_date'], $bid[$cnt]['fee_type'], $bid[$cnt]['fee'], $bid[$cnt]['memo'], $bid[$cnt]['hours'], $bid[$cnt]['prid'])= mysql_fetch_row($bid_q);
echo "
<form method=\"POST\" action=\"./\">
<input type=\"hidden\" name=\"page\" value=\"jobs\">
<input type=\"hidden\" name=\"bid_id\" value=\"$bid_id\">
<table border=1 cellpadding=3 cellspacing=0>
<tr>
<td align=\"center\"><b>Job Date</b></td>
<td align=\"center\"><b>Job Hours</b></td>
<td align=\"center\"><b>Job Fee (type)</b></td>
<td align=\"center\"><b>Memo</b></td>
<td align=\"center\"><b>Select</b></td>
</tr>";
for($cnt = 0; $cnt < $num_bid; $cnt++) {
list($tlogin, $tjob, $twhen, $jdate, $jfeet, $jfee, $jmemo, $dhosp) = mysql_fetch_row($bid_q);
echo "
<tr>
<td align=\"center\">" . $bid[$cnt]['job_date'] . "</td>
<td align=\"center\">" . $bid[$cnt]['hours'] . "</td>
<td align=\"center\">" . $bid[$cnt]['fee'] . " (" . $bid[$cnt]['fee_type'] . ")</td>
<td align=\"center\">" . $bid[$cnt]['memo'] . "</td>
<td align=\"center\"><input type=\"checkbox\" name=\"bid_date[]\" value=\"" . $bid[$cnt]['job_date'] . "\"></td>
</tr>";
}
echo "</table><select name=\"sub\">
<option value=\"bid_edit\"> Edit Bid Dates
<option value=\"detail_relief_add_bid_date\"> Add Bid Dates
<option value=\"bid_delete\"> Delete Bid Dates
<option value=\"vet_nogo\"> NOGO Selected Dates
<input type=\"hidden\" name=\"name\" value=\"$vet_last\">
<input type=\"hidden\" name=\"bid_id\" value=\"$bid_id\">
<input type=\"hidden\" name=\"email\" value=\"$email\">
<input type=\"hidden\" name=\"areacode\" value=\"$hosp_tel_area\">
</select><input type=\"submit\" value=\"Go\"></form>";
Here is the script where the posted array is supposed to end up.
vet_nogo.php3
<script language="php">
include("/usr/home/vet/web_data/libs/log.php3");
include("/usr/home/vet/web_data/libs/email/template_actions");
$vet_last = $_POST['name'];
$bid_dates[] = $_POST['bid_info'];
if(!vet_num_errors())
{
if(!template_fetch('doc_no_go', $doc_notify_subject, $doc_notify_body))
{
vet_error("Error fetching doc_no_go template.");
}
if($email == 'nogo@nogo.com') {
echo "<font size=\"5\" color=\"red\">
Your NOGO email has not been sent to the doctor. The email address is [email]nogo@nogo.com[/email]</font>";
} else {
if(strstr($email, '@'))
{
$doc_notify_subject = template_fill_vars($doc_notify_subject, array('id' => "$bid_id"));
$doc_notify_body = str_replace("\n", "\r\n", $doc_notify_body);
$doc_notify_body = template_fill_vars($doc_notify_body, array('id' => "$bid_id", 'doc_last_name' => $vet_last, 'areacode' => $areacode, 'dates' => "$bid[$cnt]['job_date']"));
$doc_sent = mail($email, $doc_notify_subject, $doc_notify_body, "Wrom: EUQZAAFXISHJEXXIMQZUIVOT
echo "<br> <font size=\"5\" color=\"#0000dd\">
Your NOGO email has been sent to the doctor.</font>";
$step_update_qtx =
"UPDATE jobs_bid
SET step='NG'
WHERE bid_id='$bid_id';";
if(!mysql_query($step_update_qtx)) {
new_error("Error saving Step: $step_update_qtx");
}
} else {
echo "<font size=\"5\" color=\"red\">
Your NOGO email has not been sent to the doctor. There is no valid email address on file.</font>";
}
}
}
</script>
<?php
echo "<a href=\"./?page=jobs&sub=bid_detail&bid_id=$bid_id\">Click to go back to detail.</a>"
?>