application/models/Dashboard_model.php
/*function for inserting datas to database*/
function for inserting datas to database
function for inserting datas to database
function Add($data,$table){
			$this->db->where($table.'.name', $data['name']);
			$ret = $this->db->get($table);
			if($ret->num_rows() >= 1){
				return $data['name'] . " is already existed!";
			}else{
				if($this->db->insert($table, $data)){
					return "Added succesfully";
				}else{
					return "Error";
				}
			}
		}
function Add ( $ data , $ table ) { $ this -> db -> where ( $ table . '.name' , $ data [ 'name' ] ) ; $ ret = $ this -> db -> get ( $ table ) ; if ( $ ret -> num_rows ( ) >= 1 ) { return $ data [ 'name' ] . "  is already existed! " ; } else { if ( $ this -> db -> insert ( $ table , $ data ) ) { return " Added succesfully " ; } else { return " Error " ; } } }
function for inserting datas to database
function for inserting datas to database