Ejemplo n.º 1
0
<div class="panel panel-default">
    <div class="panel-heading">Task list</div>
    <div class="panel-body">
        <table class="table table-bordered">
            <thead>
                <tr>
                    <td>#</td>
                    <td>Name</td>
                    <td>Type</td>
                    <td>Group</td>
                    <td>Action</td>
                </tr>
            </thead>
            <tbody id="task_list_table">
                ';
$tasks = CAdmin::getTaskArray();
$i = 0;
foreach ($tasks as $t) {
    $i++;
    $id = $t['id'];
    $name = $t['name'];
    $type = $t['type'];
    if (!isset($t['groups']) || $t['groups'] == null) {
        $group = 'Common task';
    } else {
        $group = $t['groups'];
    }
    $additional = $t['additional'];
    $delete_button = "<button class='btn btn-sm btn-danger delete-task-button' data-id='{$id}'>Delete</button>";
    $additional_button = "<button class='btn btn-sm btn-info' data-toggle='tooltip' data-placement='left' title='{$additional}'>See JSON</button>";
    $content .= "<tr><td>{$i}</td><td>{$name}</td><td>{$type}</td><td>{$group}</td><td>{$additional_button} {$delete_button} </td></tr>";