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) { switch ($fid) {
case 1: case 1:
// 1 trade_product_contact_person_name , person_landline ,person_stdcode // 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_pj_arr = $this->traverseArray($replaced_pj_arr, $arr1, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr1, $general_format); $replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr1, $general_format);
break; break;
case 2: case 2:
// 2 trade_product_contact_person_name , person_landline // 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_pj_arr = $this->traverseArray($replaced_pj_arr, $arr2, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr2, $general_format); $replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr2, $general_format);
break; break;
case 4: case 4:
// 4 other asset // 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_pj_arr = $this->traverseArray($replaced_pj_arr, $arr4, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr4, $general_format); $replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr4, $general_format);
break; break;
@ -872,6 +872,12 @@ class Data_Dump_Controller extends REST_Controller
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr6, $general_format); $replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr6, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr6, $general_format); $replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr6, $general_format);
break; 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: case 8:
// 8 label // 8 label
$arr8 = array('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); $replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr12, $general_format);
break; break;
case 13: case 13:
// 13 partner_name_master . gst_Regn_cert_pic , shop_eat_act_cert_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"); $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_pj_arr = $this->traverseArray($replaced_pj_arr, $arr13, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr13, $general_format); $replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr13, $general_format);
break; break;
case 17: 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_pj_arr = $this->traverseArray($replaced_pj_arr, $arr17, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr17, $general_format); $replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr17, $general_format);
break; break;
@ -913,7 +919,7 @@ class Data_Dump_Controller extends REST_Controller
break; break;
case 19: case 19:
// 19 neighbourhood_name // 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_pj_arr = $this->traverseArray($replaced_pj_arr, $arr19, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr19, $general_format); $replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr19, $general_format);
break; break;
@ -954,13 +960,20 @@ class Data_Dump_Controller extends REST_Controller
unlink($file); unlink($file);
} }
$bucketname = LENDER_BUCKET_NAME_PREFIX . $pdlenid; $bucketname = LENDER_BUCKET_NAME_PREFIX . $pdlenid;
$key = 'pd' . $pdid . '/*'; $key = 'pd' . $pdid;
$s3result = $this->aws_s3->deleteSingleObjFromBucket($bucketname, $key); $s3result = $this->aws_s3->deleteSingleObjFromBucket($bucketname, $key);
if (is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200) { if (is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200) {
log_message('ERROR', "s3result " . $s3result['@metadata']['statusCode']); log_message('ERROR', "s3result " . $s3result['@metadata']['statusCode']);
} else { } else {
log_message('ERROR', "Check here Not updated on S3 result " . $s3result['@metadata']['statusCode']); 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; $updt_on_tgr['pd_status'] = ARCHIVED;
@ -1017,10 +1030,18 @@ class Data_Dump_Controller extends REST_Controller
// } // }
} }
function f_get(){ public function checkjsonPD_post()
$fields = array('processed_json','json'); {
$where_condition_array = array('isactive' => 1, 'fk_pd_id' => 1, 'fk_form_id' => 18); $records = $this->post('records');
$pd_processed_forms = $this->PD_Model->selectCustomRecords($fields, $where_condition_array, PDFORMDETAILSJSON, array(), '', 'company_id', 'ASC'); $pdid = $records['pd_id'];
print_r($pd_processed_forms); $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'; $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); $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)) if(count($sales_pd_data))
{ {
@ -982,62 +982,64 @@ class Sales_PD_Controller extends REST_Controller {
{ {
$records = $this->post('records'); $records = $this->post('records');
$section_data = array(); $section_data = array();
if(!is_numeric($records['section_id'])){ if(!is_numeric($records['section_id'])){
// echo "i am here if";
// die(); // die();
$fields=array('id','sales_pd_id','section_id','status','createdby','createdon'); $fields=array('id','sales_pd_id','section_id','status','createdby','createdon');
if($records['section_id'] == 'data'){ $fields[] = 'section_data'; } 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); $section_data=$this->Sales_PD_Model->selectCustomRecords($fields,array('sales_pd_id' => $records['sales_pd_id'],'isactive' => 1),SALESPD_SECTION_DATA);
} }
else{ 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); $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(); // // echo "section_data";
if($records['section_id'] == 9 && count($section_data)) // // // print_r($section_data);
{ // // //print_r( json_decode($section_data[0]['section_data'],true));die();
$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); // // if($records['section_id'] == 9 && count($section_data))
//print_r($all_sales_pd_images);die(); // // {
$photo_questions = (json_decode(($section_data[0]['section_data']),true)); // // $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($photo_questions);
foreach ($photo_questions['questions'] as $key => $value) // // $photo_questions = (json_decode(($section_data[0]['section_data']),true));
{ // // // print_r($photo_questions);
if(isset($value['answer_value']) && $value['answer_value'] && !$value['is_repeatable']) // // foreach ($photo_questions['questions'] as $key => $value)
{ // // {
$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(isset($value['answer_value']) && $value['answer_value'] && !$value['is_repeatable'])
if(count($selfie)) // // {
{ // // $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);
$photo_questions['questions'][$key]['answer_value'] = $selfie[0]['img']; // // if(count($selfie))
//$photo_questions['questions'][$key]['answer_value'] = "CHNAGED"; // // {
} // // $photo_questions['questions'][$key]['answer_value'] = $selfie[0]['img'];
} // // //$photo_questions['questions'][$key]['answer_value'] = "CHNAGED";
else // // }
{ // // }
// // else
// // {
foreach ($value['questions_group'] as $v_key => $individual_value) // // foreach ($value['questions_group'] as $v_key => $individual_value)
{ // // {
//print_r($individual_value);die(); // // //print_r($individual_value);die();
//if($individual_value['questions'][0]['answer_value']) // // //if($individual_value['questions'][0]['answer_value'])
if(isset($individual_value['questions'][0]['answer_value'])) // // if(isset($individual_value['questions'][0]['answer_value']))
{ // // {
//iterate all_sales_pd_images to get one // // //iterate all_sales_pd_images to get one
foreach ($all_sales_pd_images as $img_key => $img_value) // // foreach ($all_sales_pd_images as $img_key => $img_value)
{ // // {
if($individual_value['questions'][0]['question_key'] == $img_value['img_name']) // // 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'] = $img_value['img'];
//$photo_questions['questions'][$key]['questions_group'][$v_key]['questions'][0]['answer_value'] = "CHANGED"; // // //$photo_questions['questions'][$key]['questions_group'][$v_key]['questions'][0]['answer_value'] = "CHANGED";
unset($all_sales_pd_images[$img_key]); // // unset($all_sales_pd_images[$img_key]);
break; // // break;
} // // }
} // // }
} // // }
} // // }
} // // }
} // // }
//die(); // // //die();
$photo_questions = json_encode($photo_questions); // // $photo_questions = json_encode($photo_questions);
$section_data[0]['section_data'] = $photo_questions; // $section_data[0]['section_data'] = $photo_questions;
} // }
@ -1465,6 +1467,14 @@ public function filterSalesPDList_post() {
$data = $this->Sales_PD_Model->testSaleSection(527); $data = $this->Sales_PD_Model->testSaleSection(527);
$this->response($data,REST_Controller::HTTP_OK); $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>"; echo "</table>";
} }
// ########################### End Of Score Card Section ######################################### // ########################### 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> </body>
</html> </html>