芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/joolsmen.com/application/controllers/user/Forgotpassword.php
data['theme'] = 'user'; $this->data['module'] = 'forgotpassword'; $this->data['page'] = ''; $this->data['base_url'] = base_url(); $this->load->model('home_model','home'); $this->user_latitude=(!empty($this->session->userdata('user_latitude')))?$this->session->userdata('user_latitude'):''; $this->user_longitude=(!empty($this->session->userdata('user_longitude')))?$this->session->userdata('user_longitude'):''; $this->currency= settings('currency'); $this->load->library('ajax_pagination'); $this->perPage = 12; $default_language_select = default_language(); if ($this->session->userdata('user_select_language') == '') { $this->data['user_selected'] = $default_language_select['language_value']; } else { $this->data['user_selected'] = $this->session->userdata('user_select_language'); } $this->data['active_language'] = $active_lang = active_language(); $lg = custom_language($this->data['user_selected']); $this->data['default_language'] = $lg['default_lang']; $this->data['user_language'] = $lg['user_lang']; $this->user_selected = (!empty($this->data['user_selected'])) ? $this->data['user_selected'] : 'en'; $this->default_language = (!empty($this->data['default_language'])) ? $this->data['default_language'] : ''; $this->user_language = (!empty($this->data['user_language'])) ? $this->data['user_language'] : ''; } public function index() { $this->data['page'] = 'index'; $this->data['category']=$this->home->get_category(); $this->data['services']=$this->home->get_service(); $this->load->vars($this->data); $this->load->view($this->data['theme'].'/template'); } public function userchangepwd() { $this->data['page'] = 'contact'; $this->load->vars($this->data); $this->load->view($this->data['theme'].'/template'); } public function insert_contact() { $query = $this->db->query("select * from system_settings WHERE status = 1"); $result = $query->result_array(); $mail_config=''; $email_address=''; $smtp_email_address=''; $tomail=''; foreach ($result as $res) { if($res['key'] == 'mail_config'){ $mail_config = $res['value']; } if($res['key'] == 'email_address'){ $email_address = $res['value']; } if($res['key'] == 'smtp_email_address'){ $smtp_email_address = $res['value']; } } if($mail_config=='smtp') { $tomail=$smtp_email_address; } else { $tomail=$email_address; } $table_datas['name']=$this->input->post('name'); $table_datas['email']=$this->input->post('email'); $table_datas['message']=$this->input->post('message'); $result=$this->db->insert('contact_form_details', $table_datas); if ($result) { $this->data['user'] = $this->session->userdata(); $body = $this->load->view('user/email/contact_form', $table_datas, true); $phpmail_config = settingValue('mail_config'); if (isset($phpmail_config) && !empty($phpmail_config)) { if ($phpmail_config == "phpmail") { $from_email = settingValue('email_address'); } else { $from_email = settingValue('smtp_email_address'); } } $this->load->library('email'); if (!empty($from_email) && isset($from_email)) { $mail = $this->email ->from($from_email) ->to($tomail) ->subject('User Contact Form Details') ->message($body) ->send(); } $message = 'Mail Sent Successfully'; $this->session->set_flashdata('success_message', $message); echo 1; } else { $message = 'Sorry, something went wrong'; $this->session->set_flashdata('error_message', $message); echo 0; } } }