|
57 | 57 |
|
58 | 58 | $delimiters = explode(" ", $_REQUEST["custom_delimiter"]);
|
59 | 59 | $str = file_get_contents($csv_file);
|
60 |
| - $str1 = str_replace($delimiters, $default_delimiter, $str); |
| 60 | + $str1 = str_replace($delimiters, $default_delimiter, $str); |
61 | 61 | file_put_contents($csv_file, $str1);
|
62 | 62 | }
|
63 | 63 |
|
|
305 | 305 | $goCustomUpdateData = array();
|
306 | 306 |
|
307 | 307 | foreach($custom_array as $custom_key => $map_data){
|
308 |
| - $goCustomValues = $col[$map_data]; |
| 308 | + $goCustomValues = preg_replace($field_regx, "", $col[$map_data]); |
| 309 | + //8626 |
| 310 | + if(is_null($goCustomValues) || $goCustomValues === "") |
| 311 | + $goCustomValues = ""; |
| 312 | + else |
| 313 | + $goCustomValues = str_replace($default_delimiter, "", $goCustomValues); |
309 | 314 | array_push($goCustomKeyData, "$custom_key");
|
310 | 315 | array_push($goCustomValuesData, "'$goCustomValues'");
|
311 | 316 | array_push($goCustomUpdateData, "$custom_key='$goCustomValues'");
|
|
333 | 338 |
|
334 | 339 | for($ax=0; $ax < $totalExplode; $ax++) {
|
335 | 340 | $goHeaderOfCustomFields = $goGetLastCustomFiledsName2[$ax]; #get the header name of the custom fields
|
336 |
| - $goCustomValues = $col[$goGetLastHeader2[$ax]]; #get the values of the custom fields |
| 341 | + $goCustomValues = preg_replace($field_regx, "",$col[$goGetLastHeader2[$ax]]); #get the values of the custom fielde" |
| 342 | + //8626 |
| 343 | + if(is_null($goCustomValues) || $goCustomValues === "") |
| 344 | + $goCustomValues = ""; |
| 345 | + else |
| 346 | + $goCustomValues = str_replace($default_delimiter, "", $goCustomValues); |
337 | 347 | array_push($goCustomValuesData, "'$goCustomValues'");
|
338 | 348 | array_push($goCustomUpdateData, "$goHeaderOfCustomFields='$goCustomValues'");
|
339 | 349 | }
|
|
420 | 430 | $goCustomUpdateData = array();
|
421 | 431 |
|
422 | 432 | foreach($custom_array as $custom_key => $map_data){
|
423 |
| - $goCustomValues = $col[$map_data]; |
| 433 | + $goCustomValues = preg_replace($field_regx, "",$col[$map_data]); |
| 434 | + //8626 |
| 435 | + if(is_null($goCustomValues) || $goCustomValues === "") |
| 436 | + $goCustomValues = ""; |
| 437 | + else |
| 438 | + $goCustomValues = str_replace($default_delimiter, "", $goCustomValues); |
424 | 439 | array_push($goCustomKeyData, "$custom_key");
|
425 | 440 | array_push($goCustomValuesData, "'$goCustomValues'");
|
426 | 441 | array_push($goCustomUpdateData, "$custom_key='$goCustomValues'");
|
|
448 | 463 |
|
449 | 464 | for($ax=0; $ax < $totalExplode; $ax++) {
|
450 | 465 | $goHeaderOfCustomFields = $goGetLastCustomFiledsName2[$ax]; #get the header name of the custom fields
|
451 |
| - $goCustomValues = $col[$goGetLastHeader2[$ax]]; #get the values of the custom fields |
| 466 | + $goCustomValues = preg_replace($field_regx, "",$col[$goGetLastHeader2[$ax]]); #get the values of the custom fields |
| 467 | + //8626 |
| 468 | + if(is_null($goCustomValues) || $goCustomValues === "") |
| 469 | + $goCustomValues = ""; |
| 470 | + else |
| 471 | + $goCustomValues = str_replace($default_delimiter, "", $goCustomValues); |
452 | 472 | #$goQueryCustomFields .= "INSERT INTO custom_$theList (lead_id,".$goHeaderOfCustomFields.") VALUES ('$goLastInsertedLeadIDDUPCAMP','".$goCustomValues."');";
|
453 | 473 | #$rsltGoQueryCustomFields = mysqli_query($link, $goQueryCustomFields);
|
454 | 474 |
|
|
540 | 560 | $goCustomUpdateData = array();
|
541 | 561 |
|
542 | 562 | foreach($custom_array as $custom_key => $map_data){
|
543 |
| - $goCustomValues = $col[$map_data]; |
| 563 | + $goCustomValues = preg_replace($field_regx, "",$col[$map_data]); |
| 564 | + //8626 |
| 565 | + if(is_null($goCustomValues) || $goCustomValues === "") |
| 566 | + $goCustomValues = ""; |
| 567 | + else |
| 568 | + $goCustomValues = str_replace($default_delimiter, "", $goCustomValues); |
544 | 569 | array_push($goCustomKeyData, "$custom_key");
|
545 | 570 | array_push($goCustomValuesData, "'$goCustomValues'");
|
546 | 571 | array_push($goCustomUpdateData, "$custom_key='$goCustomValues'");
|
|
568 | 593 |
|
569 | 594 | for($ax=0; $ax < $totalExplode; $ax++) {
|
570 | 595 | $goHeaderOfCustomFields = $goGetLastCustomFiledsName2[$ax]; #get the header name of the custom fields
|
571 |
| - $goCustomValues = $col[$goGetLastHeader2[$ax]]; #get the values of the custom fields |
572 |
| - |
| 596 | + $goCustomValues = preg_replace($field_regx, "",$col[$goGetLastHeader2[$ax]]); #get the values of the custom fields |
| 597 | + //8626 |
| 598 | + if(is_null($goCustomValues) || $goCustomValues === "") |
| 599 | + $goCustomValues = ""; |
| 600 | + else |
| 601 | + $goCustomValues = str_replace($default_delimiter, "", $goCustomValues); |
573 | 602 | #$goQueryCustomFields = "INSERT INTO custom_$theList (lead_id,".$goHeaderOfCustomFields.") VALUES ('$goLastInsertedLeadIDDUPLIST','".$goCustomValues."');";
|
574 | 603 | #$goQueryCustomFields = "INSERT INTO custom_$theList(lead_id, $goHeaderOfCustomFields) VALUES('$goLastInsertedLeadIDDUPLIST', '$goCustomValues') ON DUPLICATE KEY UPDATE $goHeaderOfCustomFields='$goCustomValues'";
|
575 | 604 | #$rsltGoQueryCustomFields = $astDB->rawQuery($goQueryCustomFields);
|
|
649 | 678 | $goCustomUpdateData = array();
|
650 | 679 |
|
651 | 680 | foreach($custom_array as $custom_key => $map_data){
|
652 |
| - $goCustomValues = $col[$map_data]; |
| 681 | + $goCustomValues = preg_replace($field_regx, "",$col[$map_data]); |
| 682 | + //8626 |
| 683 | + if(is_null($goCustomValues) || $goCustomValues === "") |
| 684 | + $goCustomValues = ""; |
| 685 | + else |
| 686 | + $goCustomValues = str_replace($default_delimiter, "", $goCustomValues); |
653 | 687 | array_push($goCustomKeyData, "$custom_key");
|
654 | 688 | array_push($goCustomValuesData, "'$goCustomValues'");
|
655 | 689 | array_push($goCustomUpdateData, "$custom_key='$goCustomValues'");
|
|
678 | 712 |
|
679 | 713 | for($ax=0; $ax < $totalExplode; $ax++) {
|
680 | 714 | $goHeaderOfCustomFields = $goGetLastCustomFiledsName2[$ax]; #get the header name of the custom fields
|
681 |
| - $goCustomValues = $col[$goGetLastHeader2[$ax]]; #get the values of the custom fields |
682 |
| - |
| 715 | + $goCustomValues = preg_replace($field_regx, "",$col[$goGetLastHeader2[$ax]]); #get the values of the custom fields |
| 716 | + //8626 |
| 717 | + if(is_null($goCustomValues) || $goCustomValues === "") |
| 718 | + $goCustomValues = ""; |
| 719 | + else |
| 720 | + $goCustomValues = str_replace($default_delimiter, "", $goCustomValues); |
683 | 721 | #$rsltGoQueryCustomFields = mysqli_query($link, $goQueryCustomFields);
|
684 | 722 |
|
685 | 723 | // $goQueryCustomFields .= "INSERT INTO custom_$theList(lead_id, $goHeaderOfCustomFields) VALUES('$goLastInsertedLeadIDNODUP', '$goCustomValues') ON DUPLICATE KEY UPDATE $goHeaderOfCustomFields='$goCustomValues';";
|
|
716 | 754 | if($goCountInsertedLeads > 0 && $duplicates < 1) {
|
717 | 755 | $apiresults = array("result" => "success", "message" => "Total Uploaded Leads: $goCountInsertedLeads" , "alex_data" => $alex);
|
718 | 756 | }elseif($goCountInsertedLeads > 0 && $duplicates > 0){
|
719 |
| - $apiresults = array("result" => "success", "message" => "Uploaded:$goCountInsertedLeads Duplicates:$duplicates"); |
| 757 | + $apiresults = array("result" => "success", "message" => "Uploaded:$goCountInsertedLeads \nDuplicates:$duplicates"); |
720 | 758 | } elseif($goGetCheckcustomFieldNamesCorrect == "error"){
|
721 |
| - $apiresults = array("result" => "error" , "message" => "Error: Lead File Not Compatible with List. Incompatible Field Names. Check the File Headers $goGetCheckcustomFieldNamesCorrect"); |
| 759 | + $apiresults = array("result" => "error" , "message" => "Error: Lead File Not Compatible with List. \nIncompatible File Headers \n\nPlease use \"Lead Mapping\" function instead"); |
722 | 760 | }elseif($duplicates > 0){
|
723 | 761 | $apiresults = array("result" => "error" , "message" => "Duplicates Found : $duplicates");
|
724 | 762 | }else {
|
|
0 commit comments