first commit
This commit is contained in:
54
webservice/farmasi/app/Mail/DrugRestriction.php
Normal file
54
webservice/farmasi/app/Mail/DrugRestriction.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Barang;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class DrugRestriction extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
protected $barang;
|
||||
protected $request;
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Barang $barang,Request $request)
|
||||
{
|
||||
$this->barang = $barang;
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
$config = config('beautymail.view');
|
||||
if(array_key_exists('logo',$config)){
|
||||
$config['logo']['path'] = preg_replace("/\%PUBLIC\%/",env('APP_URL'),$config['logo']['path']);
|
||||
}
|
||||
// dd($this->barang);
|
||||
return $this->view('emails.drugnotif')
|
||||
->with(array_merge($config,[
|
||||
'namapasien' => $this->request->input('nama_pasien'),
|
||||
'usia' => $this->request->input('usia'),
|
||||
'diagnosa' => $this->request->input('diagnosa'),
|
||||
'namaObat' => $this->barang->Nama,
|
||||
'signa' => $this->request->input('signa'),
|
||||
'jumlah_obat' => $this->request->input('jumlah_obat'),
|
||||
'kode_kirim' => $this->request->input('kode'),
|
||||
'senderName' => env('MAIL_FROM_NAME','SIMRS')
|
||||
]))
|
||||
->subject('Ijin Penggunaan Obat '.$this->barang->Nama.' '.$this->request->input('nomr'));
|
||||
}
|
||||
}
|
||||
52
webservice/farmasi/app/Mail/Otorisasi.php
Normal file
52
webservice/farmasi/app/Mail/Otorisasi.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class Otorisasi extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
protected $request;
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Request $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
$config = config('beautymail.view');
|
||||
if(array_key_exists('logo',$config)){
|
||||
$config['logo']['path'] = preg_replace("/\%PUBLIC\%/",env('APP_URL'),$config['logo']['path']);
|
||||
}
|
||||
|
||||
$no_telepon = sprintf("%s%s%s",
|
||||
substr($this->request->input('no_telepon'), 0, 4),
|
||||
str_repeat('*',4),
|
||||
substr($this->request->input('no_telepon'), (strlen($this->request->input('no_telepon'))-4) ) );
|
||||
|
||||
return $this->view('emails.otorisasi')
|
||||
->with(array_merge($config,[
|
||||
'nama' => $this->request->input('nama'),
|
||||
'no_telepon' => $no_telepon,
|
||||
'pin_author' => $this->request->input('pin'),
|
||||
'senderName' => env('MAIL_FROM_NAME','SIMRS')
|
||||
]))
|
||||
->subject('Kode Pin Otorisasi SIMRS');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user