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

class Districtmodel extends CI_Model {




function addnewdistrict($data)
{
// Query to insert data in database
  //$regnumber = $data['regnumber'];
  
    $this->db->insert('district', $data);
  if ($this->db->affected_rows() > 0) 
      {
  return true;

      }


   else

   {

     return false;

   }


}
function getdistrictbyitsid($id){


$this->db->select(" * from  district where id= '$id'");

 $this->db->order_by('id');
$bioquery = $this -> db -> get();
if($bioquery->num_rows()>0){

   return $bioquery->result();
   


}else{

  return false;
}




}
    
   public function getdistrictbyid($countyid)
    {
            $this->db->select('*');
        $this->db->from('district');
        $this->db->where('countyid',$countyid); 
        
        $query = $this->db->get();
    return $query->result();
    }  
            
 function populatedistrict()
 

{


   $query1 = $this->db->get('district');
       
 if($query1 -> num_rows() >0)

   {
  return $query1->result();

   }

   else

   {

     return false;

   }

}








}
 ?>