<?php defined('BASEPATH') OR exit('No direct script access allowed');
header("Content-Type: text/html; charset=UTF-8");
/**
 * 인클루드 class
 *
 * cm_controller: 부모 Class(CI_Controller 확장한 custome class)
 */
include_once(APPPATH.'core/web/cm_controller.php');
class mypage extends cm_Controller {

    #---------------------------------------------------------------------------
    # PURPOSE : 회원수정
    # CREATE  :	2018-04-11
    #---------------------------------------------------------------------------
	function fn_member_edit() {

	    $this->load->helper('cookie');
        $crossmap_passwd_check 		= get_cookie('crossmap_passwd_check');
        if($crossmap_passwd_check != 'Y') {
            gf_alert("잘못된 접근입니다.", '/');
            exit;
        }
        set_cookie('crossmap_passwd_check', 'N', 0);

        $SES_MEMBER_ID              = $this->session->userdata('C_Member_Id');
        $SES_MEMBER_GROUP_IDX       = $this->session->userdata('C_Member_Group');
        $SES_MEMBER_GROUP_Name      = $this->session->userdata('C_Member_Group_Name');
        if($SES_MEMBER_GROUP_IDX == '') {
            $SES_MEMBER_GROUP_IDX   ='8';
            $SES_MEMBER_GROUP_Name  = '비회원';
        }

        # 해당회원이 사용가능한지 확인
        $req_data = array();
        $req_data['member_group_idx']       = $SES_MEMBER_GROUP_IDX;
        $req_data['menu_code']              = '3';

        # model
        $this->load->model('web/m_member_group_menu_auth');
        $count = $this->m_member_group_menu_auth->member_group_menu_auth_count($req_data);
        if($count > 0) {
            gf_alert($SES_MEMBER_GROUP_Name."은 해당 메뉴를 사용하실수 없습니다.", '/');
            exit;
        }


        # model - list
        $this->load->model('web/m_member');
        $result         = $this->m_member->member_where_member_id_select($SES_MEMBER_ID);
        if(count($result) == 0){
            gf_alert("잘못된 접근입니다.", '/');
            exit;
        }

        # view data
        $return_data = array();
        $return_data['result']                      = $result;


        # view
        return $this->load->view('/web/mypage/member_edit', $return_data, true);

    }

    #---------------------------------------------------------------------------
    # PURPOSE : 북마크
    # CREATE  :	2018-05-04
    #---------------------------------------------------------------------------
	function fn_bookmark() {
        # Request
        $search_keyword         = trim($this->input->get_post('search_keyword', TRUE));
        $SES_MEMBER_ID          = $this->session->userdata('C_Member_Id');

        $limit  = 10;
        $offset = 0;

        $search_keyword_txt     = addslashes($search_keyword);


        # 북마크
        $req_data = array();
        $req_data['search_type']        = 'total';
        $req_data['search_keyword']     = $search_keyword_txt;
        $req_data['offset']             = $offset;
        $req_data['limit']              = $limit;
        $req_data['member_id']          = $SES_MEMBER_ID;

        # model - list
        $this->load->model('web/m_bookmark');
        $result         = $this->m_bookmark->bookmark_join_vw_content_list($req_data);
        $total_count    = $this->m_bookmark->bookmark_join_vw_content_list_total_count($req_data);


        # view data
        $return_data = array();
        $return_data['list']            = $result;
        $return_data['limit']           = $limit;
        $return_data['total_count']     = $total_count;
        $return_data['search_keyword']  = $search_keyword;

        # view
        return $this->load->view('/web/mypage/bookmark', $return_data, true);

    }


    #---------------------------------------------------------------------------
    # PURPOSE : 이미지 더가져오기
    # CREATE  :	2018-05-05
    #---------------------------------------------------------------------------
	function fn_ajax_bookmark_list_more() {
	    # request
        $page           = trim($this->input->get_post('page', TRUE));
        $search_keyword = trim($this->input->get_post('search_keyword', TRUE));
        $SES_MEMBER_ID  = $this->session->userdata('C_Member_Id');

        if($SES_MEMBER_ID == '')    throw new Cm_Exception('json', '9999', '회원로그인 후에 가능합니다.');

        # paging 설정
        $limit  = 10;
        $offset = ($page-1) * $limit;

        # 북마크
        $req_data = array();
        $req_data['search_type']        = 'total';
        $req_data['search_keyword']     = $search_keyword;
        $req_data['offset']             = $offset;
        $req_data['limit']              = $limit;
        $req_data['member_id']          = $SES_MEMBER_ID;

        # model - list
        $this->load->model('web/m_bookmark');
        $list           = $this->m_bookmark->bookmark_join_vw_content_list($req_data);
        $total_count    = $this->m_bookmark->bookmark_join_vw_content_list_total_count($req_data);

        $more_list = 'N';
        if(($total_count-($page*$limit)) > 0){
            $more_list = 'Y';
        }

        # view data
        $return_data = array();
        $return_data['result_code']         = '0000';
        $return_data['total_count']         = $total_count;
        $return_data['list']                = $list;
        $return_data['more_list']           = $more_list;

        # view
        return $this->load->view('/web/mypage/bookmark_list_more', $return_data);


    }


