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 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作