<?php

class Get_Lang extends CI_Model{

  function gl($define = Null, $langId = 0) {
      
        $atranslate = $this->db->query("SELECT isAdmin, ar, en ,tr FROM atranslate WHERE define = '$define' ")->result_object();
        if($atranslate){
            if($langId == 1){
                if(isset($atranslate[0]->ar)){ return $atranslate[0]->ar ;}else{ return "" ; }
            }elseif($langId == 3){
                if(isset($atranslate[0]->tr)){ return $atranslate[0]->tr ;}else{ return "" ; }
            }elseif($langId == 2){
                if(isset($atranslate[0]->en)){ return $atranslate[0]->en ;}else{ return "" ; }
            }else{
                if(isset($atranslate[0]->en)){ return $atranslate[0]->en ;}else{ return "" ; }                
            }
        }else{
            return "";
        }
  }



}

?>