    #---------------------------------------------------------------------------
    # PURPOSE : 1:1문의
    # CREATE  :	2018-05-04
    #---------------------------------------------------------------------------
	function fn_qna() {
        # Request
        $page                   = trim($this->input->get_post('page', TRUE));
        $search_type            = trim($this->input->get_post('search_type', TRUE));
        $search_keyword         = trim($this->input->get_post('search_keyword', TRUE));
        $SES_MEMBER_ID          = $this->session->userdata('C_Member_Id');
        $SES_MEMBER_GROUP_IDX   = $this->session->userdata('C_Member_Group');
        $SES_MEMBER_GROUP_Name  = $this->session->userdata('C_Member_Group_Name');
        if($SES_MEMBER_GROUP_IDX == '') {
            $SES_MEMBER_GROUP_IDX   ='8';
            $SES_MEMBER_GROUP_Name  = '비회원';
        }

        # 해당회원이 사용가능한지 확인
        $req_data = array();
        $req_data['member_group_idx']       = $SES_MEMBER_GROUP_IDX;
        $req_data['menu_code']              = '3';

        # model
        $this->load->model('web/m_member_group_menu_auth');
        $count = $this->m_member_group_menu_auth->member_group_menu_auth_count($req_data);
        if($count > 0) {
            gf_alert($SES_MEMBER_GROUP_Name."은 해당 메뉴를 사용하실수 없습니다.", '/');
            exit;
        }


        # default setting
        if($page=='')           $page = '1';

        # paging 설정
        $limit  = 20;
        $offset = ($page-1) * $limit;

        # 1:1문의
        $req_data = array();
        $req_data['search_type']        = $search_type;
        $req_data['search_keyword']     = $search_keyword;
        $req_data['offset']             = $offset;
        $req_data['limit']              = $limit;
        $req_data['member_id']          = $SES_MEMBER_ID;

        # model - list
        $this->load->model('web/m_bbs_question');
        $result         = $this->m_bbs_question->bbs_question_where_member_id_list($req_data);
        $total_count    = $this->m_bbs_question->bbs_question_where_member_id_list_total_count($req_data);

        # page
        $max_page   = ceil($total_count / $limit);
        $pagination =  gf_paging($limit, $page, $max_page, '/web/mypage/qna?search_type='.$search_type.'&search_keyword='.$search_keyword.'&page=');

        $data_num = ($total_count + $limit)-($page*$limit);

        # view data
        $return_data = array();
        $return_data['list']            = $result;
        $return_data['total_count']     = $total_count;
        $return_data['data_num']        = $data_num;
        $return_data['pagination']      = $pagination;
        $return_data['search_type']     = $search_type;
        $return_data['search_keyword']  = $search_keyword;


        # view
        return $this->load->view('/web/mypage/qna', $return_data, true);

    }

    #---------------------------------------------------------------------------
    # PURPOSE : 1:1문의 - 글쓰기
    # CREATE  :	2018-05-05
    #---------------------------------------------------------------------------
	function fn_qna_add() {

	    $SES_MEMBER_GROUP_IDX   = $this->session->userdata('C_Member_Group');
        $SES_MEMBER_GROUP_Name  = $this->session->userdata('C_Member_Group_Name');
        if($SES_MEMBER_GROUP_IDX == '') {
            $SES_MEMBER_GROUP_IDX   ='8';
            $SES_MEMBER_GROUP_Name  = '비회원';
        }

        # 해당회원이 사용가능한지 확인
        $req_data = array();
        $req_data['member_group_idx']       = $SES_MEMBER_GROUP_IDX;
        $req_data['menu_code']              = '3';

        # model
        $this->load->model('web/m_member_group_menu_auth');
        $count = $this->m_member_group_menu_auth->member_group_menu_auth_count($req_data);
        if($count > 0) {
            gf_alert($SES_MEMBER_GROUP_Name."은 해당 메뉴를 사용하실수 없습니다.", '/');
            exit;
        }



        # view
        return $this->load->view('/web/mypage/qna_add', '', true);

    }

