BBnepal-Accounts/account/application/views/setup/tables.php

93 lines
3.6 KiB
PHP
Raw Permalink Normal View History

2024-07-10 12:43:19 +00:00
<?php $pageTitle = "Application Tables"; ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<!-- Main content -->
<section class="content">
<?php
$tables = $this->db->list_tables();
foreach ($tables as $table) {
if ($table != "tbl_nepengcalendar") :
?>
<!-- Default box -->
<div class="card">
<div class="card-header">
<h3 class="card-title"><?php echo $table; ?></h3>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse">
<i class="fas fa-minus"></i>
</button>
<button type="button" class="btn btn-tool" data-card-widget="remove" title="Remove">
<i class="fas fa-times"></i>
</button>
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-8 col-md-8 col-lg-8 order-2 order-md-1">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Fixed Header Table</h3>
</div>
<!-- /.card-header -->
<div class="card-body table-responsive p-0" style="height: 300px;">
<table class="table table-head-fixed text-nowrap">
<thead>
<tr>
<?php
$fields = $this->db->field_data($table);
foreach ($fields as $field) {
echo "<th>" . $field->name . "</th>";
}
?>
</tr>
</thead>
<tbody>
<?php
$rows = $this->db->query("select * from " . $table)->result_array();
foreach ($rows as $row) :
?>
<tr>
<?php foreach ($row as $cols) : ?>
<td><?php echo $cols; ?></td>
<?php endforeach; ?>
</tr>
<?php
endforeach;
?>
</tbody>
</table>
</div>
<!-- /.card-body -->
</div>
<a href="<?php echo site_url("random"); ?>?curd=yes&table=<?php echo $table; ?>" class="btn btn-primary">Create Curd</a>
<!-- /.card -->
</div>
</div>
<!-- /.row -->
</div>
<div class="col-4 col-md-4 col-lg-4 order-1 order-md-2">
<h3 class="text-primary"><i class="fas fa-paint-brush"></i> <?php echo $table; ?> Schema</h3>
<div class="text-muted">
<?php
$fields = $this->db->list_fields($table);
pre($fields);
?>
</div>
<br>
</div>
</div>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
<?php
endif;
}
?>
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->