Advertisement
Guest User

eee

a guest
Dec 11th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. public function __construct()
  2. {
  3. parent::__construct();
  4. $this->load->model("Car_model");
  5. $this->load->library('form_validation');
  6. }
  7.  
  8.  
  9. public function delete($id=null)
  10. {
  11. if (!isset($id)) show_404();
  12.  
  13. if ($this->Car_model->delete($id)) {
  14. $this->session->set_flashdata('success', 'Berhasil disimpan');
  15. redirect(site_url('admin/car'));
  16.  
  17. }
  18. }
  19.  
  20.  
  21.  
  22.  
  23. //model
  24.  
  25. <?php defined('BASEPATH') OR exit('No direct script access allowed');
  26.  
  27. class Car_model extends CI_Model
  28. {
  29. private $_table = "car";
  30.  
  31. blic function delete($id)
  32. {
  33. return $this->db->delete($this->_table, array("id_car" => $id));
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement