Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function __construct()
- {
- parent::__construct();
- $this->load->model("Car_model");
- $this->load->library('form_validation');
- }
- public function delete($id=null)
- {
- if (!isset($id)) show_404();
- if ($this->Car_model->delete($id)) {
- $this->session->set_flashdata('success', 'Berhasil disimpan');
- redirect(site_url('admin/car'));
- }
- }
- //model
- <?php defined('BASEPATH') OR exit('No direct script access allowed');
- class Car_model extends CI_Model
- {
- private $_table = "car";
- blic function delete($id)
- {
- return $this->db->delete($this->_table, array("id_car" => $id));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement