Пример #1
0
					<h3 class="panel-title">Device Log</h3>
				</div>
				<div class="table-responsive">
					<table class="table table-border table-hover table-condensed">
						<thead>
							<tr>
								<th style="width: 5%;">No. </th>
								<th style="width: 55%;">Name</th>
								<th style="width: 20%;">Date</th>
								<th style="width: 20%;">Time</th>
							</tr>
						</thead>
						<tbody>
						<?php 
$no = 1;
$log = get_all_log();
if (!empty($log)) {
    foreach ($log as $row) {
        ?>
							<tr>
								<td><?php 
        echo $no;
        ?>
</td>
								<td><?php 
        echo $row->name;
        ?>
</td>
								<td><?php 
        echo date('d F Y', strtotime($row->time));
        ?>
<?php

include_once '/../includes/log_function.php';
$response = array();
$data = get_all_log();
if (!empty($data)) {
    $response['syslog'] = array();
    foreach ($data as $row) {
        $log = array();
        $log['logid'] = $row->logid;
        $log['name'] = $row->name;
        $log['time'] = $row->time;
        array_push($response['syslog'], $log);
    }
    $response['success'] = 1;
    echo json_encode($response);
} else {
    $response['success'] = 0;
    $response["message"] = "No Log Found";
    echo json_encode($response);
}