<?php

class Func extends CI_Model{

  function creatMemberNumber($page = Null, $content_id = 0) {
          switch ($page) {
              case "aboutUs":
                  
                  return $content_id;
                  break;
              
              
              
          }                    
        return $memNum;
  }
  
  function getParent($caId = 0,$langId = 0,$title = " "){
        $parent = $this->db->query("SELECT caId, parentId, theTitle$langId as theTitle FROM categories WHERE caId = '$caId'")->result_object();
    if (isset($parent[0]->parentId)) { 
        if($parent[0]->parentId > 0) { 
            $links = $this->db->query("SELECT url FROM links WHERE page = 'categories' AND content_id = '$caId'")->result_object();
            if($links){$link = '/'.$links[0]->url;}else{$link = "javascript:;";}
            $title = "<li class='breadcrumb-item'><a href='".$link."'>".$parent[0]->theTitle."</a></li> ".$title;
            return $this->getParent($parent[0]->parentId, $langId, $title);
        } else {
            $title = "<li class='breadcrumb-item'><a href='javascript:;'>".$parent[0]->theTitle."</a></li> ".$title;
            return $title;
        }
    } else {
        $title = "<li class='breadcrumb-item'><a href='javascript:;'>".$parent[0]->theTitle."</a></li>";
        return $title;
    }
  }



}

?>
