forked from SimplesIP/pabx-app
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
531 B
18 lines
531 B
<?php |
|
|
|
$fields = filter_input_array(INPUT_GET, FILTER_SANITIZE_SPECIAL_CHARS); |
|
|
|
|
|
|
|
if ($fields['t']) { |
|
$template = base64_decode($fields['t']); |
|
$data = json_decode(base64_decode($fields['d']), true); |
|
|
|
$contents = file_get_contents(__DIR__ . "/" . $path . $template); |
|
foreach ($data as $key => $value) { |
|
$contents = str_replace('{' . $key . '}', $value, $contents); |
|
} |
|
echo utf8_decode($contents); |
|
} else { |
|
echo '<h1>Template não encontrado!</h1>'; |
|
} |