" title="edit" style="margin:2px;"> <i class="fa fa-edit"></i> </a> <br /> <br /> <b>Harga Jual : </b> <button class="btn bg-red btn-xs" style="font-size:11px;display:block;width:100%;"> Rp<?php echo numIndo($r['harga_jual'], 0); ?> </button> <!-- <b>Harga Beli : </b> <button class="btn bg-green btn-xs" style="font-size:11px;display:block;width:100%;"> Rp<?php echo numIndo($r['harga_beli'], 0); ?> </button> --> </td> </tr> </table> </div> </div> </div> <?php } ?> </div> </section> <div class="modal fade col-md-12" data-backdrop="static" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog">
foreach ($list as $r) { $jml = $r['harga'] * $r['qty']; $subT += $jml; echo "<tr>\n <td>{$r['barang_kode']} - {$r['barang_nama']} - Qty : {$r['qty']}</td>\n <td align='right'>" . numIndo($r['harga'], 0) . "</td>\n <td align='right'>" . numIndo($jml, 0) . "</td>\n </tr>"; } $total = $list[0]['harga_kirim'] + $subT; ?> <tr> <td colspan="2" align="right">Sub Total (Rp)</td> <td align="right"><b><?php echo numIndo($subT, 0); ?> </b></td> </tr> <tr> <td colspan="2" align="right">Delivery (Rp)</td> <td align="right"><b><?php echo numIndo($list[0]['harga_kirim'], 0); ?> </b></td> </tr> <tr> <td colspan="2" align="right">Total (Rp)</td> <td align="right"><b><?php echo numIndo($total, 0); ?> </b></td> </tr> </table> </body> </html>
?> </a></span> <img src="<?php echo base_url(FILE_BARANG . $r['foto']); ?> " height="150" onclick="detailClick('<?php echo $r['id']; ?> ')"> <div class="box-footer"> <button class="btn bg-red btn-xs" style="font-size:13px;" onclick="detailClick('<?php echo $r['id']; ?> ')"> Rp<?php echo numIndo($r['harga_jual'], 0); ?> </button> </div> </div> </div> <?php } ?> </div> </section> <div class="modal fade col-md-12" data-backdrop="static" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title" id="myModalLabel"></h4>
<table id="tb" class="table"> <thead> <tr> <th>No</th> <th>Tanggal</th> <th>No Invoice</th> <th>Total</th> <th>Penerima</th> <th>Status</th> <th>Detail</th> </tr> </thead> <tbody> <?php $n = 1; foreach ($data->result_array() as $r) { echo "<tr>\n\t\t<td>{$n}</td>\n\t\t<td>" . dateToIndo($r['tanggal']) . "</td>\n\t\t<td>{$r['no_invoice']}</td>\n\t\t<td>" . numIndo($r['total'], 0) . "</td>\n\t\t<td>{$r['nama']}</td>\n\t\t<td>" . statusOrder($r['status_order']) . "</td>\n\t\t<td><a href='" . site_url('product/invoice') . "/{$r['id']}' class='btn btn-xs btn-info'><i class='fa fa-search'></i> Detail</a></td>\n\t\t</tr>"; $n++; } ?> </tbody> </table> <script type="text/javascript"> </script>
public function kirim_invoice($shop_id) { $infoPembayaran = $this->auth->infoPembayaran(); $list = $this->invoice($shop_id); $to = $list[0]['username']; $no_invoice = $list[0]['no_invoice']; $nama = $list[0]['nama']; $alamat = $list[0]['alamat']; $kode_pos = $list[0]['kode_pos']; $provinsi = $list[0]['provinsi_nama']; $kabkota = $list[0]['kabkota_nama']; $kec = $list[0]['kecamatan_nama']; $harga_kirim = $list[0]['harga_kirim']; $message = "\n\t\t<!DOCTYPE html>\n\t\t\t<html>\n\t\t\t<head>\n\t\t\t\t<title>Invoice {$shop_id}</title>\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t<h3>Invoice</h3>\n\t\t\t\t<table width='100%' border='1' rules='all'>\n\t\t\t\t <tr>\n\t\t\t\t <th width='50%'>No Invoice #{$no_invoice}</th>\n\t\t\t\t <th>Pay to</th>\n\t\t\t\t </tr>\n\t\t\t\t <tr>\n\t\t\t\t <td valign='top'>\n\t\t\t\t {$nama}\n\t\t\t\t <br />\n\t\t\t\t {$alamat} {$kode_pos}\n\t\t\t\t <br />\n\t\t\t\t {$provinsi} - {$kabkota} - {$kec}\n\t\t\t\t </td>\n\t\t\t\t <td valign='top'>\n\t\t\t\t " . nl2br($infoPembayaran['isi']) . "\n\t\t\t\t </td>\n\t\t\t\t </tr>\n\t\t\t\t</table>\n\t\t\t\t<h3>Detail Invoice</h3>\n\t\t\t\t<table width='100%' rules='all' border='1'>\n\t\t\t\t <tr>\n\t\t\t\t <th><center>Items</center></th>\n\t\t\t\t <th width='120'><center>Harga</center></th>\n\t\t\t\t <th width='120'><center>Jumlah (Rp)</center></th>\n\t\t\t\t </tr>"; $subT = 0; foreach ($list as $r) { $jml = $r['harga'] * $r['qty']; $subT += $jml; $message .= "<tr>\n\t\t\t\t <td>{$r['barang_kode']} - {$r['barang_nama']} - Qty : {$r['qty']}</td>\n\t\t\t\t <td align='right'>" . numIndo($r['harga']) . "</td>\n\t\t\t\t <td align='right'>" . numIndo($jml, 0) . "</td>\n\t\t\t\t </tr>"; } $total = $harga_kirim + $subT; $message .= "<tr>\n\t\t\t\t <td colspan='2' align='right'>Sub Total (Rp)</td>\n\t\t\t\t <td align='right'><b><?={$subT}?></b></td>\n\t\t\t\t </tr>\n\t\t\t\t <tr>\n\t\t\t\t <td colspan='2' align='right'>Delivery (Rp)</td>\n\t\t\t\t <td align='right'><b>" . numIndo($harga_kirim, 0) . "</b></td>\n\t\t\t\t </tr>\n\t\t\t\t <tr>\n\t\t\t\t <td colspan='2' align='right'>Total (Rp)</td>\n\t\t\t\t <td align='right'><b>" . numIndo($total, 0) . "</b></td>\n\t\t\t\t </tr>\n\t\t\t\t</table>\n\t\t\t</body>\n\t\t</html>\n\t\t"; $subject = "New Order #{$no_invoice}"; $e = $this->db->get_where('email_setting', array('id' => 1))->row_array(); $config = array('protocol' => $e['protocol'], 'smtp_host' => $e['host'], 'smtp_port' => $e['port'], 'smtp_user' => $e['user'], 'smtp_pass' => $e['pass'], 'mailtype' => $e['mailtype'], 'charset' => 'utf-8', 'newline' => "\r\n", 'wordwrap' => TRUE); /*$config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.gmail.com', 'smtp_port' => 465, 'smtp_user' => '*****@*****.**', //isi dengan gmailmu! 'smtp_pass' => '010988alfhan', //isi dengan password gmailmu! 'mailtype' => 'html', 'charset' => 'utf-8', 'newline' => "\r\n", 'wordwrap' => TRUE );*/ $this->load->library('email'); $this->email->initialize($config); $this->email->from($e['mailfrom'], $e['fromnamer']); $this->email->to($to); $this->email->subject($subject); $this->email->message($message); $this->email->send(); echo $this->email->print_debugger(); }