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

	

		function db_insert()
		{

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

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

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

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

			}

			
						}
			
					
				
			
		



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

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

		

			


	}	

?>