Medical creditor #'.$i.': __creditor'.$i.'__ Account #'.$i.' ALLEGED: __account'.$i.'__
'; // // } else { // // // $from = strpos($html, "__START".$i."__"); // $to = strpos($html, "__END".$i."__"); // // $html = str_replace(substr($html,$from,($to-$from)+7+strlen($i)),"",$html); // } // } // // if(!empty($image1 || $image2 || $image3 || $image4 || $image5)) // { //echo "
";print_r($_POST);exit;
           if(empty($_POST['form_id']) || $_POST['form_id'] == 63){
            
            if(empty($image1)){                            
                $from = strpos($html, "__STARTM1__");
                $to = strpos($html, "__ENDM1__");
                if(!empty($from) && !empty($to))
                $html =  str_replace(substr($html,$from,($to-$from)+9),"",$html);  
            }
             
         
            if(empty($image2)){                            
                $from = strpos($html, "__STARTM2__");
                $to = strpos($html, "__ENDM2__");
                if(!empty($from) && !empty($to))
                $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html);  
                }
                
                
            if(empty($image3)){                            
                $from = strpos($html, "__STARTM3__");
                $to = strpos($html, "__ENDM3__");
                if(!empty($from) && !empty($to))
                $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html);  
                }
                
                
            if(empty($image4)){                            
                $from = strpos($html, "__STARTM4__");
                $to = strpos($html, "__ENDM4__");
                if(!empty($from) && !empty($to))
                $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html);  
                }
               
            if(empty($image5)){                            
                $from = strpos($html, "__STARTM5__");
                $to = strpos($html, "__ENDM5__");
                if(!empty($from) && !empty($to))
                $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html);  
                }
                 
            if(empty($image6)){                            
                $from = strpos($html, "__STARTM6__");
                $to = strpos($html, "__ENDM6__");
                if(!empty($from) && !empty($to)){
                    $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html); 
                }
            }
            
            
            
                 
            for($i=1;$i<= 6;$i++){ 
                $html = str_replace("__STARTM".$i."__","", $html);
            }
            for($i=1;$i<= 6;$i++){
                $html = str_replace("__ENDM".$i."__","", $html);
            }
                
           }else{
               
               if(empty($image1)){                            
                    $from = strpos($html, "__STARTM1__");
                    $to = strpos($html, "__ENDM1__");
                    if(!empty($from) && !empty($to))
                    $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html);  
                }
                
                
                if(empty($image2)){                            
                    $from = strpos($html, "__STARTM2__");
                    $to = strpos($html, "__ENDM2__");
                    if($from > 0 && $to > 0)
                    $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html);  
                    }
                if(empty($image3)){                            
                    $from = strpos($html, "__STARTM3__");
                    $to = strpos($html, "__ENDM3__");
                    if($from > 0 && $to > 0)
                    $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html);  
                    }
                if(empty($image4)){                            
                    $from = strpos($html, "__STARTM4__");
                    $to = strpos($html, "__ENDM4__");
                    if($from > 0 && $to > 0)
                    $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html);  
                    }
                if(empty($image5)){                            
                    $from = strpos($html, "__STARTM5__");
                    $to = strpos($html, "__ENDM5__");
                    if($from > 0 && $to > 0)
                    $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html);  
                    }
                    
                if(empty($image6)){                            
                    $from = strpos($html, "__STARTM6__");
                    $to = strpos($html, "__ENDM6__");
                    if($from > 0 && $to > 0)
                    $html =  str_replace(substr($html,$from,($to-$from)+9),"",$html);  
                }
              
               
                for($i=1;$i<= 6;$i++){ 
                    $html = str_replace("__STARTM".$i."__","", $html);
                }
                for($i=1;$i<= 6;$i++){
                    $html = str_replace("__ENDM".$i."__","", $html);
                }
                
                
           }
            
            //for upload image name
            if(!empty($_POST['form_id'])){
                if($_POST["form_id"] == 63){
                    if(empty($image1)){                            
                        $from = strpos($html, "__STARTL1__");
                        $to = strpos($html, "__ENDL1__");
                        if(!empty($from) && !empty($to))
                        $html =  str_replace(substr($html,$from,($to-$from)+8+strlen($i)),"",$html);  
                        }
                    if(empty($image2)){                            
                        $from = strpos($html, "__STARTL2__");
                        $to = strpos($html, "__ENDL2__");
                        if(!empty($from) && !empty($to))
                        $html =  str_replace(substr($html,$from,($to-$from)+8+strlen($i)),"",$html);  
                        }
                    if(empty($image3)){                            
                        $from = strpos($html, "__STARTL3__");
                        $to = strpos($html, "__ENDL3__");
                        if(!empty($from) && !empty($to))
                        $html =  str_replace(substr($html,$from,($to-$from)+8+strlen($i)),"",$html);  
                        }
                    if(empty($image4)){                            
                        $from = strpos($html, "__STARTL4__");
                        $to = strpos($html, "__ENDL4__");
                        $html =  str_replace(substr($html,$from,($to-$from)+8+strlen($i)),"",$html);  
                        }
                    if(empty($image5)){                            
                        $from = strpos($html, "__STARTL5__");
                        $to = strpos($html, "__ENDL5__");
                        $html =  str_replace(substr($html,$from,($to-$from)+8+strlen($i)),"",$html);  
                        }
                        
                    if(empty($image6)){                            
                        $from = strpos($html, "__STARTM6__");
                        $to = strpos($html, "__ENDM6__");
                        if(!empty($from) && !empty($to))
                        $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html);  
                    }
                    for($i=1;$i<= 6;$i++){               
                        $html = str_replace("__STARTL".$i."__","", $html);
                    }
                    for($i=1;$i<= 6;$i++){
                        $html = str_replace("__ENDL".$i."__","", $html);
                    }
                }
            }

       //  if(!empty($_POST['form_id'])){
       //      if($_POST["form_id"] == 63){
       //          if(empty($image1)){                            
       //              $from = strpos($html, "__STARTM1__");
       //              $to = strpos($html, "__ENDM1__");
       //              $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html);  
       //              }
       //          if(empty($image2)){                            
       //              $from = strpos($html, "__STARTM2__");
       //              $to = strpos($html, "__ENDM2__");
       //              $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html);  
       //              }
       //          if(empty($image3)){                            
       //              $from = strpos($html, "__STARTM3__");
       //              $to = strpos($html, "__ENDM3__");
       //              $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html);  
       //              }
       //          if(empty($image4)){                            
       //              $from = strpos($html, "__STARTM4__");
       //              $to = strpos($html, "__ENDM4__");
       //              $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html);  
       //              }
       //          if(empty($image5)){                            
       //              $from = strpos($html, "__STARTM5__");
       //              $to = strpos($html, "__ENDM5__");
       //              $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html);  
       //              }
       //          for($i=1;$i<= 5;$i++){               
       //              $html = str_replace("__STARTM".$i."__","", $html);
       //          }
       //          for($i=1;$i<= 5;$i++){
       //              $html = str_replace("__ENDM".$i."__","", $html);
       //          }
       //     }
       // }
            
            
            if(!empty($_POST['form_id'])){
                if($_POST["form_id"] == 35 || $_POST["form_id"] == 39 || $_POST["form_id"] == 40 || $_POST["form_id"] == 52 || $_POST["form_id"] == 54 || $_POST["form_id"] == 55 || $_POST["form_id"] == 56 || $_POST["form_id"] == 43 || $_POST["form_id"] == 44 || ($_POST["form_id"] >= 81 && $_POST["form_id"] <= 88)){
                    if(empty($image1)){                            
                        $from = strpos($html, "__START1__");
                        $to = strpos($html, "__END1__");
                        if(!empty($from) && !empty($to))
                        $html =  str_replace(substr($html,$from,($to-$from)+8+strlen($i)),"",$html);  
                        }
                        
                    if(empty($image2)){                            
                        $from = strpos($html, "__START2__");
                        $to = strpos($html, "__END2__");
                        if(!empty($from) && !empty($to))
                        $html =  str_replace(substr($html,$from,($to-$from)+8+strlen($i)),"",$html);  
                        }
                    if(empty($image3)){                            
                        $from = strpos($html, "__START3__");
                        $to = strpos($html, "__END3__");
                        if(!empty($from) && !empty($to))
                        $html =  str_replace(substr($html,$from,($to-$from)+8+strlen($i)),"",$html);  
                        }
                    if(empty($image4)){                            
                        $from = strpos($html, "__START4__");
                        $to = strpos($html, "__END4__");
                        if(!empty($from) && !empty($to))
                        $html =  str_replace(substr($html,$from,($to-$from)+8+strlen($i)),"",$html);  
                        }
                    if(empty($image5)){                            
                        $from = strpos($html, "__START5__");
                        $to = strpos($html, "__END5__");
                        if(!empty($from) && !empty($to))
                        $html =  str_replace(substr($html,$from,($to-$from)+8+strlen($i)),"",$html);  
                        }
                    if(empty($image6)){                            
                        $from = strpos($html, "__STARTM6__");
                        $to = strpos($html, "__ENDM6__");
                        if(!empty($from) && !empty($to))
                        $html =  str_replace(substr($html,$from,($to-$from)+9+strlen($i)),"",$html);  
                    } 
                    for($i=1;$i<= 6;$i++){               
                        $html = str_replace("__START".$i."__","", $html);
                    }
                    for($i=1;$i<= 6;$i++){
                        $html = str_replace("__END".$i."__","", $html);
                    }
                }
            }
            
 	
