From 1455f95360ccb55e6c86b9e669367f5bdfc341a2 Mon Sep 17 00:00:00 2001 From: velz Date: Thu, 27 Sep 2018 15:07:32 +0530 Subject: [PATCH] QUES MAS CHANGED6 --- api/application/config/constants.php | 2 +- api/application/controllers/PD_Controller.php | 7 +++-- .../Question_Management_Controller.php | 2 +- api/application/libraries/AWS_SES.php | 28 +++++++++-------- api/application/models/PD_Model.php | 30 +++++++++---------- .../models/Question_Management_Model.php | 16 +++++----- 6 files changed, 45 insertions(+), 40 deletions(-) diff --git a/api/application/config/constants.php b/api/application/config/constants.php index b102ae51..d6b0dad2 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -86,7 +86,7 @@ defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest auto // define login route name for token verification //defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listLessPDDetails/:any)'); // no errors -defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listAllQuestions/:any)'); // no errors +defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'triggerNewPD'); // no errors /*********************AWS resources Constants*************************************************/ defined('PROFILE_PICTURE_BUCKET_NAME') OR define('PROFILE_PICTURE_BUCKET_NAME','sineedgedevprofilepic'); diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 169fbb62..7f4061e6 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -172,9 +172,10 @@ class PD_Controller extends REST_Controller { /********For Save New PD while Trigger****/ public function triggerNewPD_post() { - // echo "TRIGGER"; - // //$this->aws_ses->verifyEmailAddress('velmurugan.s@venbainfotech.com'); - // die(); + echo "TRIGGER"; + //$this->aws_ses->verifyEmailIdentity('raro@spindl-e.com'); + //$this->aws_ses->sendMail('raro@spindl-e.com'); + die(); $pd_details = json_decode($this->post('pd_details'),true); $pd_applicant_details = json_decode($this->post('pd_applicant_details'),true); $pd_document_titles = json_decode($this->post('pd_document_titles'),true); diff --git a/api/application/controllers/Question_Management_Controller.php b/api/application/controllers/Question_Management_Controller.php index 64a493be..9ffdab80 100644 --- a/api/application/controllers/Question_Management_Controller.php +++ b/api/application/controllers/Question_Management_Controller.php @@ -69,7 +69,7 @@ class Question_Management_Controller extends REST_Controller { $temp_answers = array('fk_question_id' => $question_id, 'answer' =>$answer['answer'] , 'createdon' =>$records['createdon'] , 'fk_createdby' =>$records['fk_createdby']); - $child_id = $this->Question_Management_Models->saveRecords($temp_answers,QUESTIONANSWERS); + $child_id = $this->Question_Management_Model->saveRecords($temp_answers,QUESTIONANSWERS); } } diff --git a/api/application/libraries/AWS_SES.php b/api/application/libraries/AWS_SES.php index a626fd9c..555116b9 100644 --- a/api/application/libraries/AWS_SES.php +++ b/api/application/libraries/AWS_SES.php @@ -21,7 +21,7 @@ class AWS_SES //echo "listAllBuckets"; $this->SES = SesClient::factory($this->ses_properties); - $this->createCustomVerificationEmailTemplate(); + //$this->verifyEmailAddress(); } @@ -31,7 +31,7 @@ class AWS_SES // Replace these sample addresses with the addresses of your recipients. If // your account is still in the sandbox, these addresses must be verified. - $recipient_emails = ['vitvelz@gmail.com']; + $recipient_emails = ['raro@spindl-e.com']; // Specify a configuration set. If you do not want to use a configuration // set, comment the following variable, and the @@ -83,27 +83,31 @@ class AWS_SES } } - public function verifyEmailAddress($email) + public function verifyEmailIdentity($email = "") { $result = $this->SES->verifyEmailIdentity([ 'EmailAddress' => $email, ]); + + print_r($result); } - - /* - $result = $client->sendCustomVerificationEmail([ - 'ConfigurationSetName' => '', - 'EmailAddress' => '', // REQUIRED - 'TemplateName' => '', // REQUIRED - ]);*/ + + public function sendCustomVerificationEmail($email,$template_name = 'myCustom') + { + $result = $this->SES->sendCustomVerificationEmail([ + //'ConfigurationSetName' => '', + 'EmailAddress' => $email, // REQUIRED + 'TemplateName' => $template_name, // REQUIRED + ]); + } public function createCustomVerificationEmailTemplate() { $result = $this->SES->createCustomVerificationEmailTemplate([ - 'FailureRedirectionURL' => 'www.google.com', // REQUIRED + 'FailureRedirectionURL' => 'https://www.google.com', // REQUIRED 'FromEmailAddress' => 'vitvelz@gmail.com', // REQUIRED - 'SuccessRedirectionURL' => 'www.gmail.com', // REQUIRED + 'SuccessRedirectionURL' => 'https://www.gmail.com', // REQUIRED 'TemplateContent' => '

