pd purge docs : ps

This commit is contained in:
VE10-Sanjeev 2022-10-20 14:01:08 +05:30
parent 5882f4ece1
commit 7db356b7f2
3 changed files with 92 additions and 91 deletions

View File

@ -844,19 +844,19 @@ class Data_Dump_Controller extends REST_Controller
switch ($fid) {
case 1:
// 1 trade_product_contact_person_name , person_landline ,person_stdcode
$arr1 = array('trade_product_contact_person_name', 'person_landline', 'person_stdcode');
$arr1 = array('trade_product_contact_person_name','trade_product_contact_person_mobile_number','person_stdcode,person_landline','manufacturing_contact_person_name','manufacturing_contact_person_mobile_number','service_provider_contact_person_name','service_provider_contact_person_mobile_number');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr1, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr1, $general_format);
break;
case 2:
// 2 trade_product_contact_person_name , person_landline
$arr2 = array('trade_product_contact_person_name', 'person_landline');
$arr2 = array('manufacturing_contact_person_name','manufacturing_contact_person_mobile_number','trade_product_contact_person_name','trade_product_contact_person_mobile_number','service_provider_product_contact_person_name','service_provider_product_contact_person_mobile_number','person_stdcode','person_landline');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr2, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr2, $general_format);
break;
case 4:
// 4 other asset
$arr4 = array('address_of_the_property');
$arr4 = array('address_of_the_property','other_owner');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr4, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr4, $general_format);
break;
@ -872,6 +872,12 @@ class Data_Dump_Controller extends REST_Controller
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr6, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr6, $general_format);
break;
case 7:
// 7 banking Details
$arr6 = array('other_applicant','other_applicant_business');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr6, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr6, $general_format);
break;
case 8:
// 8 label
$arr8 = array('label');
@ -895,13 +901,13 @@ class Data_Dump_Controller extends REST_Controller
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr12, $general_format);
break;
case 13:
// 13 partner_name_master . gst_Regn_cert_pic , shop_eat_act_cert_pic
$arr13 = array("partner_name_master", "gst_Regn_cert_pic", "shop_eat_act_cert_pic", "export_import_cert_pic", "factory_cert_pic", "pf_regn_pic", "esic_regn_pic", "eb_bill_pic");
// 13 partner_name_master . gst_Regn_cert_pic , shop_eat_act_cert_pic,family_member_name
$arr13 = array("partner_name_master", "gst_Regn_cert_pic", "shop_eat_act_cert_pic", "export_import_cert_pic", "factory_cert_pic", "pf_regn_pic", "esic_regn_pic", "eb_bill_pic","family_member_name");
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr13, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr13, $general_format);
break;
case 17:
$arr17 = array('address_property');
$arr17 = array('address_property','other_person_met','property_owner_other','name_tenant_lessees','name_tenant_lessees_per_met','property_owner_other_per_met','other_person_met','whom_third_party_check_done');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr17, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr17, $general_format);
break;
@ -913,7 +919,7 @@ class Data_Dump_Controller extends REST_Controller
break;
case 19:
// 19 neighbourhood_name
$arr19 = array('neighbourhood_name');
$arr19 = array('neighbourhood_name','mobile','reference_name','std_code','landline');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr19, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr19, $general_format);
break;
@ -954,13 +960,20 @@ class Data_Dump_Controller extends REST_Controller
unlink($file);
}
$bucketname = LENDER_BUCKET_NAME_PREFIX . $pdlenid;
$key = 'pd' . $pdid . '/*';
$key = 'pd' . $pdid;
$s3result = $this->aws_s3->deleteSingleObjFromBucket($bucketname, $key);
if (is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200) {
log_message('ERROR', "s3result " . $s3result['@metadata']['statusCode']);
} else {
log_message('ERROR', "Check here Not updated on S3 result " . $s3result['@metadata']['statusCode']);
}
$bucket_name = OPTIMIZED_IMAGE_BUCKET_NAME;
$optimizeds3result = $this->aws_s3->deleteSingleObjFromBucket($bucket_name, $key);
if (is_object($optimizeds3result) && $optimizeds3result['ObjectURL'] != '' && $optimizeds3result['@metadata']['statusCode'] == 200) {
log_message('ERROR', "optimizeds3result " . $optimizeds3result['@metadata']['statusCode']);
} else {
log_message('ERROR', "Check here Not updated on Optimized s3 result " . $optimizeds3result['@metadata']['statusCode']);
}
}
}
$updt_on_tgr['pd_status'] = ARCHIVED;
@ -1017,10 +1030,18 @@ class Data_Dump_Controller extends REST_Controller
// }
}
function f_get(){
$fields = array('processed_json','json');
$where_condition_array = array('isactive' => 1, 'fk_pd_id' => 1, 'fk_form_id' => 18);
$pd_processed_forms = $this->PD_Model->selectCustomRecords($fields, $where_condition_array, PDFORMDETAILSJSON, array(), '', 'company_id', 'ASC');
print_r($pd_processed_forms);
public function checkjsonPD_post()
{
$records = $this->post('records');
$pdid = $records['pd_id'];
$fromid = $records['form_id'];
$fields = array('json', 'company_id','processed_json');
$where_condition_array = array('isactive' => 1, 'fk_form_id' => $fromid, 'fk_pd_id' => $pdid);
$data = $this->PD_Model->selectCustomRecords($fields, $where_condition_array, PDFORMDETAILSJSON);
$dat['j'] = (json_decode($data[0]['json'],true));
$dat['pj'] =(json_decode($data[0]['processed_json'],true));
$this->response($dat, REST_Controller::HTTP_OK);
}
}

