Exakat\Reports\Devoops::formatHorizontal PHP Method

formatHorizontal() protected method

protected formatHorizontal ( $data, $css )
    protected function formatHorizontal($data, $css)
    {
        static $counter;
        if (!isset($counter)) {
            $counter = 1;
        } else {
            ++$counter;
        }
        $html = <<<HTML
\t\t\t\t\t\t\t<p>
\t\t\t\t\t\t\t\t<table id="horizontal-{$counter}" class="table table-bordered table-striped table-hover table-heading table-datatable">
\t\t\t\t\t\t\t\t\t<thead>
HTML;
        if ($css->displayTitles === true) {
            $html .= '<tr>';
            foreach ($css->titles as $title) {
                $html .= <<<HTML
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<th>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{$title}
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</th>
HTML;
            }
            $html .= '</tr>';
        }
        $html .= <<<HTML
\t\t\t\t\t\t\t\t\t</thead>
\t\t\t\t\t\t\t\t\t<tbody>
HTML;
        foreach ($data as $row) {
            $row['Code'] = $this->makeHtml($row['Code']);
            if (empty($row['Code'])) {
                $row['Code'] = '&nbsp;';
            }
            $row['File'] = $this->makeLink($row['File']);
            $html .= <<<HTML

\t\t\t\t\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t\t\t\t\t<td><pre class="prettyprint linenums">{$row['Code']}</pre></td>
\t\t\t\t\t\t\t\t\t\t\t<td>{$row['File']}</td>
\t\t\t\t\t\t\t\t\t\t\t<td>{$row['Line']}</td>
\t\t\t\t\t\t\t\t\t\t</tr>
HTML;
        }
        $html .= <<<HTML
\t\t\t\t\t\t\t\t\t</tbody>
\t\t\t\t\t\t\t\t</table>
\t\t\t\t\t\t\t</p>
<script type="text/javascript">
// Run Datables plugin and create 3 variants of settings
function AllTables(){
\t\$('#horizontal-{$counter}').dataTable( {
\t\t"aaSorting": [[ 0, "asc" ]],
\t\t"sDom": "<'box-content'<'col-sm-6'f><'col-sm-6 text-right'l><'clearfix'>>rt<'box-content'<'col-sm-6'i><'col-sm-6 text-right'p><'clearfix'>>",
\t\t"sPaginationType": "bootstrap",
\t\t"oLanguage": {
\t\t\t"sSearch": "",
\t\t\t"sLengthMenu": '_MENU_'
\t\t}
\t});
}

\$(document).ready(function() {
\t// Load Datatables and run plugin on tables 
\tLoadDataTablesScripts(AllTables);
\t// Add Drag-n-Drop feature
\tWinMove();
});
</script>

HTML;
        return $html;
    }