<!DOCTYPE html>
<html>
<head>
    <title>BladeSoulTool Issue</title>
    <link href="../../bower_components/bootstrap/dist/css/bootstrap.min.css" type="text/css" rel="stylesheet">
    <script type="text/javascript">
        function getUrlVars() {
            var vars = [], hash;
            var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < hashes.length; i++) {
                hash = hashes[i].split('=');
                vars.push(hash[0]);
                vars[hash[0]] = hash[1];
            }
            return vars;
        }
        function solveIssue(id) {
            window.open('http://' + window.location.hostname + '/issues/solve/' + id + '?token=' + getUrlVars()['token']);
        }
        function deleteIssue(id) {
            window.open('http://' + window.location.hostname + '/issues/delete/' + id + '?token=' + getUrlVars()['token']);
        }
    </script>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-12">
            <h3>Issues: <?php echo $issue->id ?></h3>
        </div>
        <div class="col-md-12">
            <button onclick="solveIssue('<?php echo $issue->id ?>');" class="btn btn-primary btn-info">solve</button>
            <button onclick="deleteIssue('<?php echo $issue->id ?>');" class="btn btn-primary btn-info">delete</button>
        </div>
    </div>
    <div ng-controller="BstSearchCtrl">
        <div class="row">
            <div class="col-md-12">
                <div class="clearfix">
                    <div style="width:100px;font-weight:bold;" class="pull-left"><span>Id</span></div>
                    <div class="pull-left"><?php echo $issue->id ?></div>
                </div>
                <div class="clearfix">
                    <div style="width:100px;font-weight:bold;" class="pull-left"><span>Origin</span></div>
                    <div class="pull-left"><pre><?php print_r(json_decode($issue->origin, true)) ?></pre></div>
                </div>
                <div class="clearfix">
                    <div style="width:100px;font-weight:bold;" class="pull-left"><span>Target</span></div>
                    <div class="pull-left"><pre><?php print_r(json_decode($issue->target, true)) ?></pre></div>
                </div>
                <div class="clearfix">
                    <div style="width:100px;font-weight:bold;" class="pull-left"><span>Console</span></div>
                    <div class="pull-left"><pre><?php echo $issue->console; ?></pre></div>
                </div>
                <div class="clearfix">
                    <div style="width:100px;font-weight:bold;" class="pull-left"><span>Solved</span></div>
                    <div class="pull-left"><?php echo $issue->solved ?></div>
                </div>
                <div class="clearfix">
                    <div style="width:100px;font-weight:bold;" class="pull-left"><span>Time</span></div>
                    <div class="pull-left"><?php echo date('Y-m-d H:i:s', $issue->time) ?></div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>