<?php

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

class Sms_marketing_model extends CI_Model{

    function insert_sms_package($data){

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

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

    }


    function show_non_masking_package(){

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

    }

    function show_masking_package(){

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

    }

    function show_sms_package(){

		$query = $this->db->get('smspackages');
		$res = $query->result_array();
	 	return $res;

    }

    function single_sms_package($data){

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

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

    function delete_sms_package($data){
        
        $query = $this->db->delete('smspackages', array('smspackageid' => $data['smspackageid']));

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

}

?>