View File

@ -429,7 +429,7 @@ class Sales_PD_Controller extends REST_Controller {
$order_by = 'SALES_PD_DATA.sales_pd_id';
$sales_pd_data = $this->Sales_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array,$order_by,'DESC','',$or_where);
// print_r($this->db->last_query());die();
print_r($this->db->last_query());die();
if(count($sales_pd_data))
{
@ -982,62 +982,64 @@ class Sales_PD_Controller extends REST_Controller {
{
$records = $this->post('records');
$section_data = array();
if(!is_numeric($records['section_id'])){
// echo "i am here if";
// die();
$fields=array('id','sales_pd_id','section_id','status','createdby','createdon');
if($records['section_id'] == 'data'){ $fields[] = 'section_data'; }
$section_data=$this->Sales_PD_Model->selectCustomRecords($fields,array('sales_pd_id' => $records['sales_pd_id'],'isactive' => 1),SALESPD_SECTION_DATA);
}
else{
// echo "i am here else";
$section_data = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('sales_pd_id' => $records['sales_pd_id'],'isactive' => 1,'section_id' => $records['section_id']),SALESPD_SECTION_DATA);
//print_r( json_decode($section_data[0]['section_data'],true));die();
if($records['section_id'] == 9 && count($section_data))
{
$all_sales_pd_images = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $records['sales_pd_id'],'img_name !=' => 'satellite','isactive' => 1),SALEPD_DOCS);
//print_r($all_sales_pd_images);die();
$photo_questions = (json_decode(($section_data[0]['section_data']),true));
// print_r($photo_questions);
foreach ($photo_questions['questions'] as $key => $value)
{
if(isset($value['answer_value']) && $value['answer_value'] && !$value['is_repeatable'])
{
$selfie = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $records['sales_pd_id'],'img_name' => 'selfie_with_person_met','isactive' => 1),SALEPD_DOCS);
if(count($selfie))
{
$photo_questions['questions'][$key]['answer_value'] = $selfie[0]['img'];
//$photo_questions['questions'][$key]['answer_value'] = "CHNAGED";
}
}
else
{
// // echo "section_data";
// // // print_r($section_data);
// // //print_r( json_decode($section_data[0]['section_data'],true));die();
// // if($records['section_id'] == 9 && count($section_data))
// // {
// // $all_sales_pd_images = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $records['sales_pd_id'],'img_name !=' => 'satellite','isactive' => 1),SALEPD_DOCS);
// // $photo_questions = (json_decode(($section_data[0]['section_data']),true));
// // // print_r($photo_questions);
// // foreach ($photo_questions['questions'] as $key => $value)
// // {
// // if(isset($value['answer_value']) && $value['answer_value'] && !$value['is_repeatable'])
// // {
// // $selfie = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $records['sales_pd_id'],'img_name' => 'selfie_with_person_met','isactive' => 1),SALEPD_DOCS);
// // if(count($selfie))
// // {
// // $photo_questions['questions'][$key]['answer_value'] = $selfie[0]['img'];
// // //$photo_questions['questions'][$key]['answer_value'] = "CHNAGED";
// // }
// // }
// // else
// // {
foreach ($value['questions_group'] as $v_key => $individual_value)
{
//print_r($individual_value);die();
//if($individual_value['questions'][0]['answer_value'])
if(isset($individual_value['questions'][0]['answer_value']))
{
//iterate all_sales_pd_images to get one
foreach ($all_sales_pd_images as $img_key => $img_value)
{
if($individual_value['questions'][0]['question_key'] == $img_value['img_name'])
{
$photo_questions['questions'][$key]['questions_group'][$v_key]['questions'][0]['answer_value'] = $img_value['img'];
//$photo_questions['questions'][$key]['questions_group'][$v_key]['questions'][0]['answer_value'] = "CHANGED";
unset($all_sales_pd_images[$img_key]);
break;
}
}
}
}
}
}
//die();
$photo_questions = json_encode($photo_questions);
$section_data[0]['section_data'] = $photo_questions;
}
// // foreach ($value['questions_group'] as $v_key => $individual_value)
// // {
// // //print_r($individual_value);die();
// // //if($individual_value['questions'][0]['answer_value'])
// // if(isset($individual_value['questions'][0]['answer_value']))
// // {
// // //iterate all_sales_pd_images to get one
// // foreach ($all_sales_pd_images as $img_key => $img_value)
// // {
// // if($individual_value['questions'][0]['question_key'] == $img_value['img_name'])
// // {
// // $photo_questions['questions'][$key]['questions_group'][$v_key]['questions'][0]['answer_value'] = $img_value['img'];
// // //$photo_questions['questions'][$key]['questions_group'][$v_key]['questions'][0]['answer_value'] = "CHANGED";
// // unset($all_sales_pd_images[$img_key]);
// // break;
// // }
// // }
// // }
// // }
// // }
// // }
// // //die();
// // $photo_questions = json_encode($photo_questions);
// $section_data[0]['section_data'] = $photo_questions;
// }
@ -1465,6 +1467,14 @@ public function filterSalesPDList_post() {
$data = $this->Sales_PD_Model->testSaleSection(527);
$this->response($data,REST_Controller::HTTP_OK);
}
public function checksalesPD_post()
{
$records = $this->post('records');
$section_data = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('sales_pd_id' => $records['sales_pd_id'],'isactive' => 1,'section_id' => $records['section_id']),SALESPD_SECTION_DATA);
print_r(json_decode($section_data[0]['section_data'],true));
}
}

View File

@ -5158,37 +5158,7 @@ if($total_no_of_business > 0) {
echo "</table>";
}
// ########################### End Of Score Card Section #########################################
echo "here check";
?>
<div class="PB-container">
<div class="PB-skills">
<h3>Similarty</h3>
<div class="PB-progress-bar">
<div class="PB-red">
<span>70%</span>
</div>
</div>
<h3>Similarty</h3>
<div class="PB-progress-bar">
<div class="PB-green">
<span>55%</span>
</div>
</div>
<h3>Similarty</h3>
<div class="PB-progress-bar">
<div class="PB-orange">
<span>67%</span>
</div>
</div>
<h3>Similarty</h3>
<div class="PB-progress-bar">
<div class="PB-html">
<span>37</span>
</div>
</div>
</div>
</div>
</body>
</html>