Files
2026-01-14 23:04:53 +01:00

77 lines
6.0 KiB
PHP

<div class="dbm-content-header">
<div class="dbm-breadcrumb">
<a href="<?php echo Config::get('URL'); ?>database/index">Databases</a>
<span class="separator">/</span>
<span><?php echo htmlspecialchars($this->database_name); ?></span>
</div>
<div class="dbm-title">
<h1><?php echo htmlspecialchars($this->database_name); ?></h1>
<span class="badge"><?php echo count($this->tables); ?> tables</span>
</div>
<div class="dbm-actions">
<a href="<?php echo Config::get('URL'); ?>table/create/<?php echo urlencode($this->database_name); ?>" class="dbm-btn dbm-btn-success">
<i data-lucide="plus"></i>
New Table
</a>
<a href="<?php echo Config::get('URL'); ?>database/export/<?php echo urlencode($this->database_name); ?>" class="dbm-btn dbm-btn-secondary" target="_blank">
<i data-lucide="download"></i>
Export SQL
</a>
<a href="<?php echo Config::get('URL'); ?>sql/index/<?php echo urlencode($this->database_name); ?>" class="dbm-btn dbm-btn-secondary">
<i data-lucide="terminal"></i>
SQL Console
</a>
</div>
</div>
<div class="dbm-content-body">
<?php if (empty($this->tables)): ?>
<div class="dbm-empty">
<i data-lucide="table" class="dbm-empty-icon"></i>
<h3>No tables yet</h3>
<p>This database is empty. Create your first table to get started.</p>
<a href="<?php echo Config::get('URL'); ?>table/create/<?php echo urlencode($this->database_name); ?>" class="dbm-btn dbm-btn-success" style="margin-top: 16px;">Create Table</a>
</div>
<?php else: ?>
<div class="dbm-table-wrapper">
<table class="dbm-table">
<thead>
<tr>
<th>Table Name</th>
<th>Engine</th>
<th>Rows</th>
<th>Size</th>
<th>Collation</th>
<th style="width: 220px;">Actions</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->tables as $table):
$info = isset($this->table_info[$table]) ? $this->table_info[$table] : [];
?>
<tr>
<td>
<a href="<?php echo Config::get('URL'); ?>table/show/<?php echo urlencode($this->database_name); ?>/<?php echo urlencode($table); ?>" style="color: var(--accent-blue); text-decoration: none; font-weight: 500;">
<?php echo htmlspecialchars($table); ?>
</a>
</td>
<td><span class="type-column"><?php echo isset($info['engine']) ? htmlspecialchars($info['engine']) : '-'; ?></span></td>
<td><?php echo isset($info['rows']) ? number_format($info['rows']) : '-'; ?></td>
<td><?php echo isset($info['total_size']) ? $info['total_size'] : '-'; ?></td>
<td><span style="font-size: 11px;"><?php echo isset($info['collation']) ? htmlspecialchars($info['collation']) : '-'; ?></span></td>
<td>
<a href="<?php echo Config::get('URL'); ?>table/show/<?php echo urlencode($this->database_name); ?>/<?php echo urlencode($table); ?>" class="dbm-btn dbm-btn-sm dbm-btn-primary">Browse</a>
<a href="<?php echo Config::get('URL'); ?>table/structure/<?php echo urlencode($this->database_name); ?>/<?php echo urlencode($table); ?>" class="dbm-btn dbm-btn-sm dbm-btn-secondary">Structure</a>
<a href="<?php echo Config::get('URL'); ?>table/export/<?php echo urlencode($this->database_name); ?>/<?php echo urlencode($table); ?>" class="dbm-btn dbm-btn-sm dbm-btn-secondary" target="_blank">Export</a>
<a href="<?php echo Config::get('URL'); ?>table/delete/<?php echo urlencode($this->database_name); ?>/<?php echo urlencode($table); ?>"
class="dbm-btn dbm-btn-sm dbm-btn-danger"
data-confirm="Drop table '<?php echo htmlspecialchars($table); ?>'? This cannot be undone!">Drop</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</div>