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条回答

    报告相同问题?

    悬赏问题

    • ¥35 平滑拟合曲线该如何生成
    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集