    #---------------------------------------------------------------------------
    # PURPOSE : 1:1문의 - 글쓰기저장
    # CREATE  :	2018-05-05
    #---------------------------------------------------------------------------
	function fn_qna_add_proc() {
        # Request
        $title              = trim($this->input->get_post('title', TRUE));
        $content            = trim($this->input->get_post('content', TRUE));
        $SES_MEMBER_ID      = $this->session->userdata('C_Member_Id');
        $SES_MEMBER_NICNAME = $this->session->userdata('C_Member_Nicname');

        $SES_MEMBER_GROUP_IDX   = $this->session->userdata('C_Member_Group');
        $SES_MEMBER_GROUP_Name  = $this->session->userdata('C_Member_Group_Name');
        if($SES_MEMBER_GROUP_IDX == '') {
            $SES_MEMBER_GROUP_IDX   ='8';
            $SES_MEMBER_GROUP_Name  = '비회원';
        }

        # 해당회원이 사용가능한지 확인
        $req_data = array();
        $req_data['member_group_idx']       = $SES_MEMBER_GROUP_IDX;
        $req_data['menu_code']              = '3';

        # model
        $this->load->model('web/m_member_group_menu_auth');
        $count = $this->m_member_group_menu_auth->member_group_menu_auth_count($req_data);
        if($count > 0) {
            gf_alert($SES_MEMBER_GROUP_Name."은 해당 메뉴를 사용하실수 없습니다.", '/');
            exit;
        }


        # model
        $this->load->model('web/m_bbs_question');

        # max idx 가져오기
        $result         = $this->m_bbs_question->bbs_question_max_idx_select();

        $max_idx    = $result['max_idx']+1;
        $now_date   = date("Y-m-d H:i:s");

        $req_data = array();
        $req_data['title']      = $title;
        $req_data['content']    = $content;
        $req_data['idx']        = $max_idx;
        $req_data['p_idx']      = $max_idx;
        $req_data['s_idx']      = '1';
        $req_data['member_id']  = $SES_MEMBER_ID;
        $req_data['write_id']   = $SES_MEMBER_ID;
        $req_data['write_name'] = $SES_MEMBER_NICNAME;
        $req_data['reg_date']   = $now_date;
        $req_data['update_id']  = $SES_MEMBER_ID;
        $req_data['update_date']= $now_date;

        # insert
        $this->m_bbs_question->bbs_question_insert($req_data);

        gf_alert("등록되었습니다.", '/web/mypage/qna');

    }

    #---------------------------------------------------------------------------
    # PURPOSE : 1:1문의 - 삭제
    # CREATE  :	2018-05-05
    #---------------------------------------------------------------------------
	function fn_qna_arr_del_proc() {
	    # request
        $arr_idx        = $this->input->get_post('is_del', TRUE);   // 삭제할 idx
        $SES_MEMBER_ID  = $this->session->userdata('C_Member_Id');

        if($SES_MEMBER_ID == '') {
            gf_alert("회원로그인 후에 가능합니다.", '/web/mypage/qna');
            exit;
        }

        $SES_MEMBER_GROUP_IDX   = $this->session->userdata('C_Member_Group');
        $SES_MEMBER_GROUP_Name  = $this->session->userdata('C_Member_Group_Name');
        if($SES_MEMBER_GROUP_IDX == '') {
            $SES_MEMBER_GROUP_IDX   ='8';
            $SES_MEMBER_GROUP_Name  = '비회원';
        }

        # 해당회원이 사용가능한지 확인
        $req_data = array();
        $req_data['member_group_idx']       = $SES_MEMBER_GROUP_IDX;
        $req_data['menu_code']              = '3';

        # model
        $this->load->model('web/m_member_group_menu_auth');
        $count = $this->m_member_group_menu_auth->member_group_menu_auth_count($req_data);
        if($count > 0) {
            gf_alert($SES_MEMBER_GROUP_Name."은 해당 메뉴를 사용하실수 없습니다.", '/');
            exit;
        }

        # model
        $this->load->model('web/m_bbs_question');

        $now_date   = date("Y-m-d H:i:s");
        foreach ($arr_idx as $key=>$val) {
            $req_data = array();
            $req_data['idx']        = $val;
            $req_data['write_id']   = $SES_MEMBER_ID;

            $count   = $this->m_bbs_question->bbs_question_write_id_idx_count($req_data);
            if($count > 0) {
                $arr_update_data1 = array();
                $arr_update_data1[$key]['idx']           = $val;
                $arr_update_data1[$key]['is_del']        = 'Y';
                $arr_update_data1[$key]['update_id']     = $SES_MEMBER_ID;
                $arr_update_data1[$key]['update_date']   = $now_date;
                $this->m_bbs_question->bbs_question_is_del_update_batch($arr_update_data1);

                $arr_update_data2 = array();
                $arr_update_data2[$key]['p_idx']         = $val;
                $arr_update_data2[$key]['is_del']        = 'Y';
                $arr_update_data2[$key]['update_id']     = $SES_MEMBER_ID;
                $arr_update_data2[$key]['update_date']   = $now_date;
                $this->m_bbs_question->bbs_question_p_idx_is_del_update_batch($arr_update_data2);

            }

        }


        gf_alert("삭제되었습니다.", '/web/mypage/qna');

    }


