INLINE PHOTO FOR BUSINESS FORM

This commit is contained in:
Velz2020 2019-07-12 19:20:02 +05:30
parent f9c88069ef
commit 3218738775
6 changed files with 175 additions and 95 deletions

View File

@ -7177,7 +7177,7 @@ class PD_Controller extends REST_Controller {
// $incomplete_details[] = 'Supplier Section - '.$supplier_name.' - Images Not Found';
// }
}
else if($manu_value['manufacturing_raw_material_name'] == "" && $manu_value['manufacturing_supplier_name'] == "" && $manu_value['manufacturing_contact_person_name'] != "" && ($manu_value['manufacturing_contact_person_mobile_number'] == "" || $manu_value['person_landline'] == ""))
else if($manu_value['manufacturing_raw_material_name'] == "" || $manu_value['manufacturing_supplier_name'] == "" || $manu_value['manufacturing_contact_person_name'] != "" || ($manu_value['manufacturing_contact_person_mobile_number'] == "" || $manu_value['person_landline'] == ""))
{
$insufficient_supplier_info++;
}
@ -7227,7 +7227,7 @@ class PD_Controller extends REST_Controller {
// $incomplete_details[] = 'Supplier Section - '.$supplier_name.' - Images Not Found';
// }
else if($trading_value['trade_product_name'] == "" && $trading_value['trade_supplier_name'] == "" && $trading_value['trade_product_contact_person_name'] != "" && ($trading_value['trade_product_contact_person_mobile_number'] == "" || $trading_value['person_landline'] == ""))
else if($trading_value['trade_product_name'] == "" || $trading_value['trade_supplier_name'] == "" || $trading_value['trade_product_contact_person_name'] != "" || ($trading_value['trade_product_contact_person_mobile_number'] == "" || $trading_value['person_landline'] == ""))
{
$insufficient_supplier_info++;
}
@ -7276,7 +7276,7 @@ class PD_Controller extends REST_Controller {
// $incomplete_details[] = 'Supplier Section - '.$supplier_name.' - Images Not Found';
// }
else if($service_value['service_provider_name'] == "" && $service_value['service_provider_supplier_name'] == "" && $service_value['service_provider_contact_person_name'] == "" && ($service_value['service_provider_contact_person_mobile_number'] == "" || $service_value['person_landline'] == ""))
else if($service_value['service_provider_name'] == "" || $service_value['service_provider_supplier_name'] == "" || $service_value['service_provider_contact_person_name'] == "" || ($service_value['service_provider_contact_person_mobile_number'] == "" || $service_value['person_landline'] == ""))
{
$insufficient_supplier_info++;
}
@ -7296,8 +7296,9 @@ class PD_Controller extends REST_Controller {
}
}
if($supplier_count && (count($supplier_images) != 3) ){ $incomplete_details[] = 'Supplier Section - Images Not sufficient'; }
//echo $supplier_count. count($supplier_images);die();
//echo $insufficient_supplier_info;
if($supplier_form['bill_info'] == 'yes' && $supplier_count && (count($supplier_images) < 3) ){ $incomplete_details[] = 'Supplier Section - Images Not sufficient'; }
if($insufficient_supplier_info){ $incomplete_details[] = 'Supplier Section - Information Not sufficient';
}
@ -7352,7 +7353,7 @@ class PD_Controller extends REST_Controller {
// }
}
else if($value['manufacturing_product_name'] == "" && $value['manufacturing_client_name'] == "" && $value['manufacturing_contact_person_name'] == "" && ($value['manufacturing_contact_person_mobile_number'] == "" || $value['person_landline'] == ""))
else if($value['manufacturing_product_name'] == "" || $value['manufacturing_client_name'] == "" || $value['manufacturing_contact_person_name'] == "" || ($value['manufacturing_contact_person_mobile_number'] == "" || $value['person_landline'] == ""))
{
$insufficient_client_info++;
}
@ -7397,7 +7398,7 @@ class PD_Controller extends REST_Controller {
// $incomplete_details[] = 'Client Section - '.$client_name .'- Images Not Found';
// }
}
else if($value['trade_product_name'] == "" && (isset($value['trade_client_name'])) && $value['trade_client_name'] == "" && $value['trade_product_contact_person_name'] == "" && ($value['trade_product_contact_person_mobile_number'] == "" || $value['person_landline'] == ""))
else if($value['trade_product_name'] == "" || (isset($value['trade_client_name'])) || $value['trade_client_name'] == "" || $value['trade_product_contact_person_name'] == "" || ($value['trade_product_contact_person_mobile_number'] == "" || $value['person_landline'] == ""))
{
$insufficient_client_info++;
}
@ -7442,7 +7443,7 @@ class PD_Controller extends REST_Controller {
// }
}
else if($value['service_provider_product_name'] == "" && $value['service_provider_client_name'] == "" && $value['service_provider_product_contact_person_name'] == "" && ($value['service_provider_product_contact_person_mobile_number'] == "" || $value['person_landline'] == ""))
else if($value['service_provider_product_name'] == "" || $value['service_provider_client_name'] == "" || $value['service_provider_product_contact_person_name'] == "" || ($value['service_provider_product_contact_person_mobile_number'] == "" || $value['person_landline'] == ""))
{
$insufficient_client_info++;
}
@ -7455,8 +7456,8 @@ class PD_Controller extends REST_Controller {
}
}
//echo $client_count;die();
if($client_count && (count($client_images) != 3) ){ $incomplete_details[] = 'Client Section - Images not sufficient';}
if($insufficient_client_info){ $incomplete_details[] = 'Client Section - Information Insufficient';}
if($client_form['bill_info'] == 'yes' && $client_count && (count($client_images) < 3) ){ $incomplete_details[] = 'Client Section - Images not sufficient';}
if($insufficient_client_info){ $incomplete_details[] = 'Client Section - Information Not Sufficient';}
}
}
@ -7526,7 +7527,7 @@ class PD_Controller extends REST_Controller {
}
}
if( $total_stock_observed != 0 && !(count($pd_images[11])) != 3)//&& !count($pd_images[11][0])) )
if( $total_stock_observed != 0 && !(count($pd_images[11])))//&& !count($pd_images[11][0])) )
{
$incomplete_details[] = 'Stock Section - Images not sufficient. Available Images';// - '.(count($pd_images[11]) ? count($pd_images[11]) : 0);
}
@ -7645,7 +7646,7 @@ class PD_Controller extends REST_Controller {
$fk_user_id = $records['fk_user_id'];
$select_data = array('notification_token_id');
//$where_condition_array = array('fk_user_id' =>$fk_user_id );
$where_condition_array = array('fk_user_id' =>$fk_user_id );
$exist_data = $this->PD_Model->selectCustomRecords($select_data,$where_condition_array,USERNOTIFICATIONTOKENS);
if(!count($exist_data))

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 192 KiB

View File

@ -32,15 +32,92 @@ class INLINEPHOTOTRANSFORM
public static function retransformBusinessFormInlinePhotos($records)
{
$CI =&get_instance();
$pd_details =$CI->PD_Model->getPDMasterDetails($records['pdid']);
$busienss_info_location = (isset($records['business_info_location']) ? $records['business_info_location'] : null);
if(isset($records['shop_eat_act_cert']) && $records['shop_eat_act_cert'] == 'yes' && isset($records['shop_eat_act_cert_pic']) && $records['shop_eat_act_cert_pic'] != '')
{
$base64 = self::addTimestampAndReturnBase64($CI,$records['shop_eat_act_cert_pic'],'shop_eat_act_cert_pic',$pd_details,13,$records['company_id'],$busienss_info_location);
$records['shop_eat_act_cert_pic'] = $base64;
}
if(isset($records['gst_Regn_cert']) && $records['gst_Regn_cert'] == 'yes' && isset($records['gst_Regn_cert_pic']) && $records['gst_Regn_cert_pic'] != '')
{
$base64 = self::addTimestampAndReturnBase64($CI,$records['gst_Regn_cert_pic'],'gst_Regn_cert_pic',$pd_details,13,$records['company_id'],$busienss_info_location);
$records['gst_Regn_cert_pic'] = $base64;
}
if(isset($records['pf_regn']) && $records['pf_regn'] == 'yes' && isset($records['pf_regn_pic']) && $records['pf_regn_pic'] != '')
{
$base64 = self::addTimestampAndReturnBase64($CI,$records['pf_regn_pic'],'pf_regn_pic',$pd_details,13,$records['company_id'],$busienss_info_location);
$records['pf_regn_pic'] = $base64;
}
if(isset($records['esic_regn']) && $records['esic_regn'] == 'yes' && isset($records['esic_regn_pic']) && $records['esic_regn_pic'] != '')
{
$base64 = self::addTimestampAndReturnBase64($CI,$records['esic_regn_pic'],'esic_regn_pic',$pd_details,13,$records['company_id'],$busienss_info_location);
$records['esic_regn_pic'] = $base64;
}
if(isset($records['export_import_cert']) && $records['export_import_cert'] == 'yes' && isset($records['export_import_cert_pic']) && $records['export_import_cert_pic'] != '')
{
$base64 = self::addTimestampAndReturnBase64($CI,$records['export_import_cert_pic'],'export_import_cert_pic',$pd_details,13,$records['company_id'],$busienss_info_location);
$records['export_import_cert_pic'] = $base64;
}
if(isset($records['factory_cert']) && $records['factory_cert'] == 'yes' && isset($records['factory_cert_pic']) && $records['factory_cert_pic'] != '')
{
$base64 = self::addTimestampAndReturnBase64($CI,$records['factory_cert_pic'],'factory_cert_pic',$pd_details,13,$records['company_id'],$busienss_info_location);
$records['factory_cert_pic'] = $base64;
}
if(isset($records['practice_cert']) && $records['practice_cert'] == 'yes' && isset($records['practice_cert_pic']) && $records['practice_cert_pic'] != '')
{
$base64 = self::addTimestampAndReturnBase64($CI,$records['practice_cert_pic'],'practice_cert_pic',$pd_details,13,$records['company_id'],$busienss_info_location);
$records['practice_cert_pic'] = $base64;
}
if(isset($records['documents']) && count($records['documents']))
{
foreach ($records['documents'] as $key => $value) {
if($value['document_pic'] != '')
{
$base64 = self::addTimestampAndReturnBase64($CI,$value['document_pic'],$value['document'],$pd_details,13,$records['company_id'],$busienss_info_location);
$records['documents'][$key]['document_pic'] = $base64;
}
}
}
return $records;
}
public static function addTimestampAndReturnBase64($CI,$base64,$doc_name,$pd_details,$form_id)
public static function addTimestampAndReturnBase64($CI,$base64,$doc_name,$pd_details,$form_id,$company_id = null,$location = '')
{
// ##############################################
$temp_base64_string = $base64;
$title = $doc_name;
$output_file = APPPATH."/docs/temp_base64_image.png";
@ -61,8 +138,8 @@ class INLINEPHOTOTRANSFORM
fclose( $ifp );
//echo mime_content_type($output_file);
// ################### start img water marking with text
$imagetobewatermark=imagecreatefromstring(file_get_contents(($output_file));
$location_watermarktext="Location: ".$pd_details[0]['start_location'];
$imagetobewatermark=imagecreatefromstring(file_get_contents(($output_file)));
$location_watermarktext="Location: ".($location != null ? $location: $pd_details[0]['start_location']);
$font=APPPATH."docs/robold.ttf"; //metion font and it's location
$fontsize="7";
$water_mark_text_color = imagecolorallocate($imagetobewatermark, 234, 100, 81);
@ -83,7 +160,7 @@ class INLINEPHOTOTRANSFORM
imagepng($curret_file,$output_file);// save png image in specified location
//###########end of image water marking with logo
self::saveImagesInS3($CI,$pd_details,$output_file,$temp_file_name,$form_id,$title);
//self::saveImagesInS3($CI,$pd_details,$output_file,$temp_file_name,$form_id,$title,$company_id);
//convert img to base64
//$path = $output_file;
//$type = pathinfo($path, PATHINFO_EXTENSION);

View File

@ -250,7 +250,9 @@ class PDALERTS
$pd_status = $core_details[0]['pd_status'];
$central_offcier_web_token = $core_details[0]['centralpdofficer_webtoken'];
$central_offcier_mob_token = $core_details[0]['centralpdofficer_mobtoken'];
PUSH_NOTIFICATION::sendNotification($central_offcier_mob_token,$central_offcier_web_token,$pd_status);
$msg = $pd_notification_msg[0]['pdincharge'];
$msg = self::stringReplace($msg,$core_details);
PUSH_NOTIFICATION::sendNotification($central_offcier_mob_token,$central_offcier_web_token,$pd_status,$msg);
}

View File

@ -2384,44 +2384,44 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '<p>'.$client_form_remarks.'</p>';
//CLient Photo Section
$client_photo_count = $pd_images[2];
$client_img_row_count = ceil(count($client_photo_count) / 3);
// $client_photo_count = $pd_images[2];
// $client_img_row_count = ceil(count($client_photo_count) / 3);
if(count($client_photo_count)){
// echo '<br>';
// echo '<p>Supplier '.($k+1).' Photograph`s : </p>';
// echo '<br>';
echo '<table border="1" height="100%" width="50%">';
// if(count($client_photo_count)){
// // echo '<br>';
// // echo '<p>Supplier '.($k+1).' Photograph`s : </p>';
// // echo '<br>';
// echo '<table border="1" height="100%" width="50%">';
$client_from_index_increment = 0;
for($img_row = 1; $img_row <= $client_img_row_count; $img_row++)
{
// $client_from_index_increment = 0;
// for($img_row = 1; $img_row <= $client_img_row_count; $img_row++)
// {
echo '<tr>';
$from = $client_from_index_increment;
$to = ($from + 2);
for($client_photo_iter = $from; $client_photo_iter <= $to;$client_photo_iter++)
{
// echo '<tr>';
// $from = $client_from_index_increment;
// $to = ($from + 2);
// for($client_photo_iter = $from; $client_photo_iter <= $to;$client_photo_iter++)
// {
if(isset($client_photo_count[$client_photo_iter]) &&$client_photo_count[$client_photo_iter]['company_id'] == ($business_count+1))
{
echo '<td>';
echo '<div class="gallery">';
echo '<img src="'.$client_photo_count[$client_photo_iter]['doc_url'].'" alt="" width="200" height="200">';
echo '<div class="desc">'.$client_photo_count[$client_photo_iter]['pd_document_title'].'<br>'.$client_photo_count[$client_photo_iter]['location'].'<br>'. date('Y/m/d h:s:i A',strtotime($client_photo_count[$client_photo_iter]['createdon'])).'</div>';
echo '</div>';
echo '</td>';
//unset($stock_photo_count[$stock_photo_iter]);
}
// if(isset($client_photo_count[$client_photo_iter]) &&$client_photo_count[$client_photo_iter]['company_id'] == ($business_count+1))
// {
// echo '<td>';
// echo '<div class="gallery">';
// echo '<img src="'.$client_photo_count[$client_photo_iter]['doc_url'].'" alt="" width="200" height="200">';
// echo '<div class="desc">'.$client_photo_count[$client_photo_iter]['pd_document_title'].'<br>'.$client_photo_count[$client_photo_iter]['location'].'<br>'. date('Y/m/d h:s:i A',strtotime($client_photo_count[$client_photo_iter]['createdon'])).'</div>';
// echo '</div>';
// echo '</td>';
// //unset($stock_photo_count[$stock_photo_iter]);
// }
}
//echo "<br><br><hr>";
echo '</tr>';
$client_from_index_increment = $client_from_index_increment + 3;
}
//echo '</tbody>';
echo '</table>';
}
// }
// //echo "<br><br><hr>";
// echo '</tr>';
// $client_from_index_increment = $client_from_index_increment + 3;
// }
// //echo '</tbody>';
// echo '</table>';
// }
//End of CLient Photo Section
?>
<?php }
@ -2588,55 +2588,55 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</table>
<?php
//Supplier Photo section
// //*/Supplier Photo section
$supplier_photo_count = array();
foreach($pd_images[1] as $sup_img)
{
if(!strcasecmp($sup_img['pd_document_title'],$fetchRow['supplier_name_for_photo']))
{
$supplier_photo_count[] = $sup_img;
}
}
// $supplier_photo_count = array();
// foreach($pd_images[1] as $sup_img)
// {
// if(!strcasecmp($sup_img['pd_document_title'],$fetchRow['supplier_name_for_photo']))
// {
// $supplier_photo_count[] = $sup_img;
// }
// }
$supplier_img_row_count = ceil(count($supplier_photo_count) / 3);
// $supplier_img_row_count = ceil(count($supplier_photo_count) / 3);
if(count($supplier_photo_count)){
echo '<br>';
echo '<p>Supplier '.($k+1).' Photograph`s : </p>';
echo '<br>';
echo '<table border="1" height="100%" width="50%">';
// if(count($supplier_photo_count)){
// echo '<br>';
// echo '<p>Supplier '.($k+1).' Photograph`s : </p>';
// echo '<br>';
// echo '<table border="1" height="100%" width="50%">';
$supplier_from_index_increment = 0;
for($img_row = 1; $img_row <= $supplier_img_row_count; $img_row++)
{
// $supplier_from_index_increment = 0;
// for($img_row = 1; $img_row <= $supplier_img_row_count; $img_row++)
// {
echo '<tr>';
$from = $supplier_from_index_increment;
$to = ($from + 2);
for($supplier_photo_iter = $from; $supplier_photo_iter <= $to;$supplier_photo_iter++)
{
// echo '<tr>';
// $from = $supplier_from_index_increment;
// $to = ($from + 2);
// for($supplier_photo_iter = $from; $supplier_photo_iter <= $to;$supplier_photo_iter++)
// {
if(isset($supplier_photo_count[$supplier_photo_iter]) &&$supplier_photo_count[$supplier_photo_iter]['company_id'] == ($business_count+1))
{
echo '<td>';
echo '<div class="gallery">';
echo '<img src="'.$supplier_photo_count[$supplier_photo_iter]['doc_url'].'" alt="" width="200" height="200">';
echo '<div class="desc">'.$supplier_photo_count[$supplier_photo_iter]['pd_document_title'].'<br>'.$supplier_photo_count[$supplier_photo_iter]['location'].'<br>'.date('Y/m/d h:s:i A',$supplier_photo_count[$supplier_photo_iter]['createdon']).'</div>';
echo '</div>';
echo '</td>';
//unset($stock_photo_count[$stock_photo_iter]);
}
// if(isset($supplier_photo_count[$supplier_photo_iter]) &&$supplier_photo_count[$supplier_photo_iter]['company_id'] == ($business_count+1))
// {
// echo '<td>';
// echo '<div class="gallery">';
// echo '<img src="'.$supplier_photo_count[$supplier_photo_iter]['doc_url'].'" alt="" width="200" height="200">';
// echo '<div class="desc">'.$supplier_photo_count[$supplier_photo_iter]['pd_document_title'].'<br>'.$supplier_photo_count[$supplier_photo_iter]['location'].'<br>'.date('Y/m/d h:s:i A',$supplier_photo_count[$supplier_photo_iter]['createdon']).'</div>';
// echo '</div>';
// echo '</td>';
// //unset($stock_photo_count[$stock_photo_iter]);
// }
}
//echo "<br><br><hr>";
echo '</tr>';
$supplier_from_index_increment = $supplier_from_index_increment + 3;
}
//echo '</tbody>';
echo '</table>';
}
// }
// //echo "<br><br><hr>";
// echo '</tr>';
// $supplier_from_index_increment = $supplier_from_index_increment + 3;
// }
// //echo '</tbody>';
// echo '</table>';
// }*/
//End of Supplier Photo section
@ -2809,11 +2809,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '<br>';
echo '<table border="1" height="100%" width="50%">';
for($img_row = 1; $img_row <= $stock_img_row_count; $img_row++)
for($img_row = 0; $img_row < $stock_img_row_count; $img_row++)
{
echo '<tr>';
$from = $img_row == 1 ? $img_row : ($img_row+2);
$from = $img_row == 0 ? $img_row : ($img_row+2);
$to = ($from + 2);
for($stock_photo_iter = $from; $stock_photo_iter <= $to;$stock_photo_iter++)
{
@ -2823,7 +2823,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '<td>';
echo '<div class="gallery">';
echo '<img src="'.$stock_photo_count[$stock_photo_iter]['doc_url'].'" alt="" width="200" height="200">';
echo '<div class="desc">'.$stock_photo_count[$stock_photo_iter]['pd_document_title'].'<br>'.$stock_photo_count[$stock_photo_iter]['location'].'<br>'.date('Y/m/d h:s:i A',$stock_photo_count[$stock_photo_iter]['createdon']).'</div>';
echo '<div class="desc">'.$stock_photo_count[$stock_photo_iter]['pd_document_title'] .'</div>';
echo '</div>';
echo '</td>';
//unset($stock_photo_count[$stock_photo_iter]);