FI PD report DI : ps
This commit is contained in:
parent
04e460272a
commit
fdd0ab7738
@ -4003,7 +4003,6 @@ class PD_Controller extends REST_Controller
|
||||
}
|
||||
|
||||
// Get all assigned pd forms associated with this pd from template_forms table
|
||||
// pdtype 4 is template_id ella.
|
||||
if ($template_id == null) {
|
||||
$columns = array('TEMPLATEFORMS.form_id', 'PDFORMS.pd_form_name');
|
||||
$table = TEMPLATEFORMS . ' as TEMPLATEFORMS';
|
||||
@ -4023,8 +4022,9 @@ class PD_Controller extends REST_Controller
|
||||
//$pd_form_raw_data_with_score = $this->calculatePDScore($pd_form_raw_data);
|
||||
$transformed_data = $this->transformKeyPairToQuestionAnswers($pd_form_raw_data, $template_form_detail['form_id']);
|
||||
|
||||
|
||||
if($final_data_to_response['fk_pd_type'] != 4){
|
||||
$final_data_to_response['question_answers']['form_details'][] = array('name' => [$template_form_detail['pd_form_name']], 'details' => $transformed_data);
|
||||
}else{$final_data_to_response['question_answers']['form_details'] = array(); }
|
||||
|
||||
//$final_data_to_response['question_answers']['form_details'] = array_merge($final_data_to_response['question_answers']['form_details'],array('name' =>[$template_form_detail['pd_form_name']],'details' => $transformed_data));
|
||||
|
||||
@ -4040,7 +4040,6 @@ class PD_Controller extends REST_Controller
|
||||
foreach ($final_data_to_response as $key => $value) {
|
||||
$object->$key = $value;
|
||||
}
|
||||
if($final_data_to_response['fk_pd_type'] == 4){ $final_data_to_response = 1; }
|
||||
if (count($final_data_to_response)) {
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
@ -4769,7 +4768,7 @@ class PD_Controller extends REST_Controller
|
||||
$pd_report_time = date('Y-m-d-H-i-s');
|
||||
$pd_report_store = $this->external_path . '/pd_reports/' . $pdid . '/' . $pd_report_time . '.html';
|
||||
$is_write_done = file_put_contents($pd_report_store, $t);
|
||||
die;
|
||||
|
||||
if ($is_write_done) {
|
||||
|
||||
//$update = $this->PD_Model->updateRecords(array('pd_report_html_filename' => $pd_report_time),PDTRIGGER,array('pd_id' => $pdid));
|
||||
|
||||
@ -1935,6 +1935,7 @@ class PD_Model extends SPARQ_Model {
|
||||
// echo $pd_form_id;
|
||||
$pd_master_detials = $this->getPDMasterDetails($pd_id);
|
||||
|
||||
if(!empty($pd_master_detials[0]['fk_pd_template_id'])){
|
||||
$this->db->SELECT('PDFORMDETAILS.fk_pd_id,PDFORMDETAILS.fk_form_id,PDFORMDETAILS.iter_column_name,PDFORMDETAILS.iter_sub_column_name,PDFORMDETAILS.iteration, PDFORMDETAILS.column_name, PDFORMDETAILS.column_id, PDFORMDETAILS.column_value,TEMPLATECATEGORYWEIGHTAGE.weightage as category_weightage,TEMPLATECATEGORYWEIGHTAGE.fk_question_category_id,QUESTIONKEYMAPPING.fk_category_id,QUESTIONCATEGORY.category_name,SCORECARDQUESTIONS.score_question_id,SCORECARDQUESTIONS.weightage as question_weightage,SCORECARDQUESTIONS.calc_type,SCORECARDANSWERS.score');
|
||||
$this->db->FROM(PDFORMDETAILS.' as PDFORMDETAILS');
|
||||
$this->db->JOIN(TEMPLATECATEGORYWEIGHTAGE.' as TEMPLATECATEGORYWEIGHTAGE','TEMPLATECATEGORYWEIGHTAGE.fk_template_id ='.$pd_master_detials[0]['fk_pd_template_id']);
|
||||
@ -1983,7 +1984,7 @@ class PD_Model extends SPARQ_Model {
|
||||
}
|
||||
}
|
||||
|
||||
return $form_details;
|
||||
return $form_details;}else{ return array();}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -419,7 +419,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
|
||||
$value = $general_form['json'];
|
||||
$all_applicant_details = $applicants_details;
|
||||
if ($value['is_person_met'] == 'yes') {
|
||||
echo '<p>' . 'Applicant ('.$value['Name_of_the_Person_met'].') was met at the visited address.' . '</p>';
|
||||
echo '<p>' . 'Applicant <b>('.$value['Name_of_the_Person_met'].')</b> was met at the visited address.' . '</p>';
|
||||
}else if ($value['is_person_met'] == 'no') {
|
||||
echo '<p>' . '('.$value['Name_of_the_Person_met'].') ('.$value['designation_person_met_master'].') was met at the visited address during visit..' . '</p>';
|
||||
}
|
||||
@ -438,15 +438,15 @@ defined('BASEPATH') or exit('No direct script access allowed');
|
||||
echo '<h3 contenteditable="true">Address Details: </h3>';
|
||||
if ($address_value['is_pd_done_on_initiated_address'] == 'yes') {
|
||||
echo '<p>' . '
|
||||
Visit Initiated Address: '.$address_value['initiated_address'].' , '.$address_value['city_master'].' , '.$address_value['state_master'].' , '.$address_value['pincode_master'].'. </p>';
|
||||
<b>Visit Initiated Address:</b> '.$address_value['initiated_address'].' , '.$address_value['city_master'].' , '.$address_value['state_master'].' , '.$address_value['pincode_master'].'. </p>';
|
||||
}
|
||||
if ($address_value['is_pd_done_on_initiated_address'] == 'no') {
|
||||
echo '<p>' . '
|
||||
Address Where Visit is Initiated: '.$address_value['initiated_address'].' , '.$address_value['city_master'].' , '.$address_value['state_master'].' , '.$address_value['pincode_master'].'.
|
||||
Address Where Visit was actually done: '.$address_value['actual_pd_address'].' , '.$address_value['city2_master'].' , '.$address_value['state2_master'].' , '.$address_value['pincode2_master'].'.
|
||||
Reason for change in Visit address: '.$address_value['end_use'].'.</p>';
|
||||
<b>Address Where Visit is Initiated:</b> '.$address_value['initiated_address'].' , '.$address_value['city_master'].' , '.$address_value['state_master'].' , '.$address_value['pincode_master'].'.
|
||||
<b>Address Where Visit was actually done:</b> '.$address_value['actual_pd_address'].' , '.$address_value['city2_master'].' , '.$address_value['state2_master'].' , '.$address_value['pincode2_master'].'.
|
||||
<b>Reason for change in Visit address:</b> '.$address_value['end_use'].'.</p>';
|
||||
}
|
||||
echo '<p>' . 'The Field Visit was done at '.$address_value['address_type_master'].' of the loan applicants. The '.$address_value['address_type_master'].' is located in a '.$address_value['locality_master'].' and the estimated area of the '.$address_value['address_type_master'].' is '.$address_value['uom_master'].'. The location was '.$address_value['Approach_to_PD_location'].'. As Per Officer, the '.$address_value['address_type_master'].' is situated in a '.$address_value['comment_locality_master'].' Locality. ' . '</p>';
|
||||
echo '<p>' . 'The Field Visit was done at <b>'.$address_value['address_type_master'].'</b> of the loan applicants. The <b>'.$address_value['address_type_master'].'</b> is located in a <b>'.$address_value['locality_master'].'</b> and the estimated area of the <b>'.$address_value['address_type_master'].'</b> is <b>'.$address_value['uom_master'].'</b>. The location was <b>'.$address_value['Approach_to_PD_location'].'</b>. As Per Officer, the <b>'.$address_value['address_type_master'].'</b> is situated in a <b>'.$address_value['comment_locality_master'].'</b> Locality. ' . '</p>';
|
||||
}
|
||||
?>
|
||||
<div id="page_break"></div>
|
||||
@ -460,28 +460,30 @@ defined('BASEPATH') or exit('No direct script access allowed');
|
||||
$ov_value = $Office_visit_data['json'];
|
||||
|
||||
$business_activities_during_visit = implode(', ', $ov_value['Was_any_business_activities_observed_during_visit']);
|
||||
$business_activities_during_visit = preg_replace("/_/i", ' ', $business_activities_during_visit );
|
||||
$company_name_sighted = $ov_value['was_the_company_name_board_sighted'] == 'Yes' ? 'seen' : 'not seen';
|
||||
|
||||
echo '<p>Brief of the Business / Service Model: '.$ov_value['business_brief'].'.</p>
|
||||
<p>Visited address is of a '.$ov_value['visited_address_is'].'.</p>
|
||||
<p>At the time of visit, the officer sighted '.$ov_value['no_of_employees_sighted_by_PD_officer_during_visit'].' employees at the business premises.</p>
|
||||
<p>The Business Name board was .'.$company_name_sighted.'.at the visited address.</p>';
|
||||
echo '<ul><li><b>Brief of the Business / Service Model:</b> '.$ov_value['business_brief'].'.</li>
|
||||
<li>Visited address is of a <b>'.$ov_value['visited_address_is'].'</b>.</li>
|
||||
<li>At the time of visit, the officer sighted <b>'.$ov_value['no_of_employees_sighted_by_PD_officer_during_visit'].'</b> employees at the business premises.</li>
|
||||
<li>The Business Name board was <b>'.$company_name_sighted.'</b> at the visited address.</li>';
|
||||
if($ov_value['do_you_want_to_add_other_documents'] == 'Yes'){
|
||||
echo '<p>'.$ov_value['remarks_others'].'was sighted during visit and pictures are enclosed with the Report.</p>';
|
||||
echo '<li> <b>'.$ov_value['remarks_others'].'</b> was sighted during visit and pictures are enclosed with the Report.</li>';
|
||||
}
|
||||
if($ov_value['Visited_address_is_rented'] != 'not disclosed '){
|
||||
echo '<p>The '.$ov_value['visited_address_is'].' is '.$ov_value['Visited_address_is_rented'].'.</p>';
|
||||
echo '<li>The <b>'.$ov_value['visited_address_is'].'</b> is <b>'.$ov_value['Visited_address_is_rented'].'</b>.</li>';
|
||||
}
|
||||
if($ov_value['Visited_address_is_rented'] == 'not disclosed '){
|
||||
echo '<p>The '.$ov_value['visited_address_is'].' is Rented or Owned is Not Disclosed by the person met.</p>';
|
||||
echo '<li>The <b>'.$ov_value['visited_address_is'].'</b> is Rented or Owned is Not Disclosed by the person met.</li>';
|
||||
}
|
||||
echo '<p>Business Activity was '.$company_name_sighted.' and '.$business_activities_during_visit.'</p>';
|
||||
echo '<li>Business Activity was <b>'.$company_name_sighted.'</b> and <b>'.$business_activities_during_visit.'</b> </li>';
|
||||
if($ov_value['stock_photograph'] == 'Yes'){
|
||||
echo '<p>Stock was seen during visit and pictures are enclosed with the Report.</p>';
|
||||
echo '<li>Stock was seen during visit and pictures are enclosed with the Report.</li>';
|
||||
}
|
||||
if($ov_value['stock_photograph'] == 'No'){
|
||||
echo '<p>Stock was not seen during visit because '.$ov_value['reason_of_stock_non_availability'].' .</p>';
|
||||
echo '<li>Stock was not seen during visit because <b>'.$ov_value['reason_of_stock_non_availability'].'</b> .</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
?>
|
||||
<div id="page_break"></div>
|
||||
<!-- ####################### office visit DI ends ############################-->
|
||||
@ -500,67 +502,64 @@ defined('BASEPATH') or exit('No direct script access allowed');
|
||||
if(count($neighbour_value)>0){
|
||||
|
||||
$neighbourhood_name='Neighbour Check was done with ';
|
||||
$neighbourhood_name.= $neighbour_value['neighbourhood_name'].'.';
|
||||
$neighbourhood_do_know = null;
|
||||
$neighbourhood_business_running_yr = null;
|
||||
$ownership = null;
|
||||
$neighbourhood_name_only = $neighbour_value['neighbourhood_name'];
|
||||
if(strtoupper($neighbour_value['do_know'])=='YES'){
|
||||
|
||||
$neighbourhood_do_know = $neighbour_value['neighbourhood_name']." knows about applicants and their business.";
|
||||
} else if(strtoupper($neighbour_value['do_know'])=='NO'){
|
||||
$neighbourhood_do_know = $neighbour_value['neighbourhood_name']." did not know about the applicant or their business.";
|
||||
}
|
||||
|
||||
if($neighbour_value['how_long_do_know_in_year'] || $neighbour_value['how_long_do_know_in_month'])
|
||||
{
|
||||
$neighbourhood_business_running_yr = $neighbour_value['neighbourhood_name']." confirmed that the business has been in operation for ";
|
||||
$neighbourhood_business_running_yr .= ($neighbour_value['how_long_do_know_in_year'] == 1) ? $neighbour_value['how_long_do_know_in_year']." year" : (($neighbour_value['how_long_do_know_in_year'] > 1) ? $neighbour_value['how_long_do_know_in_year']." years" : "");
|
||||
$neighbour_value['how_long_do_know_in_year'] && $neighbour_value['how_long_do_know_in_month'] ? $neighbourhood_business_running_yr .= ' and ':'';
|
||||
$neighbourhood_business_running_yr .= ($neighbour_value['how_long_do_know_in_month'] == 1) ? $neighbour_value['how_long_do_know_in_month']." month" : (($neighbour_value['how_long_do_know_in_month'] > 1) ? $neighbour_value['how_long_do_know_in_month']." months" : "");
|
||||
$neighbourhood_business_running_yr .= '.';
|
||||
}
|
||||
else
|
||||
{
|
||||
$neighbourhood_business_running_yr = $neighbour_value['neighbourhood_name']." was not aware of how long the business is in operation.";
|
||||
}
|
||||
$ownwers_list = '';
|
||||
if($neighbour_value['organisation_owner']){
|
||||
foreach($neighbour_value['organisation_owner'] as $owner)
|
||||
{
|
||||
if($owner['id'] != 0)
|
||||
{
|
||||
$title = MYUTIL::applicantTitleName($applicants_details,$owner['id']);
|
||||
$ownwers_list .= $title.' '.APPLICANTNAME_GRABBER::getApplicantsNameById($owner['id'],$applicants_details).' , ';
|
||||
|
||||
$neighbourhood_name.= $neighbour_value['neighbourhood_name'].'.';
|
||||
$neighbourhood_do_know = null;
|
||||
$neighbourhood_business_running_yr = null;
|
||||
$ownership = null;
|
||||
$neighbourhood_name_only = $neighbour_value['neighbourhood_name'];
|
||||
if(strtoupper($neighbour_value['do_know'])=='YES'){
|
||||
$neighbourhood_do_know = $neighbour_value['neighbourhood_name']." knows about applicants and their business.";
|
||||
} else if(strtoupper($neighbour_value['do_know'])=='NO'){
|
||||
$neighbourhood_do_know = $neighbour_value['neighbourhood_name']." did not know about the applicant or their business.";
|
||||
}
|
||||
if($neighbour_value['how_long_do_know_in_year'] || $neighbour_value['how_long_do_know_in_month'])
|
||||
{
|
||||
$neighbourhood_business_running_yr = $neighbour_value['neighbourhood_name']." confirmed that the business has been in operation for ";
|
||||
$neighbourhood_business_running_yr .= ($neighbour_value['how_long_do_know_in_year'] == 1) ? $neighbour_value['how_long_do_know_in_year']." year" : (($neighbour_value['how_long_do_know_in_year'] > 1) ? $neighbour_value['how_long_do_know_in_year']." years" : "");
|
||||
$neighbour_value['how_long_do_know_in_year'] && $neighbour_value['how_long_do_know_in_month'] ? $neighbourhood_business_running_yr .= ' and ':'';
|
||||
$neighbourhood_business_running_yr .= ($neighbour_value['how_long_do_know_in_month'] == 1) ? $neighbour_value['how_long_do_know_in_month']." month" : (($neighbour_value['how_long_do_know_in_month'] > 1) ? $neighbour_value['how_long_do_know_in_month']." months" : "");
|
||||
$neighbourhood_business_running_yr .= '.';
|
||||
}
|
||||
else
|
||||
{
|
||||
$ownwers_list .= ' '.$neighbour_value['other_organisation_owner'].' , ';
|
||||
$neighbourhood_business_running_yr = $neighbour_value['neighbourhood_name']." was not aware of how long the business is in operation.";
|
||||
}
|
||||
}
|
||||
//echo $ownwers_list;
|
||||
//$ownwers_list = substr_replace($ownwers_list,'', strrpos(-$ownwers_list,','),1);
|
||||
//echo $ownwers_list;
|
||||
//echo $ownwers_list;echo "**********";
|
||||
|
||||
$ownwers_list = substr_replace($ownwers_list,'', strrpos($ownwers_list,','),1);
|
||||
if(strrpos($ownwers_list,','))
|
||||
{
|
||||
$ownwers_list = substr_replace($ownwers_list,' and ', strrpos($ownwers_list,','),1);
|
||||
}
|
||||
|
||||
|
||||
$grammer1 = count($neighbour_value['organisation_owner']) > 1 ? ' are ': ' is ';
|
||||
$grammer2 = count($neighbour_value['organisation_owner']) > 1 ? 'owners': 'owner';
|
||||
$ownership = 'As per '.$neighbour_value['neighbourhood_name'].' the '.$grammer2 .' of '.$company_name.$grammer1.$ownwers_list.'.';
|
||||
|
||||
}else
|
||||
{
|
||||
$ownership = $neighbour_value['neighbourhood_name']." was not aware of the business ownership.";
|
||||
}
|
||||
$existNeighRefCheck = array('neighbourhood_name_only' => $neighbourhood_name_only,'neighbourhood_name' => $neighbourhood_name,'neighbourhood_do_know' => $neighbourhood_do_know,'neighbourhood_business_running_yr' => $neighbourhood_business_running_yr,'ownership' => $ownership);
|
||||
print_r($existNeighRefCheck);die();
|
||||
$ownwers_list = '';
|
||||
if($neighbour_value['organisation_owner']){
|
||||
foreach($neighbour_value['organisation_owner'] as $owner)
|
||||
{
|
||||
if($owner['id'] != 0)
|
||||
{
|
||||
$title = MYUTIL::applicantTitleName($applicants_details,$owner['id']);
|
||||
$ownwers_list .= $title.' '.APPLICANTNAME_GRABBER::getApplicantsNameById($owner['id'],$applicants_details).' , ';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$ownwers_list .= ' '.$neighbour_value['other_organisation_owner'].' , ';
|
||||
}
|
||||
}
|
||||
//echo $ownwers_list;
|
||||
//$ownwers_list = substr_replace($ownwers_list,'', strrpos(-$ownwers_list,','),1);
|
||||
//echo $ownwers_list;
|
||||
//echo $ownwers_list;echo "**********";
|
||||
|
||||
$ownwers_list = substr_replace($ownwers_list,'', strrpos($ownwers_list,','),1);
|
||||
if(strrpos($ownwers_list,','))
|
||||
{
|
||||
$ownwers_list = substr_replace($ownwers_list,' and ', strrpos($ownwers_list,','),1);
|
||||
}
|
||||
|
||||
|
||||
$grammer1 = count($neighbour_value['organisation_owner']) > 1 ? ' are ': ' is ';
|
||||
$grammer2 = count($neighbour_value['organisation_owner']) > 1 ? 'owners': 'owner';
|
||||
$ownership = 'As per '.$neighbour_value['neighbourhood_name'].' the '.$grammer2 .' of '.$company_name.$grammer1.$ownwers_list.'.';
|
||||
|
||||
}else
|
||||
{
|
||||
$ownership = $neighbour_value['neighbourhood_name']." was not aware of the business ownership.";
|
||||
}
|
||||
$existNeighRefCheck = array('neighbourhood_name_only' => $neighbourhood_name_only,'neighbourhood_name' => $neighbourhood_name,'neighbourhood_do_know' => $neighbourhood_do_know,'neighbourhood_business_running_yr' => $neighbourhood_business_running_yr,'ownership' => $ownership);
|
||||
?>
|
||||
|
||||
<?php foreach($existNeighRefCheck as $nkey => $nfValue) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user