116 lines
3.1 KiB
PHP
116 lines
3.1 KiB
PHP
<?php
|
|
require("../functions.php");
|
|
// Define variables for file names
|
|
$pdf_name = "RTG-CRAPIs-all-GENERAL-BUREAUS-ATTACK-for-PERSONAL-INFORMATION.pdf";
|
|
$html_format_name = "RTG-CRAPIs-all-GENERAL-BUREAUS-ATTACK-for-PERSONAL-INFORMATION_FORMAT.html";
|
|
|
|
//collect required POST form's input
|
|
$cra_report = $_POST["cra_report"];
|
|
$first_name = $_POST["first_name"];
|
|
$last_name = $_POST["last_name"];
|
|
$street_no = $_POST["street_no"];
|
|
$street_name = $_POST["street_name"];
|
|
$city = $_POST["city"];
|
|
$state = $_POST["state"];
|
|
$alleged = $_POST["alleged"];
|
|
//$personal_tracking_number = $_POST["personal_tracking_number"];
|
|
$personal_tracking_number =getPersonalTrackingNumber();
|
|
$credit_bureau_name_address = nl2br($_POST["credit_bureau_name_address"]);
|
|
|
|
|
|
|
|
|
|
|
|
//Optional Creditors and Dates
|
|
|
|
|
|
|
|
|
|
|
|
// the unique pdf filename which will be saved on server
|
|
$file_name = mt_rand(0, 1000).time().'_'.$pdf_name;
|
|
|
|
if(isset($cra_report)){
|
|
|
|
//get html content from pre defined format
|
|
$today = date("d M, Y");
|
|
$html = file_get_contents($html_format_name);
|
|
|
|
$personal_tracking_number = getPersonalTrackingNumber();
|
|
|
|
$varList = array(
|
|
'__CRA_REPORT__', '__FIRST_NAME__','__LAST_NAME__','__STREET_NO__','__STREET_NAME__',
|
|
'__CITY__','__STATE__','__TODAY__','__PERSONAL_TRACKING_NUMBER__',
|
|
'__credit_bureau_name_address__'
|
|
|
|
);
|
|
|
|
|
|
$valueList = array(
|
|
$cra_report, $first_name,$last_name,$street_no,$street_name,
|
|
$city,$state,$today,$personal_tracking_number,
|
|
$credit_bureau_name_address);
|
|
|
|
|
|
for($i=1;$i<=6;$i++){
|
|
if(isset($_POST["report".$i]) && !empty($_POST["report".$i])){
|
|
$creditor[$i] = $_POST["report".$i];
|
|
$varList[] = "__COURT_".$i."__";
|
|
$valueList[] = nl2br($creditor[$i]);
|
|
$start = "__START".$i."__";
|
|
$end = "__END".$i."__";
|
|
|
|
$html = str_replace(array($start,$end),array("",""),$html);
|
|
|
|
|
|
} else {
|
|
$from = strpos($html, "__START".$i."__");
|
|
$to = strpos($html, "__END".$i."__");
|
|
|
|
$html = str_replace(substr($html,$from,($to-$from)+7+strlen($i)),"",$html);
|
|
}
|
|
}
|
|
|
|
|
|
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"];
|
|
upload_media($imagefilename[$i],$_POST['image'.$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]."<br/>";
|
|
|
|
|
|
} else {
|
|
|
|
$from = strpos($html, "__STARTM".$i."__");
|
|
$to = strpos($html, "__ENDM".$i."__");
|
|
|
|
$html = str_replace(substr($html,$from,($to-$from)+8+strlen($i)),"",$html);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
require("../common_file.php");
|
|
|
|
|
|
|
|
|
|
} else {
|
|
$url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."RTG-CRAPIs-all-GENERAL-BUREAUS-ATTACK-for-PERSONAL-INFORMATION.html";
|
|
header("Location:".$url);
|
|
}
|
|
|
|
?>
|