<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
	
/**
	 * 
	 */
 
	class Add_privacy_policy_model extends CI_Model
	{
		 
		
		function __construct()
		{
			parent::__construct();
		}

	

		function db_insert()
		{

			$ds = $this->db->get('privacy_policy_method');
			if($ds->num_rows() > 0){ 
					$alt = $this->input->post('text');
					
							$data =  array(
						'text' =>$alt
					);

					
					$q = $this->db->update('privacy_policy_method', $data);
					if($q){
						return 1;
					}else{
						return 2;
					}

				
			}else{
				$alt = $this->input->post('text');
			
							$data =  array(
						'text' =>$alt
					);

					$q = $this->db->insert('privacy_policy_method', $data);
					if($q){
						return 1;
					}else{
						return 2;
					}

			}

			
						}
			
					
				
			
		



// UPDATE PRODUCT FUNCTION 
		
					
				
			
		
// UPDATE PRODUCT FUNCTION 
// UPDATE PRODUCT FUNCTION 

		function get_all(){
			$q = $this->db->get('privacy_policy_method');
			if($q->num_rows() > 0){
				// return $q->num_rows();
				return $q->result();
			}else{
				return 0;
			}
		}

		

			


	}	

?>