    #---------------------------------------------------------------------------
    # PURPOSE : 1:1문의 - 보기
    # CREATE  :	2018-05-05
    #---------------------------------------------------------------------------
	function fn_qna_view() {
        # Request
	    $idx                    = $this->uri->segment(4);
        $page                   = trim($this->input->get_post('page', TRUE));
        $search_type            = trim($this->input->get_post('search_type', TRUE));
        $search_keyword         = trim($this->input->get_post('search_keyword', TRUE));
        $data_num               = trim($this->input->get_post('data_num', TRUE));
        $SES_MEMBER_ID          = $this->session->userdata('C_Member_Id');


        $SES_MEMBER_GROUP_IDX   = $this->session->userdata('C_Member_Group');
        $SES_MEMBER_GROUP_Name  = $this->session->userdata('C_Member_Group_Name');
        if($SES_MEMBER_GROUP_IDX == '') {
            $SES_MEMBER_GROUP_IDX   ='8';
            $SES_MEMBER_GROUP_Name  = '비회원';
        }

        # 해당회원이 사용가능한지 확인
        $req_data = array();
        $req_data['member_group_idx']       = $SES_MEMBER_GROUP_IDX;
        $req_data['menu_code']              = '3';

        # model
        $this->load->model('web/m_member_group_menu_auth');
        $count = $this->m_member_group_menu_auth->member_group_menu_auth_count($req_data);
        if($count > 0) {
            gf_alert($SES_MEMBER_GROUP_Name."은 해당 메뉴를 사용하실수 없습니다.", '/');
            exit;
        }


        $req_data = array();
        $req_data['idx']            = $idx;
        $req_data['member_id']      = $SES_MEMBER_ID;

        # model
        $this->load->model('web/m_bbs_question');
        $result  = $this->m_bbs_question->bbs_question_member_id_idx_select($req_data);
        if(count($result)==0) {
            gf_alert("잘못된 접근입니다.", '/web/mypage/qna');
            exit;
        }


        # next
        $req_data = array();
        $req_data['idx']                = $idx;
        $req_data['search_type']        = $search_type;
        $req_data['search_keyword']     = $search_keyword;
        $req_data['offset']             = 0;
        $req_data['limit']              = 4;
        $req_data['member_id']          = $SES_MEMBER_ID;
        $next_list  = $this->m_bbs_question->bbs_question_next_parent_list($req_data);


        # view data
        $return_data = array();
        $return_data['idx']                     = $idx;
        $return_data['result']                  = $result;
        $return_data['next_list']               = $next_list;
        $return_data['page']                    = $page;
        $return_data['search_type']             = $search_type;
        $return_data['search_keyword']          = $search_keyword;
        $return_data['data_num']                = $data_num;

        # view
        return $this->load->view('/web/mypage/qna_view', $return_data, true);


    }


