⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
mydry
/
application
/
controllers
/
Edit File: Home.php
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Home extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('Model_common'); $this->load->model('Model_home'); $this->load->model('Model_portfolio'); } public function index() { $data['setting'] = $this->Model_common->all_setting(); $data['page_home'] = $this->Model_common->all_page_home(); $data['comment'] = $this->Model_common->all_comment(); $data['social'] = $this->Model_common->all_social(); $data['all_news'] = $this->Model_common->all_news(); $data['all_news_category'] = $this->Model_common->all_news_category(); $data['sliders'] = $this->Model_home->all_slider(); $data['services'] = $this->Model_home->all_service(); $data['features'] = $this->Model_home->all_feature(); $data['why_choose'] = $this->Model_home->all_why_choose(); $data['team_members'] = $this->Model_home->all_team_member(); $data['testimonials'] = $this->Model_home->all_testimonial(); $data['clients'] = $this->Model_home->all_client(); $data['pricing_table'] = $this->Model_home->all_pricing_table(); $data['home_faq'] = $this->Model_home->all_faq_home(); $data['portfolio_category'] = $this->Model_portfolio->get_portfolio_category(); $data['portfolio'] = $this->Model_portfolio->get_portfolio_data(); $data['portfolio_footer'] = $this->Model_portfolio->get_portfolio_data(); $this->load->view('view_header',$data); $this->load->view('view_home',$data); $this->load->view('view_footer',$data); } public function send_email() { $data['setting'] = $this->Model_common->all_setting(); $error = ''; if(isset($_POST['form_contact'])) { $valid = 1; if($_POST['pest_control'] == 'Pest Control') { $pest_control_status = 'Yes'; } else { $pest_control_status = 'No'; } if($_POST['termite_control'] == 'Termite Control') { $termite_control_status = 'Yes'; } else { $termite_control_status = 'No'; } if($_POST['damage_repair'] == 'Damage Repair') { $damage_repair_status = 'Yes'; } else { $damage_repair_status = 'No'; } $this->form_validation->set_rules('name', 'Name', 'trim|required'); $this->form_validation->set_rules('email', 'Email Address', 'trim|required|valid_email'); $this->form_validation->set_rules('phone', 'Phone Number', 'trim|required'); $this->form_validation->set_rules('city', 'City', 'trim|required'); $this->form_validation->set_error_delimiters('', '<br>'); if($this->form_validation->run() == FALSE) { $valid = 0; $error .= validation_errors(); } if( $pest_control_status == 'No' && $termite_control_status == 'No' && $damage_repair_status == 'No' ) { $valid = 0; $error .= 'You must have to select at least one service.'; } if($valid == 1) { $msg = ' <h3>Visitor Information</h3> <b>Name: </b> '.$_POST['name'].'<br><br> <b>Email: </b> '.$_POST['email'].'<br><br> <b>Phone: </b> '.$_POST['phone'].'<br><br> <b>City: </b> '.$_POST['city'].'<br><br> <b>Pest Control: </b> '.$pest_control_status.'<br><br> <b>Termite Control: </b> '.$termite_control_status.'<br><br> <b>Damage Repair: </b> '.$damage_repair_status.' '; $this->load->library('email'); $this->email->from($data['setting']['website_email']); $this->email->to($data['setting']['receive_email']); $this->email->subject('Contact Form Email'); $this->email->message($msg); $this->email->set_mailtype("html"); $this->email->send(); $success = 'Thank you for sending the email. We will contact with you shortly.'; $this->session->set_flashdata('success',$success); } else { $this->session->set_flashdata('error',$error); } redirect(base_url()); } else { redirect(base_url()); } } }
Simpan