//        }
//        else{
//            for($i=1;$i<= 5;$i++){
// 		if(isset($_FILES["image".$i]["name"]) && !empty($_FILES["image".$i]["name"])){
// 	
// 			$imagefilename[$i]  = mt_rand(0, 1000).time().'_'.$_FILES["image".$i]["name"];
// 			move_uploaded_file($_FILES["image".$i]["tmp_name"], $imagefilename[$i]);
// 			$deletionArray[] = $imagefilename[$i];
// 	
// 	
// 	
// 			$varList[] = "__image".$i."__";
// 			$valueList[] = $imagefilename[$i];
// 	
// 			$start = "__STARTM".$i."__";
// 			$end = "__ENDM".$i."__";
// 	
// 			$html =  str_replace(array($start,$end),array("",""),$html);
// 	
// 			// $serialLineHTML = $serialLineHTML.$fileNameArray[$i-1]."
"; // // // } else { // // $from = strpos($html, "__STARTM".$i."__"); // $to = strpos($html, "__ENDM".$i."__"); // // $html = str_replace(substr($html,$from,($to-$from)+8+strlen($i)),"",$html); // // } // } // // } // replace serial lines //$html = str_replace('__SERIAL_LINES__',$serialLineHTML,$html); // // // // // require("../common_file.php"); // // } else { // $url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."RTG-med-COLLECTIONS-cra.html"; // header("Location:".$url); // } //} ?>