model boost.php

<?php

class Boost extends CI_Model{



public function __construct()
{
parent::__construct();
}

public function update($table, $field, $kondisi){

$q = "UPDATE $table SET $field $kondisi";
$this->db->query($q);



}


public function edit($id)
{
$q = "SELECT * FROM tb_karyawan WHERE kary_id = $id";
$result = $this->db->query($q)->result_array();
//$result = $this->db->query($q)->result();

return $result;
}


public function transfer_detail($id)
{
$q = "SELECT * FROM tb_gaji a, tb_karyawan b WHERE a.kary_id = b.kary_id AND a.kary_id = $id";
$result = $this->db->query($q)->result_array();
//$result = $this->db->query($q)->result();

return $result;
}

public function all_transfer_detail()
{
$q = "SELECT * FROM tb_gaji a, tb_karyawan b WHERE a.kary_id = b.kary_id ";
$result = $this->db->query($q)->result_array();
//$result = $this->db->query($q)->result();

return $result;
}


public function ambil($table)
{
$q = "SELECT * FROM $table";
$result = $this->db->query($q)->result_array();
//$result = $this->db->query($q)->result();

return $result;
}


public function delete($id){

$q = "DELETE FROM tb_karyawan WHERE kary_id = $id";
$result = $this->db->query($q);
return $result;

}


}

0 Response to "model boost.php"

Posting Komentar