<?php

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

class Web_package_model extends CI_Model{

    function insert_web_package($data){

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

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

    }


    function show_business_package(){

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

    }

    function show_ecommerce_package(){

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

    }

    function show_web_package(){
        $query = $this->db->get('webpackages');
		$res = $query->result_array();
	 	return $res;
    }

    function single_web_package($data){

        $query = $this->db->get_where('webpackages', array('webpackageid' => $data['webpackageid']));
        $res = $query->result_array();
        return $res;
        
    }

    function update_web_package($data){
        $array = array(
            'title' => $data['title'],
            'price' => $data['price'],
            'type' => $data['type'],
            'description' => $data['description']
        );
        $this->db->where('webpackageid', $data['webpackageid']);
        $query = $this->db->update('webpackages', $array);
        if($query){
            return TRUE;
        }
        else{
            return FALSE;
        }
    }

    function delete_web_package($data){
        $query = $this->db->delete('webpackages', array('webpackageid' => $data['webpackageid']));

        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;
    //     }
    // }

}

?>