%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 class Front extends MY_Controller { function __construct() { parent::__construct(); $this->load->model("front_model", "front"); } function sent_otp(){ $inf=array('success'=>'F', 'msg'=>'Error!'); $post=trim_array($this->input->post()); $qs=trim_array($this->input->get()); $post['lpage_id']=(int)$this->db->get_where("landing_pages", array('trimed_title'=>$post['lpage']))->row()->id; if(!$post['lpage_id']){ //$inf['msg']="Invalid landing page"; $this->json_data($inf); } $this->form_validation->set_rules('name', 'Name', "required|callback_valid_name", $this->req); $this->form_validation->set_rules('email', 'Email', "required|valid_email|is_unique[applicants.email]", $this->req); $this->form_validation->set_rules('state_id', 'State', "required", $this->req); $this->form_validation->set_rules('city_id', 'City', "required", $this->req); $this->form_validation->set_rules('program_id', 'Program', "required", $this->req); if($post['program_id']<>'8') { $this->form_validation->set_rules('appointment_date', 'Appointment Date', "required|callback_valid_date", $this->req); $this->form_validation->set_rules('appointment_time', 'Appointment Time', "required", $this->req); } $this->form_validation->set_rules('mob', 'Mobile', "required|integer|exact_length[10]|is_unique[applicants.mob]", $this->req); if($this->form_validation->run() == FALSE){ $inf['errors']=$this->form_validation->get_errors(); $inf['msg']=reset($inf['errors']); }else{ if($post['program_id']=='8') { $data=filter_value(array_merge($post, $qs), array('id', 'lpage_id', 'name', 'email', 'state_id', 'city_id', 'program_id', 'mob', 'utm_source', 'utm_campaign', 'utm_medium', 'utm_term', 'utm_content', 'utm_keyword', 'utm_placement')); } else { $post['appointment_datetime'] = date('Y-m-d',strtotime($post['appointment_date'])).' '.date('H:i:s', strtotime($post['appointment_time'])); if(strtotime($post['appointment_datetime'])<time()){ $inf['msg']="Preferred Date/Time must be in future"; $this->json_data($inf); } $data=filter_value(array_merge($post, $qs), array('id', 'lpage_id', 'name', 'email', 'state_id', 'city_id', 'program_id', 'mob', 'utm_source', 'utm_campaign', 'utm_medium', 'utm_term', 'utm_content', 'utm_keyword', 'utm_placement', 'appointment_datetime')); } if($data['city_id']){ $data['city']=$this->db->select("title")->get_where("master_cities", ['id'=>$data['city_id']])->row()->title; if(!$data['city']){ $data['city']=''; } } $this->front->tmp_register($data); $otp=$this->front->sent_otp($post['mob'], $post['email']); $inf['encOtpMob']=encrypt_password($otp['otp'].$post['mob']); $inf['encOtpEmail']=encrypt_password($otp['emailOtp'].$post['email']); $inf['success']='T'; $inf['msg']='OTP sent successfully'; } $this->json_data($inf); } function uploadDocuments() { $config['upload_path'] = '/var/www/html/shardahospital.org/international/generic/attachments/'; $config['allowed_types'] = 'gif|jpg|png|jpeg|JPG|PNG|JPEG|PDF|pdf|SVG|doc'; $this->load->library('upload', $config); $this->upload->initialize($config); if (!$this->upload->do_upload('document_attachments')) { //print_r($this->upload->display_errors()); die; } $img = $this->upload->data(); echo $img['file_name']; } // International OTP function sent_emailotp(){ $inf=array('success'=>'F', 'msg'=>'Error!'); $post=trim_array($this->input->post()); $qs=trim_array($this->input->get()); $post['lpage_id']=(int)$this->db->get_where("landing_pages", array('trimed_title'=>$post['lpage']))->row()->id; #if(!$post['lpage_id']){ //$inf['msg']="Invalid landing page"; $this->json_data($inf); #} $this->form_validation->set_rules('name', 'Name', "required|callback_valid_name", $this->req); $this->form_validation->set_rules('email', 'Email', "required|valid_email|is_unique[international_applicants.email]", $this->req); $this->form_validation->set_rules('country', 'Country', "required", $this->req); $this->form_validation->set_rules('enquire_for', 'Enquire For', "required", $this->req); $this->form_validation->set_rules('query', 'Health Query', "required", $this->req); $this->form_validation->set_rules('mob', 'Mobile', "required|integer|exact_length[10]|is_unique[international_applicants.mob]", $this->req); if($this->form_validation->run() == FALSE){ $inf['errors']=$this->form_validation->get_errors(); $inf['msg']=reset($inf['errors']); }else{ $data=filter_value(array_merge($post, $qs), array('id', 'lpage_id', 'name', 'email', 'country', 'enquire_for','query','file_attachments', 'mob', 'utm_source', 'utm_campaign', 'utm_medium', 'utm_term', 'utm_content', 'utm_keyword', 'utm_placement', 'appointment_datetime')); $this->front->tmp_international_register($data); $otp=$this->front->sent_intotp($post['email']); $inf['encOtpEmail']=encrypt_password($otp['emailOtp'].$post['email']); $inf['success']='T'; $inf['msg']='OTP sent successfully'; } $this->json_data($inf); } function register(){ $inf=array('success'=>'F', 'msg'=>'Error!'); $post=trim_array($this->input->post()); $qs=trim_array($this->input->get()); $post['lpage_id']=(int)$this->db->get_where("landing_pages", array('trimed_title'=>$post['lpage']))->row()->id; if(!$post['lpage_id']){ //$inf['msg']="Invalid landing page"; $this->json_data($inf); } $data=filter_value(array_merge($post, $qs), array('id', 'lpage_id', 'name', 'email', 'state_id', 'city_id', 'program_id', 'mob', 'utm_source', 'utm_campaign', 'utm_medium', 'utm_term', 'utm_content', 'utm_keyword', 'utm_placement', 'appointment_date', 'appointment_time')); if($post['program_id']=='8') { $data=filter_value(array_merge($post, $qs), array('id', 'lpage_id', 'name', 'email', 'state_id', 'city_id', 'program_id', 'mob', 'utm_source', 'utm_campaign', 'utm_medium', 'utm_term', 'utm_content', 'utm_keyword', 'utm_placement')); } if(!$data['utm_source']){ $nautmid=$this->db->select("na_utm_source_id")->get_where("landing_pages", ['id'=>$data['lpage_id']])->row()->na_utm_source_id; $utmsrc=$this->db->select("title")->get_where("master_utm_sources", ['id'=>$nautmid])->row()->title; $data['utm_source']=$utmsrc?$utmsrc:"Google_Direct_LP"; //Google_Direct } $this->form_validation->set_rules('name', 'Name', "required|callback_valid_name", $this->req); $this->form_validation->set_rules('email', 'Email', "required|valid_email|is_unique[applicants.email]", $this->req); $this->form_validation->set_rules('state_id', 'State', "required", $this->req); $this->form_validation->set_rules('city_id', 'City', "required", $this->req); $this->form_validation->set_rules('program_id', 'Program', "required", $this->req); $this->form_validation->set_rules('mob', 'Mobile', "required|integer|exact_length[10]|is_unique[applicants.mob]", $this->req); $this->form_validation->set_rules('otp', 'OTP', "required", $this->req); if($post['program_id']<>'8') { $this->form_validation->set_rules('appointment_date', 'Appointment Date', "required", $this->req); $this->form_validation->set_rules('appointment_time', 'Appointment Time', "required", $this->req); } if(@$this->form_validation->run() == FALSE){ $inf['errors']=$this->form_validation->get_errors(); $inf['msg']=reset($inf['errors']); }else{ $otpChk=false; if(encrypt_password($post['otp'].$post['mob'])==$post['encOtpMob'] || $post['otp']=='SAT232524'){ $data['verified_by']='MOB'; $otpChk=true; } if(encrypt_password($post['otp'].$post['email'])==$post['encOtpEmail']){ $data['verified_by']='EMAIL'; $otpChk=true; } if(!$otpChk){ $inf['msg']="Invalid OTP"; $this->json_data($inf); } if($post['program_id']<>'8') { $data['appointment_datetime'] = date('Y-m-d',strtotime($data['appointment_date'])).' '.date('H:i:s', strtotime($data['appointment_time'])); if(strtotime($data['appointment_datetime'])<time()){ $inf['msg']="Preferred Date/Time must be in future"; $this->json_data($inf); } } if($data['city_id']){ $data['city']=$this->db->select("title")->get_where("master_cities", ['id'=>$data['city_id']])->row()->title; if(!$data['city']){ $data['city']=''; } } if($id=$this->front->register($data)){ $this->front->sendSystemIdGenMsg($id); $lpageArray = array('9','13','14'); // Skip the Covid, Hospital and Internation Lpage $inf['key'] = ''; if(!in_array($post['lpage_id'], $lpageArray)){ $inf['key']=base64_encode($id); } $inf['success']='T'; $inf['msg']='Registered successfully'; } } $this->json_data($inf); } /* ** *** */ function internationalregister(){ $inf=array('success'=>'F', 'msg'=>'Error!'); $post=trim_array($this->input->post()); $qs=trim_array($this->input->get()); $post['lpage_id']=(int)$this->db->get_where("landing_pages", array('trimed_title'=>$post['lpage']))->row()->id; if(!$post['lpage_id']){ //$inf['msg']="Invalid landing page"; $this->json_data($inf); } $data=filter_value(array_merge($post, $qs), array('id', 'lpage_id', 'name', 'email', 'country','file_attachments', 'enquire_for','query', 'mob', 'utm_source', 'utm_campaign', 'utm_medium', 'utm_term', 'utm_content', 'utm_keyword', 'utm_placement', 'appointment_datetime')); if(!$data['utm_source']){ $nautmid=$this->db->select("na_utm_source_id")->get_where("landing_pages", ['id'=>$data['lpage_id']])->row()->na_utm_source_id; $utmsrc=$this->db->select("title")->get_where("master_utm_sources", ['id'=>$nautmid])->row()->title; $data['utm_source']=$utmsrc?$utmsrc:"Google_Direct_LP"; //Google_Direct } $this->form_validation->set_rules('name', 'Name', "required|callback_valid_name", $this->req); $this->form_validation->set_rules('email', 'Email', "required|valid_email|is_unique[international_applicants.email]", $this->req); $this->form_validation->set_rules('country', 'Country', "required", $this->req); $this->form_validation->set_rules('enquire_for', 'Enquire For', "required", $this->req); $this->form_validation->set_rules('query', 'Health Query', "required", $this->req); $this->form_validation->set_rules('mob', 'Mobile', "required|integer|exact_length[10]|is_unique[international_applicants.mob]", $this->req); $this->form_validation->set_rules('otp', 'OTP', "required", $this->req); if(@$this->form_validation->run() == FALSE){ $inf['errors']=$this->form_validation->get_errors(); $inf['msg']=reset($inf['errors']); }else{ $otpChk=false; if(encrypt_password($post['otp'].$post['email'])==$post['encOtpEmail']){ $data['verified_by']='EMAIL'; $otpChk=true; } if(!$otpChk){ $inf['msg']="Invalid OTP"; $this->json_data($inf); } if($id=$this->front->internationalregister($data)){ //$this->front->sendSystemIdGenMsg($id); $inf['success']='T'; $inf['msg']='Registered successfully'; } } $this->json_data($inf); } function init(){ $qs=trim_array($this->input->post()); $data['states'] = $this->front->states(); $data['cities']=$this->front->cities(); $data['programs']=$this->front->programs($qs['lpage']); $data['def_prg_id']=$this->front->def_prg_id($qs['lpage']); $data['appointment_times']=appointment_times(); $this->json_data($data); } /** */ function gaCodeHead(){ echo $this->db->get_where("master_data", array('datakey'=>'gacode_head'))->row()->datavalue;; } function gaCodeBody(){ echo $this->db->get_where("master_data", array('datakey'=>'gacode_body'))->row()->datavalue; } } //EOF