douying8666 2014-06-09 23:04
浏览 59

电子邮件编辑的Oracle SQL查询的HTML输出

Thank you for anyone who can help me with this!
What i have is an oracle database and i display all open work tickets using while and oci_fetch_row (page pickupready.php).
Each row is displayed in the table and has a checkbox to click on. User clicks multiple checkboxes selecting the rows (work tickets) they need and click Submit button.
New page (sendpickup.php) opens only showing table with rows that were selected by user. Then user has an ability to type quantity for each of the rows and then they click Send Pickup button which should email this output with their entered quantities and pickup times.
My question is how to grab everything that was output on that page + user edited information and email it using php mail() function?
This is my sendpickup.php page:

echo "<form action='' method='post'>";
echo "<table class = 'pickup'>
";
echo "<tr style='background-color: orange'>
";
echo "<th>CXL Date</th><th>Customer</th>";
echo "<th>WO #</th><th>Lot #</th><th>Style</th><th>Color</th><th>Original Qty</th>";
echo "<th>Cut Qty</th><th>Cut Date</th><th>Pickup Qty</th><th>Pickup Time</th>";
echo "</tr>";
echo "<tr style='background-color: #FFFFFF'>
";
echo "<td>".($row[1] !== null ? htmlentities($row[1], ENT_QUOTES) : "&nbsp;")."</td>
";
echo "<td>".($row[2] !== null ? htmlentities($row[2], ENT_QUOTES) : "&nbsp;")."</td>
";
echo "<td>".($row[3] !== null ? htmlentities($row[3], ENT_QUOTES) : "&nbsp;")."</td>
";
echo "<td>".($row[4] !== null ? htmlentities($row[4], ENT_QUOTES) : "&nbsp;")."</td>
";
echo "<td>".($row[5] !== null ? htmlentities($row[5], ENT_QUOTES) : "&nbsp;")."</td>
";
echo "<td>".($row[6] !== null ? htmlentities($row[6], ENT_QUOTES) : "&nbsp;")."</td>
";
echo "<td>".($row[7] !== null ? htmlentities($row[7], ENT_QUOTES) : "&nbsp;")."</td>
";
echo "<td>".($row[8] !== null ? htmlentities($row[8], ENT_QUOTES) : "&nbsp;")."</td>
";
echo "<td>".($row[9] !== null ? htmlentities($row[9], ENT_QUOTES) : "&nbsp;")."</td>
";
echo "<td><input size= '5' style = 'color: red; font-weight: bold' value = $row[8]></td>";
echo "<td><input size= '5' style = 'color: red; font-weight: bold' value = '9 AM'></td>";
echo "</tr>
";
echo "</table>";
echo "<input type='submit' name = 'sendpickup' value='Send Pickup'>";
echo "</form>";

Then i use following to send an email:

if (isset($_POST['sendpickup'])) 
{
$to  = 'wip@abc.com';
$subject = 'READY FOR PICKUP';
$headers  = 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
$headers .= 'To: WIP <wip@abc.com>' . "
";
$headers .= 'From: ABC User<wip@abc.com>' . "
";
mail($to, $subject, $message, $headers);
header( 'Location: pickupready.php');
}

Basically my page sendpickup.php works correctly, mail() function works too and my only problem is how to grab data for my $message variable.

i can use grab everything from sql output and assign to this variable but i cannot figure out how to send user information filled out in these 2 input boxes:

echo "<td><input size= '5' style = 'color: red; font-weight: bold' value = $row[8]></td>";
echo "<td><input size= '5' style = 'color: red; font-weight: bold' value = '9 AM'></td>";

so as of right now i do something very basic. I select my output table by dragging mouse over it, then use a copy paste into email and email it manually. It works for time being but i really want to automate this and yet can't figure out how. I apologize if this was asked before - i tried to search but couldn't find any information and i cannot figure it out myself.
thank you again!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥20 用雷电模拟器安装百达屋apk一直闪退