Postingan lainnya
Kelas Premium!
Belajar Javascript untuk website
Gunakan kupon "mulaijs" untuk diskon 75 ribu!
Notifikasi suara saat ada data baru yang masuk
Ane pengin saat user berhasil create data nanti bakalan muter audio caranya gimana ya gan..? ane pake framework codeigniter
CONTROLLER
public function postcomment()
{
$this->form_validation->set_rules('comment','Commment','required');
$this->form_validation->set_rules('subject','Subject','required');
if($this->form_validation->run() != false){
$comment = $this->input->post('comment');
$subject = $this->input->post('subject');
$data = array(
'comment' => $comment,
'subject' => $subject
);
$this->m_comment->input_data($data,'comments');
$_SESSION['pesan'] = 'Data berhasil di kirim';
redirect('home/contact');
}else{
$this->load->view('web/contact',$data);
}
}
MODEL
function update_data($where,$data,$table){
$this->db->where($where);
$this->db->update($table,$data);
}
AUDIONYA
<audio id="myAudio">
<source src="<?php echo base_url(); ?>assets/AdminLTE/sound/line_messenger.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
NOTIFIKASI NAVBAR
<a class="nav-link" id="notification-icon" data-toggle="dropdown" href="#">
<i class="far fa-comments"></i>
<span id="notif-count" class="badge badge-danger navbar-badge"><?php if($count>0) { echo $count; } ?></span>
<div id="notification-latest"></div>
</a>
0