From 9eb9198a2a39cb83c7b3b087b542edece42c7519 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 26 Sep 2022 16:04:05 +0000 Subject: [PATCH] Multiple ZIP image fixes 1 : ps --- api/application/helpers/smc_creditpd_helper.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/application/helpers/smc_creditpd_helper.php b/api/application/helpers/smc_creditpd_helper.php index 0edc124e..708b9663 100644 --- a/api/application/helpers/smc_creditpd_helper.php +++ b/api/application/helpers/smc_creditpd_helper.php @@ -625,6 +625,9 @@ class smc_creditpd $CI->load->library('zip'); $CI->zip->add_dir('pdimages'); + + $is_this_multiple_image = array('property_images','supplier_image','stock_image','client_image','additional_photograph'); + $cl=1;$st=1;$su=1;$pr=1;$ad=1;//$first2character flag don't Deleted it. foreach($all_pd_images as $image) { @@ -642,6 +645,12 @@ class smc_creditpd } fclose( $ifp ); $MyFile = file_get_contents($src_local_file); + if( in_array($image['img_name'] ,$is_this_multiple_image)) + { $first2character = substr($image['img_name'], 0, 2); + $char = ${$first2character}; + $doc_name = $image['img_name']."_".$char; + ${$first2character}++; + } $CI->zip->add_data('pdimages/'.$doc_name.'.png',$MyFile); unlink($src_local_file); }