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

class Nationmodel extends CI_Model {



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

      }


   else

   {

     return false;

   }


}











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

      }


   else

   {

     return false;

   }


}
 function populatenation()
 

{


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

   {
  return $query1->result();

   }

   else

   {

     return false;

   }

}

 function populatereligion()
 

{


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

   {
  return $query1->result();

   }

   else

   {

     return false;

   }

}

function getreligionbyid($id){


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

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

   return $bioquery->result();
   


}else{

  return false;
}




}









function getcountrybyid($id){


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

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

   return $bioquery->result();
   


}else{

  return false;
}




}

function getspecificcountrybyid($id){


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

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

   return $bioquery->result_array();
   


}else{

  return false;
}




}









            
}

