%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 User extends CI_Controller { function __construct(){ parent::__construct(); $this->load->model(array('Home_Model')); $userData = $this->session->userdata('user_data'); if($userData->id==''){ redirect('home'); } } public function index() { $data = array(); $header = array(); $this->load->view('_parts/header'); $this->load->view('dashboard',$data); $this->load->view('_parts/footer'); } /* * Function : deleteprofile * */ public function deleteprofile() { $data = array(); $header = array(); $userData = $this->session->userdata('user_data'); $id= base64_decode($this->input->get('id')); $resp = $this->Home_Model->deleteRecord('tbl_dependant_registration','id', $id); if($resp){ $this->session->set_flashdata('error', 'Record deleted successfully.'); redirect('user/dependants'); } } /* * Function : editprofile * */ public function editprofile() { $data = array(); $header = array(); $userData = $this->session->userdata('user_data'); $data['titleArray'] = $this->Home_Model->getAllRecords('tbl_title_master', $col = ' * ', $condition=null, $order_by = NULL,$limit=NULL, $start=NULL); // State $data['stateArray'] = $this->Home_Model->getAllRecords('tbl_states', $col = ' * ', array('status'=>'1','country_id'=>'74'), $order_by = array('state_name'=>'asc'),$limit=NULL, $start=NULL); // State $header['title'] = 'Add Dependant'; $id= base64_decode($this->input->get('id')); if($_POST){ $this->form_validation->set_rules('full_name','Full Name','required'); $this->form_validation->set_rules('email_id','Email','required'); $this->form_validation->set_rules('mobile_no','Contact No','required'); $this->form_validation->set_rules('gender','Gender','required'); //$this->form_validation->set_rules('dob','Date of birth','required'); if($this->form_validation->run()) { $is_dependant = $_POST['is_dependant']; $title_id = $_POST['title_id']; $full_name = $this->input->post('full_name'); $gender = $this->input->post('gender'); $dob = date('Y-m-d',strtotime($this->input->post('dateofbirth'))); $age = $this->input->post('age');; $contact_number = $this->input->post('mobile_no'); $email_id = $this->input->post('email_id'); $address = $this->input->post('address'); $country_id = $this->input->post('country_id'); $state_id = $this->input->post('state_id'); $pincode = $this->input->post('pincode'); $city_id = $this->input->post('city_id'); $user_id = $userData->id; $data=array( 'user_id'=>$user_id, 'full_name'=>ucwords($full_name), 'contact_number'=>$contact_number, 'is_dependant'=>$is_dependant, 'email_id'=>$email_id, 'aadhar_number'=>$aadhar_number, 'user_id'=>$userData->id, 'title_id'=>$title_id, 'dob'=>$dob, 'age'=>$age, 'email_id'=>$email_id, 'gender'=>$gender, 'address'=>$address, 'state_id'=>$state_id, 'city_id'=>$city_id, 'pincode'=>$pincode, 'country_id'=>$country_id, 'is_deleted'=>'0', 'createdon'=>date('y-m-d H:i:s') ); if($this->input->post('nuser_id')) { $this->Home_Model->updateinfo($tbl_name='tbl_dependant_registration',$data, 'id', $this->input->post('nuser_id')); $this->session->set_flashdata('success', 'Record updated successfully.'); redirect('user/dependants'); } } else { $this->load->view('_parts/header', $header); $this->load->view('edit_profile',$data); $this->load->view('_parts/footer'); } } else { if($id>0){ $_POST = $this->Home_Model->getSingleRecord('tbl_dependant_registration','*', array('id'=>$id)); $data['cityArray'] = $this->Home_Model->getAllRecords('tbl_city', $col = ' * ', array('status'=>'1','state_id'=>$_POST['state_id']), $order_by = array('city_name'=>'asc'),$limit=NULL, $start=NULL); } $this->load->view('_parts/header', $header); $this->load->view('edit_profile',$data); $this->load->view('_parts/footer'); } } public function dependants() { $data = array(); $header = array(); $userData = $this->session->userdata('user_data'); $data['userInfo'] = $userData; $data['userData'] = $this->Home_Model->getAllRecords('tbl_dependant_registration', '*', array('user_id'=>$userData->id)); $header['title'] = 'My Dependant'; $this->load->view('_parts/header', $header); $this->load->view('dependants',$data); $this->load->view('_parts/footer'); } public function viewprofile() { $data = array(); $header = array(); $userData = $this->session->userdata('user_data'); $data['records'] = $records = $this->Home_Model->getSingleRecord('tbl_registrations_otp','*', array('mob'=>$userData->mobile_number)); $titleData = $this->Home_Model->getAllRecords('tbl_title_master', '*', array('status'=>'1') , array('id'=>'ASC')); $data['titleData'] = $this->buildGenderArray($titleData); if($_POST['submit']){ $addParams = array(); $addParams['full_name'] = $_POST['full_name']; $addParams['email_id'] = $_POST['email_id']; $addParams['dob'] = date('Y-m-d',strtotime($_POST['dob'])); $addParams['gender'] = $_POST['gender']; $this->Home_Model->updateinfo($tbl_name='tbl_registrations_otp',$addParams,'id',$userData->id); $this->session->set_flashdata('msg', 'Profile updated successfully.'); redirect('user/viewprofile'); } $header['title'] = 'My Profile'; $this->load->view('_parts/header', $header); $this->load->view('view_profile',$data); $this->load->view('_parts/footer'); } /* * Function : buildGenderArray */ function buildGenderArray($titleData) { $resultsArray = array(); foreach($titleData as $row){ $resultsArray[$row['gender']] = $row['gender']; } return $resultsArray; } public function faq() { $userData = $this->session->userdata('user_data'); $data['recordArray'] = $this->Home_Model->getAllRecords('tbl_faq_master', '*', array('status'=>'1') , array('id'=>'ASC')); $this->load->view('_parts/header', $header); $this->load->view('faq',$data); $this->load->view('_parts/footer'); } public function feedback() { $userData = $this->session->userdata('user_data'); if($_POST['submit']){ $addParams = array(); $addParams['full_name'] = $_POST['full_name']; $addParams['email_id'] = $_POST['email_id']; $addParams['contact_no'] = $_POST['contact_no']; $addParams['remarks'] = $_POST['message']; $addParams['type'] = 'Feedback'; //$addParams['ip_address'] = get_client_ip(); $this->Home_Model->saveinfo($tbl_name='tbl_feedback',$addParams); $this->session->set_flashdata('msg', 'Feedback send successfully.'); redirect('user/feedback'); } $header['title'] = 'Feedback'; $this->load->view('_parts/header', $header); $this->load->view('feedback',$data); $this->load->view('_parts/footer'); // } } public function help() { $userData = $this->session->userdata('user_data'); if($_POST['submit']){ $addParams = array(); $addParams['full_name'] = $_POST['full_name']; $addParams['email_id'] = $_POST['email_id']; $addParams['contact_no'] = $_POST['contact_no']; $addParams['remarks'] = $_POST['message']; $addParams['type'] = 'Get In Touch'; //$addParams['ip_address'] = get_client_ip(); $this->Home_Model->saveinfo($tbl_name='tbl_feedback',$addParams); $this->session->set_flashdata('msg', 'Your query saved successfully.'); redirect('user/help'); } $this->load->view('_parts/header', $header); $this->load->view('help',$data); $this->load->view('_parts/footer'); // } } /* * Function : addnewprofile */ public function addnewprofile() { $data = array(); $header = array(); $userData = $this->session->userdata('user_data'); $data['titleArray'] = $this->Home_Model->getAllRecords('tbl_title_master', $col = ' * ', $condition=null, $order_by = NULL,$limit=NULL, $start=NULL); // State $data['stateArray'] = $this->Home_Model->getAllRecords('tbl_states', $col = ' * ', array('status'=>'1','country_id'=>'74'), $order_by = array('state_name'=>'asc'),$limit=NULL, $start=NULL); // State $data['cityArray'] = ''; $header['title'] = 'Add Dependant'; // Get Documents List if($_POST){ $this->form_validation->set_rules('full_name','Full Name','required'); $this->form_validation->set_rules('gender','Gender','required'); if($this->form_validation->run()) { $title_id = $_POST['title_id']; $full_name = $this->input->post('full_name'); $gender = $this->input->post('gender'); $dob = date('Y-m-d',strtotime($this->input->post('dateofbirth'))); $age = $this->input->post('age');; $contact_number = $this->input->post('mobile_no'); $email_id = $this->input->post('email_id'); $address = $this->input->post('address'); $country_id = $this->input->post('country_id'); $state_id = $this->input->post('state_id'); $pincode = $this->input->post('pincode'); $city_id = $this->input->post('city_id'); $is_dependant = $this->input->post('is_dependant'); $user_id = $userData->id; $data=array( 'user_id'=>$user_id, 'full_name'=>ucwords($full_name), 'contact_number'=>$contact_number, 'is_dependant'=>$is_dependant, 'email_id'=>$email_id, 'aadhar_number'=>$aadhar_number, 'user_id'=>$userData->id, 'title_id'=>$title_id, 'dob'=>$dob, 'age'=>$age, 'email_id'=>$email_id, 'gender'=>$gender, 'address'=>$address, 'state_id'=>$state_id, 'city_id'=>$city_id, 'pincode'=>$pincode, 'country_id'=>$country_id, 'is_deleted'=>'0', 'is_dependant'=>'1', 'createdon'=>date('y-m-d H:i:s') ); $this->Home_Model->saveinfo($tbl_name='tbl_dependant_registration',$data); $this->session->set_flashdata('success', 'Dependant added successfully.'); redirect('user/dependants'); } else { $this->session->set_flashdata('error', 'Validation error.'); $this->load->view('_parts/header'); $this->load->view('add_new_profile',$data); $this->load->view('_parts/footer'); } } else { $recored = $this->Home_Model->getSingleRecord('tbl_dependant_registration','*',array('user_id'=>$userData->id)); $this->load->view('_parts/header', $header); $this->load->view('add_new_profile',$data); $this->load->view('_parts/footer'); } } /* * Function : profile */ public function profile() { $data = array(); $header = array(); $userData = $this->session->userdata('user_data'); $header['title'] = 'Provide Your Details for COVID 19 Vaccination'; // Get Documents List $data['proofArray'] = $this->Home_Model->getAllRecords('tbl_documents_master', '*', array('status'=>'1') , array('display_order'=>'ASC')); $data['idproofArray'] = $this->Home_Model->getAllRecords('tbl_documents_master', '*', array('status'=>'0') , array('display_order'=>'ASC')); $data['companyArray'] = $this->Home_Model->getAllRecords('tbl_company_master', '*', array('status'=>'1') , array('display_order'=>'ASC')); if($_POST){ if($_POST['vaccination_type']=='2') { $this->form_validation->set_rules('company_name','Company Name','required'); $this->form_validation->set_rules('other_id_proof','ID Proof','required'); } else { $this->form_validation->set_rules('id_proof','ID Proof','required'); } $this->form_validation->set_rules('aadhar_number','Aadhar Number','required'); $this->form_validation->set_rules('full_name','Full Name','required'); $this->form_validation->set_rules('gender','Gender','required'); $this->form_validation->set_rules('dob','Date of birth','required'); if($this->form_validation->run()) { $account_type = '1'; $company_name = $this->input->post('company_name'); $vaccination_type = $this->input->post('vaccination_type'); if($vaccination_type=='2') { $id_proof = $this->input->post('other_id_proof'); } else { $id_proof = $this->input->post('id_proof'); } $photo_proof = $this->uploadDocuments(); $aadhar_number = $this->input->post('aadhar_number'); $full_name = $this->input->post('full_name'); $email_id = $this->input->post('email_id'); $address = $this->input->post('address'); $gender = $this->input->post('gender'); $dob = date('Y-m-d',strtotime($this->input->post('dob'))); //getAge($this->input->post('dob')); $age = getAge($dob); $onsite_collection = $this->input->post('onsite_collection'); $data=array( 'vaccination_type'=>$vaccination_type, 'company_name'=>$company_name, 'account_type'=>$account_type, 'id_proof'=>$id_proof, 'aadhar_number'=>$aadhar_number, 'user_id'=>$userData->id, 'dob'=>$dob, 'contact_number'=>$userData->mob, 'email_id'=>$email_id, 'address'=>$address, 'status'=>'3', 'age'=>$age, 'full_name'=>ucwords($full_name), 'photo_proof'=>$photo_proof, 'gender'=>$gender, 'onsite_collection'=>$onsite_collection, 'is_deleted'=>'0', 'createdon'=>date('y-m-d H:i:s') ); $this->Home_Model->saveinfo($tbl_name='tbl_user_registration',$data); redirect('dashboard'); } else { $this->load->view('_parts/header'); $this->load->view('my_profile',$data); $this->load->view('_parts/footer'); } } else { $recored = $this->Home_Model->getSingleRecord('tbl_user_registration','*',array('user_id'=>$userData->id)); if($recored['user_id']>0){ $this->session->set_flashdata('success', 'Welcome to dashboard.'); if($recored['account_type']=='2') { redirect('companydashboard'); } else { redirect('dashboard'); } } $this->load->view('_parts/header', $header); $this->load->view('my_profile',$data); $this->load->view('_parts/footer'); } } /* * Function : bulkupload * Description : Upload the user Documents */ public function bulkupload(){ $data = array(); $header = array(); $userData = $this->session->userdata('user_data'); $header['title'] = 'Bulk Upload for Company COVID 19 Vaccination'; $this->load->view('_parts/header', $header); $this->load->view('company-upload',$data); $this->load->view('_parts/footer'); } /* * Function : uploadDocuments * Description : Upload the user Documents */ private function uploadDocuments() { $config['upload_path'] = './attachments/documents/'; $config['allowed_types'] = 'gif|jpg|png|jpeg|JPG|PNG|JPEG|PDF|pdf|SVG|svg|avi|mp4|3gp|mpeg|mpg|mov|mp3|flv|wmv'; $this->load->library('upload', $config); $this->upload->initialize($config); if (!$this->upload->do_upload('photo_proof')) { log_message('error', 'Image Upload Error: ' . $this->upload->display_errors()); } $img = $this->upload->data(); return $img['file_name']; } // level functions end function importdata() { $data = array(); $logged_in = $this->session->userdata('user_data'); $profile_data = $this->session->userdata('profile_data'); $this->load->helper('xlsimport/php-excel-reader/excel_reader2'); $this->load->helper('xlsimport/spreadsheetreader.php'); if(isset($_FILES['xlsfile'])){ $targets = 'attachments/xls/'; $targets = $targets . basename( $_FILES['xlsfile']['name']); $docadd=($_FILES['xlsfile']['name']); if(move_uploaded_file($_FILES['xlsfile']['tmp_name'], $targets)){ $Filepath = $targets; $allxlsdata = array(); date_default_timezone_set('UTC'); $StartMem = memory_get_usage(); //echo '---------------------------------'.PHP_EOL; //echo 'Starting memory: '.$StartMem.PHP_EOL; //echo '---------------------------------'.PHP_EOL; try { $Spreadsheet = new SpreadsheetReader($Filepath); $BaseMem = memory_get_usage(); $Sheets = $Spreadsheet -> Sheets(); //echo '---------------------------------'.PHP_EOL; //echo 'Spreadsheets:'.PHP_EOL; //print_r($Sheets); //echo '---------------------------------'.PHP_EOL; //echo '---------------------------------'.PHP_EOL; foreach ($Sheets as $Index => $Name) { //echo '---------------------------------'.PHP_EOL; //echo '*** Sheet '.$Name.' ***'.PHP_EOL; //echo '---------------------------------'.PHP_EOL; $Time = microtime(true); $Spreadsheet -> ChangeSheet($Index); foreach ($Spreadsheet as $Key => $Row) { //echo $Key.': '; if ($Row) { //print_r($Row); //$Row['11'] = $logged_in['uid']; $allxlsdata[] = $Row; } else { var_dump($Row); } $CurrentMem = memory_get_usage(); //echo 'Memory: '.($CurrentMem - $BaseMem).' current, '.$CurrentMem.' base'.PHP_EOL; //echo '---------------------------------'.PHP_EOL; if ($Key && ($Key % 500 == 0)) { //echo '---------------------------------'.PHP_EOL; //echo 'Time: '.(microtime(true) - $Time); //echo '---------------------------------'.PHP_EOL; } } // echo PHP_EOL.'---------------------------------'.PHP_EOL; //echo 'Time: '.(microtime(true) - $Time); //echo PHP_EOL; //echo '---------------------------------'.PHP_EOL; //echo '*** End of sheet '.$Name.' ***'.PHP_EOL; //echo '---------------------------------'.PHP_EOL; } } catch (Exception $E) { echo $E -> getMessage(); } $this->Home_Model->import_user($allxlsdata, $profile_data); } } else{ echo "Error: " . $_FILES["file"]["error"]; } $this->session->set_flashdata('success', 'Bulk data added successfully.'); //setHistory('Go to import user module'); redirect('companydashboard'); } }