Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
cf4a934a13
@ -331,7 +331,7 @@ $route['downloadDataDump'] = 'Request_DataDump_Controller/downloadDataDump2';
|
||||
$route['getSMCVendorList'] = 'SMC_Credit_PD_Controller/getStateWiseAgency';
|
||||
$route['getSMCVendorPDOfficersList'] = 'SMC_Credit_PD_Controller/getSMCVendorPDOfficersList';
|
||||
|
||||
//Template V2 (Dynamical)
|
||||
## Template V2 (Dynamical)
|
||||
$route['getTemplateMappingDetailsV2'] = 'Template_Management_Controller/getTemplateV2';
|
||||
$route['getTemplateFormsV2'] = 'Template_Management_Controller/getTemplateFormsV2';
|
||||
$route['saveTemplateMappingDetailsV2'] = 'Template_Management_Controller/saveTemplateV2';
|
||||
@ -342,8 +342,9 @@ $route['loadFullTemplateV2'] = 'Template_Management_Controller/loadFullTemplateV
|
||||
$route['formWiseJSONTemplateV2'] = 'Template_Management_Controller/formWiseJSONTemplateV2';
|
||||
$route['disableformV2'] = 'Template_Management_Controller/disableformV2';
|
||||
$route['questionsV2'] = 'Template_Management_Controller/JSONquestionFilterV2';
|
||||
$route['getBuinessGroupForms'] = 'Template_Management_Controller/getBuinessGroupForms';
|
||||
|
||||
$route['getBuinessGroupForms'] = 'Template_Management_Controller/getBuinessGroupFormsV2';
|
||||
$route['getCompaniesListsForBusinessV2'] = 'PD_Controller/getCompaniesListsFromGeneralFormRawJSONV2';
|
||||
## PDjson developers Testing Purposer
|
||||
$route['PDjson'] = 'PD_Controller/PDjson';
|
||||
|
||||
$route['regenerateSatelliteImg'] = 'Sales_PD_Controller/regenerateSatelliteImg';
|
||||
|
||||
@ -2977,6 +2977,7 @@ public function assignPDTempalate($data)
|
||||
|
||||
|
||||
$temp_array = array('fk_form_id'=>$formid,'company_id' => $company_id,'fk_pd_id'=>$pdid,'fk_createdby'=>$createdby,'json'=>$records,'processed_json' => $processed_json,'rental_count_id' => $rental_count_id,'template_id'=>$templateid);
|
||||
// $temp_array = array('fk_form_id'=>$formid,'company_id' => $company_id,'fk_pd_id'=>$pdid,'fk_createdby'=>$createdby,'json'=>$records,'processed_json' => $processed_json,'rental_count_id' => $rental_count_id);
|
||||
|
||||
$id = $this->PD_Model->saveRecords($temp_array,PDFORMDETAILSJSON);
|
||||
|
||||
@ -6721,11 +6722,247 @@ public function getPDFormDetailsJSON_post()
|
||||
}
|
||||
}
|
||||
|
||||
##v1
|
||||
public function getCompaniesListsFromGeneralFormRawJSON_post()
|
||||
{
|
||||
$records = $this->post('records');
|
||||
$pd_id = $records['pd_id'];
|
||||
|
||||
$ai_flag = 0;
|
||||
//GET TEMPALE ID FROM MASTER
|
||||
$pd_master_details = $this->PD_Model->getPDMasterDetails($pd_id);
|
||||
$lender_short_name = $pd_master_details[0]['lender_short_name'];
|
||||
$product_abbr = $pd_master_details[0]['product_abbr'];
|
||||
//print_r($lender_short_name);
|
||||
$str = substr($pd_master_details[0]['customer_segment_abbr'],-2);
|
||||
//echo $str;
|
||||
if(!strcmp($str,'AI')) { $ai_flag = 1; }
|
||||
//echo $ai_flag;
|
||||
|
||||
$company_list = array();
|
||||
$fields = array('json');
|
||||
$where_condition_array = array('isactive' => 1,'fk_form_id'=>18,'fk_pd_id'=>$pd_id);
|
||||
$rec = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDFORMDETAILSJSON);
|
||||
if(count($rec))
|
||||
{
|
||||
$temp_data = json_decode($rec[0]['json'],true);
|
||||
// print_r($temp_data);die();
|
||||
foreach($temp_data['companies'] as $company)
|
||||
{
|
||||
|
||||
if($company['associate_pd_id'] == $pd_id)
|
||||
{
|
||||
$temp_array = array('company_order_id' => $company['company_order_id'],'company_name' => $company['company_name'],'is_active' => $company['is_active'],'is_company_applicant'=>$company['is_company_applicant'],'business_entity_type'=>$company['business_entity_type'],'business_years'=>$company['business_years'],'business_month'=>$company['business_month'],'business_month'=>$company['business_month'],'business_date_object'=>$company['business_date_object']);
|
||||
if(isset($company['business_entity_type_other']))
|
||||
{
|
||||
$temp_array['business_entity_type_other'] = $company['business_entity_type_other'];
|
||||
}
|
||||
$company_list[] = $temp_array;
|
||||
}
|
||||
}
|
||||
// $company_list = array( array('company_order_id' => 1));
|
||||
//print_r($company_list);die();
|
||||
$form_array = array();
|
||||
|
||||
if($ai_flag == 0) // DI case
|
||||
{
|
||||
|
||||
$form_array[] = array('form_id' => 13,'form_name' => 'About Business');
|
||||
|
||||
|
||||
$form_array[] = array('form_id' => 22,'form_name' => 'Business Assets');
|
||||
if(!strcasecmp($lender_short_name, 'CLIX')){
|
||||
$form_array[] = array('form_id' => 21,'form_name' => 'Business Banking');
|
||||
}
|
||||
$form_array[] = array('form_id' => 14,'form_name' => 'Financial Information');
|
||||
$form_array[] = array('form_id' => 1,'form_name' => 'Supplier Details');
|
||||
$form_array[] = array('form_id' => 2,'form_name' => 'Client Details');
|
||||
$form_array[] = array('form_id' => 11,'form_name' => 'Stock Details');
|
||||
if(!strcasecmp($lender_short_name, 'CLIX') || (!strcasecmp($lender_short_name, 'MWISE')))
|
||||
{
|
||||
$form_array[] = array('form_id' => 23,'form_name' => 'Future Plans & Business Environments');
|
||||
}
|
||||
|
||||
}
|
||||
else // AI Case
|
||||
{
|
||||
|
||||
$form_array[] = array('form_id' => 13,'form_name' => 'About Business');
|
||||
$form_array[] = array('form_id' => 22,'form_name' => 'Business Assets');
|
||||
if(!strcasecmp($lender_short_name, 'CLIX')){
|
||||
$form_array[] = array('form_id' => 21,'form_name' => 'Business Banking');
|
||||
}
|
||||
$form_array[] = array('form_id' => 14,'form_name' => 'Financial Information');
|
||||
$form_array[] = array('form_id' => 1,'form_name' => 'Supplier Details');
|
||||
$form_array[] = array('form_id' => 2,'form_name' => 'Client Details');
|
||||
$form_array[] = array('form_id' => 11,'form_name' => 'Stock Details');
|
||||
$form_array[] = array('form_id' => 16,'form_name' => 'Assessed Income');
|
||||
if(!strcasecmp($lender_short_name, 'CLIX') || (!strcasecmp($lender_short_name, 'MWISE')) )// && !strcasecmp($product_abbr,'LFMP'))
|
||||
{
|
||||
$form_array[] = array('form_id' => 23,'form_name' => 'Future Plans & Business Environments');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//print_r($form_array);//die();
|
||||
foreach($company_list as $list_key => $company)
|
||||
{
|
||||
|
||||
$temp = array();
|
||||
$business_form_status = 0;
|
||||
$supplier_form_status = 0;
|
||||
$client_form_status = 0;
|
||||
foreach($form_array as $form)
|
||||
{
|
||||
|
||||
$template_forms_count = 0;
|
||||
if($form['form_id'] != 16)
|
||||
{
|
||||
$this->db->SELECT('count(*) as count');
|
||||
$this->db->FROM(PDFORMDETAILSJSON.' as PDFORMDETAILSJSON');
|
||||
$this->db->WHERE('PDFORMDETAILSJSON.fk_pd_id',$pd_id);
|
||||
$this->db->WHERE('PDFORMDETAILSJSON.fk_form_id',$form['form_id']);
|
||||
$this->db->WHERE('PDFORMDETAILSJSON.company_id',$company['company_order_id']);
|
||||
$this->db->WHERE('PDFORMDETAILSJSON.isactive',1);
|
||||
$template_forms_count = $this->db->GET()->result_array();
|
||||
//print_r($this->db->last_query());die();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$fields = array('count(*) as count');
|
||||
$where_condition_array = array('fk_pd_id'=>$pd_id,'company_id' => $company['company_order_id'],'is_completed' => 1);
|
||||
$template_forms_count = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDASSESSEDINCOMEESTIMATIONOFGROSSPROFITTYPE);
|
||||
}
|
||||
// print_r($this->db->last_query());
|
||||
// print_r($template_forms_count);echo $form['form_id'];
|
||||
if($template_forms_count[0]['count'] != 0) {
|
||||
|
||||
|
||||
if($form['form_id'] == 13 || $form['form_id'] == 22 || $form['form_id'] == 23)
|
||||
{
|
||||
|
||||
$temp[] = array('form_id' => $form['form_id'],'form_name'=> $form['form_name'],'isAnswered' => true,'isAnswerable'=>true);
|
||||
if($form['form_id'] == 22)
|
||||
{
|
||||
$business_form_status = 1;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if($business_form_status == 1){
|
||||
|
||||
|
||||
|
||||
if($form['form_id'] == 1)//if supplier form answered set supplier_form_status = 1
|
||||
{
|
||||
$supplier_form_status = 1;
|
||||
}
|
||||
|
||||
if($form['form_id'] == 2)//if client form answered set client_form_status = 1
|
||||
{
|
||||
$client_form_status = 1;
|
||||
}
|
||||
|
||||
if($form['form_id'] == 11 || $form['form_id'] == 22 || $form['form_id'] == 23)
|
||||
{
|
||||
//echo "COUNT YES STOCK"
|
||||
if($client_form_status == 1 && $supplier_form_status == 1)
|
||||
{
|
||||
$temp[] = array('form_id' => $form['form_id'],'form_name'=> $form['form_name'],'isAnswered' => true,'isAnswerable'=>true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$temp[] = array('form_id' => $form['form_id'],'form_name'=> $form['form_name'],'isAnswered' => true,'isAnswerable'=>true);
|
||||
}
|
||||
|
||||
}
|
||||
else //busienss false
|
||||
{
|
||||
//echo "business false".$form['form_id'];
|
||||
$temp[] = array('form_id' => $form['form_id'],'form_name'=> $form['form_name'],'isAnswered' => true,'isAnswerable'=>false);
|
||||
}
|
||||
}
|
||||
}
|
||||
else //Not previously answered
|
||||
{
|
||||
//echo "else-- " .$form['form_id'];
|
||||
if($form['form_id'] == 13 || $form['form_id'] == 22 || $form['form_id'] == 23)
|
||||
{
|
||||
|
||||
$temp[] = array('form_id' => $form['form_id'],'form_name'=> $form['form_name'],'isAnswered' => false,'isAnswerable'=>true);
|
||||
|
||||
}
|
||||
else{
|
||||
if($business_form_status == 1){
|
||||
|
||||
if($form['form_id'] == 11 || $form['form_id'] == 22 || $form['form_id'] == 23)
|
||||
{
|
||||
//echo "BUSISTOCk";
|
||||
if($client_form_status == 1 && $supplier_form_status == 1)
|
||||
{
|
||||
$temp[] = array('form_id' => $form['form_id'],'form_name'=> $form['form_name'],'isAnswered' => false,'isAnswerable'=>true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$temp[] = array('form_id' => $form['form_id'],'form_name'=> $form['form_name'],'isAnswered' => false,'isAnswerable'=>false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$temp[] = array('form_id' => $form['form_id'],'form_name'=> $form['form_name'],'isAnswered' => false,'isAnswerable'=>true);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$temp[] = array('form_id' => $form['form_id'],'form_name'=> $form['form_name'],'isAnswered' => false,'isAnswerable'=>false);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$company_list[$list_key]['form_status'] = $temp;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// print_r($company_list);die();
|
||||
if(count($company_list))
|
||||
{
|
||||
if($pd_master_details[0]['fk_pd_type'] == 2)
|
||||
{
|
||||
$vendor_form_status = $this->PD_Model->getVendorFormStatus($pd_id);
|
||||
$company_list[0]['vendor_form_status'] = $vendor_form_status;
|
||||
}
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['records'] = $company_list;
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{ $data['dataStatus'] = false;
|
||||
$data['status'] = REST_Controller::HTTP_NO_CONTENT;
|
||||
$data['msg'] = 'No Comapany Details Found!';
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
### V2
|
||||
public function getCompaniesListsFromGeneralFormRawJSONV2_post()
|
||||
{
|
||||
$records = $this->post('records');
|
||||
$pd_id = $records['pd_id'];
|
||||
$ai_flag = 0;
|
||||
//GET TEMPALE ID FROM MASTER
|
||||
$pd_master_details = $this->PD_Model->getPDMasterDetails($pd_id);
|
||||
@ -10768,10 +11005,9 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
||||
// is_smc_vendor(true/false) - here this api called both smart pd(vendor) and SMC(vendor) also but we using this key only for SMC(vendor module).
|
||||
if($smc_lender_id == $current_lender_id && isset($agency_id) && $agency_id != null && $records['is_smc_vendor'] == true){
|
||||
if(isset($records['vendor_status']) && ($records['vendor_status'] == QC_COMPLETED)){
|
||||
$records['pd_status'] = $records['vendor_status']; //Here vendor_status is (QC_COMPLETED) means i have to update the Normal Status also.
|
||||
unset($records['vendor_status']);//Here vendor status unsetted when qc_completed means.
|
||||
$fields_to_update['pd_status'] = COMPLETED; //Here vendor_status is (QC_COMPLETED) means i have to update the Normal Status as COMPLETED.
|
||||
}
|
||||
// else{ $records['vendor_status'] = $records['pd_status']; }
|
||||
else{ $fields_to_update['vendor_status'] = $records['pd_status']; }
|
||||
}
|
||||
if(!isset($records['complete_override_data']) && isset($records['is_smc_vendor']) && $records['is_smc_vendor'] == false)
|
||||
{
|
||||
|
||||
@ -924,6 +924,7 @@ class Template_Management_Controller extends REST_Controller {
|
||||
|
||||
// API 2 Get Template with Form Details V2.0 : ps 20/12/2021
|
||||
public function getTemplateFormsV2_get(){
|
||||
// echo "i am @927";die();
|
||||
if(isset($_GET['map_id']))
|
||||
{
|
||||
$records['map_id'] = $this->get("map_id");}
|
||||
@ -942,20 +943,17 @@ class Template_Management_Controller extends REST_Controller {
|
||||
foreach($result_array as $inx => $arr)
|
||||
{
|
||||
if($arr['map_id'] != null || $arr['map_id'] != ""){
|
||||
$completed_details = $this->Template_Management_Model->getTemplateFormsV2($arr['map_id'],1); ### 1 means completed
|
||||
$draft_or_approve_details = $this->Template_Management_Model->getTemplateFormsV2($arr['map_id'],2); ### 2 means draft or approved
|
||||
$details = ((count($completed_details)>0)
|
||||
?$completed_details
|
||||
:((count($draft_or_approve_details)>0)
|
||||
?$draft_or_approve_details
|
||||
:array()));
|
||||
$result_array[$inx]["forms"] = $details;
|
||||
$forms =$this->Template_Management_Model->getTemplateFormsV2($arr['map_id']);
|
||||
for($i=0; $i<count($forms); $i++){
|
||||
if($forms[$i]['form_id']=='19'){$forms[$i]['form_name']="Neighbourhood";}
|
||||
}
|
||||
$result_array[$inx]["forms"] = $forms;
|
||||
}else{
|
||||
$result_array[$inx]["forms"] = array();
|
||||
}
|
||||
array_push($result_array[$inx]["forms"],array("form_id"=> "13","form_name"=> "Business Information","json"=> "","is_form_disabled"=> "0","is_business_form"=> "1","is_group_form"=> "1","pd_form_order"=>"5","is_form_status"=>null));
|
||||
array_push($result_array[$inx]["forms"],array("form_id"=> "18","form_name"=> "General Information","json"=> "","is_form_disabled"=> "0","is_business_form"=> "0","is_group_form"=> "0","pd_form_order"=>"2","is_form_status"=>null));
|
||||
array_push($result_array[$inx]["forms"],array("form_id"=> "26","form_name"=> "Photograph","json"=> "","is_form_disabled"=> "0","is_business_form"=> "0","is_group_form"=> "0","pd_form_order"=>"24","is_form_status"=>null));
|
||||
array_push($result_array[$inx]["forms"],array("form_id"=> "13","form_name"=> "Business Information","json"=> "","is_form_disabled"=> "0","is_business_form"=> "1","is_group_form"=> "1","pd_form_order"=>"5","is_form_status"=>null,"template_id"=>null));
|
||||
array_push($result_array[$inx]["forms"],array("form_id"=> "18","form_name"=> "General Information","json"=> "","is_form_disabled"=> "0","is_business_form"=> "0","is_group_form"=> "0","pd_form_order"=>"2","is_form_status"=>null,"template_id"=>null));
|
||||
array_push($result_array[$inx]["forms"],array("form_id"=> "26","form_name"=> "Photograph","json"=> "","is_form_disabled"=> "0","is_business_form"=> "0","is_group_form"=> "0","pd_form_order"=>"24","is_form_status"=>null,"template_id"=>null));
|
||||
// $buiness_arr = array("form_id"=> "13","form_name"=> "Business Information","json"=> "","is_form_disabled"=> "0","is_business_form"=> "1","is_group_form"=> "1");
|
||||
// array_push($result_array[$inx]["forms"],$buiness_arr);
|
||||
}
|
||||
@ -1114,23 +1112,32 @@ class Template_Management_Controller extends REST_Controller {
|
||||
// $json_pk_id = $this->Template_Management_Model->saveTemplateMapping($fields,TEMPLATE_JSON_V2);
|
||||
|
||||
if($status == "DRAFT"){
|
||||
if(count($json_table)>0 && $status == "COMPLETED"){
|
||||
if(count($json_table)>0){
|
||||
if($status == "COMPLETED"){
|
||||
$this->db->where_in('id',$json_table[0]['id']);
|
||||
$this->db->set('isactive',0);
|
||||
$this->db->where('is_form_status',"COMPLETED");
|
||||
$this->db->update(TEMPLATE_JSON_V2);
|
||||
}
|
||||
//draft means insert.
|
||||
}else{
|
||||
$json_pk_id = $json_table[0]['id'];
|
||||
$data = array('json' => json_encode($records['json'],true),'is_form_status' => $status);
|
||||
$this->db->where('isactive',1);
|
||||
$this->db->where('id',$json_pk_id);
|
||||
$this->db->update(TEMPLATE_JSON_V2,$data);
|
||||
$msg = "Sucessfully Updated";
|
||||
}
|
||||
}else{
|
||||
$json = json_encode($records['json'],true);
|
||||
$fields = array('form_id' => $form_id,'json' => $json,'map_id'=>$map_id,'is_form_status'=>$status);
|
||||
$json_pk_id = $this->Template_Management_Model->saveTemplateMapping($fields,TEMPLATE_JSON_V2);
|
||||
$msg = "Sucessfully Inserted";
|
||||
$msg = "Sucessfully Inserted";}
|
||||
}else if($status == "APPROVED" || $status == "COMPLETED"){
|
||||
//approve and completed status means just update the status only.
|
||||
$json_pk_id = $json_table[0]['id'];
|
||||
$data = array('json' => json_encode($records['json'],true),'is_form_status' => $status);
|
||||
$this->db->where('isactive',1);
|
||||
$this->db->where('id',$json_pk_id);
|
||||
$this->db->set('is_form_status',$status);
|
||||
$this->db->update(TEMPLATE_JSON_V2);
|
||||
$this->db->update(TEMPLATE_JSON_V2,$data);
|
||||
$msg = "Sucessfully Updated";
|
||||
}
|
||||
|
||||
@ -1221,7 +1228,6 @@ class Template_Management_Controller extends REST_Controller {
|
||||
}
|
||||
//API 7
|
||||
public function formWiseJSONTemplateV2_get(){
|
||||
|
||||
if( (!isset($_GET['map_id'])) && (!isset($_GET['form_id'])) )
|
||||
{
|
||||
$data['dataStatus'] = false;
|
||||
@ -1232,13 +1238,17 @@ class Template_Management_Controller extends REST_Controller {
|
||||
|
||||
$map_id = $_GET['map_id'];
|
||||
$form_id = $_GET['form_id'];
|
||||
$fields = array('json');
|
||||
$where_condition_array = array('map_id'=>$map_id,"form_id"=>$form_id,"isactive"=>1,"is_form_status"=>"COMPLETED");
|
||||
$form_id = $_GET['form_id'];
|
||||
$template_id = isset($_GET['template_id'])?$_GET['template_id']:null;
|
||||
$fields = array('id','json');
|
||||
if($template_id){$where_condition_array = array('map_id'=>$map_id,"form_id"=>$form_id,"is_form_status"=>"COMPLETED","id"=>$template_id);}
|
||||
else{$where_condition_array = array('map_id'=>$map_id,"form_id"=>$form_id,"is_form_status"=>"COMPLETED","isactive"=>1);$data['note'] = "Existing JSON..";}
|
||||
$json_table = $this->Template_Management_Model->selectCustomRecords($fields,$where_condition_array,TEMPLATE_JSON_V2);
|
||||
if(count($json_table)>0){
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['json'] = $json_table[0]['json'];
|
||||
$data['template_id'] = $json_table[0]['id'];
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@ -1298,8 +1308,8 @@ class Template_Management_Controller extends REST_Controller {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getBuinessGroupForms_get(){
|
||||
// analysing
|
||||
public function getBuinessGroupFormsV2_get(){
|
||||
// if((!isset($_GET['map_id'])))
|
||||
// {
|
||||
// $data['dataStatus'] = false;
|
||||
@ -1326,6 +1336,7 @@ class Template_Management_Controller extends REST_Controller {
|
||||
{
|
||||
if($arr['map_id'] != null || $arr['map_id'] != ""){
|
||||
$result_array[$inx]["forms"] = $this->Template_Management_Model->getBuinessGroupForms($arr['map_id']);
|
||||
array_push($result_array[$inx]["forms"],array("form_id"=> "14","form_name"=> "Financial Information","pd_form_level_order"=> "2","json"=> "","is_form_disabled"=> "0","is_business_form"=> "1","is_group_form"=> "0","pd_form_order"=>"8","is_form_status"=>null,"template_id"=>null,"map_id"=>$arr['map_id']));
|
||||
}else{
|
||||
$result_array[$inx]["forms"] = array();
|
||||
}
|
||||
|
||||
@ -2364,17 +2364,18 @@ class PD_Model extends SPARQ_Model {
|
||||
$map_id = "";
|
||||
}
|
||||
}
|
||||
$this->db->SELECT('TEMPLATE_JSON_V2.map_id,TEMPLATE_JSON_V2.form_id,PDFORMS.pd_form_order,PDFORMS.pd_form_level_order,PDFORMS.pd_form_name as form_name,TEMPLATE_JSON_V2.is_form_disabled,PDFORMS.is_business_form,TEMPLATE_JSON_V2.is_group_form');
|
||||
$this->db->SELECT('TEMPLATE_JSON_V2.id as template_id,TEMPLATE_JSON_V2.map_id,TEMPLATE_JSON_V2.form_id,PDFORMS.pd_form_order,PDFORMS.pd_form_level_order,PDFORMS.pd_form_name as form_name,TEMPLATE_JSON_V2.is_form_disabled,PDFORMS.is_business_form,TEMPLATE_JSON_V2.is_group_form');
|
||||
$this->db->FROM(TEMPLATE_JSON_V2.' as TEMPLATE_JSON_V2');
|
||||
$this->db->JOIN(PDFORMS.' as PDFORMS','TEMPLATE_JSON_V2.form_id = PDFORMS.pd_form_id','LEFT');
|
||||
$this->db->WHERE('TEMPLATE_JSON_V2.isactive',1);
|
||||
$this->db->WHERE('TEMPLATE_JSON_V2.map_id',$map_id);
|
||||
$this->db->WHERE("(TEMPLATE_JSON_V2.is_form_status = 'COMPLETED' or TEMPLATE_JSON_V2.is_form_status = 'APPROVED' or TEMPLATE_JSON_V2.is_form_status = 'DRAFT')");
|
||||
$this->db->ORDER_BY('PDFORMS.pd_form_order');
|
||||
$template_forms = $this->db->GET()->result_array();
|
||||
//here Hard-coded
|
||||
if(count($template_forms) > 0){
|
||||
array_push($template_forms,Array('map_id'=>$map_id,'form_id' => '18','pd_form_order' => '2','pd_form_level_order' => '1','form_name' => 'General Information','is_form_disabled'=>0));
|
||||
array_push($template_forms,Array('map_id'=>$map_id,'form_id' => '26','pd_form_order' => '24','pd_form_level_order' => '1','form_name' => 'Photograph','is_form_disabled'=>0));
|
||||
array_push($template_forms,Array('map_id'=>$map_id,'form_id' => '18','pd_form_order' => '2','pd_form_level_order' => '1','form_name' => 'General Information','is_form_disabled'=>0,"template_id"=>null));
|
||||
array_push($template_forms,Array('map_id'=>$map_id,'form_id' => '26','pd_form_order' => '24','pd_form_level_order' => '1','form_name' => 'Photograph','is_form_disabled'=>0,"template_id"=>null));
|
||||
}
|
||||
$buiness_related_form = array(22,14,1,2,11,16);
|
||||
if(!strcasecmp($pd_master_detials[0]['lender_short_name'], 'CLIX')){
|
||||
|
||||
@ -313,24 +313,35 @@ class Template_Management_Model extends SPARQ_Model {
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getTemplateFormsV2($value,$flag){
|
||||
$this->db->SELECT('TEMPLATE_JSON_V2.id as template_id,TEMPLATE_JSON_V2.form_id,PDFORMS.pd_form_name as form_name,TEMPLATE_JSON_V2.json,TEMPLATE_JSON_V2.is_form_disabled,PDFORMS.is_business_form,TEMPLATE_JSON_V2.is_group_form,PDFORMS.pd_form_order,TEMPLATE_JSON_V2.is_form_status');
|
||||
$this->db->FROM(TEMPLATE_JSON_V2.' as TEMPLATE_JSON_V2');
|
||||
$this->db->JOIN(PDFORMS.' as PDFORMS','TEMPLATE_JSON_V2.form_id = PDFORMS.pd_form_id','LEFT');
|
||||
$this->db->WHERE('TEMPLATE_JSON_V2.isactive',1);
|
||||
$this->db->WHERE('TEMPLATE_JSON_V2.map_id',$value);
|
||||
if($flag == 1){
|
||||
$this->db->WHERE('TEMPLATE_JSON_V2.is_form_status',"COMPLETED");
|
||||
}else if($flag == 2){
|
||||
// $this->db->WHERE("(TEMPLATE_JSON_V2.is_form_status = 'APPROVED' or TEMPLATE_JSON_V2.is_form_status = 'DRAFT')");
|
||||
$this->db->WHERE('TEMPLATE_JSON_V2.is_form_status', "APPROVED");
|
||||
$this->db->OR_WHERE("TEMPLATE_JSON_V2.is_form_status", "DRAFT");
|
||||
}
|
||||
|
||||
$this->db->WHERE('PDFORMS.is_business_form',0);
|
||||
$this->db->ORDER_BY('PDFORMS.pd_form_order');
|
||||
$result = $this->db->GET()->result_array();
|
||||
return $result;
|
||||
public function getTemplateFormsV2($value){
|
||||
// $this->db->SELECT('TEMPLATE_JSON_V2.id as template_id,TEMPLATE_JSON_V2.form_id,PDFORMS.pd_form_name as form_name,TEMPLATE_JSON_V2.json,TEMPLATE_JSON_V2.is_form_disabled,PDFORMS.is_business_form,TEMPLATE_JSON_V2.is_group_form,PDFORMS.pd_form_order,TEMPLATE_JSON_V2.is_form_status');
|
||||
// $this->db->FROM(TEMPLATE_JSON_V2.' as TEMPLATE_JSON_V2');
|
||||
// $this->db->JOIN(PDFORMS.' as PDFORMS','TEMPLATE_JSON_V2.form_id = PDFORMS.pd_form_id','LEFT');
|
||||
// $this->db->WHERE('TEMPLATE_JSON_V2.isactive',1);
|
||||
// $this->db->WHERE('TEMPLATE_JSON_V2.map_id',$value);
|
||||
// $this->db->WHERE("(TEMPLATE_JSON_V2.is_form_status = 'COMPLETED')");
|
||||
// $this->db->OR_WHERE("(TEMPLATE_JSON_V2.is_form_status = 'APPROVED')");
|
||||
// $this->db->OR_WHERE("(TEMPLATE_JSON_V2.is_form_status = 'DRAFT')");
|
||||
// $this->db->WHERE('PDFORMS.is_business_form',0);
|
||||
// $this->db->ORDER_BY('PDFORMS.pd_form_order');
|
||||
// $result = $this->db->GET()->result_array();
|
||||
// return $result;
|
||||
$sql_query = "SELECT `TEMPLATE_JSON_V2`.`id` as `template_id`, `TEMPLATE_JSON_V2`.`form_id`, `PDFORMS`.`pd_form_name` as `form_name`,
|
||||
`TEMPLATE_JSON_V2`.`json`, `TEMPLATE_JSON_V2`.`is_form_disabled`, `PDFORMS`.`is_business_form`,
|
||||
`TEMPLATE_JSON_V2`.`is_group_form`, `PDFORMS`.`pd_form_order`, `TEMPLATE_JSON_V2`.`is_form_status`
|
||||
FROM `m_template_json_v2` as `TEMPLATE_JSON_V2`
|
||||
LEFT JOIN `m_pd_forms` as `PDFORMS` ON `TEMPLATE_JSON_V2`.`form_id` = `PDFORMS`.`pd_form_id`
|
||||
WHERE `TEMPLATE_JSON_V2`.`isactive` = 1
|
||||
AND `TEMPLATE_JSON_V2`.`map_id` = ".$value."
|
||||
AND `PDFORMS`.`is_business_form` = 0
|
||||
AND
|
||||
`TEMPLATE_JSON_V2`.`is_form_status` = 'COMPLETED'
|
||||
or
|
||||
`TEMPLATE_JSON_V2`.`is_form_status` = 'APPROVED'
|
||||
or
|
||||
`TEMPLATE_JSON_V2`.`is_form_status` = 'DRAFT'
|
||||
ORDER BY `PDFORMS`.`pd_form_order`";
|
||||
return $this->db->query($sql_query)->result_array();
|
||||
}
|
||||
|
||||
public function saveTemplateMapping($records,$table){
|
||||
@ -353,22 +364,46 @@ class Template_Management_Model extends SPARQ_Model {
|
||||
return count($afftectedRows)>0 ? true: false;
|
||||
}
|
||||
|
||||
public function getBuinessGroupForms($map_id){
|
||||
$this->db->SELECT('TEMPLATE_JSON_V2.id as template_id,TEMPLATE_JSON_V2.form_id,PDFORMS.pd_form_order,PDFORMS.pd_form_level_order,PDFORMS.pd_form_name as form_name,TEMPLATE_JSON_V2.is_form_disabled,PDFORMS.is_business_form,TEMPLATE_JSON_V2.is_group_form');
|
||||
public function getBuinessGroupForms_existing($map_id){
|
||||
$this->db->SELECT('TEMPLATE_JSON_V2.id as template_id,TEMPLATE_JSON_V2.form_id,PDFORMS.pd_form_order,PDFORMS.pd_form_level_order,PDFORMS.pd_form_name as form_name,TEMPLATE_JSON_V2.is_form_disabled,PDFORMS.is_business_form,TEMPLATE_JSON_V2.is_group_form');
|
||||
if(!empty($map_id)){
|
||||
$this->db->SELECT('TEMPLATE_JSON_V2.map_id,TEMPLATE_JSON_V2.json');
|
||||
$this->db->FROM(TEMPLATE_JSON_V2.' as TEMPLATE_JSON_V2');
|
||||
$this->db->JOIN(PDFORMS.' as PDFORMS','TEMPLATE_JSON_V2.form_id = PDFORMS.pd_form_id','LEFT');
|
||||
$this->db->WHERE('TEMPLATE_JSON_V2.map_id',$map_id);
|
||||
}else{
|
||||
$this->db->SELECT('TEMPLATE_JSON_V2.map_id,PDFORMS.form_template as json');
|
||||
$this->db->FROM(PDFORMS.' as PDFORMS');
|
||||
$this->db->JOIN(TEMPLATE_JSON_V2.' as TEMPLATE_JSON_V2','TEMPLATE_JSON_V2.form_id = PDFORMS.pd_form_id','LEFT');
|
||||
}
|
||||
$this->db->WHERE('TEMPLATE_JSON_V2.isactive',1);
|
||||
$this->db->WHERE('PDFORMS.is_business_form',1);
|
||||
$result = $this->db->GET()->result_array();
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getBuinessGroupForms($map_id){
|
||||
if(!empty($map_id)){
|
||||
$this->db->SELECT('TEMPLATE_JSON_V2.map_id,TEMPLATE_JSON_V2.json');
|
||||
$this->db->FROM(TEMPLATE_JSON_V2.' as TEMPLATE_JSON_V2');
|
||||
$this->db->JOIN(PDFORMS.' as PDFORMS','TEMPLATE_JSON_V2.form_id = PDFORMS.pd_form_id','LEFT');
|
||||
$this->db->WHERE('TEMPLATE_JSON_V2.map_id',$map_id);
|
||||
}else{
|
||||
$sql_query = "SELECT `TEMPLATE_JSON_V2`.`id` as `template_id`, `TEMPLATE_JSON_V2`.`form_id`, `PDFORMS`.`pd_form_order`, `PDFORMS`.`pd_form_level_order`, `PDFORMS`.`pd_form_name` as `form_name`, `TEMPLATE_JSON_V2`.`is_form_disabled`, `PDFORMS`.`is_business_form`, `TEMPLATE_JSON_V2`.`is_group_form`, `TEMPLATE_JSON_V2`.`is_form_status`, `TEMPLATE_JSON_V2`.`map_id`, `TEMPLATE_JSON_V2`.`json`
|
||||
FROM `m_template_json_v2` as `TEMPLATE_JSON_V2`
|
||||
LEFT JOIN `m_pd_forms` as `PDFORMS` ON `TEMPLATE_JSON_V2`.`form_id` = `PDFORMS`.`pd_form_id`
|
||||
WHERE `TEMPLATE_JSON_V2`.`map_id` = ".$map_id."
|
||||
AND `PDFORMS`.`is_business_form` = 1
|
||||
AND `TEMPLATE_JSON_V2`.`isactive` = 1
|
||||
AND `TEMPLATE_JSON_V2`.`is_form_status` = 'COMPLETED'
|
||||
OR `TEMPLATE_JSON_V2`.`is_form_status` = 'APPROVED'
|
||||
OR `TEMPLATE_JSON_V2`.`is_form_status` = 'DRAFT'";
|
||||
$result = $this->db->query($sql_query)->result_array();
|
||||
}else{
|
||||
$this->db->SELECT('TEMPLATE_JSON_V2.id as template_id,TEMPLATE_JSON_V2.form_id,PDFORMS.pd_form_order,PDFORMS.pd_form_level_order,PDFORMS.pd_form_name as form_name,TEMPLATE_JSON_V2.is_form_disabled,PDFORMS.is_business_form,TEMPLATE_JSON_V2.is_group_form,TEMPLATE_JSON_V2.is_form_status');
|
||||
$this->db->SELECT('TEMPLATE_JSON_V2.map_id,PDFORMS.form_template as json');
|
||||
$this->db->FROM(PDFORMS.' as PDFORMS');
|
||||
$this->db->JOIN(TEMPLATE_JSON_V2.' as TEMPLATE_JSON_V2','TEMPLATE_JSON_V2.form_id = PDFORMS.pd_form_id','LEFT');
|
||||
$this->db->WHERE('TEMPLATE_JSON_V2.isactive',1);
|
||||
$this->db->WHERE('PDFORMS.is_business_form',1);
|
||||
$result = $this->db->GET()->result_array();
|
||||
}
|
||||
$this->db->WHERE('TEMPLATE_JSON_V2.isactive',1);
|
||||
$this->db->WHERE('PDFORMS.is_business_form',1);
|
||||
$result = $this->db->GET()->result_array();
|
||||
return $result;
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1847,7 +1847,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
//echo $pd_offiecer_status_about_neighbor;
|
||||
if(count($existNeighRefCheck)>0){
|
||||
print_r($existNeighRefCheck);die();
|
||||
// print_r($existNeighRefCheck);die();
|
||||
?>
|
||||
|
||||
<?php foreach($existNeighRefCheck as $nkey => $nfValue) {
|
||||
|
||||
@ -6,6 +6,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
$dash = '<span style="color:black;"> </span>';
|
||||
// $product_name = $master[0]['abbr'];
|
||||
$rupee_symbol = "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>";
|
||||
// echo $pd_master_details[0]['main_applicant'];
|
||||
// echo $applicant_details[0]['company_name'];die();
|
||||
// $pd_type = "";
|
||||
// if($master[0]['sales_pd_type'] == 1){$pd_type = "Physical "; }else if($master[0]['sales_pd_type'] == 2){$pd_type = "Telephonic ";}
|
||||
// $company = array();
|
||||
@ -223,7 +225,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
<tr>
|
||||
<td colspan="3"> Name of the Company/Firm</td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo isset($applicant_details[0]['company_name']) ? $applicant_details[0]['company_name'] : $pd_master_details[0]['main_applicant']?></td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo isset($applicant_details[0]['company_name']) && (strlen($applicant_details[0]['company_name']) != 0) ? $applicant_details[0]['company_name'] : $pd_master_details[0]['main_applicant']?></td>
|
||||
</tr>
|
||||
|
||||
<?php if(isset($pd_section_data[1]['person_met']) && $pd_section_data[1]['person_met'] != ''){?>
|
||||
@ -859,7 +861,7 @@ $business_pd_visited_remark = (isset($pd_section_data[8]['business_pd_visited_re
|
||||
<?php if(isset($pd_section_data[10]) && strtolower($pd_section_data[10]['financial_info_available']) == 'yes') { ?>
|
||||
<tr>
|
||||
<td colspan="6" >Name of the Company / Firm whose financials are noted </td>
|
||||
<td class = "tdcenteralign" colspan="4" ><?php echo (isset($pd_section_data[10]['company_name'] ) ? ($company[$pd_section_data[10]['company_name']]) : (isset($applicant_details[0]['company_name']) ? $applicant_details[0]['company_name'] : $pd_master_details[0]['main_applicant'])) ?></td>
|
||||
<td class = "tdcenteralign" colspan="4" ><?php echo (isset($pd_section_data[10]['company_name'] ) ? ($company[$pd_section_data[10]['company_name']]) : (isset($applicant_details[0]['company_name']) && (strlen($applicant_details[0]['company_name']) != 0) ? $applicant_details[0]['company_name'] : $pd_master_details[0]['main_applicant'])) ?></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<table class="scorecard_table"><tbody>
|
||||
|
||||
@ -211,7 +211,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
<tr>
|
||||
<td colspan="3"> Name of the Company/Firm</td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo isset($applicant_details[0]['company_name']) ? $applicant_details[0]['company_name'] : $pd_master_details[0]['main_applicant']?></td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo isset($applicant_details[0]['company_name']) && (strlen($applicant_details[0]['company_name']) != 0) ? $applicant_details[0]['company_name'] : $pd_master_details[0]['main_applicant']?></td>
|
||||
</tr>
|
||||
|
||||
<?php if(isset($pd_section_data[1]['person_met']) && $pd_section_data[1]['person_met'] != ''){?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user