BAWANG GORENG
/
home
/
ecommerceavenue
/
ecommerceavenue.com
/
public_html
/
couronne205
/
tvchannels
/
logs
/
Nama File / Folder
Size
Action
_notes
--
NONE
config.php
0.489KB
Hapus
Edit
Rename
delete.php
2.585KB
Hapus
Edit
Rename
display_logs.php
3.986KB
Hapus
Edit
Rename
index.php
5.473KB
Hapus
Edit
Rename
<=Back
<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); require_once __DIR__ . '/vendor/autoload.php'; // Using Medoo namespace use Medoo\Medoo; try { $database = new Medoo([ // required 'database_type' => 'mariadb', 'database_name' => 'tvchannels', 'server' => '127.0.0.1', 'username' => 'vchiem', 'password' => 'House205-', // [optional] 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_general_ci', 'port' => 3306, // [optional] Table prefix 'prefix' => '', // [optional] Enable logging (Logging is disabled by default for better performance) 'logging' => true, // [optional] MySQL socket (shouldn't be used with server and port) //'socket' => '/tmp/mysql.sock', // [optional] driver_option for connection, read more from http://www.php.net/manual/en/pdo.setattribute.php 'option' => [ PDO::ATTR_CASE => PDO::CASE_NATURAL ], // [optional] Medoo will execute those commands after connected to the database for initialization 'command' => [ 'SET SQL_MODE=ANSI_QUOTES' ] ]); //$account_id = $database->id(); // echo $account_id; /* $database->insert('channel_number_logs', [ 'channel_number' => '5' ]); */ /* $database->delete("account", [ "OR" => [ "username" => "vchiem.fr", "email" => "vchiem.fr@gmail.com" ] ]); */ /* $database->update("tv_channels", [ "url" => "https://www.google.com" ], [ "channel_number" => 5 ]); */ $dataFromDB = $database->select("channel_number_logs", [ 'id', 'channel_number', 'stamp_web_access', 'stamp_selected', 'description', 'url', 'ip_address', 'debug_info' ], [ 'ORDER' => [ 'id' => "DESC" ] ]); /* $count = $database->count("tv_channels", "channel_id"); echo "We have " . $count . " items."; */ //print_r($database->info()); } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } ?> <h1>Display Logs</h1> <hr/> <div class="table-wrapper" tabindex="0"> <table border="1"> <thead> <tr> <th>#</th> <th>stamp_web_access</th> <th>stamp_selected</th> <th>channel_number</th> <th>id</th> <th>description</th> <th>url</th> <th>ip_address</th> <th>debug_info</th> </tr> </thead> <tbody> <?php $max_row_results = 40; $i = 0; foreach ($dataFromDB as $row) { $i = $i + 1; ?> <tr> <td><?php echo $i; ?></td> <td> <?php $str_dt_stamp_web_access = $row['stamp_web_access']; if (!empty($str_dt_stamp_web_access)) { $dt_stamp_web_access = new DateTime($row['stamp_web_access'], new DateTimeZone('UTC')); $dt_stamp_web_access->setTimezone(new DateTimeZone('Europe/Paris')); $str_dt_stamp_web_access = $dt_stamp_web_access->format('d-m-Y H:i:s P'); } echo($str_dt_stamp_web_access . "<br>"); ?> </td> <td> <?php $str_dt_stamp_selected = $row['stamp_selected']; if (!empty($str_dt_stamp_selected)) { $dt_stamp_selected = new DateTime($row['stamp_selected'], new DateTimeZone('UTC')); $dt_stamp_selected->setTimezone(new DateTimeZone('Europe/Paris')); $str_dt_stamp_selected = $dt_stamp_selected->format('d-m-Y H:i:s P'); } echo($str_dt_stamp_selected . "<br>"); ?> </td> <td><?php echo $row['channel_number']; ?></td> <td><?php echo $row['id']; ?></td> <td><?php echo $row['description']; ?></td> <td><?php echo $row['url']; ?></td> <td><?php echo $row['ip_address']; ?></td> <td><?php echo $row['debug_info']; ?></td> </tr> <?php if ($i == $max_row_results) { break; } } ?> </tbody> </table> </div>
Liking