Image Editable backend changes : ps

This commit is contained in:
sanjeev.p 2021-10-26 20:27:04 +05:30
parent 97c5fab376
commit de62df0ec0
2 changed files with 18 additions and 15 deletions

View File

@ -1213,6 +1213,7 @@ class Common_Masters_Controller extends REST_Controller {
$section_names = array(array('section_id' => '1','section_name' => 'General Section'),array('section_id' => '2', 'section_name'=> 'Fund Requirement'),array('section_id' => '3', 'section_name'=> 'stakeholders'),array('section_id' => '4', 'section_name' => 'Brief of business'),array('section_id' => '5', 'section_name' => 'Financial'),array('section_id' => '6', 'section_name' => 'Property Details'),array('section_id' => '7', 'section_name' => 'Final Remraks'),array('section_id' => '8', 'section_name' => 'Officer Details'),array('section_id' => '9', 'section_name' => 'Photography'));
$config['sales_pd_section_to_fetch'] = $section_names;
$config['photo_names'] = array('selfie_with_person_met' => array('Person met','18',0,0),'person_met_id' => array('Person met ID Proof','18',0,0),'address_proof_visited' => array('Address Proof','5',0,0),'name_board_seen' => array('Name Board Seen','13',0,0),'machinary_image' => array('Machinery Image','22',0,0),'gst_Regn_cert_pic' => array('GST Regn Cert','13',0,0),'pf_regn_pic' => array('PF Regn','13',0,0),'esic_regn_pic' => array('ESIC Regn','13',0,0),'export_import_cert_pic' => array('Export Import Cert','13',0,0),'factory_cert_pic' => array('Factory Cert','13',0,0),'shop_eat_act_cert_pic' => array('Shop Est Act Cert','13',0,0),'eb_bill_pic' => array('EB Bill','13',0,0),'practice_cert_pic' => array('Cert of Practice','13',0,0),'fire_noc_pic' => array('Fire NOC','13',0,0),'stock_image' => array('Stock image','11',1,1),'client_image' => array('Client Bills','2',1,1),'supplier_image' => array('Supplier Bills','1',1,1));
$data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK;
$data['records'] = $config;

View File

@ -20,7 +20,7 @@ class PD_Controller extends REST_Controller {
//class level variable declaration
//protected $external_path;
private $photo_names = array('selfie_with_person_met' => array('Person met','18',0),'person_met_id' => array('Person met ID Proof','18',0),'address_proof_visited' => array('Address Proof','5',0),'name_board_seen' => array('Name Board Seen','13',0),'machinary_image' => array('Machinery Image','22',0),'gst_Regn_cert_pic' => array('GST Regn Cert','13',0),'pf_regn_pic' => array('PF Regn','13',0),'esic_regn_pic' => array('ESIC Regn','13',0),'export_import_cert_pic' => array('Export Import Cert','13',0),'factory_cert_pic' => array('Factory Cert','13',0),'shop_eat_act_cert_pic' => array('Shop Est Act Cert','13',0),'eb_bill_pic' => array('EB Bill','13',0),'practice_cert_pic' => array('Cert of Practice','13',0),'fire_noc_pic' => array('Fire NOC','13',0),'stock_image' => array('Stock image','11',1),'client_image' => array('Client Bills','2',1),'supplier_image' => array('Supplier Bills','1',1));
private $photo_names = array('selfie_with_person_met' => array('Person met','18',0,0),'person_met_id' => array('Person met ID Proof','18',0,0),'address_proof_visited' => array('Address Proof','5',0,0),'name_board_seen' => array('Name Board Seen','13',0,0),'machinary_image' => array('Machinery Image','22',0,0),'gst_Regn_cert_pic' => array('GST Regn Cert','13',0,0),'pf_regn_pic' => array('PF Regn','13',0,0),'esic_regn_pic' => array('ESIC Regn','13',0,0),'export_import_cert_pic' => array('Export Import Cert','13',0,0),'factory_cert_pic' => array('Factory Cert','13',0,0),'shop_eat_act_cert_pic' => array('Shop Est Act Cert','13',0,0),'eb_bill_pic' => array('EB Bill','13',0,0),'practice_cert_pic' => array('Cert of Practice','13',0,0),'fire_noc_pic' => array('Fire NOC','13',0,0),'stock_image' => array('Stock image','11',1,1),'client_image' => array('Client Bills','2',1,1),'supplier_image' => array('Supplier Bills','1',1,1));
private $existing_imges = array();
function __construct()
@ -9442,7 +9442,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
}
else
{
$temp_array = array('img_key' =>$key,'img_name' => $value[0],'fk_form_id' => $value[1],"is_multiple" => $value[2]);
$temp_array = array('img_key' =>$key,'img_name' => $value[0],'fk_form_id' => $value[1],"is_multiple" => $value[2],'pd_image_alias_name'=> "",'is_name_editable'=> $value[3]);
$temp_array[($value[2] ? 'img_data' : 'img_url')] = ($value[2] ? array() : '');
$final_data[] = $temp_array;
@ -9456,7 +9456,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
//print_r(count($this->existing_imges));
if(!$value['fk_form_id'] && ($value['pd_document_title'] != 'satellite'))
{
$final_data[] = array('img_key' =>'common_image','img_name' => $value['pd_document_title'],'img_url' => $value['doc_url'],'fk_form_id' => null,'pd_document_id' => $value['pd_document_id']);
$final_data[] = array('img_key' =>'common_image','img_name' => $value['pd_document_title'],'img_url' => $value['doc_url'],'fk_form_id' => null,'pd_document_id' => $value['pd_document_id'],'pd_image_alias_name'=> $value['pd_image_alias_name'],'is_name_editable'=> $value['is_name_editable']);
unset($this->existing_imges[$key]);
}
elseif($value['pd_document_title'] != 'satellite' && $value['fk_form_id'] == 24)
@ -9480,7 +9480,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
if($is_listed)
{
$final_data[] = array('img_key' => 'docs_to_be_collected','img_name' => $value['pd_document_title'],'img_url' => $value['doc_url'],'fk_form_id' => 24,'is_multiple' => 0,'pd_document_id' => $value['pd_document_id']);
$final_data[] = array('img_key' => 'docs_to_be_collected','img_name' => $value['pd_document_title'],'img_url' => $value['doc_url'],'fk_form_id' => 24,'is_multiple' => 0,'pd_document_id' => $value['pd_document_id'],'pd_image_alias_name'=> $value['pd_image_alias_name'],'is_name_editable'=> $value['is_name_editable']);
//break;
}
@ -9496,7 +9496,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
{
foreach ($docs_to_be_collected as $key => $value)
{
$final_data[] = array('img_key' => 'docs_to_be_collected','img_name' => $value['doc_name'],'img_url' => "",'fk_form_id' => "24",'pd_document_id' => $value['pd_document_id']);
$final_data[] = array('img_key' => 'docs_to_be_collected','img_name' => $value['doc_name'],'img_url' => "",'fk_form_id' => "24",'pd_document_id' => $value['pd_document_id'],'pd_image_alias_name'=> $value['pd_image_alias_name'],'is_name_editable'=> $value['is_name_editable']);
}
}
@ -9506,7 +9506,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
{
foreach ($this->photo_names as $key => $value)
{
$final_data[] = array('img_key' => $key,'img_name' => $value[0],'img_url' => "",'fk_form_id' => $value[1],"is_multiple" => $value[2]);
$final_data[] = array('img_key' => $key,'img_name' => $value[0],'img_url' => "",'fk_form_id' => $value[1],"is_multiple" => $value[2],'pd_image_alias_name'=> "",'is_name_editable'=> $value[3]);
}
@ -9514,7 +9514,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
{
foreach ($docs_to_be_collected as $key => $value)
{
$final_data[] = array('img_key' => 'docs_to_be_collected','img_name' => $value['doc_name'],'img_url' => "",'fk_form_id' => "24","is_multiple" => 0);
$final_data[] = array('img_key' => 'docs_to_be_collected','img_name' => $value['doc_name'],'img_url' => "",'fk_form_id' => "24","is_multiple" => 0,'pd_image_alias_name'=> "",'is_name_editable'=> 0);
}
}
}
@ -9546,7 +9546,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
{
//echo "SELFIE";
$arr = array('img_key' => 'selfie_with_person_met','img_name' => $this->photo_names['selfie_with_person_met'][0],'fk_form_id' => $this->photo_names['selfie_with_person_met'][1],'img_url' => $value['doc_url'],'is_multiple' => 0,'pd_document_id' => $value['pd_document_id']);
$arr = array('img_key' => 'selfie_with_person_met','img_name' => $this->photo_names['selfie_with_person_met'][0],'fk_form_id' => $this->photo_names['selfie_with_person_met'][1],'img_url' => $value['doc_url'],'is_multiple' => 0,'pd_document_id' => $value['pd_document_id'],'pd_image_alias_name' =>$value['pd_image_alias_name'] ,'is_name_editable' => $this->photo_names['selfie_with_person_met'][3]);
unset($this->existing_imges[$key]);
return $arr;
@ -9555,7 +9555,8 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
{
//echo 'HOLD';
$arr = array('img_key' => 'person_met_id','img_name' => $this->photo_names['person_met_id'][0],'img_url' => $value['doc_url'],'fk_form_id' => $this->photo_names['person_met_id'][1],'is_multiple' => 0,'pd_document_id' => $value['pd_document_id']);
$arr = array('img_key' => 'person_met_id','img_name' => $this->photo_names['person_met_id'][0],'img_url' => $value['doc_url'],'fk_form_id' => $this->photo_names['person_met_id'][1],'is_multiple' => 0,'pd_document_id' => $value['pd_document_id'],'pd_image_alias_name' =>$value['pd_image_alias_name'] ,'is_name_editable' => $this->photo_names['person_met_id'][3]);
unset($this->existing_imges[$key]);
return $arr;
// unset($this->photo_names['selfie_with_person_met']);
@ -9565,7 +9566,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
{
//echo "APPROACH";
$arr = array('img_key' => 'approach_to_pd_location','img_name' => $this->photo_names['approach_to_pd_location'][0],'img_url' => $value['doc_url'],'fk_form_id' => $this->photo_names['approach_to_pd_location'][1],'is_multiple' => 0,'pd_document_id' => $value['pd_document_id']);
$arr = array('img_key' => 'approach_to_pd_location','img_name' => $this->photo_names['approach_to_pd_location'][0],'img_url' => $value['doc_url'],'fk_form_id' => $this->photo_names['approach_to_pd_location'][1],'is_multiple' => 0,'pd_document_id' => $value['pd_document_id'],'pd_image_alias_name' =>$value['pd_image_alias_name'] ,'is_name_editable' => $this->photo_names['person_met_id'][3]);
unset($this->existing_imges[$key]);
return $arr;
// unset($this->photo_names['selfie_with_person_met']);
@ -9575,7 +9576,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
{
//echo "APPROACH";
$arr = array('img_key' => 'name_board_seen','img_name' => $this->photo_names['name_board_seen'][0],'img_url' => $value['doc_url'],'fk_form_id' => $this->photo_names['name_board_seen'][1],'is_multiple' => 0,'pd_document_id' => $value['pd_document_id']);
$arr = array('img_key' => 'name_board_seen','img_name' => $this->photo_names['name_board_seen'][0],'img_url' => $value['doc_url'],'fk_form_id' => $this->photo_names['name_board_seen'][1],'is_multiple' => 0,'pd_document_id' => $value['pd_document_id'],'pd_image_alias_name' =>$value['pd_image_alias_name'] ,'is_name_editable' => $this->photo_names['name_board_seen'][3]);
unset($this->existing_imges[$key]);
return $arr;
// unset($this->photo_names['selfie_with_person_met']);
@ -9588,21 +9589,22 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
//echo "OTHER";
if($current_img[2])
{
//echo $current_img_key.'***'.$value['pd_document_title'];
$current_multiple_img_key = $current_img_key;
if(!array_key_exists($current_img_key, $multiple_img_data))
{
$multiple_img_data[$current_img_key] = array('img_key' => $value['pd_document_title'],'img_name' => $this->photo_names[ $value['pd_document_title'] ][0],'img_data' => array(array('img_url' => $value['doc_url'],'img_name' => $value['pd_document_title'],'pd_document_id' => $value['pd_document_id'])),'fk_form_id' => $this->photo_names[ $value['pd_document_title'] ][1],'is_multiple' => $current_img[2]);
$multiple_img_data[$current_img_key] = array('img_key' => $value['pd_document_title'],'img_name' => $this->photo_names[ $value['pd_document_title'] ][0],'img_data' => array(array('img_url' => $value['doc_url'],'img_name' => $value['pd_document_title'],'pd_document_id' => $value['pd_document_id'])),'fk_form_id' => $this->photo_names[ $value['pd_document_title'] ][1],'is_multiple' => $current_img[2],'pd_image_alias_name' =>$value['pd_image_alias_name'] ,'is_name_editable' => $this->photo_names[ $value['pd_document_title'] ][3]);
}
else
{
$multiple_img_data[$current_img_key]['img_data'][] = array('img_url' => $value['doc_url'],'img_name' => $value['pd_document_title'],'pd_document_id' => $value['pd_document_id']);
$multiple_img_data[$current_img_key]['img_data'][] = array('img_url' => $value['doc_url'],'img_name' => $value['pd_document_title'],'pd_document_id' => $value['pd_document_id'],'pd_image_alias_name' =>$value['pd_image_alias_name'] ,'is_name_editable' => $value['is_name_editable']);
}
}
else
{
$arr = array('img_key' => $value['pd_document_title'],'img_name' => $this->photo_names[ $value['pd_document_title'] ][0],'img_url' => $value['doc_url'],'fk_form_id' => $this->photo_names[ $value['pd_document_title'] ][1],'is_multiple' => $current_img[2],'pd_document_id' => $value['pd_document_id']);
$arr = array('img_key' => $value['pd_document_title'],'img_name' => $this->photo_names[ $value['pd_document_title'] ][0],'img_url' => $value['doc_url'],'fk_form_id' => $this->photo_names[ $value['pd_document_title'] ][1],'is_multiple' => $current_img[2],'pd_document_id' => $value['pd_document_id'],'pd_image_alias_name' =>$value['pd_image_alias_name'] ,'is_name_editable' => $value['is_name_editable']);
return $arr;
}
unset($this->existing_imges[$key]);