HEX
Server: Apache
System: Linux www3.pit.tblive.com 5.14.0-687.38.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 12 17:19:12 EDT 2026 x86_64
User: awaldron (1020)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/awaldron/_accomods/_apibak/pdftemplate.php
<?php

function stripAttributes( $html, $emptyText='' ) {
    $find = ['&nbsp;', '’', '“', '”', 'o:p', '–'];
    $repl = ['', "'", '"', '"', 'p'. '-'];
    $html = preg_replace("/<([a-z][a-z0-9]*)[^>]*?(\/?)>/si",'<$1$2>', $html);
    $html = str_ireplace($find, $repl, $html);
    $html = strip_tags($html, ['p','a','br','ul','li','ol','sub','sup','strike','i','b','strong']);
    return (empty($html) ? $emptyText : $html);
}

function pdf_template($strengths, $needs, $accomods) {
    $html = '<html><head><style type="text/css">body{margin: 0; padding: 0; font-family: Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif !important; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;} .pdf-header{color: #3E787D; font-weight: 700; border-top: solid 6px #97B92E; text-align: right; height: 75px; padding-top: 8px; margin-bottom: 30px; line-height: 1.2em;}.pdf-body{ margin: 0 10px; page-break-after: always;}h3, .h3{font-size: 1.75rem;}.pdf-body h4{margin-top: 40px;}a, a:link, a:active, a:visited{color: #97B92E; text-decoration: none;}.row{display: flex; flex-wrap: wrap; margin-right: -15px; margin-left: -15px;}.col-sm-6{flex: 0 0 50%; max-width: 50%;}.option-list h4{color: #3E787D; border-bottom: solid 1px #787985;}.select-table{width: 100%;  page-break-after: always;}table{border-collapse: collapse;}.select-table td:nth-child(1), .select-table th:nth-child(1){width: 60px;}.select-table thead tr th, .select-table tbody tr:first-child td{border-top: solid 1px #787985;}.select-table thead tr th, .select-table tbody tr td{line-height: 38px; padding: 0 8px;}.select-table td:nth-child(2), .select-table th:nth-child(2){width: auto;}.select-table tbody tr:nth-child(odd){background-color: #f4f6f9;}.select-table td:nth-child(1), .select-table th:nth-child(1){width: 60px;}.select-table tbody tr td{border-bottom: solid 1px #d8dfe9;}.option-list div{display: block;overflow: auto;margin-bottom:6px;}.option-list div img{display:block;float:left;width: 23px;margin-right: 12px;}.option-list div div{display:block;float:left;width: calc(100% - 45px);}h2, .h2{font-size: 2rem;}h1, h2, h3, h4, h5{color: #3E787D;}.pdf-body h4{color: #000;}.select-table{width: 100%;}.select-table-title{color: $color-blue; padding-bottom: 10px;}.select-table thead tr th, .select-table tbody tr td{line-height: 38px; padding: 0 8px;}.select-table thead tr th, .select-table tbody tr:first-child td{border-top: solid 1px #787985;}.select-table thead tr td{border-bottom: solid 1px #787985;}.select-table tbody tr td{border-bottom: solid 1px #d8dfe9;}.select-table tbody tr:nth-child(odd){background-color: #f4f6f9;}.select-table td:nth-child(1), .select-table th:nth-child(1){width: 60px;}.select-table td:nth-child(2), .select-table th:nth-child(2){width: auto;}.select-table td:nth-child(3), .select-table th:nth-child(3){width: 120px;}.container{width: 100%; padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto;}</style></head><body>';
    $html .= '<div class="acco-modal-content"><div class="pdf-header"><div class="container"><div class="row">';
    $html .= '<div class="col-sm-6" style="text-align:left;"><img src="http://api.accomods.com/logo.png" style="width:225px;height:44px;" /></div>';
    $html .= '<div class="col-sm-6 blue" style="text-align:right;"><div style="padding-right:30px;">Action Driven Education<br>accomods.com</div></div>';
    $html .= '</div></div></div>';
    $html .= '<div class="container"><div class="row">';
    $html .= '<div class="col-sm-6 option-list"><h4>Student Strengths</h4>';
    foreach ($strengths as $s) {
        $html .= '<div><img src="https://api.accomods.com/check.png" />  &nbsp;<div>'.stripAttributes($s['Name']).'</div></div>';
    }
    $html .= '</div>';
    $html .= '<div class="col-sm-6 option-list"><h4>Student Needs</h4>';
    foreach ($needs as $n) {
        $html .= '<div><img src="http://api.accomods.com/check.png" /> &nbsp;<div>'.stripAttributes($n['Name']).'</div></div>';
    }
    $html .= '</div></div></div>';
    $html .= '<br/><br/>';
    $html .= '<h4 class="blue">Accomod Index</h4>';
    $html .= '<table class="select-table"><thead><tr><th>ID</th><th>Accomod Title</th></tr></thead><tbody>';
    foreach ($accomods as $a) {
        $html .= '<tr><td>'.$a['Key'].'</td><td>'.stripAttributes($a['Title']).'</a></td></tr>';
    }
    $html .= '</tbody></table>';
    $html .= '<div class="accomod-list">';
    foreach ($accomods as $a) {
        $html .= '<div class="pdf-body"><h3 class="blue">'.$a['Key'].' - '.stripAttributes($a['Title']).'</h3>';
        if (!empty($a['Subtitle'])) $html .= '<h3>'.stripAttributes($a['Subtitle']).'</h3>';
        $html .= '<h4>Description of Accomodation or Modification:</h4><div>'.stripAttributes($a['Description'], 'None.').'</div>';
        $html .= '<h4>Considerations:</h4><div>'.stripAttributes($a['Considerations'], 'None.').'</div>';
        $html .= '<h4>Examples:</h4><div>'.stripAttributes($a['Examples'], 'None.').'</div>';
        $html .= '<h4>Related downloads, links or other items:</h4><div>'.stripAttributes($a['RelatedLinks'], 'None.').'</div>';
        $html .= '</div>';
    }
    $html .= '</div>';
    $html .= '</div></body></html>';

    return $html;
}

?>