<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * staff Class
 *
 * @package     edusol
 * @subpackage  district
 * @author      Atif Razzaq
 * @link        http://atifrazzaq.arteck.xyz
 */

class taluka_model extends CI_Model {

    public function __construct()
    {
        parent::__construct();
        $this->load->database();
    }

	
        //saving data in sql
    public function save($data)
	{
            $fields_taluka = array(
                            'district_id' =>  $data['district'],
                            'province_id' =>  $data['province'],
                            'country_id' =>  $data['country'],
                            'name' =>  $data['taluka'],
                           
                );
              
             return $this->db->insert('taluka',$fields_taluka);
             
	}

    public function edit($id){
            $this->db->where('id',$id);
         return $this->db->get('taluka')->result();


    }
        // update the data
public function update($data)
    {
           $id=$data['id'];
 
           $fields_taluka = array(

                            'district_id' =>  $data['district'],
                            'province_id' =>  $data['province'],
                            'country_id' =>  $data['country'],
                            'name' =>  $data['taluka'],
                           
                );
               
                    $this->db->where('id',$id);
             return $this->db->update('taluka',$fields_taluka);
                 
    }

    // updating record 0 to 1
   public function delete($id){

                $fields_taluka=array('is_delete'=>'1');
                $this->db->where('id',$id);
                return $this->db->update('taluka',$fields_taluka);
   }
    

}