Heading

', // REQUIRED 'TemplateName' => 'myCustom', // REQUIRED 'TemplateSubject' => 'customTemlate', // REQUIRED diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 4ec89373..36e0390f 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -14,18 +14,18 @@ class PD_Model extends SPARQ_Model { { $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.fk_lender_id,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name, PDTRIGGER.lender_applicant_id, PDTRIGGER.pd_date_of_initiation, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name, PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.fk_pd_status,PDSTATUS.pd_status_name, PDTRIGGER.pd_specific_clarification, PDTRIGGER.createdon, PDTRIGGER.fk_createdby, PDTRIGGER.updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.full_name as agency_name, PDTRIGGER.loan_amount'); $this->db->FROM(PDTRIGGER.' as PDTRIGGER'); - $this->db->JOIN(ENTITY.' as ENTITY','PDTRIGGER.fk_lender_id = ENTITY.entity_id AND ENTITY.isactive = 1'); - $this->db->JOIN(PRODUCTS.' as PRODUCTS','PDTRIGGER.fk_product_id = PRODUCTS.product_id AND PRODUCTS.isactive = 1'); - $this->db->JOIN(SUBPRODUCTS.' as SUBPRODUCTS','PDTRIGGER.fk_subproduct_id = SUBPRODUCTS.subproduct_id AND SUBPRODUCTS.isactive = 1'); - $this->db->JOIN(PDTYPE.' as PDTYPE','PDTRIGGER.fk_pd_type = PDTYPE.pd_type_id AND PDTYPE.isactive = 1'); - $this->db->JOIN(PDSTATUS.' as PDSTATUS','PDTRIGGER.fk_pd_status = PDSTATUS.pd_status_id AND PDSTATUS.isactive = 1'); - $this->db->JOIN(USERPROFILE.' as USERPROFILE','PDTRIGGER.fk_createdby = USERPROFILE.userid AND USERPROFILE.isactive = 1'); - $this->db->JOIN(USERPROFILE.' as USERPROFILE1','PDTRIGGER.fk_updatedby = USERPROFILE1.userid AND USERPROFILE1.isactive = 1'); - $this->db->JOIN(PDALLOCATIONTYPE.' as PDALLOCATIONTYPE','PDTRIGGER.fk_pd_allocation_type = PDALLOCATIONTYPE.pd_allocation_type_id AND PDALLOCATIONTYPE.isactive = 1'); - $this->db->JOIN(USERPROFILE.' as USERPROFILE2','PDTRIGGER.fk_pd_allocation_type = USERPROFILE2.userid AND USERPROFILE2.isactive = 1'); - $this->db->JOIN(TEMPLATE.' as TEMPLATE','PDTRIGGER.fk_pd_template_id = TEMPLATE.template_id AND TEMPLATE.isactive = 1'); - $this->db->JOIN(CUSTOMERSEGMENT.' as CUSTOMERSEGMENT','PDTRIGGER.fk_customer_segment = CUSTOMERSEGMENT.customer_segment_id AND CUSTOMERSEGMENT.isactive = 1'); - $this->db->JOIN(ENTITY.' as AGENCY','PDTRIGGER.pd_agency_id = AGENCY.entity_id AND AGENCY.isactive = 1','LEFT'); + $this->db->JOIN(ENTITY.' as ENTITY','PDTRIGGER.fk_lender_id = ENTITY.entity_id '); + $this->db->JOIN(PRODUCTS.' as PRODUCTS','PDTRIGGER.fk_product_id = PRODUCTS.product_id'); + $this->db->JOIN(SUBPRODUCTS.' as SUBPRODUCTS','PDTRIGGER.fk_subproduct_id = SUBPRODUCTS.subproduct_id'); + $this->db->JOIN(PDTYPE.' as PDTYPE','PDTRIGGER.fk_pd_type = PDTYPE.pd_type_id'); + $this->db->JOIN(PDSTATUS.' as PDSTATUS','PDTRIGGER.fk_pd_status = PDSTATUS.pd_status_id'); + $this->db->JOIN(USERPROFILE.' as USERPROFILE','PDTRIGGER.fk_createdby = USERPROFILE.userid'); + $this->db->JOIN(USERPROFILE.' as USERPROFILE1','PDTRIGGER.fk_updatedby = USERPROFILE1.userid','LEFT'); + $this->db->JOIN(PDALLOCATIONTYPE.' as PDALLOCATIONTYPE','PDTRIGGER.fk_pd_allocation_type = PDALLOCATIONTYPE.pd_allocation_type_id'); + $this->db->JOIN(USERPROFILE.' as USERPROFILE2','PDTRIGGER.fk_pd_allocation_type = USERPROFILE2.userid'); + $this->db->JOIN(TEMPLATE.' as TEMPLATE','PDTRIGGER.fk_pd_template_id = TEMPLATE.template_id'); + $this->db->JOIN(CUSTOMERSEGMENT.' as CUSTOMERSEGMENT','PDTRIGGER.fk_customer_segment = CUSTOMERSEGMENT.customer_segment_id'); + $this->db->JOIN(ENTITY.' as AGENCY','PDTRIGGER.pd_agency_id = AGENCY.entity_id','LEFT'); $this->db->ORDER_BY('PDTRIGGER.pd_id',$sort); $this->db->LIMIT($page,$limit); $result_array = $this->db->GET()->result_array(); @@ -36,9 +36,9 @@ class PD_Model extends SPARQ_Model { { $this->db->SELECT('PDAPPLICANTSDETAILS.pd_co_applicant_id, PDAPPLICANTSDETAILS.fk_pd_id, PDAPPLICANTSDETAILS.applicant_name, PDAPPLICANTSDETAILS.applicant_type, PDAPPLICANTSDETAILS.mobile_no, PDAPPLICANTSDETAILS.email, PDAPPLICANTSDETAILS.addressline1, PDAPPLICANTSDETAILS.addressline2, PDAPPLICANTSDETAILS.addressline3, PDAPPLICANTSDETAILS.fk_city, PDAPPLICANTSDETAILS.fk_state, PDAPPLICANTSDETAILS.pincode'); $this->db->FROM(PDAPPLICANTSDETAILS.' as PDAPPLICANTSDETAILS'); - $this->db->JOIN(STATE.' as STATE','PDAPPLICANTSDETAILS.fk_state = STATE.state_id AND STATE.isactive = 1'); - $this->db->JOIN(CITY.' as CITY','PDAPPLICANTSDETAILS.fk_city = CITY.city_id AND CITY.isactive = 1'); - $this->db->WHERE('PDAPPLICANTSDETAILS.fk_pd_id = $result["pd_id"] AND PDAPPLICANTSDETAILS.isactive = 1'); + $this->db->JOIN(STATE.' as STATE','PDAPPLICANTSDETAILS.fk_state = STATE.state_id '); + $this->db->JOIN(CITY.' as CITY','PDAPPLICANTSDETAILS.fk_city = CITY.city_id'); + $this->db->WHERE('PDAPPLICANTSDETAILS.fk_pd_id = $result["pd_id"]'); $result_child_array = $this->db->GET()->result_array(); if(count($result_child_array) != 0) { diff --git a/api/application/models/Question_Management_Model.php b/api/application/models/Question_Management_Model.php index 9e947345..dd4e5860 100644 --- a/api/application/models/Question_Management_Model.php +++ b/api/application/models/Question_Management_Model.php @@ -16,10 +16,10 @@ class Question_Management_Model extends SPARQ_Model { $this->db->SELECT('QUESTIONS.question_id, QUESTIONS.question, QUESTIONS.description, QUESTIONS.fk_question_catagory,QUESTIONCATEGORY.categroy_name, QUESTIONS.fk_question_answertype,QUESTIONANSWERTYPE.answer_type_name,QUESTIONS.isactive, QUESTIONS.createdon, QUESTIONS.fk_createdby, QUESTIONS.updatedon, QUESTIONS.fk_updatedby,concat(USERPROFILE.first_name," " ,USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby'); $this->db->FROM(QUESTIONS.' as QUESTIONS'); - $this->db->JOIN(QUESTIONANSWERTYPE.' as QUESTIONANSWERTYPE','QUESTIONS.fk_question_answertype = QUESTIONANSWERTYPE.question_answer_type_id AND QUESTIONANSWERTYPE.isactive = 1'); - $this->db->JOIN(QUESTIONCATEGORY.' as QUESTIONCATEGORY','QUESTIONS.fk_question_catagory = QUESTIONCATEGORY.question_categroy_id AND QUESTIONCATEGORY.isactive = 1'); - $this->db->JOIN(USERPROFILE.' as USERPROFILE','QUESTIONS.fk_createdby = USERPROFILE.userid AND USERPROFILE.isactive = 1'); - $this->db->JOIN(USERPROFILE.' as USERPROFILE1','QUESTIONS.fk_updatedby = USERPROFILE1.userid AND USERPROFILE1.isactive = 1','LEFT'); + $this->db->JOIN(QUESTIONANSWERTYPE.' as QUESTIONANSWERTYPE','QUESTIONS.fk_question_answertype = QUESTIONANSWERTYPE.question_answer_type_id'); + $this->db->JOIN(QUESTIONCATEGORY.' as QUESTIONCATEGORY','QUESTIONS.fk_question_catagory = QUESTIONCATEGORY.question_categroy_id'); + $this->db->JOIN(USERPROFILE.' as USERPROFILE','QUESTIONS.fk_createdby = USERPROFILE.userid'); + $this->db->JOIN(USERPROFILE.' as USERPROFILE1','QUESTIONS.fk_updatedby = USERPROFILE1.userid','LEFT'); $this->db->ORDER_BY('QUESTIONS.question_id',$sort); $this->db->LIMIT($page,$limit); @@ -29,12 +29,12 @@ class Question_Management_Model extends SPARQ_Model { { $this->db->SELECT('QUESTIONANSWERS.question_answer_id, QUESTIONANSWERS.fk_question_id, QUESTIONANSWERS.answer, QUESTIONANSWERS.createdon, QUESTIONANSWERS.fk_createdby, QUESTIONANSWERS.updatedon, QUESTIONANSWERS.fk_updatedby, QUESTIONS.isactive'); $this->db->FROM(QUESTIONANSWERS.' as QUESTIONANSWERS'); - $this->db->JOIN(QUESTIONS.' as QUESTIONS','QUESTIONANSWERS.fk_question_id = QUESTIONS.question_id AND QUESTIONS.isactive'); - $this->db->JOIN(USERPROFILE.' as USERPROFILE','QUESTIONANSWERS.fk_createdby = USERPROFILE.userid AND USERPROFILE.isactive = 1'); - $this->db->JOIN(USERPROFILE.' as USERPROFILE1','QUESTIONANSWERS.fk_updatedby = USERPROFILE1.userid AND USERPROFILE1.isactive = 1','LEFT'); + $this->db->JOIN(QUESTIONS.' as QUESTIONS','QUESTIONANSWERS.fk_question_id = QUESTIONS.question_id'); + $this->db->JOIN(USERPROFILE.' as USERPROFILE','QUESTIONANSWERS.fk_createdby = USERPROFILE.userid '); + $this->db->JOIN(USERPROFILE.' as USERPROFILE1','QUESTIONANSWERS.fk_updatedby = USERPROFILE1.userid','LEFT'); $this->db->where('QUESTIONS.question_id',$r['question_id']); $answers_data = $this->db->get()->result_array(); - + //$result[$key]['answers'] = $answers_data; array_push($result[$key],$answers_data); }