Hallo! Selamat Datang di Marketplace produk digital, Freelancer terbaik di indonesia (68497 Members, 790 Products, 5357 Topic, 13048 Comments)

Bagaimana Cara Merubah atau menambah modul pada kontributor di admin

Dibuat
Login Terakhir 2 Tahun lalu,
Telah Dilihat 941 Kali
Dedi Apriadi Mengatakan : Sultan Account
  1. Assalamualaikum Warahmatullahi Wabarakatuh...mas mau tanya bagaimanacara merubah atau menambah modul kontributor di admin pada baris 74 id_modul di kontibutor.php
  2.  
  3. function pendaftaran(){
  4. if (isset($_POST['submit'])){
  5. $cek = $this->model_app->view_where('users',array('username'=>cetak($this->input->post('a'))));
  6. if ($cek->num_rows()>0){
  7. echo $this->session->set_flashdata('message', '<div class="alert alert-danger">Maaf, Username '.cetak($this->input->post('a')).' tidak tersedia.</div>');
  8. redirect('kontributor');
  9. }else{
  10. $config['upload_path'] = 'asset/foto_user/';
  11. $config['allowed_types'] = 'gif|jpg|png|JPG|JPEG';
  12. $config['max_size'] = '1000'; // kb
  13. $this->load->library('upload', $config);
  14. $this->upload->do_upload('f');
  15. $hasil=$this->upload->data();
  16. if ($this->input->post() && (strtolower($this->input->post('secutity_code')) == strtolower($this->session->userdata('mycaptcha')))) {
  17. if ($hasil['file_name']==''){
  18. $data = array('username'=>cetak($this->input->post('a',TRUE)),
  19. 'password'=>hash("sha512", md5(cetak($this->input->post('b',TRUE)))),
  20. 'nama_lengkap'=>cetak($this->input->post('c',TRUE)),
  21. 'email'=>cetak($this->input->post('d',TRUE)),
  22. 'no_telp'=>cetak($this->input->post('e',TRUE)),
  23. 'level'=>'kontributor',
  24. 'blokir'=>'N',
  25. 'id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis'));
  26. }else{
  27. $data = array('username'=>cetak($this->input->post('a',TRUE)),
  28. 'password'=>hash("sha512", md5(cetak($this->input->post('b',TRUE)))),
  29. 'nama_lengkap'=>cetak($this->input->post('c',TRUE)),
  30. 'email'=>cetak($this->input->post('d',TRUE)),
  31. 'no_telp'=>cetak($this->input->post('e',TRUE)),
  32. 'foto'=>$hasil['file_name'],
  33. 'level'=>'kontributor',
  34. 'blokir'=>'N',
  35. 'id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis'));
  36. }
  37.  
  38. $this->model_app->insert('users',$data);
  39. $datam = array('id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis'),
  40. 'id_modul'=>18);
  41. $this->model_app->insert('users_modul',$datam);
  42. $this->session->set_userdata('upload_image_file_manager',true);
  43. $this->session->set_userdata(array('username'=>cetak($this->input->post('a')),
  44. 'level'=>'kontributor',
  45. 'id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis')));
  46. }
  47. redirect('administrator/home');
  48. }
  49.  

Ada 1 Jawaban

PHPMU.COM Support
commented on 27 Jul 2022 10:54:36
  1. Assalamualaikum,.. bisa dengan mengubah baris berikut ini :
  2. $datam = array('id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis'),
  3. 'id_modul'=>18);
  4. $this->model_app->insert('users_modul',$datam);
  5.  
  6. Menjadi :
  7. $modul = array('18','23','35'); // isikan id modul yang diberikan akses ke kontributor
  8. for ($i=0; $i <count($modul) ; $i++) {
  9. $datam = array('id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis'),
  10. 'id_modul'=>$modul[$i]);
  11. $this->model_app->insert('users_modul',$datam);
  12. }
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!

Online