    #---------------------------------------------------------------------------
    # PURPOSE : 1:1문의 - 삭제
    # CREATE  :	2018-05-05
    #---------------------------------------------------------------------------
	function fn_qna_del_proc() {
	    # request
        $idx            = trim($this->input->get_post('idx', TRUE));
        $SES_MEMBER_ID  = $this->session->userdata('C_Member_Id');

        if($SES_MEMBER_ID == '') {
            gf_alert("회원로그인 후에 가능합니다.", '/web/mypage/qna');
            exit;
        }

        $SES_MEMBER_GROUP_IDX   = $this->session->userdata('C_Member_Group');
        $SES_MEMBER_GROUP_Name  = $this->session->userdata('C_Member_Group_Name');
        if($SES_MEMBER_GROUP_IDX == '') {
            $SES_MEMBER_GROUP_IDX   ='8';
            $SES_MEMBER_GROUP_Name  = '비회원';
        }

        # 해당회원이 사용가능한지 확인
        $req_data = array();
        $req_data['member_group_idx']       = $SES_MEMBER_GROUP_IDX;
        $req_data['menu_code']              = '3';

        # model
        $this->load->model('web/m_member_group_menu_auth');
        $count = $this->m_member_group_menu_auth->member_group_menu_auth_count($req_data);
        if($count > 0) {
            gf_alert($SES_MEMBER_GROUP_Name."은 해당 메뉴를 사용하실수 없습니다.", '/');
            exit;
        }


        # model
        $this->load->model('web/m_bbs_question');

        $now_date   = date("Y-m-d H:i:s");

        $req_data = array();
        $req_data['idx']        = $idx;
        $req_data['write_id']   = $SES_MEMBER_ID;

        $count   = $this->m_bbs_question->bbs_question_write_id_idx_count($req_data);
        if($count > 0) {
            $arr_update_data1 = array();
            $arr_update_data1[0]['idx']           = $idx;
            $arr_update_data1[0]['is_del']        = 'Y';
            $arr_update_data1[0]['update_id']     = $SES_MEMBER_ID;
            $arr_update_data1[0]['update_date']   = $now_date;
            $this->m_bbs_question->bbs_question_is_del_update_batch($arr_update_data1);

            $arr_update_data2 = array();
            $arr_update_data2[0]['p_idx']         = $idx;
            $arr_update_data2[0]['is_del']        = 'Y';
            $arr_update_data2[0]['update_id']     = $SES_MEMBER_ID;
            $arr_update_data2[0]['update_date']   = $now_date;
            $this->m_bbs_question->bbs_question_p_idx_is_del_update_batch($arr_update_data2);

        }


        gf_alert("삭제되었습니다.", '/web/mypage/qna');

    }


