data = $data; } /** * Execute the job. */ public function handle(): void { if($this->data['jenis']==="penolakan"){ $text = "BETA\n". "Penolakan Pengajuan Seminar Proposal Mahasiswa: ".$this->data['nama']."\n". "Dengan Email : ".$this->data['email']."\n\n". "Alasan : ".$this->data['alasan']; Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') ->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') ) ->get(); } elseif($this->data['jenis'] == 'dpu'){ $data = PengajuanSempro::where('pengajuan_sempros.id',$this->data['id']) ->select( 'pengajuan_sempros.caseid', 'pengajuan_sempros.nilai_plagiasi', 'mahasiswas.nama', 'mahasiswas.nim', 'mahasiswas.email', 'mahasiswas.judul_seminar_proposal', 'mahasiswas.dosen_dpu_id',) ->join('mahasiswas','mahasiswas.id','=','mahasiswas_id') ->first(); $text = "BETA - ".$data->caseid."\n". "Kirim Pengajuan A/N Mahasiswa: ".$data->nama."\n". "Kepada mahasiswa : ".$data->nama."\n\n". "Alamat Email : ".$data->email; Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') ->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') ) ->get(); } elseif($this->data['jenis'] == 'mahasiswa selesai'){ $data = PengajuanSempro::where('pengajuan_sempros.id',$this->data['id']) ->select( 'pengajuan_sempros.caseid', 'pengajuan_sempros.nilai_plagiasi', 'mahasiswas.nama', 'mahasiswas.nim', 'mahasiswas.judul_seminar_proposal', 'mahasiswas.dosen_dpu_id', 'users.nama_gelar', 'users.email') ->join('mahasiswas','mahasiswas.id','=','mahasiswas_id') ->join('users','users.id','=','dosen_dpu_id') ->first(); $text = "BETA - ".$data->caseid."\n". "Pengajuan Selesai A/N Mahasiswa: ".$data->nama."\n". "Kepada DPU : ".$data->nama_gelar."\n\n". "Alamat Email : ".$data->email; Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') ->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') ) ->get(); } elseif($this->data['jenis'] == 'mahasiswa'){ $data = PengajuanSempro::where('pengajuan_sempros.id',$this->data['id']) ->select( 'pengajuan_sempros.caseid', 'pengajuan_sempros.nilai_plagiasi', 'mahasiswas.nama', 'mahasiswas.nim', 'mahasiswas.judul_seminar_proposal', 'mahasiswas.dosen_dpu_id', 'users.nama_gelar', 'users.email') ->join('mahasiswas','mahasiswas.id','=','mahasiswas_id') ->join('users','users.id','=','dosen_dpu_id') ->first(); $text = "BETA - ".$data->caseid."\n". "Kirim Pengajuan A/N Mahasiswa: ".$data->nama."\n". "Kepada DPU : ".$data->nama_gelar."\n\n". "Alamat Email : ".$data->email; Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') ->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') ) ->get(); } } }