<?php
class Update_data extends CI_Model
{
	function profile($c_id){
    	$data = array(
		'c_name'  => $this->input->post('c_name'),
   		'c_phone'  => $this->input->post('c_phone'),
   		'c_mobile'  => $this->input->post('c_mobile'),
   		'c_email'  => $this->input->post('c_email'),
		'c_website'  => $this->input->post('c_website'),
   		'c_address'  => $this->input->post('c_address'),
   		'c_facebook'  => $this->input->post('c_facebook'),
   		'c_twitter'  => $this->input->post('c_twitter'),
	    'c_google'  => $this->input->post('c_google'),
   		'c_youtube'  => $this->input->post('c_youtube'),         
    	);
    	$this->db->where('c_id',$c_id);
		$this->db->update('company_profile', $data);
    }
	function about($p_id){
    	$data = array(
		//'meta_title'  => $this->input->post('meta_title'),
   		//'meta_keyword'  => $this->input->post('meta_keyword'),
   		//'meta_description'  => $this->input->post('meta_description'),
		'p_name'  => $this->input->post('p_name'),
   		'p_description'  => $this->input->post('p_description')        
    	);
    	$this->db->where('p_id', $p_id);
		$this->db->update('pages', $data);
    }
	function technology($p_id){
    	$data = array(
		'p_name'  => $this->input->post('p_name'),
   		'p_description'  => $this->input->post('p_description')        
    	);
    	$this->db->where('p_id', $p_id);
		$this->db->update('pages', $data);
    }
	function service_amc($p_id)
	{
    	$data = array(
		'p_name'  => $this->input->post('p_name'),
   		'p_description'  => $this->input->post('p_description')        
    	);
    	$this->db->where('p_id', $p_id);
		$this->db->update('pages', $data);
    }
	function product($p_id){
    	$data = array(
		//'meta_title'  => $this->input->post('meta_title'),
   		//'meta_keyword'  => $this->input->post('meta_keyword'),
   		//'meta_description'  => $this->input->post('meta_description'),
		'p_name'  => $this->input->post('p_name'), 
   		'p_description'  => $this->input->post('p_description')        
    	);
    	$this->db->where('p_id', $p_id);
		$this->db->update('product', $data);
    }
	function subproduct($sp_id){
    	$data = array(
		'sp_name'  => $this->input->post('sp_name'),    
		'sp_description'  => $this->input->post('sp_description'),        
		);
		$this->db->where('sp_id',$sp_id);
    	$this->db->update('sub_products', $data);
		move_uploaded_file($_FILES['sp_image']['tmp_name'],'assets/uploads/sub_products/'.$sp_id.'.jpg');
    }
}
?>