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

	

		function db_insert()
		{

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

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

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

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

			}

			
						}
			
					
				
			
		



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

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

		

			


	}	

?>