D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
realadss
/
public_html
/
partymaker.in
/
application
/
controllers
/
Filename :
Home.php
back
Copy
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Home extends CI_Controller { public $data = array(); public function __construct() { parent::__construct(); $this->base_url = base_url(); $this->data['base_url'] = $this->base_url; } public function index() { //redirect(base_url().'admin'); $home_data = $this->common_model->get_count_data_manual('home_content','',1); $this->data['cms_data'] = $home_data; $this->load->view('front/page_part/header',$this->data); $this->load->view('front/home',$this->data); $this->load->view('front/page_part/footer',$this->data); } public function page_404() { $this->output->set_status_header('404'); $this->load->view('front/page_part/header',$this->data); $this->load->view('front/page_404',$this->data); $this->load->view('front/page_part/footer',$this->data); } public function common_blog_other($alise='') { if($alise =='admin') { redirect(base_url().'admin/index'); } $home_data = $this->common_model->get_count_data_manual('cms_page',array('alias'=>$alise),1); if(isset($home_data) && $this->common_model->is_array_count($home_data)) { $this->data['cms_data'] = $home_data; $this->load->view('front/page_part/header',$this->data); $this->load->view('front/cms_page',$this->data); $this->load->view('front/page_part/footer',$this->data); } else { $home_data = $this->common_model->get_count_data_manual('blog_master',array('alias'=>$alise),1); if(isset($home_data) && $this->common_model->is_array_count($home_data)) { $this->blog_detail($home_data); } else { $this->page_404(); } } } public function blog_detail($home_data = '') { if(is_numeric($home_data)) { $this->blog($home_data); } else { $this->data['cms_data'] = $home_data; $this->data['page_active'] = 'blog'; $this->load->view('front/page_part/header',$this->data); $this->load->view('front/blog_detail',$this->data); $this->load->view('front/page_part/footer',$this->data); } } public function blog($page_number = 1) { $this->data['total_count'] = $this->common_model->get_count_data_manual('blog_master','',0); $home_data = $this->common_model->get_count_data_manual('blog_master','',2,'','id desc',$page_number); $this->data['blog_data'] = $home_data; $this->data['page_active'] = 'blog'; $this->load->view('front/page_part/header',$this->data); $this->load->view('front/blog_list',$this->data); $this->load->view('front/page_part/footer',$this->data); } public function contact() { $code = rand(100000,999999); $this->data['page_active'] = 'contact'; $this->session->set_userdata('captcha_code_up',$code); $this->load->library('form_validation'); $this->load->view('front/page_part/header',$this->data); $this->load->view('front/contact',$this->data); $this->load->view('front/page_part/footer',$this->data); } public function thank_you() { //$code = rand(100000,999999); //$this->data['page_active'] = 'contact'; //$this->session->set_userdata('captcha_code_up',$code); //$this->load->library('form_validation'); $this->load->view('front/page_part/header',$this->data); $this->load->view('front/thank_you',$this->data); $this->load->view('front/page_part/footer',$this->data); } public function contact_process() { $this->load->library('form_validation'); $this->form_validation->set_rules('name', 'Name', 'required'); $this->form_validation->set_rules('contact', 'Phone No', 'required'); $this->form_validation->set_rules('contactemail1', 'Email', 'required|valid_email'); $this->form_validation->set_rules('contactsubject', 'Subject', 'required'); //$this->form_validation->set_rules('message', 'Message', 'required'); //$this->form_validation->set_rules('code_captcha', 'Captcha Code', 'callback_validate_captcha'); if ($this->form_validation->run() == FALSE) { $this->contact(); } else { $name = $this->input->post('name'); $phone = $this->input->post('contact'); $email = $this->input->post('contactemail1'); $contactsubject = $this->input->post('contactsubject'); $event_date = $this->input->post('event_date'); if($event_date !='') { $event_date = date('Y-m-d',strtotime($event_date)); } $data = array( 'name' => $name, 'phone' => $phone, 'email' => $email, 'subject' => $contactsubject, 'event_date' => $event_date, 'created_on'=> date('Y-m-d H:i:s'), ); $this->db->insert('contact_us_request',$data); $this->session->set_flashdata('success_err', 'Your contact us form submitted successfully'); $common_setting = $this->common_model->common_setting; $contact_email = $common_setting['contact_email']; if($contact_email !='') { $message = "<html> <head> </head> <body> <p>Dear admin,</p> <p>This mail is to inform you that someone has submitted contact us form on your website ".base_url()." </p> <p>Following are the details that has been provided by user.</p> <p><strong> Name : $name<br /> Email : $email<br /> Contact No : $phone<br /> Subject : $contactsubject<br /> Event_date : ".$event_date."<br /> </p> </strong> <br /><br /> <p>Regards ,<br /> ".base_url()." </p> </body> </html>"; $config = array(); $config['wordwrap'] = TRUE; $config['mailtype'] = 'html'; $this->load->library('email',$config); $this->email->from($contact_email); $this->email->to($contact_email); $this->email->subject('Contact us form submiited by - '.$name); $this->email->message($message); $this->email->send(); } redirect('thank-you'); } } public function send_email() { $contact_email = "mmustakimbhai@gmail.com"; $config = array(); $config['wordwrap'] = TRUE; $config['mailtype'] = 'html'; $this->load->library('email',$config); $this->email->from($contact_email); $this->email->to($contact_email); $message = "test message"; $this->email->subject('Contact us form submiited by - '); $this->email->message($message); $this->email->send(); $this->email->print_debugger(); } public function inquiry_form() { // $this->load->library('form_validation'); // $this->form_validation->set_rules('name', 'Name', 'required'); // $this->form_validation->set_rules('contact', 'Phone No', 'required'); // $this->form_validation->set_rules('contactemail1', 'Email', 'required|valid_email'); // $this->form_validation->set_rules('contactsubject', 'Subject', 'required'); // //$this->form_validation->set_rules('message', 'Message', 'required'); // //$this->form_validation->set_rules('code_captcha', 'Captcha Code', 'callback_validate_captcha'); // if ($this->form_validation->run() == FALSE) // { // $this->contact(); // } // else // { $name = $this->input->post('yourname'); $phone = $this->input->post('yourmobile'); $email = $this->input->post('youremail'); $location = $this->input->post('location'); $gender = $this->input->post('gender'); $fchildage = $this->input->post('fchildage'); $package = $this->input->post('fpackage'); $Budgetidea = $this->input->post('Budgetidea'); $looking_for = $this->input->post('looking_for'); $event_date = $this->input->post('eventdate'); if($event_date !='') { $event_date = date('Y-m-d',strtotime($event_date)); } $data = array( 'name' => $name, 'mobile' => $phone, 'email' => $email, 'location' => $location, 'budget' => $Budgetidea, 'looking_for' => $looking_for, 'gender' => $gender, 'child_age' => $fchildage, 'event_date' => $event_date, 'package' => $package, 'posted_on'=> date('Y-m-d H:i:s'), ); $this->db->insert('enquiry_form',$data); $this->session->set_flashdata('success_err', 'Your Enquiry form submitted successfully'); $common_setting = $this->common_model->common_setting; $contact_email = $common_setting['contact_email']; if($contact_email !='') { $message = "<html> <head> </head> <body> <p>Dear admin,</p> <p>This mail is to inform you that someone has submitted Enquiry form on your website ".base_url()." </p> <p>Following are the details that has been provided by user.</p> <p><strong> Name : $name<br /> Email : $email<br /> Contact No : $phone<br /> location : $location<br /> budget : $Budgetidea<br /> looking_for : $looking_for<br /> gender : $gender<br /> child_age : $fchildage<br /> package : $package<br /> Event_date : ".$event_date."<br /> </p> </strong> <br /><br /> <p>Regards ,<br /> ".base_url()." </p> </body> </html>"; $config = array(); $config['wordwrap'] = TRUE; $config['mailtype'] = 'html'; $this->load->library('email',$config); $this->email->from($contact_email); $this->email->to($contact_email); $this->email->subject('Enquiry form submiited by - '.$name); $this->email->message($message); $this->email->send(); } redirect('thank-you'); // } } public function about() { $home_data = $this->common_model->get_count_data_manual('cms_page',array('id'=>'2'),1); $this->data['cms_data'] = $home_data; $this->data['alise'] = 'about'; $this->data['page_active'] = 'about'; $this->load->view('front/page_part/header',$this->data); $this->load->view('front/about',$this->data); $this->load->view('front/page_part/footer',$this->data); } public function validate_captcha() { $captcha_code_up_sess = ''; if(isset($this->session->userdata['captcha_code_up'])) { $captcha_code_up_sess = $this->session->userdata['captcha_code_up']; } if($this->input->post('code_captcha') && $captcha_code_up_sess !='') { if($this->input->post('code_captcha') != $this->session->userdata['captcha_code_up']) { $this->form_validation->set_message('validate_captcha', 'Wrong captcha code, Please enter valid captcha code'); return false; } else { return true; } } else { $this->form_validation->set_message('validate_captcha', 'Please reload the page and try again.'); return false; } } }