%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class ayusharda2025 extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('Common_Model'); } public function index(){ $this->load->view('cme'); } public function registration_form() { $full_names = []; $dobs = []; $genders = []; $emails = []; $mobile_nos = []; $cities = []; $employee_ids = []; $id_card_nos = []; $pictures = []; $uploaded_aadhar = []; $registration_type = $this->input->post('registration_type'); for ($i = 1; $i <= $registration_type; $i++) { $suffix = ($i == 1 ? '' : '_' . $i); $full_names[] = $this->input->post('full_name' . $suffix); $dobs[] = $this->input->post('dob' . $suffix); $genders[] = $this->input->post('gender' . $suffix); $emails[] = $this->input->post('email' . $suffix); $mobile_nos[] = $this->input->post('mobile_no' . $suffix); $cities[] = $this->input->post('city' . $suffix); $employee_ids[] = $this->input->post('employee_id' . $suffix); $id_card_nos[] = $this->input->post('id_card_no' . $suffix); $pictures[] = $this->uploadImage("picture" . $suffix); $uploaded_aadhar[] = $this->uploadImage("upload_aadhar_card" . $suffix); } // Load form validation $this->load->library('form_validation'); $this->form_validation->set_rules('ticket_category', 'Ticket Category', 'required|trim'); $this->form_validation->set_rules('transaction_id', 'Transaction Id', 'required|trim'); $this->form_validation->set_rules('additional_information', 'Additional Information', 'required|trim'); if ($this->form_validation->run() == true) { $formarray = array( 'ticket_category' => $this->input->post('ticket_category'), 'registration_type' => $this->input->post('registration_type'), 'full_name' => implode(',', $full_names), 'dob' => implode(',', $dobs), 'gender' => implode(',', $genders), 'email' => implode(',', $emails), 'mobile_no' => implode(',', $mobile_nos), 'city' => implode(',', $cities), 'employee_id' => implode(',', $employee_ids), 'id_card_no' => implode(',', $id_card_nos), 'picture' => implode(',', $pictures), 'aadhar_card' => implode(',', $uploaded_aadhar), 'transaction_id' => $this->input->post('transaction_id'), 'calculated_amount' => $this->input->post('calculated_amount'), 'additional_information' => $this->input->post('additional_information'), 'status' => '1', 'created_at' => date('Y-m-d H:i:s') ); $formarray['id_proof_img'] = $this->uploadImage(); // echo '<pre>'; print_r($formarray); die; $inserted_data = $this->Common_Model->saveinfo('cme_registration', $formarray); if ($inserted_data > 0) { $subject = "Registration Confirmed – National Conference on Ayushman Bharat (PMJAY)"; $mailmessage = "<p>Thank you for registering for the <b> National Conference Cum Advanced Workshop on Implementation of Ayushman Bharat – PMJAY Scheme in Hospitals.</b></p>"; foreach (array_filter($emails) as $email) { $this->sendMail($email, $subject, $mailmessage); } $this->session->set_flashdata('submit_status_msg', '<span style="color:green;font-size:12px;">Your CME registration has been submitted successfully.</span>'); redirect('ayusharda-2025/registration-form'); } else { $this->session->set_flashdata('submit_status_msg', '<span style="color:red;font-size:12px;">Failed to submit your CME registration. Please try again.</span>'); $this->load->view('registration_form'); } } else { $this->load->view('registration_form'); } } public function uploadImage($fieldName = 'id_proof_img') { // echo '<pre>'; print_r($_FILES[$fieldName]['name']); die; if (empty($_FILES[$fieldName]['name'])) { return null; // no file uploaded } $config['upload_path'] = 'assests/imgs/'; $config['allowed_types'] = "*"; $this->load->library('upload', $config); $this->upload->initialize($config); if (!$this->upload->do_upload($fieldName)) { echo '<pre>'; print_r($this->upload->display_errors()); die; log_message('error', 'Image Upload Error (' . $fieldName . '): ' . $this->upload->display_errors()); return null; } $img = $this->upload->data(); // echo '<pre>'; print_r($img); die; return $img['file_name']; // $config['upload_path'] = 'assests/imgs/'; // $config['allowed_types'] = "*"; // $this->load->library('upload', $config); // $this->upload->initialize($config); // if (!$this->upload->do_upload('id_proof_img')) { // log_message('error', 'Image Upload Error: ' . $this->upload->display_errors()); // } // $img = $this->upload->data(); // return $img['file_name']; } // Send Mail public function sendMail($to, $subject, $mailmessage) { $config = array( 'protocol' => 'smtp', 'smtp_host' => 'smtp.gmail.com', 'smtp_port' => 587, 'smtp_user' => 'rwamarketing@sharda.ac.in', 'smtp_pass' => 'uieu aafm nbgr bvma', 'mailtype' => 'html', 'charset' => 'utf-8', 'wordwrap' => TRUE, 'smtp_crypto' => 'tls', 'newline' => "\r\n" ); $this->load->library('email', $config); $this->email->initialize($config); $this->email->from('rwamarketing@sharda.ac.in', 'CME Registration'); $this->email->to(trim($to)); $this->email->subject($subject); $this->email->message($mailmessage); $template_path = FCPATH . 'application/views/email_templates/v_email.php'; if (file_exists($template_path)) { ob_start(); $content = $mailmessage; include $template_path; $message = ob_get_clean(); } else { $message = "<p style='color:red;'>Error: Email template not found.</p>"; } $this->email->message($message); if (!$this->email->send()) { log_message('error', 'Email failed: ' . print_r($this->email->print_debugger(['headers']), true)); } } }