Server IP : 192.185.129.71 / Your IP : 3.16.147.87 Web Server : Apache System : Linux bh-ht-3.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : svymadmin ( 4072) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home4/svymadmin/public_html/site/controllers/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Medical_electives extends CI_Controller { function __construct() { parent::__construct(); $this->load->library('session'); $this->load->database(); $this->load->helper(array('form', 'url')); $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); $this->output->set_header('Pragma: no-cache'); } public function index() { $this->load->helper('url'); $this->load->view('medical_electives_v'); } public function volunteer_form(){ $this->load->view('medical_volunteer_form'); } public function apply(){ $data["name"] = $this->input->post("v_name"); $data["age"] = $this->input->post("v_age"); $data["gender"] = $this->input->post("v_gender"); $data["nationality"] = $this->input->post("v_nationality"); $data["current_address"] = $this->input->post("v_caddress"); $data["c_phone_number"] = $this->input->post("v_phone"); $data["permanent_address"] = $this->input->post("v_paddress"); $data["p_phone_number"] = $this->input->post("v_pphone"); $data["marital"] = $this->input->post("v_martial"); $data["email"] = $this->input->post("v_mail"); //$data["education"] = $this->input->post("v_education"); $data["passport_num"] = $this->input->post("v_pass"); $data["issued_place"] = $this->input->post("v_issued"); $data["visa_num"] = $this->input->post("v_visa_no"); $data["visa_type"] = $this->input->post("v_visa_type"); $data["visa_validity"] = $this->input->post("v_visa_validate"); $data["college"] = $this->input->post("v_college"); $data["location"] = $this->input->post("v_locations"); $data["country"] = $this->input->post("v_country"); $data["years"] = $this->input->post("v_years"); $data["subjects"] = $this->input->post("v_subjects"); $data["date_arrival"] = $this->input->post("v_arrival"); $data["date_departure"] = $this->input->post("v_departure"); $data["applied_year"] = $this->input->post("v_myapp"); $data["know_svym"] = (($this->input->post("know"))!="")? $this->input->post("know") : ""; $data["other_source"] = (($this->input->post("v_othersrc"))!="")? $this->input->post("v_othersrc") : ""; $data["expectations"] =$this->input->post("v_expect"); $data["to_speak"] = $this->input->post("v_speak"); $data["to_read"] = $this->input->post("v_read"); $data["to_write"] = $this->input->post("v_write"); $data["interest"] = $this->input->post("v_intrest"); $data["medication"] = $this->input->post("v_medication"); $data["name_m"] = (($this->input->post("v_name_medication"))!="")? $this->input->post("v_name_medication") : ""; $data["reason_m"] = (($this->input->post("v_reason_medication"))!="")? $this->input->post("v_reason_medication") : ""; $data["since"] = (($this->input->post("v_since_medication"))!="")? $this->input->post("v_since_medication") : ""; $data["logn_term"] = (($this->input->post("v_long_term"))!="")? $this->input->post("v_long_term") : ""; $data["physical_limitation"] = $this->input->post("v_physical"); $data["p_details"] = (($this->input->post("v_physical_details"))!="")? $this->input->post("v_physical_details") : ""; $data["c_name"] = (($this->input->post("v_e_name"))!="")? $this->input->post("v_e_name") : ""; $data["c_phone"] = (($this->input->post("v_e_phone"))!="")? $this->input->post("v_e_phone") : ""; $data["in_group"] = $this->input->post("v_grp"); $data["long_association"] = $this->input->post("v_asso"); $data["resume"] = (isset($_FILES['v_curriculum']))? "yes" : "no"; $data["stmt_porpose"] = (isset($_FILES['v_stmt_prps']))? "yes" : "no"; $data["refer1"] = (isset($_FILES['v_refer_1']))? "yes" : "no"; $data["refer2"] = (isset($_FILES['v_refer_2']))? "yes" : "no"; //$data["expections"] =(($this->input->post("v_expetations"))!="")? $this->input->post("v_expetations") : ""; $data["date_applied"]= date("Y-m-d"); if($this->db->insert('medical_elective_tb', $data)){ $v_id = $this->db->insert_id(); if (!is_dir('./uploads/medical/'.$v_id)) { mkdir('./uploads/medical/'.$v_id); } $path='./uploads/medical/'.$v_id."/"; $name = $_FILES["v_curriculum"]["name"]; $ext = pathinfo($_FILES['v_curriculum']['name'], PATHINFO_EXTENSION); $config['file_name'] = "curriculum.".$ext; move_uploaded_file($_FILES['v_curriculum']['tmp_name'], $path.$config['file_name'] ); $name = $_FILES["v_stmt_prps"]["name"]; $ext = pathinfo($_FILES['v_stmt_prps']['name'], PATHINFO_EXTENSION); $config['file_name'] = "stmt_prps.".$ext; move_uploaded_file($_FILES['v_stmt_prps']['tmp_name'], $path.$config['file_name'] ); $name = $_FILES["v_refer_1"]["name"]; $ext = pathinfo($_FILES['v_refer_1']['name'], PATHINFO_EXTENSION); $config['file_name'] = "refer1.".$ext; move_uploaded_file($_FILES['v_refer_1']['tmp_name'], $path.$config['file_name'] ); $name = $_FILES["v_refer_2"]["name"]; $ext = pathinfo($_FILES['v_refer_2']['name'], PATHINFO_EXTENSION); $config['file_name'] = "refer1.".$ext; move_uploaded_file($_FILES['v_refer_2']['tmp_name'], $path.$config['file_name'] ); /* $name = $_FILES["v_curriculum"]["name"]; $ext = pathinfo($_FILES['v_curriculum']['name'], PATHINFO_EXTENSION); $config['file_name'] = "curriculum.".$ext; $config['upload_path'] = $path; $config['allowed_types'] = 'pdf|doc|docx'; $config['max_size'] = 2048*5; $this->upload->initialize($config); if($this->upload->do_upload("v_curriculum")){ echo $this->upload->display_errors(); exit(); } //exit; $name = $_FILES["v_stmt_prps"]["name"]; $ext = pathinfo($_FILES['v_stmt_prps']['name'], PATHINFO_EXTENSION); $config['file_name'] = "stmt_prps.".$ext; $config['upload_path'] = $path; $config['allowed_types'] = 'pdf|doc|docx|PDF|DOC|DOCX'; $config['max_size'] = 0; $this->upload->initialize($config); if(!$this->upload->do_upload("v_stmt_prps")){ echo $this->upload->display_errors(); exit(); } $name = $_FILES["v_refer_1"]["name"]; $ext = pathinfo($_FILES['v_refer_1']['name'], PATHINFO_EXTENSION); $config['file_name'] = "refer1.".$ext; $config['upload_path'] = $path; $config['allowed_types'] = 'pdf|doc|docx|PDF|DOC|DOCX'; $config['max_size'] = 0; $this->upload->initialize($config); if(!$this->upload->do_upload("v_refer_1")){ echo $this->upload->display_errors(); exit(); } $name = $_FILES["v_refer_2"]["name"]; $ext = pathinfo($_FILES['v_refer_2']['name'], PATHINFO_EXTENSION); $config['file_name'] = "refer2.".$ext; $config['upload_path'] = $path; $config['allowed_types'] = 'pdf|doc|docx|PDF|DOC|DOCX'; $config['max_size'] = 0; $this->upload->initialize($config); if(!$this->upload->do_upload("v_refer_2")){ echo $this->upload->display_errors(); exit(); } */ $this->load->library('email'); $fromemail="info@svym.org"; $toemail = $data["email"]; $subject = "Medical Elective"; $data['data']="Thank you for submitting your application. We will process your application and get back to you soon."; $mesg = $this->load->view('templates/applied',$data,true); $config=array( 'charset'=>'utf-8', 'wordwrap'=> TRUE, 'mailtype' => 'html' ); $this->email->initialize($config); $this->email->to($toemail); $this->email->from($fromemail, "SVYM"); $this->email->subject($subject); $this->email->message($mesg); $mail = $this->email->send(); redirect(base_url() . 'medical_electives/status/success', 'refresh'); }else{ redirect(base_url() . 'medical_electives/status', 'refresh'); } redirect(base_url() . 'medical_electives', 'refresh'); } function status($param=""){ $pagedata['status']=$param; $this->load->view('application_success', $pagedata); } }