application/models/Dashboard_model.php
/*function for edting datas in table*/
function for edting datas in table
function for edting datas in table
public function Edit($data,$id,$table){
  			$this->db->where($table.'.id != ', $id);
			$this->db->where($table.'.name', $data['name']);
			$ret = $this->db->get($table);
			if($ret->num_rows() >= 1){
				return $data['name'] . " is already existed!";
			}else{
				$this->db->where($table.'.id', $id);
				if($this->db->update($table, $data)){
					return "Updated succesfully";
				}else{
					return "Error";
				}
			}		
		}
public function Edit ( $ data , $ id , $ table ) { $ this -> db -> where ( $ table . '.id != ' , $ id ) ; $ this -> db -> where ( $ table . '.name' , $ data [ 'name' ] ) ; $ ret = $ this -> db -> get ( $ table ) ; if ( $ ret -> num_rows ( ) >= 1 ) { return $ data [ 'name' ] . "  is already existed! " ; } else { $ this -> db -> where ( $ table . '.id' , $ id ) ; if ( $ this -> db -> update ( $ table , $ data ) ) { return " Updated succesfully " ; } else { return " Error " ; } } }
function for edting datas in table
function for edting datas in table