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

class PortfolioModel extends CI_Model{

	public function exist_image($portfolio_id) {
		$this->db->select("picture");
		$this->db->where('portfolio_id',$portfolio_id);
		$query = $this->db->get('portfolio');
		return $query->row();
	}
	public function exist_url($url, $id = null)
	{
		$this->db->where('Trim(LOWER(url))', $url);
		if ($id != null) {
			$this->db->where_not_in('portfolio_id', $id);
		}
		$query = $this->db->get('portfolio');
		$rs =  $query->num_rows();
		if ($rs > 0) {
			return false;
		} else {
			return true;
		}
	}
}
