<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Profile extends CI_Controller {

	function __construct() 
	{
        error_reporting(0);
        parent::__construct();
        $this->load->driver('session');
        $this->load->library('session');
        $this->load->model('CommonModel');
        $this->load->helper('Security');
        $this->load->library('cart');
       
    }
	public function index()
	{
        if($this->session->userdata('user_id')){
    		$data['content'] = 'profile';
    		$this->load->view('layout_home', $data);
        } else{
            redirect(base_url());
        }
	}
    public function edit()
    {
        $input_data = $this->input->post();
        $input_data = $this->security->xss_clean($input_data);
        $edit_data['name'] = $input_data['name'];
        $edit_data['email'] = $input_data['email'];
        $edit_data['mobile'] = $input_data['mobile'];
        $edit_data['state'] = $input_data['state'];
        $edit_data['city'] = $input_data['city'];
        $edit_data['address'] = $input_data['address'];
        
        $this->db->where('c_id',$this->session->userdata('user_id'));
    $this->db->update('customer',$edit_data);
    echo $this->db->last_query();
    }
}
