MEQ REPORT FEEDBACKS

This commit is contained in:
Velz2020 2020-12-17 11:39:41 +05:30
parent 0fdf204aab
commit fe7daeb666
3 changed files with 46 additions and 38 deletions

View File

@ -187,11 +187,9 @@ class Sales_PD_Controller extends REST_Controller {
mkdir($this->external_path.'/sales_pd/'.$sales_pd_id,0777);
}
if($sales_pd_data[0]['is_pdf'] || $sales_pd_data[0]['is_edited'])
if(!$sales_pd_data[0]['is_pdf'] || $sales_pd_data[0]['is_edited'])
{
$all_section_data = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('sales_pd_id' => $sales_pd_id,'isactive' => 1),SALESPD_SECTION_DATA,array(),'','section_id','ASC');
// print_r(json_decode($all_section_data[2]['section_data'],true));//die();
$view_data['master'] = $sales_pd_data;
@ -200,7 +198,7 @@ class Sales_PD_Controller extends REST_Controller {
// print_r($section['section_id']);die();
$view_data['section'.$section['section_id'] ] = $this->processSalesPDJSON($section);//die();
}
// print_r($view_data['section6']);die();
// print_r($view_data['section3']);die();
$view_data['section9'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name !=' => 'satellite','isactive' => 1),SALEPD_DOCS);
$view_data['satellite_image'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name' => 'satellite','isactive' => 1),SALEPD_DOCS);
$view_data['product_id'] = $sales_pd_data[0]['product_id'];
@ -214,8 +212,8 @@ class Sales_PD_Controller extends REST_Controller {
//End of PDF Gen using DOM PDF
$output_file = $this->external_path ."/sales_pd/" . $sales_pd_id . "/temp.pdf";
$bytes = file_put_contents($output_file, $pdf_doc);
// echo $bytes;
// die();
//echo $bytes;
//die();
$bucket_data = array('bucket_name'=>$bucket_name,'key'=>$key,'sourcefile'=>$this->external_path.'/sales_pd/'.$sales_pd_id.'/temp.pdf');
log_message('ERROR','####SALES PD REPORT UPLOAD TO S3'.$sales_pd_id);
$s3result= $this->aws_s3->uploadFileToS3Bucket($bucket_data);
@ -353,7 +351,7 @@ class Sales_PD_Controller extends REST_Controller {
{
$temp_array[ $question['question_key'] ] = isset($question['answer_value']) ? $question['answer_value'] : null;
if($question['question_key'] == 'state' || $question['question_key'] == 'city' || $question['question_key'] == 'pincode' || $question['question_key'] == 'loan_purpose' || $question['question_key'] == 'constitution' || $question['question_key'] == 'about_locality' || $question['question_key'] == 'equipment_list' || $question['question_key'] == 'vendor_list')
if($question['question_key'] == 'state' || $question['question_key'] == 'city' || $question['question_key'] == 'pincode' || $question['question_key'] == 'loan_purpose' || $question['question_key'] == 'constitution' || $question['question_key'] == 'about_locality' || $question['question_key'] == 'equipment_list' || $question['question_key'] == 'vendor_list' || $question['question_key'] == 'person_met_designation')
{
//if($question['type'] == 4) { print_r($question['answer_value']); }
$temp_array[ $question['question_key'] ] = $this->getMasterData($question['answer_value'],$question['answers']);
@ -511,14 +509,14 @@ class Sales_PD_Controller extends REST_Controller {
$lender_short_name = $this->Sales_PD_Model->selectCustomRecords(array('short_name'),array('entity_id' => $records['lender_id']),ENTITY);
$product_short_name = $this->Sales_PD_Model->selectCustomRecords(array('abbr'),array('product_id' => $records['product_id']),PRODUCTS);
$section_names = array('1' => 'General Section','2' => 'Fund Requirement','3' => 'stakeholders','4' => 'Brief of business','5' => 'Financial','6' => 'Property Details','7' => 'Final Remraks','8' => 'Officer Details','9' => 'Photography');
if($product_short_name == 'MEQ')
if($product_short_name[0]['abbr'] == 'MEQ')
{
$section_names = array('1' => 'General Section','2' => 'Fund Requirement','3' => 'stakeholders','4' => 'Institution Details','5' => 'Product Information','6' => 'Financial Information','7' => 'Final Remraks','8' => 'Officer Details','9' => 'Photography');
}
//$count = $this->Sales_PD_Model->selectCustomRecords(array('count(*) as count'),array('lender_id' => $records['lender_id'],'product_id' => $records['product_id']),SALES_PD_DATA);
$count = $this->Sales_PD_Model->selectCustomRecords(array('count(*) as count'),array('lender_id' => $records['lender_id'],'product_id' => $records['product_id']),SALES_PD_DATA);
// die();
if($records['sales_pd_id'] == '' || $records['sales_pd_id'] == null)
@ -540,6 +538,7 @@ class Sales_PD_Controller extends REST_Controller {
$salepd_serial_no .= '-'.(++$count[0]['count']);
$records['sales_pd_sno'] = $salepd_serial_no;
// print_r($records);die();
$id = $this->Sales_PD_Model->saveRecords($records,SALES_PD_DATA);
}
else
@ -586,7 +585,7 @@ class Sales_PD_Controller extends REST_Controller {
if(count($gen))
{
$gen = json_decode($gen[0]['section_data'],true);
echo $gen['questions'][2]['answer_value'];
//echo $gen['questions'][2]['answer_value'];
if($gen['questions'][2]['answer_value'] == 9 || $gen['questions'][2]['answer_value'] == 10)
{
unset($dup_of_section_names[3]);// remove stake holders if MEQ Gen sectio have constitiion as socity or trust
@ -1023,7 +1022,7 @@ public function filterSalesPDList_post() {
$imgs = array('selfie_with_person_met' => array('is_multiple' => 0,'img_name' => 'Selfie of the person contacted'),'name_board_seen' => array('is_multiple' => 1,'img_name' => 'Business Name Board'),'stock_image' => array('is_multiple' => 1,'img_name' => 'Stock Images'),'workplace_interior_image' => array('is_multiple' => 1,'img_name' => 'Work Place Interior'));
if($product_short_name[0]['abbr'] == 'MEQ')
{
$imgs = array('selfie_with_person_met' => array('is_multiple' => 0,'img_name' => 'Selfie of the person contacted'),'hospital_building' => array('is_multiple' => 1,'img_name' => 'Hospital building photo'));
$imgs = array('selfie_with_person_met' => array('is_multiple' => 0,'img_name' => 'Selfie of the person contacted'),'hospital_building' => array('is_multiple' => 1,'img_name' => 'Hospital building photo'),'name_board_seen' => array('is_multiple' => 1,'img_name' => 'Name Board'),'institute_interior' => array('is_multiple' => 1,'img_name' => 'Institute interior potographs'));
}
$img_data = array();

View File

@ -165,19 +165,28 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td colspan="3"> Constitution</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['constitution']?></td>
</tr>
<tr>
<tr>
<td colspan="3">Name of the person met during the visit</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['person_met_during_visit']?></td>
</tr>
<tr>
<td colspan="3">Person met Designation and contact no</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['person_met_designation'].'-'.$section1['person_met_contact_no']?></td>
</tr>
<!-- <tr>
<td colspan="3"><?php if($master[0]['sales_pd_type'] == 1){echo 'Name of Person Met during visit'; }else{ echo 'Name of the Person Contacted'; } ?></td>
<td class = "tdcenteralign" colspan="7"><?php echo $section1['person_met_during_visit']?></td>
</tr>
</tr> -->
<tr>
<td colspan="3" rowspan="2" ><?php if($master[0]['sales_pd_type'] == 1){echo 'Address Visited'; }else{ echo 'Business Address'; } ?></td>
<td class = "tdcenteralign" colspan="7"><?php echo $section1['address_visited']?></td>
</tr>
<tr>
<td>City</td>
<td class = "tdcenteralign"><?php echo $section1['state']?></td>
<td>State</td>
<td class = "tdcenteralign"><?php echo $section1['city']?></td>
<td>State</td>
<td class = "tdcenteralign"><?php echo $section1['state']?></td>
<td>PIN</td>
<td class = "tdcenteralign" colspan="2"><?php if(isset($section1['pincode_others'])){ echo $section1['pincode_others']; } else { echo $section1['pincode']; }?></td>
</tr>
@ -215,26 +224,26 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<th class="thlargefont" colspan="10">Details of Key Stakeholders in the Business</th>
</tr>
<tr>
<th colspan="6">Name</th>
<th colspan="2" >Share Holding</th>
<th colspan="2" >Year(s) in Current Business</th>
<!-- <th colspan="1">Total Work Exp(Yrs)</th>
<th colspan="3" >Previous Experience Details</th>
<th colspan="2" >Started Business</th> -->
<th colspan="3">Name</th>
<th colspan="1" >Share Holding</th>
<th colspan="1" >Year(s) in Current Business</th>
<th colspan="1">Total Work Exp(Yrs)</th>
<th colspan="2" >Previous Experience Details</th>
<th colspan="2" >Started Business</th>
</tr>
<?php
foreach ($section3 as $section3_key => $section3_value)
{
echo '<tr><td class="tdcenteralign" colspan="6">'.$section3_value['name'] .'</td>'.
'<td class="tdcenteralign" colspan="2">'.$section3_value['share_holding'].'%</td>'.
'<td class="tdcenteralign" colspan="2">'.$section3_value['vintage_in_current_biz'].'</td>'.'</tr>';
//'<td class="tdcenteralign" colspan="1">'.$section3_value['total_work_exp'].'</td>'.
echo '<tr><td class="tdcenteralign" colspan="3">'.$section3_value['name'] .'</td>'.
'<td class="tdcenteralign" colspan="1">'.$section3_value['share_holding'].'%</td>'.
'<td class="tdcenteralign" colspan="1">'.$section3_value['vintage_in_current_biz'].'</td>'.
'<td class="tdcenteralign" colspan="1">'.$section3_value['total_work_exp'].'</td>'.
//'<td class="tdcenteralign" colspan="3">'.( isset ($section3_value['previous_experience_details']) && $section3_value['previous_experience_details'] ? $section3_value['previous_experience_details'] : 'NA' ).'</td>'.
//'<td class="tdcenteralign" colspan="2" style="text-align: center">'.$section3_value['started_biz'].'</td>'.
//'</tr>';
'<td class="tdcenteralign" colspan="2">'.( isset ($section3_value['previous_experience_details']) && $section3_value['previous_experience_details'] ? $section3_value['previous_experience_details'] : 'NA' ).'</td>'.
'<td class="tdcenteralign" colspan="2" style="text-align: center">'.$section3_value['started_biz'].'</td>'.
'</tr>';
}
}
@ -248,7 +257,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<tr>
<td colspan="3" >Type of institution</td>
<td class = "tdcenteralign" colspan="2" ><?php echo ($section4['institution_type'])?></td>
<td colspan="2">About the Locality</td>
<td colspan="2">Locality type</td>
<td class = "tdcenteralign" colspan="3"> <?php echo ($section4['about_locality'])?></td>
</tr>
@ -256,7 +265,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td colspan="3" >Institution vintage</td>
<td class = "tdcenteralign" colspan="2" ><?php echo ($section4['instituion_vitage'])?></td>
<td colspan="2">If existing ( Since When) </td>
<td class = "tdcenteralign" colspan="3"> <?php echo ($section4['existing_since'])?></td>
<td class = "tdcenteralign" colspan="3"> <?php echo isset($section4['existing_since']) ? $section4['existing_since'] : '-'?></td>
</tr>
<tr>
<td colspan="3" >Opening New Branch</td>
@ -271,7 +280,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td class = "tdcenteralign" colspan="3"> <?php echo ($section4['floor'])?></td>
</tr>
<tr>
<td colspan="3">How many Bedded</td>
<td colspan="3">Number of beds</td>
<td class = "tdcenteralign" colspan="2" ><?php echo ($section4['how_many_beds'])?></td>
<td colspan="2">Occupancy ratio </td>
<td class = "tdcenteralign" colspan="3"> <?php echo ($section4['occupancy_ratio'])?></td>
@ -299,7 +308,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<th class="thlargefont" colspan="10">Product Information</th>
</tr>
<tr>
<td colspan="5">Equipment List</td>
<td colspan="5">Equipment Name</td>
<td class = "tdcenteralign" colspan="5" ><?php echo ($section5['equipment_list'])?></td>
</tr>
<?php if(isset($section5['equipment_list_other'])) { ?>
@ -312,10 +321,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
?>
<tr>
<td colspan="5">Total invoice value of the selected product</td>
<td class = "tdcenteralign" colspan="5"> <?php echo ($section5['tot_product_invoice_value'])?></td>
<td class = "tdcenteralign" colspan="5"> <?php echo $rupee_symbol.''.MYUTIL::customIndianNumberFormat(($section5['tot_product_invoice_value']))?></td>
</tr>
<tr>
<td colspan="5">Vendor list</td>
<td colspan="5">Vendor Name</td>
<td class = "tdcenteralign" colspan="5"> <?php echo ($section5['vendor_list'])?></td>
</tr>
<?php if(isset($section5['equipment_list_other']))
@ -538,7 +547,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
?>
<?php
$iter = 0;
$photo_names = array('selfie_with_person_met' => 'Selfie with person met','approach_to_pd_location' => 'Approach to pd location','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','workplace_interior_image' => 'Workplace interior image','satellite1' => 'satellite');
$photo_names = array('selfie_with_person_met' => 'Selfie with person met','hospital_building' => 'Hospital Building','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','workplace_interior_image' => 'Workplace interior image','satellite1' => 'satellite');
if($master[0]['sales_pd_type'] == 2){ $photo_names['selfie_with_person_met'] = 'Selfie of the person contacted';}
//echo count($section9);die();
//print_r(array_keys($section9));die();

View File

@ -171,9 +171,9 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</tr>
<tr>
<td>City</td>
<td class = "tdcenteralign"><?php echo $section1['state']?></td>
<td>State</td>
<td class = "tdcenteralign"><?php echo $section1['city']?></td>
<td>State</td>
<td class = "tdcenteralign"><?php echo $section1['state']?></td>
<td>PIN</td>
<td class = "tdcenteralign" colspan="2"><?php if(isset($section1['pincode_others'])){ echo $section1['pincode_others']; } else { echo $section1['pincode']; }?></td>
</tr>