当前位置: 首页>>代码示例>>PHP>>正文


PHP utility::email_data方法代码示例

本文整理汇总了PHP中utility::email_data方法的典型用法代码示例。如果您正苦于以下问题:PHP utility::email_data方法的具体用法?PHP utility::email_data怎么用?PHP utility::email_data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在utility的用法示例。


在下文中一共展示了utility::email_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: send_email

 /**
  * Arrange html message then call utility email
  * 
  * @param none
  * @return mixed | customer data table
  */
 protected static function send_email()
 {
     $j = json_decode($_POST["args"]);
     $id = $j->id;
     $name = $j->name;
     $email = $j->email;
     $country = $j->country;
     //basic information
     $html = "<p>\n                   Hello {$name}, <br><br>\n                   We are pleased to inform you about your latest information on testapp below:    \n                   <br><br>    \n                </p>\n                <h1>Your Current Information at TESTAPP</h1>\n                  <table>\n                    <tr>\n                        <td>ID</td>\n                        <td>Name</td>\n                        <td>Email</td>\n                        <td>Country</td>\n                    </tr>\n                    <tr>\n                        <td>{$id}</td>\n                        <td>{$name}</td>\n                        <td>{$email}</td>\n                        <td>{$country}</td>\n                    </tr>\n                  </table>";
     //transactions
     $query = array('stmt' => "SELECT * FROM transactions\n                                  WHERE transactions_customer_id = ?", 'bind' => 'i', 'fields' => $id);
     $transactions = db::execute_query($query, true);
     $html .= "<h1>List of all your transactions</h1>\n                  <table>\n                    <tr>\n                        <td>ID</td>\n                        <td>Item</td>\n                        <td>Price</td>\n                        <td>Date</td>\n                    </tr>";
     $total = 0;
     foreach ($transactions as $t) {
         $total += $t['transactions_amount'];
         $html .= "<tr>\n                        <td>" . $t['transactions_id'] . "</td>\n                        <td>" . $t['transactions_item'] . "</td>\n                        <td>" . $t['transactions_amount'] . "</td>\n                        <td>" . date("M jS\\, Y", strtotime($t["transactions_date"])) . "</td>\n                     </tr>";
     }
     $html .= "<tr>\n                    <td></td>\n                    <td></td>\n                    <td></td>\n                    <td style='color:green; font-size:18px; margin:12px 0px; padding-top:5px; border-top:1px dashed #333'>Total: " . number_format($total, 2, '.', ',') . "</td>\n                </tr>\n             </table>\n             <p><br><br>\n                   Best Regards, <br>\n                   TestApp Team    \n                   <br><br>    \n             </p>";
     utility::email_data($html, $email);
     exit;
 }
开发者ID:apswebdev,项目名称:testapp,代码行数:28,代码来源:control_viewer.php


注:本文中的utility::email_data方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。