From 4fd2154f3e7273f51a4078d31638d73acfa8eb98 Mon Sep 17 00:00:00 2001 From: sanjeev Date: Wed, 1 Dec 2021 14:54:40 +0530 Subject: [PATCH] Allocate Issues fixes : ps --- api/application/controllers/PD_Controller.php | 72 +++++++++++++++---- .../controllers/SMC_Credit_PD_Controller.php | 2 +- 2 files changed, 61 insertions(+), 13 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 29e6a632..df8067c5 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -1625,7 +1625,7 @@ public function assignPDTempalate($data) public function allocatePD_post() { $records = $this->post('records'); - //print_r($records);die(); + // print_r($records);die(); //if($records['fk_pd_allocated_to'] != "" || $records['fk_pd_allocated_to'] != null) //{ // $records['pd_agency_id'] =isset($records['pd_agency_id']) ? $records['pd_agency_id'] : null; @@ -1635,20 +1635,35 @@ public function assignPDTempalate($data) $lender_id = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDTRIGGER); $smc_lender_id = ENVIRONMENT == 'production' ? 7 : 35; //SMC lender id MWISE in live and demo + // IF Condition - PD AGENCY ID means SMC VENDOR FLOW + if(isset($records['pd_agency_id'])){ + // IF Condition - using PDID get the lender and mapped with SMC_lender_id macthed means Vendor status dynamically assigned + if($smc_lender_id == $lender_id[0]['fk_lender_id'] && isset($records['pd_agency_id']) && $records['pd_agency_id'] != null){ + $records['vendor_status'] = isset($records['pd_status']) ? $records['pd_status'] : ALLOCATED ; //Here vendor_status is dynamic (ALLOCATED,SCHEDULED,COMPLETED like that) + } + } + else{ + //Normal FLOW + $records['pd_status'] = isset($records['pd_status']) ? $records['pd_status'] : ALLOCATED; + if(isset($records['pd_status']) && ($records['pd_status'] == ALLOCATED_TO_FIA )) + { + $records['vendor_status'] = TRIGGERED; + } + } + // if($smc_lender_id != $lender_id[0]['fk_lender_id']){ // $records['pd_status'] = isset($records['pd_status']) ? $records['pd_status'] : ALLOCATED ; // } - // IF Condition - using PDID get the lender and mapped with SMC_lender_id macthed means Vendor status dynamically assigned - if($smc_lender_id == $lender_id[0]['fk_lender_id'] && isset($records['pd_agency_id']) && $records['pd_agency_id'] != null){ - $records['vendor_status'] = isset($records['pd_status']) ? $records['pd_status'] : ALLOCATED ; //Here vendor_status is dynamic (ALLOCATED,SCHEDULED,COMPLETED like that) - } - else if(isset($records['pd_status']) && ($records['pd_status'] == ALLOCATED_TO_FIA )) - { - $records['pd_status'] = isset($records['pd_status']) ? $records['pd_status'] : ALLOCATED ; + // if($smc_lender_id == $lender_id[0]['fk_lender_id'] && isset($records['pd_agency_id']) && $records['pd_agency_id'] != null){ + // $records['vendor_status'] = isset($records['pd_status']) ? $records['pd_status'] : ALLOCATED ; //Here vendor_status is dynamic (ALLOCATED,SCHEDULED,COMPLETED like that) + // } + // else if(isset($records['pd_status']) && ($records['pd_status'] == ALLOCATED_TO_FIA )) + // { + // $records['pd_status'] = isset($records['pd_status']) ? $records['pd_status'] : ALLOCATED ; - $records['vendor_status'] = TRIGGERED; - } + // $records['vendor_status'] = TRIGGERED; + // } //} // $where_condition_array = array('pd_id' => $records['pd_id']); $pd_id_modified = $this->PD_Model->updateRecords($records,PDTRIGGER,$where_condition_array); @@ -11299,8 +11314,41 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $url = $this->get('url'); $this->load->helper('video_grabber_helper'); // $url="https://venbainfotech.com/VenbaIT/"; - $result_data = "127.0.0.1:5000/sh_url?url=".$url; - $result_data = json_decode($result_data,true); + // $result_data = "127.0.0.1:5000/sh_url?url=".$url; + // $result_data = exec($result_data); + // $result_data = json_decode($result_data,true); + $client = new \GuzzleHttp\Client(); + // $response = $client->request('GET',$result_data); + // print_r($response);die(); + // $ch = curl_init(); + // $timeout = 5; + // curl_setopt($ch,CURLOPT_URL,$result_data); + // curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); + // curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); + // $tinyurl = curl_exec($ch); + // print_r($tinyurl);die(); + $client = new \GuzzleHttp\Client(); + $res = $client->get( 'http://github.com', [ + 'headers' => ['Content-Type' => 'application/json'], + ]); + print_r($res); + print_r(json_decode($res->getBody())); + // print_r($res); + // try{ + // $response = $client->request('GET', 'http://github.com'); + // print_r($response);die(); + // } + // catch (ConnectException $e) { + // // Connection exceptions are not caught by RequestException + // echo "Internet, DNS, or other connection error\n"; + // die; + // } + // catch (RequestException $e) { + // echo "Request Exception\n"; + // die; + // } + + die(); if(!empty($result_data) && $result_data['datastatus'] == 200) { $data['dataStatus'] = true; diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 4621eb79..0aad2a39 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1627,7 +1627,7 @@ public function filterSalesPDList_post() { $html_content = $this->load->view('smc_creditpd_reports/MWISE',$view_data,true); } - echo $html_content;exit(); + // echo $html_content;exit(); $pdf_name = $view_data['pd_master_details'][0]['main_applicant']; $pdf_doc = $this->pdfgenerator->generate($html_content, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); //End of PDF Gen using DOM PDF