139 lines
4.3 KiB
PHP
139 lines
4.3 KiB
PHP
<?php
|
|
|
|
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
require("../functions.php");
|
|
require("./creditor_addresses.php");
|
|
|
|
$experian_report = $_POST["report_file_name"];
|
|
|
|
// Define variables for file names
|
|
$pdf_name = "Metro_1535_compliance_challenge_letter.pdf";
|
|
$html_format_name = "Metro_1535_compliance_challenge_letter_FORMAT.html";
|
|
|
|
$file_name = mt_rand(0, 1000) . time() . '_' . $pdf_name;
|
|
|
|
//$personal_tracking_number = getPersonalTrackingNumber();
|
|
$first_name = isset($_POST['first_name']) ? $_POST['first_name'] : "";
|
|
$last_name = isset($_POST['last_name']) ? $_POST['last_name'] : "";
|
|
$street_no = isset($_POST['street_no']) ? $_POST['street_no'] : "";
|
|
$street_name = isset($_POST['street_name']) ? $_POST['street_name'] : "";
|
|
$city = isset($_POST['city']) ? $_POST['city'] : "";
|
|
$state = isset($_POST['state']) ? $_POST['state'] : "";
|
|
$ssn = isset($_POST['ssn']) ? $_POST['ssn'] : "";
|
|
$dob = isset($_POST['dob']) ? $_POST['dob'] : "";
|
|
$sincerely = isset($_POST['sincerely']) ? $_POST['sincerely'] : "";
|
|
$credit_report = isset($_POST['credit_report']) ? $_POST['credit_report'] : "";
|
|
$creditor1 = isset($_POST['creditor1']) ? nl2br($_POST['creditor1']) : "";
|
|
$creditor2 = isset($_POST['creditor2']) ? nl2br($_POST['creditor2']) : "";
|
|
|
|
$name = $first_name . " " . $last_name;
|
|
$street_info = $street_no . "," . $street_name;
|
|
$city_info = $city . "," . $state;
|
|
//get html content from pre defined format
|
|
$today = date("d M, Y");
|
|
$html = file_get_contents($html_format_name);
|
|
|
|
$destination_address = "";
|
|
|
|
if (!empty($dob)) {
|
|
$dob = date('m/d/Y', strtotime($dob));
|
|
}
|
|
|
|
$credit_report_string = "";
|
|
|
|
if ($experian_report == 1) { // exp
|
|
if (!empty($credit_report)) {
|
|
$credit_report_string = 'Experian Report # <span style="background-color:yellow;">' . $credit_report . '</span><br/>';
|
|
}
|
|
|
|
$destination_address = getExperianAddress();
|
|
} else if ($experian_report == 2) { // equif
|
|
if (!empty($credit_report)) {
|
|
$credit_report_string = 'Equifax Confirmation # <span style="background-color:yellow;">' . $credit_report . '</span><br/>';
|
|
}
|
|
|
|
$destination_address = getEquifaxAddress();
|
|
} else if ($experian_report == 3) { // trans
|
|
if (!empty($credit_report)) {
|
|
$credit_report_string = 'Trans Union File # <span style="background-color:yellow;">' . $credit_report . '</span><br/>';
|
|
}
|
|
|
|
$destination_address = getTransUnionAddress();
|
|
} else {
|
|
$destination_address = !empty($_POST['credit_bureau_name_address']) ? $_POST['credit_bureau_name_address'] : "";
|
|
}
|
|
|
|
if (!empty($creditor1)) {
|
|
$creditor1 = '<span style="background-color:yellow;">' . $creditor1 . '</span>';
|
|
}
|
|
|
|
if (!empty($creditor2)) {
|
|
$creditor2 = '<span style="background-color:yellow;">' . $creditor2 . '</span>';
|
|
}
|
|
|
|
|
|
$varList = array(
|
|
'__TODAY_DATE__',
|
|
'__NAME__',
|
|
'__STREET_NO_STREET_NAME__',
|
|
'__CITY_STATE__',
|
|
'__SSN__',
|
|
'__DOB__',
|
|
'__DESTINATION_ADDRESS__',
|
|
'__SCIENCERELY__',
|
|
'__CREDIT_REPORT_STRING__',
|
|
'__ALLEGED_INQUIRY__',
|
|
'__ALLEGED_ACCOUNT__'
|
|
);
|
|
|
|
|
|
$valueList = array(
|
|
$today,
|
|
$name,
|
|
$street_info,
|
|
$city_info,
|
|
$ssn,
|
|
$dob,
|
|
$destination_address,
|
|
$sincerely,
|
|
$credit_report_string,
|
|
$creditor2,
|
|
$creditor1
|
|
);
|
|
|
|
for ($i = 1; $i <= 3; $i++) {
|
|
|
|
if (isset($_FILES["image" . $i]["name"]) && !empty($_FILES["image" . $i]["name"])) {
|
|
$html = str_replace(["__ATTACH_PLEASE__"], ["See the Attached PLEASE:"], $html);
|
|
$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 = "__START" . $i . "__";
|
|
$end = "__END" . $i . "__";
|
|
|
|
$html = str_replace(array($start, $end), array("", ""), $html);
|
|
|
|
// $serialLineHTML = $serialLineHTML.$fileNameArray[$i-1]."<br/>";
|
|
} else {
|
|
|
|
$from = strpos($html, "__START" . $i . "__");
|
|
$to = strpos($html, "__END" . $i . "__");
|
|
|
|
$html = str_replace(substr($html, $from, ($to - $from) + 7 + strlen($i)), "", $html);
|
|
}
|
|
}
|
|
|
|
$html = str_replace(["__ATTACH_PLEASE__"], [""], $html);
|
|
|
|
require("../common_file.php");
|