Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class User_m extends CI_Model {
- public function login($post)
- {
- $this->db->select('*');
- $this->db->from('multiuser');
- $this->db->where('username', $post['username']);
- $this->db->where('password', sha1($post['password']));
- $query = $this->db->get();
- return $query;
- }
- public function get($id = null)
- {
- $this->db->from('multiuser');
- if ($id !=null){
- $this->db->where('id_user',$id);
- }
- $query = $this->db->get();
- return $query;
- }
- public function add($post)
- {
- $params['nama_user'] = $post['nama'];
- $params['nomor_telepon'] = $post['nomor'];
- $params['status'] = $post['status'];
- $params['username'] = $post['username'];
- $params['password'] = sha1($post['password']);
- $params['akses'] = $post['akses'];
- $this->db->insert('multiuser',$params);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement