<?php

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

class Portfolio_model extends CI_Model{

    function insert_portfolio($data){

        $query = $this->db->insert('logos',$data);

        if($query){
            return TRUE;
        }
        else{
            return FALSE;
        }

    }


    function show_portfolio(){

		$query = $this->db->get_where('logos', array('type' => 'portfolio'));
		$res = $query->result_array();
	 	return $res;

    }


    function delete_portfolio($data){
        unlink(FCPATH . $data['picture_path']);
        $query = $this->db->delete('logos', array('logoid' => $data['logoid']));

        if($query){
            return TRUE;
        }
        else{
            return FALSE;
        }
    }
    
    // function update_front_countdown($data){
    //     $array = array(
    //         'total_experience' => $data['total_experience'],
    //         'happy_clients' => $data['happy_clients'],
    //         'projects_done' => $data['projects_done']
    //     );
    
    //     $this->db->where('front_countdownid', $data['front_countdownid']);
    //     $query = $this->db->update('front_countdown', $array);

    //     if($query){
    //         return TRUE;
    //     }
    //     else{
    //         return FALSE;
    //     }
    // }

}

?>