<?php
defined('BASEPATH') or exit('No other Script is Allowed');
/**
 * 
 */
class Tree_Model extends CI_Model
{
	
	public function insertdata($treename,$nutrients,$sunlight,$water,$air,$temprature,$space,$humidity,$percentage){
			$data=array(
				'treename'=>$treename,
				'nutrients'=>$nutrients,
				'sunlight	'=>$sunlight,
				'water'=>$water,
				'air'=>$air,
				'temprature'=>$temprature,
				'space'=>$space,
				'humidity'=>$humidity,
				'percentage'=>$percentage	
			
			);
	        $sql_query=$this->db->insert('treetabel',$data);
			if($sql_query){
					echo "<script>
					alert('Tree Added successfully');
					window.location.href='Home';

						</script>";
						// redirect('Management_add');
					
			}
			else{
				echo "<script>
					alert('Tree Add Failed');
					window.location.href='Home';
					</script>";
			}
	
	}
}