[ Mini Kiebo ]
Server: Windows NT AKFAR_SERVER 10.0 build 26200 (Windows 10) AMD64
Path:
D:
/
xampp
/
htdocs
/
simaku
/
application-old
/
models
/
[
Home
]
File: Mpass.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); //Model Pengaturan Password Unit class Mpass extends CI_Model { function __construct() { parent::__construct(); } //DELETE username dan password sesuai id_unit// ??? cek lagi function delete_userpass($id_unit) { $this->db->where('id_unit', $id_unit); $this->db->delete('ueu_tbl_user'); } //panggil record pada tabel ueu_tbl_user dengan id_unit tertentu function cek_idlog($id_unit) { return $this->db->get_where('ueu_tbl_user', array('id_unit' => $id_unit))->result(); } public function kewenangan($id_unit) { $this->db->select('wewenang'); $this->db->where('id_unit', $id_unit); $q = $this->db->get('ueu_tbl_user'); $a = array(); if ($q->num_rows() > 0) { foreach ($q->result() as $key) { $a[] = $key->wewenang; } } return $a; } function cek_idlog_by_otorisator1($id_unit) { return $this->db->get_where('ueu_tbl_user', array('id_unit' => $id_unit, 'wewenang' => 'otorisator1')); } //INSERT record pada tabel ueu_tbl_user function add_pass($pass) { $this->db->insert('ueu_tbl_user', $pass); } function get_id($username, $password) { return $this->db->get_where('ueu_tbl_user', array('username' => $username, 'password' => $password)); } function get_id_opr($username) { return $this->db->get_where('ueu_tbl_user', array('username' => $username, 'password' => 'operator', 'wewenang' => 'operator')); } function cari_id_otorisator1() { return $this->db->get_where('ueu_tbl_user', array('wewenang' => 'otorisator1')); } function cari_id_otorisator2() { return $this->db->get_where('ueu_tbl_user', array('wewenang' => 'otorisator2')); } function change_super($a) { $this->db->where('idlog', 1); $this->db->update('ueu_tbl_user', $a); } function change_userpass($idlog, $a) { $this->db->where('idlog', $idlog); $this->db->update('ueu_tbl_user', $a); } function view_super() { return $this->db->get_where('ueu_tbl_user', array('idlog' => 1)); } }