db->set('qty_available_fancpu', 'qty_available_fancpu + ' . (int) $av_fancpu, FALSE); $this->db->where('tipe_fancpu', $fancpu); $this->db->update('tbl_fancpu'); } ?>
_rules(); if ($this->form_validation->run() == FALSE) { $this->create(); } else { $data = array( 'av_psu' => $this->input->post('av_psu', TRUE), //untuk update ke log transaksinya 'av_fancpu' => $this->input->post('av_fancpu', TRUE), ); $fancpu = $this->input->post('merk', TRUE); //untuk nambah stok di tabel fancpu $av_fancpu = $this->input->post('av_fancpu', TRUE); $psu = $this->input->post('merk', TRUE); //untuk nambah stok di tabel psu $av_psu = $this->input->post('av_psu', TRUE); $this->M_fancpu->av_fancpu($fancpu,$av_fancpu); //model fancpu $this->M_psu->av_psu($psu,$av_psu); //model psu $this->M_trans_tmbhqty->insert($data); //model log transaksinya