    #---------------------------------------------------------------------------
    # PURPOSE : 회원수정
    # CREATE  :	2018-06-04
    #---------------------------------------------------------------------------
	function fn_member_edit_proc() {
        # Request
        $SES_MEMBER_ID              = $this->session->userdata('C_Member_Id');
        $org_profile_img            = trim($this->input->get_post('org_profile_img', TRUE));
        $member_nickname            = trim($this->input->get_post('member_nickname', TRUE));
        $member_intro               = trim($this->input->get_post('member_intro', TRUE));
        $is_nickname                = trim($this->input->get_post('is_nickname', TRUE));
        $is_agree_sms               = trim($this->input->get_post('is_agree_sms', TRUE));
        $is_agree_mail              = trim($this->input->get_post('is_agree_mail', TRUE));
        $is_agree_info_open         = trim($this->input->get_post('is_agree_info_open', TRUE));
        $member_edit_church         = trim($this->input->get_post('member_edit_church', TRUE));
        $member_edit_etc1           = trim($this->input->get_post('member_edit_etc1', TRUE));
        $member_edit_etc2           = trim($this->input->get_post('member_edit_etc2', TRUE));
        $member_edit_password       = trim($this->input->get_post('member_edit_password', TRUE));
        $member_edit_new_password   = trim($this->input->get_post('member_edit_new_password', TRUE));

        // 쿠키
        $this->load->helper('cookie');
        set_cookie('crossmap_passwd_check', 'Y', 0);

        if($member_nickname!='' && $is_nickname=='N') {
            gf_alert("닉네임 중복확인을 해주세요.", '/web/mypage/member_edit');
            exit;
        }

        $member_nickname            = addslashes($member_nickname);
        $member_intro               = addslashes($member_intro);
        $member_edit_church         = addslashes($member_edit_church);
        $member_edit_password       = addslashes($member_edit_password);
        $member_edit_new_password   = addslashes($member_edit_new_password);
        $member_edit_etc1           = addslashes($member_edit_etc1);
        $member_edit_etc2           = addslashes($member_edit_etc2);

        # 이미지업로드
        if($_FILES['member_img']['name']!='') {
            # image upload
            $upload_path = './files/profile/'.date("Y")."/".date("m");
            if (!is_dir($upload_path)) {
                mkdir($upload_path, 0777, TRUE);
            }
            $config['upload_path']      = $upload_path;
            $config['allowed_types']    = 'gif|jpg|png';
            $config['encrypt_name']     = TRUE;

            $this->load->library('upload');
            $this->upload->initialize($config);

            if ( ! $this->upload->do_upload('member_img')) {
                $error = array('error' => $this->upload->display_errors());
                gf_alert("이미지 업로드에 실패했습니다.", '/web/mypage/member_edit');
                exit;
            }
            $arr_upload_data = $this->upload->data();
            $filename = str_replace($_SERVER['DOCUMENT_ROOT'], '', $arr_upload_data['full_path']);
        } else {
            $filename = $org_profile_img;
        }

        $now_date = date("Y-m-d H:i:s");

        #  update
        $this->load->model('web/m_member');
        $req_data = array();
        if($member_edit_new_password!='') {
            # 비밀번호 확인
            $req_data = array();
            $req_data['member_id']  = $SES_MEMBER_ID;
            $req_data['member_pwd'] = MD5($member_edit_password);
            $count = $this->m_member->member_where_member_id_member_pwd_count($req_data);
            if($count==0) {
                gf_alert("입력하신 현재 비밀번호가 맞지 않습니다.", '/web/mypage/member_edit');
                exit;
            }

            $req_data['last_pwd_change_date']   = $now_date;
            $req_data['member_pwd']             = MD5($member_edit_new_password);

        }

        $req_data['member_img']         = $filename;
        $req_data['member_nickname']    = $member_nickname;
        $req_data['member_id']          = $SES_MEMBER_ID;
        $req_data['member_intro']       = $member_intro;
        $req_data['member_church']      = $member_edit_church;
        $req_data['etc1']               = $member_edit_etc1;
        $req_data['etc2']               = $member_edit_etc2;
        $req_data['is_agree_sms']       = $is_agree_sms;
        $req_data['is_agree_mail']      = $is_agree_mail;
        $req_data['is_agree_info_open'] = $is_agree_info_open;
        $req_data['update_id']          = $SES_MEMBER_ID;
        $req_data['update_date']        = $now_date;

        $this->m_member->member_where_member_id_update($req_data);


        if($member_edit_new_password!='') {
            $result = $this->m_member->member_where_member_id_select($SES_MEMBER_ID);
            $member_email   = $result['member_email'];
            $member_name    = $result['member_name'];

            if($member_email!='') {
                // 이메일발송
                $content =$member_name.'님, '.date("Y").'년 '.date("m").'월 '.date("d").'일 '.date("H").'시 '.date("i").'분 '.date("s").'초에 계정 비밀번호 정보를 변경하였습니다.<p></p>';
                $content.='혹시, 변경한 적이 없는 경우 1:1 고객센터로 문의해 주시면, 도움 드리도록 하겠습니다.<p></p>';
                $content.='* 소중한 개인정보, 잊어버리지 않도록 유의해 주세요. <p></p><p>&nbsp;</p>';
                $content.='P.S) 하나님의 은혜와 평강이 '.$member_name.'님의 삶 가운데 늘 가득하기를 <p></p>';
                $content.='크로스맵이 응원하고 기도합니다! <p></p><p>&nbsp;</p>';
                $content.=' - 크로스맵 일동 올림 -  <p></p>';

                $mail_result['content'] = $content;
                $message = $this->load->view('/web/comm/mail_template', $mail_result, TRUE);

                $this->load->library('email');
                $config = array();
                $config['wordwrap'] = true;
                $config['mailtype'] = 'html';
                $this->email->initialize($config);
                $this->email->from(CROSSMAP_EMAIL, CROSSMAP_EMAIL_NAME);
                $this->email->to($member_email);
                $this->email->subject('개인 비밀번호 정보 변경 안내 메일입니다.');
                $this->email->message($message);

                $this->email->send();
            }

        }


        $this->session->set_userdata('C_Member_Nicname', $member_nickname);
        $this->session->set_userdata('C_Member_Intro', $member_intro);
        $this->session->set_userdata('C_Member_Profile', $filename);

        gf_alert("회원정보가 수정되었습니다.", '/web/mypage/member_edit');

    }




}
?>


