<?php

namespace App\Models;

use DB;
use Illuminate\Database\Eloquent\Model;

class Country extends Model
{

    /*
     * Date: 11-09-2018
     * Author: Muhammad Imran
     * Parameter: country id (optional)
     * Description:  this function will return the  country/list of countires
     */

    public static function GetCountryList($id = "",$iso="")
    {
        if ($id != "") {
            $country = DB::table('country')->where('country_id', $id)->first();
        } 
        elseif ($iso != "") {
            $country = DB::table('country')->where('iso', $iso)->orwhere('printable_name', $iso)->first();
        } 
        else {
            $country = DB::table('country')->get();
        }
        return $country;
    }
	
	public static function GetInstitueCountryList()
    {
        $countries = DB::table("tbl_institutes_countries")
                    ->select("country")
                    ->get();
        
        return $countries;
    }

}
