Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3.  
  4. class User_m extends CI_Model {
  5.  
  6.  
  7. public function login($post)
  8. {
  9. $this->db->select('*');
  10. $this->db->from('multiuser');
  11. $this->db->where('username', $post['username']);
  12. $this->db->where('password', sha1($post['password']));
  13. $query = $this->db->get();
  14. return $query;
  15. }
  16.  
  17. public function get($id = null)
  18. {
  19. $this->db->from('multiuser');
  20. if ($id !=null){
  21. $this->db->where('id_user',$id);
  22. }
  23. $query = $this->db->get();
  24. return $query;
  25. }
  26.  
  27. public function add($post)
  28. {
  29. $params['nama_user'] = $post['nama'];
  30. $params['nomor_telepon'] = $post['nomor'];
  31. $params['status'] = $post['status'];
  32. $params['username'] = $post['username'];
  33. $params['password'] = sha1($post['password']);
  34. $params['akses'] = $post['akses'];
  35. $this->db->insert('multiuser',$params);
  36. }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement