<style type="text/css">
    .phpdebugbar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        border-top: 0;
        font-family: arial, sans-serif;
        background: #fff;
        z-index: 10000;
        color: #000;
        text-align: left;
    }

    .phpdebugbar-closed {
        width: auto;
    }

    .phpdebugbar * {

        -moz-box-sizing: content-box;
        box-sizing: content-box;
    }

    .phpdebugbar code, .phpdebugbar pre {
        background: none;
        font-family: monospace;
        font-size: 1em;
        border: 0;
        padding: 0;
        margin: 0;
    }

    .phpdebugbar a.phpdebugbar-restore-btn {
        float: left;
        padding: 5px 8px;
        font-size: 14px;
        color: #555;
        text-decoration: none;
        border-right: 1px solid #ddd;
    }

    .phpdebugbar-resize-handle {
        display: none;
        height: 4px;
        margin-top: -4px;
        width: 100%;
        background: none;
        border-bottom: 1px solid #ccc;
        cursor: n-resize;
    }

    .phpdebugbar-closed, .phpdebugbar-minimized {
        border-top: 1px solid #ccc;
    }

    /* -------------------------------------- */

    .phpdebugbar-header, a.phpdebugbar-restore-btn {
        background: #efefef;
    }

    .phpdebugbar-header {
        min-height: 26px;
        line-height: 16px;
    }

    .phpdebugbar-header:before, .phpdebugbar-header:after {
        display: table;
        line-height: 0;
        content: "";
    }

    .phpdebugbar-header:after {
        clear: both;
    }

    .phpdebugbar-header-left {
        float: left;
    }

    .phpdebugbar-header-right {
        float: right;
    }

    .phpdebugbar-header > div > * {
        padding: 5px 8px;
        font-size: 14px;
        color: #555;
        text-decoration: none;
    }

    .phpdebugbar-header-left > * {
        float: left;
    }

    .phpdebugbar-header-right > * {
        float: right;
    }

    .phpdebugbar-header-right > select {
        padding: 0;
    }

    /* -------------------------------------- */

    span.phpdebugbar-indicator,
    a.phpdebugbar-indicator,
    a.phpdebugbar-close-btn {
        border-right: 1px solid #ddd;
    }

    a.phpdebugbar-tab.phpdebugbar-active {
        background: #ccc;
        color: #444;
        background-image: linear-gradient(bottom, rgb(173, 173, 173) 41%, rgb(209, 209, 209) 71%);
        background-image: -o-linear-gradient(bottom, rgb(173, 173, 173) 41%, rgb(209, 209, 209) 71%);
        background-image: -moz-linear-gradient(bottom, rgb(173, 173, 173) 41%, rgb(209, 209, 209) 71%);
        background-image: -webkit-linear-gradient(bottom, rgb(173, 173, 173) 41%, rgb(209, 209, 209) 71%);
        background-image: -ms-linear-gradient(bottom, rgb(173, 173, 173) 41%, rgb(209, 209, 209) 71%);
        background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.41, rgb(173, 173, 173)), color-stop(0.71, rgb(209, 209, 209)));
    }

    a.phpdebugbar-tab span.phpdebugbar-badge {
        display: none;
        margin-left: 5px;
        font-size: 11px;
        line-height: 14px;
        padding: 0px 6px;
        background: #ccc;
        border-radius: 4px;
        color: #555;
        font-weight: normal;
        text-shadow: none;
        vertical-align: middle;
    }

    a.phpdebugbar-tab i {
        display: none;
        vertical-align: middle;
    }

    a.phpdebugbar-tab span.phpdebugbar-badge.phpdebugbar-important {
        background: #ed6868;
        color: white;
    }

    a.phpdebugbar-close-btn, a.phpdebugbar-open-btn, a.phpdebugbar-restore-btn {
        width: 16px;
        height: 16px;
    }

    a.phpdebugbar-close-btn {
        background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuM4zml1AAAADDSURBVDhPxZCxCsIwFEUzuGdwCvQD7BIIcehUXDqVfGM/wsG/iG4ifkzMlRuSPLo4eeFBue8c6Iv6b4wxW557Hs0KnWa3seqDxTiOyVqbhmF4UND4Rofdruyce3rvE6bIRSo9GOI1McbLPM/vVm4l7MAQr0kpHaQsJTDE+6zrepym6SVFdNgR69M+hBTLzWCI10gJvydvBkO8ZlmWayvhJnkzGOI1+fBTCOHWPkT7YNiBId4HizxnCKy+r81uX/otSn0A7dioI/vYX+8AAAAASUVORK5CYII=) no-repeat 9px 6px;
    }

    a.phpdebugbar-open-btn {
        background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAOCAYAAADJ7fe0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfdCgYULwwNKp3GAAAAGHRFWHRTb2Z0d2FyZQBwYWludC5uZXQgNC4wLjOM5pdQAAAA1UlEQVQ4T2OgKpCUlOQH4vdA/B8Jv4dKEwYgDdLS0v8NDQ3/GxsbwzGIj2YoGEO1oQJkjcRgqDZUAJKwsrJ6/v//fwdiMFQbKgAZkpGR0QR0ajy60wlgRJhBXSGhpqb2CNnZhHBkZORcqBEMDFBX2BsYGGBVjAv39vZaQ41gYIC6Ygs2hbiwr6/vdqA+DqgR4CiW19bWxqoYF87Ly4uFaocAZWXlydgU4sJ2dna3ga4QgGqHAC0trY/YFOPCKSkpDVCtCAA01QaIsaYJHFgCqpVagIEBACGlF2c3r4ViAAAAAElFTkSuQmCC) no-repeat 8px 6px;
    }

    .phpdebugbar-indicator {
        position: relative;
        cursor: pointer;
    }

    .phpdebugbar-indicator span.phpdebugbar-text {
        margin-left: 5px;
    }

    .phpdebugbar-indicator span.phpdebugbar-tooltip {
        display: none;
        position: absolute;
        top: -30px;
        background: #efefef;
        opacity: .7;
        border: 1px solid #ccc;
        color: #555;
        font-size: 11px;
        padding: 2px 3px;
        z-index: 1000;
        text-align: center;
        width: 200%;
        right: 0;
    }

    .phpdebugbar-indicator:hover span.phpdebugbar-tooltip:not(.phpdebugbar-disabled) {
        display: block;
    }

    select.phpdebugbar-datasets-switcher {
        float: right;
        display: none;
        margin: 2px 0 0 7px;
        max-width: 200px;
        max-height: 23px;
        padding: 0;
    }

    /* -------------------------------------- */

    .phpdebugbar-body {
        border-top: 1px solid #ccc;
        display: none;
        position: relative;
        height: 300px;
    }

    /* -------------------------------------- */

    .phpdebugbar-panel {
        display: none;
        height: 100%;
        overflow: auto;
        width: 100%;
    }

    .phpdebugbar-panel.phpdebugbar-active {
        display: block;
    }

    /* -------------------------------------- */

    .phpdebugbar-mini-design a.phpdebugbar-tab {
        position: relative;
        border-right: 1px solid #ddd;
    }

    .phpdebugbar-mini-design a.phpdebugbar-tab span.phpdebugbar-text {
        display: none;
    }

    .phpdebugbar-mini-design a.phpdebugbar-tab:hover span.phpdebugbar-text {
        display: block;
        position: absolute;
        top: -30px;
        background: #efefef;
        opacity: .7;
        border: 1px solid #ccc;
        color: #555;
        font-size: 11px;
        padding: 2px 3px;
        z-index: 1000;
        text-align: center;
        right: 0;
    }

    .phpdebugbar-mini-design a.phpdebugbar-tab i {
        display: inline-block;
    }

    /* -------------------------------------- */

    .phpdebugbar-widgets-list {
        margin: 0;
        padding: 0;
        list-style: none;
        font-family: monospace;
    }
    .phpdebugbar-widgets-list .list-item {
        padding: 3px 6px;
        border-bottom: 1px solid #eee;
        position: relative;
    }

    .phpdebugbar-widgets-exceptions .list-item .message {
        display: block;
        color: red;
    }

    .phpdebugbar-widgets-exceptions .list-item .filename {
        display: block;
        font-style: italic;
        color: #555;
    }

    .phpdebugbar-widgets-exceptions .list-item .type {
        display: block;
        position: absolute;
        right: 4px;
        top: 4px;
        font-weight: bold;
    }

    .phpdebugbar-widgets-exceptions .list-item .file {
        display: none;
        margin: 10px;
        padding: 5px;
        border: 1px solid #ddd;
        font-family: monospace;
    }

</style>
<?php
$exception = $debugLogs['Exception'];
$error = $debugLogs['Error'];
?>
<div class="phpdebugbar" id="phpdebugbar">
    <div class="phpdebugbar-resize-handle" id="phpdebugbarResizeHandle" style="display: block;">
    </div>
    <div class="phpdebugbar-header">
        <div class="phpdebugbar-header-left">
            <a href="javascript:" onclick="phpdebugbarTab(this.id);" class="phpdebugbar-tab phpdebugbar-active" id="phpdebugbar-Exceptions">
                <i class="fa fa-bug"></i>
                <span class="phpdebugbar-text">
                    Exceptions
                </span>
                <span class="phpdebugbar-badge" style="display: none;">
                </span>
            </a>
            <a href="javascript:" onclick="phpdebugbarTab(this.id);" class="phpdebugbar-tab" id="phpdebugbar-Error">
                <i class="fa fa-tags"></i>
                <span class="phpdebugbar-text">
                    Error
                </span>
                <span class="phpdebugbar-badge"></span>
            </a>
            <!--a href="javascript:" onclick="phpdebugbarTab(this.id);" class="phpdebugbar-tab" id="phpdebugbar-Messages">
                <i class="fa fa-list-alt"></i>
                <span class="phpdebugbar-text">
                    Messages
                </span>
                <span class="phpdebugbar-badge" style="display: inline;">
                    1
                </span>
            </a>
            <a href="javascript:" onclick="phpdebugbarTab(this.id);" class="phpdebugbar-tab" id="phpdebugbar-Timeline">
                <i class="fa fa-tasks"></i>
                <span class="phpdebugbar-text">
                    Timeline
                </span>
                <span class="phpdebugbar-badge">
                </span>
            </a-->
        </div>
        <div class="phpdebugbar-header-right">
            <a href="javascript:" class="phpdebugbar-close-btn"></a>
            <a href="javascript:" class="phpdebugbar-open-btn" style="display: none;"></a>
            <select class="phpdebugbar-datasets-switcher">
                <option value="d55d200ec7013fafbbc7e5368dbf0e27">
                    #1 demo (17:55:57)
                </option>
            </select>
            <span class="phpdebugbar-indicator">
                <i class="fa fa-clock-o">
                </i>
                <span class="phpdebugbar-text">
                    3.96ms
                </span>
                <span class="phpdebugbar-tooltip">
                    Request Duration
                </span>
            </span>
            <span class="phpdebugbar-indicator">
                <i class="fa fa-cogs">
                </i>
                <span class="phpdebugbar-text">
                    <?php echo memory_get_usage(true);?>KB
                </span>
                <span class="phpdebugbar-tooltip">
                    Memory Usage
                </span>
            </span>
        </div>
    </div>
    <div class="phpdebugbar-body" id="phpdebugbarBody" style="display: block;">
        <div class="phpdebugbar-panel" id="phpdebugbar-Error-Body">
            <div class="phpdebugbar-widgets-messages">
                <?php if(!empty($error)){?>
                <ul class="phpdebugbar-widgets-list">
                    <li class="phpdebugbar-widgets-list-item">
                        <table style="width: 100%;">
                            <tbody>
                                <tr style="background-color: #efefef;min-height: 15px;"><td>Error</td><td>Location</td></td></tr>
                                <?php foreach($error as $key =>$val){?>
                                <tr>
                                    <td><?php echo $val['message'];?></td>
                                    <td><?php echo $val['backtrace']['error_file'],' # ',$val['backtrace']['error_line'];?></td>
                                </tr>
                                <?php }?>
                            </tbody>
                        </table>
                    </li>
                </ul>
                <?php }?>
            </div>
        </div>
        <div class="phpdebugbar-panel" id="phpdebugbar-Messages-Body">
            <ul class="phpdebugbar-widgets-timeline">
            </ul>
        </div>
        <div class="phpdebugbar-panel" id="phpdebugbar-Timeline-Body">
            <ul class="phpdebugbar-widgets-timeline">
            </ul>
        </div>
        <div class="phpdebugbar-panel phpdebugbar-active" id="phpdebugbar-Exceptions-Body">
            <div class="phpdebugbar-widgets-exceptions">
                <?php if(!empty($exception['message'])){ ?>
                <ul class="phpdebugbar-widgets-list">
                    <li class="list-item">
                        <span class="message" style="margin-bottom: 10px;"><?php echo $exception['message'];?></span>
                        <span class="filename"><?php echo $exception['file'],' # ',$exception['line'];?></span>
                        <span class="type"><?php echo $exception['type'];?></span>
                        <div style="display: block;">
                            <div>
                                <?php
                                    $surroundingHtml = '';
                                    foreach($exception['surrounding_lines'] as $linesKey => $linesVal){
                                        $surroundingHtml .= ($linesKey+1) . $linesVal;
                                    }
                                    echo highlight_string($surroundingHtml,true);
                                ?>
                            </div>
                            <table style="width: 100%;"><tbody>
                                <tr style="background-color: #efefef;min-height: 15px;"><td>Function</td><td>Location</td></td></tr>
                            <?php
                            $html = '';
                            foreach($exception['exception_list'] as $key =>$val){
                                $className = $val['class'].$val['type'].$val['function'];
                                $args = array();
                                if(isset($val['args'])) {
                                    if (is_array($val['args'])) {
                                        foreach ($val['args'] as $argsKey => $argsVal) {
                                            if(is_array($argsVal)){
                                                foreach($argsVal as $_k=>$_v){
                                                    $args[] = $_v;
                                                }
                                            }else{
                                                $args[]= $argsVal;
                                            }
                                        }
                                    }
                                }
                                $argsStr = count($args) >0 ? ('('.implode(',',$args).')') : '';
                                $html .= '<tr><td style="color: #0000BB;">' . $className .$argsStr. ';</td><td>' . $val['file'] .' # '. $val['line'] . '</td></tr>';
                            }
                            echo $html;
                            ?>
                            </tbody></table>
                        </div>
                    </li>
                </ul>
                <?php }?>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function phpdebugbarTab(tabName){
        //,'phpdebugbar-Messages','phpdebugbar-Timeline'
        var tabList = ['phpdebugbar-Exceptions','phpdebugbar-Error'];
        for(var i=0;i<tabList.length;i++){
            phpdebugbarRemoveClass(document.getElementById(tabList[i]),'phpdebugbar-active');
            phpdebugbarRemoveClass(document.getElementById(tabList[i]+"-Body"),'phpdebugbar-active');
        }
        phpdebugbarAddClass(document.getElementById(tabName),'phpdebugbar-active');
        phpdebugbarAddClass(document.getElementById(tabName+"-Body"),'phpdebugbar-active');
        return false;
    }
    function phpdebugbarHasClass(ele,cls) {
        return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
    }

    function phpdebugbarAddClass(ele,cls) {
        if (!this.phpdebugbarHasClass(ele,cls)) ele.className += " "+cls;
    }

    function phpdebugbarRemoveClass(ele,cls) {
        if (phpdebugbarHasClass(ele,cls)) {
            var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
            ele.className=ele.className.replace(reg,' ');
        }
    }

    function hoodDebug(id) {
        return document.getElementById(id)
    }
    window.onload = function() {
        var oBox = document.body, oBottom = hoodDebug("phpdebugbar"), oLine = hoodDebug("phpdebugbarResizeHandle");
        oLine.onmousedown = function(e) {
            var disY = (e || event).clientY;
            oLine.top = oLine.offsetTop;
            document.onmousemove = function(e) {
                var iT = oLine.top + ((e || event).clientY - disY);
                var maxT = document.body.clientHeight - oLine.offsetHeight;
                oLine.style.margin = 0;
                iT < 0 && (iT = 0);
                iT > maxT && (iT = maxT);
                oLine.style.top = oBottom.style.top = iT + "px";
                window.console && console.log(oBottom);
                return false
            };
            document.onmouseup = function() {
                document.onmousemove = null;
                document.onmouseup = null;
                oLine.releaseCapture && oLine.releaseCapture()
            };
            oLine.setCapture && oLine.setCapture();
            return false
        };
    };

</script>