Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function userletter($order, $order_items) {
- $tx="";
- $src = (isset($_SERVER['HTTPS']) ? "https" : "http") . '://' . $_SERVER['HTTP_HOST'] .'/assets/img/logo2.png';
- $tx.='
- <div style="font-family:Arial;font-size:14px;color:#4a4437; width: 700px; margin: 0px auto;">
- <table style="border:0;border-collapse:collapse;width:100%;">
- <td style="width:50%;"> </td>
- <td>
- <div style="width:730px;font-family:Arial;font-size:14px;color:#4a4437;">
- <table style="width:100%;border:0;border-collapse:collapse;font-family:Arial;font-size:14px;color:#4a4437;">
- <tr>
- <td rowspan="2" style="width:1px;padding:0;">
- <img src="'.$src.'" style="width: 120px;">
- </td>
- <td style="border-bottom:1px solid #000;padding:0;text-align:right;line-height:18px;height:42px;">
- <a style="text-decoration:none;color:#f28700;" href="http://'.$_SERVER['HTTP_HOST'].'/ro/logare">Logare</a>
- |
- <a style="text-decoration:none;color:#f28700;" href="http://'.$_SERVER['HTTP_HOST'].'/">'.$_SERVER['HTTP_HOST'].'</a>
- </td>
- </tr>
- <tr>
- <td style="text-align:right;">
- <strong style="font-size:20px;">'.ORDER_EMAIL_TITLE.'</strong>
- <div style="height:10px;"></div>
- <strong style="font-size:20px;">'.ORDER_NUMBER.'</strong>: #'.$order->order_nr.'
- </td>
- </tr>
- </table>
- <span style="font-size:20px;color:#f28700;">'.EMAIL_HELLO.' '.$_SERVER['HTTP_HOST'].'</p>
- <p style="font-family: Arial;font-size: 14px;color: #4a4437;">'.EMAIL_HEADER.'</p>
- <div style="border-top:2px solid #000;background:#f8f2e8;width:100%;font-family:Arial;font-size:14px;color:#4a4437;">
- <table style="width:100%;border:0;border-collapse:collapse;font-family:Arial;font-size:14px;color:#4a4437;">
- <tr>
- <td style="width:30%;">
-
- </td>
- <td style="">
- <div style="margin:30px 20px 30px 50px;width:365px;">
- Date personale:<br />
- <div style="font-size:16px;color:#f28700;padding: 5px 0px;">' . PHONE_TITLE . ': '.$order->phone.'</div>';
- if (!empty($order->address)) {
- $tx.='<strong>'.$order->name. ' ' . $order->surname .'<br />';
- if (!empty($order->address)) $tx.= $order->address;
- if (!empty($order->house)) $tx.= ', '.$order->house;
- if (!empty($order->app)) $tx.= ', '.ACC_APPARTMENT.' '.$order->app;
- if (!empty($order->entrance)) $tx.= ', '.ACCOUNT_PORCH_NUMER.' '.$order->entrance;
- if (!empty($order->floor)) $tx.= ', '.ACCOUNT_FLOOR_NUMBER.' '.$order->floor;
- if (!empty($order->interfon)) $tx.= ', '.ACCOUNT_INTERCOM.' '.$order->interfon;
- }
- if ($order->city == 1) {
- $city = CHISINAU;
- } else {
- $city = BALTI;
- }
- $tx.='<br />'.$city.'</strong>
- </div>
- </td>
- <td style="width:70%;">
-
- </td>
- </tr>
- </table>
- </div>
- <div style="height:30px;"></div>
- <span style="font-size:20px;color:#f28700;">'.ORDERLETTER7.'</span><br />
- <div style="height:10px;"></div>
- <table style="width:100%;border:0;border-collapse:collapse;">';
- foreach($order_items as $arr2) {
- $ci =& get_instance();
- $img = $ci->db->where('food_id', $arr2->food_id)->order_by('sorder ASC, id DESC')->get('foods_foto')->result();
- $tx.='<tr>
- <td style="width:120px;padding:15px 15px;border-top:1px solid #000;border-bottom:1px solid #000;vertical-allign:middle;">';
- if (!empty($img[0]->img)) $tx.='<img src="http://'.$_SERVER['HTTP_HOST'].'/public/foods/thumbs/version_110x120x0/'.$img[0]->img.'" width="110">';
- $tx.='</td>
- <td style="border-top:1px solid #000;border-bottom:1px solid #000;font-size:12px;text-transform:uppercase;width:280px;vertical-allign:middle;">
- '.$arr2->food_title . ' ' . $arr2->food_item_title;
- $tx.='</td>
- <td style="border-top:1px solid #000;border-bottom:1px solid #000;text-align:center;white-space:nowrap;text-transform:uppercase;">
- <p style="font-size:10px;color:#8f8c86;">'.CART_PRODUCTS_TOTALS.'</p>
- <span style="font-size:19px;line-height:44px;">'.$arr2->qt.'</span>
- </td>
- <td style="border-top:1px solid #000;border-bottom:1px solid #000;text-align:center;white-space:nowrap;text-transform:uppercase;">
- <p style="font-size:10px;color:#8f8c86;">'.CART_PRODUCTS_PRICE_TITLE.'</p>
- <span style="line-height:44px;">'.number_format($arr2->price,2,'.',' ').' MDL</span>
- </td>
- <td style="border-top:1px solid #000;border-bottom:1px solid #000;text-align:center;white-space:nowrap;text-transform:uppercase;">
- <p style="font-size:10px;color:#8f8c86;">'.CART_PRODUCTS_TOTAL_TITLE.'</p>
- <span style="line-height:44px;">'.number_format(($arr2->price * $arr2->qt),2,'.',' ').' MDL</span>
- </td>
- </tr>';
- }
- $tx.='<tr>
- <td style="width:120px;padding:15px 15px;border-top:1px solid #000;border-bottom:1px solid #000;vertical-allign:middle;">
- </td>
- <td style="border-top:1px solid #000;border-bottom:1px solid #000;font-size:12px;text-transform:uppercase;width:280px;vertical-allign:middle;">
- '.PAGE_CONTACTS_DELIVERY.'
- </td>
- <td style="border-top:1px solid #000;border-bottom:1px solid #000;text-align:center;white-space:nowrap;text-transform:uppercase;"></td>
- <td style="border-top:1px solid #000;border-bottom:1px solid #000;text-align:center;white-space:nowrap;text-transform:uppercase;">
- </td>
- <td style="border-top:1px solid #000;border-bottom:1px solid #000;text-align:center;white-space:nowrap;text-transform:uppercase;">
- <span style="line-height:24px;white-space:nowrap;">'.number_format($order->delivery, 2, '.',' ').' MDL</span>
- </td>
- </tr>';
- $tx.='</table>
- <div style="height:20px;"></div>
- <table style="width:100%;border:0;border-collapse:collapse;">
- <tr>
- <td><div style="width:480px;"></td>
- <td style="text-align:left;padding:padding:10px 10px 10px 0;font-size:11px;">'.CART_SUBTOTAL.'</td>
- <td style="text-align:right;padding:10px;font-size:15px;white-space:nowrap;">'.number_format(($order->total - $order->delivery), 2,'.',' ').' MDL</td>
- </tr>
- <tr>
- <td><div style="width:480px;"></td>
- <td style="text-align:left;padding:padding:10px 10px 10px 0;font-size:11px;">'.CART_PRODUCTS_TOTAL_TITLE.'</td>
- <td style="text-align:right;padding:10px;font-size:15px;white-space:nowrap;">'.number_format($order->total, 2,'.',' ').' MDL</td>
- </tr>
- </table>
- </div>
- </td>
- </table>
- </div>';
- return $tx;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement