Added query
This commit is contained in:
@@ -2,11 +2,39 @@
|
|||||||
|
|
||||||
namespace App\Controllers;
|
namespace App\Controllers;
|
||||||
|
|
||||||
|
use function MongoDB\BSON\toJSON;
|
||||||
|
|
||||||
class Home extends BaseController
|
class Home extends BaseController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public function index(): string
|
public function index(): string
|
||||||
{
|
{
|
||||||
|
$template = array(
|
||||||
|
'table_open' => "<table class='table table-sm table-striped table-hover table-bordered table-condensed'>",
|
||||||
|
'thead_open' => '<thead class=\'bg-indigo\'>',
|
||||||
|
'thead_close' => '</thead>',
|
||||||
|
'heading_row_start' => '<tr>',
|
||||||
|
'heading_row_end' => '</tr>',
|
||||||
|
'heading_cell_start' => '<th>',
|
||||||
|
'heading_cell_end' => '</th>',
|
||||||
|
'tbody_open' => '<tbody>',
|
||||||
|
'tbody_close' => '</tbody>',
|
||||||
|
'row_start' => '<tr>',
|
||||||
|
'row_end' => '</tr>',
|
||||||
|
'cell_start' => '<td>',
|
||||||
|
'cell_end' => '</td>',
|
||||||
|
'row_alt_start' => '<tr>',
|
||||||
|
'row_alt_end' => '</tr>',
|
||||||
|
'cell_alt_start' => '<td>',
|
||||||
|
'cell_alt_end' => '</td>',
|
||||||
|
'table_close' => '</table>'
|
||||||
|
);
|
||||||
|
//$this->load->library('table');
|
||||||
|
// $this->table->set_template($template);
|
||||||
|
|
||||||
$data['label_env'] = $this->what_env();
|
$data['label_env'] = $this->what_env();
|
||||||
|
$data["hanging_list"] = $this->getProvisionList(20);
|
||||||
return view('welcome_message',$data);
|
return view('welcome_message',$data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,6 +44,12 @@ class Home extends BaseController
|
|||||||
// echo env('CI_ENVIRONMENT');
|
// echo env('CI_ENVIRONMENT');
|
||||||
return $curr_env;
|
return $curr_env;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getProvisionList($limit){
|
||||||
|
$mysql ="SELECT * FROM members_products ORDER BY id DESC LIMIT $limit";
|
||||||
|
$query = $this->db->query($mysql);
|
||||||
|
return $query->getResult();
|
||||||
|
}
|
||||||
// public function provision(): string
|
// public function provision(): string
|
||||||
// {
|
// {
|
||||||
// $public_path = FCPATH;
|
// $public_path = FCPATH;
|
||||||
|
|||||||
@@ -21,40 +21,106 @@
|
|||||||
crossorigin="anonymous"></script>
|
crossorigin="anonymous"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body style="font-size: 14px; margin-top: auto; margin-bottom: auto; text-align: center; background-color: #fafac9; padding: 15px">
|
<body
|
||||||
<span style="font-size: 60px; margin-top: auto; margin-bottom: auto; text-align: center;">
|
style="font-size: 14px; margin-top: auto; margin-bottom: auto; text-align: center; background-color: #fafac9; padding: 15px">
|
||||||
MERMS Provision <?=$label_env??''?>
|
|
||||||
</span>
|
<div class="container-fluid">
|
||||||
|
<span style="font-size: 60px; margin-top: auto; margin-bottom: auto; text-align: center;">
|
||||||
|
MERMS Provision <?= $label_env ?? '' ?>
|
||||||
|
</span>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm">
|
||||||
|
<h3>
|
||||||
|
Ongoing Provisions
|
||||||
|
</h3>
|
||||||
|
<table class="table table-hover table-dark">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">#</th>
|
||||||
|
<th scope="col">Default URL</th>
|
||||||
|
<th scope="col">Added</th>
|
||||||
|
<th scope="col">Prov. Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
foreach ($hanging_list ?? [] as $pr) {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?= $pr->id ?></th>
|
||||||
|
<td><?= $pr->internal_url ?></td>
|
||||||
|
<td><?= $pr->added ?></td>
|
||||||
|
<td><?= $pr->status ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<h3>
|
||||||
|
Hanging Provisions
|
||||||
|
</h3>
|
||||||
|
<table class="table table-hover table-dark">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">#</th>
|
||||||
|
<th scope="col">Default URL</th>
|
||||||
|
<th scope="col">Added</th>
|
||||||
|
<th scope="col">Prov. Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
foreach ($hanging_list ?? [] as $pr) {
|
||||||
|
?>
|
||||||
|
<tr style="text-align: left;">
|
||||||
|
<th scope="row"><?= $pr->id ?></th>
|
||||||
|
<td><a href="https://<?=$pr->internal_url ?>" target="_blank"><?= $pr->internal_url ?></a></td>
|
||||||
|
<td><?= $pr->added ?></td>
|
||||||
|
<td><?= $pr->status ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<h3>
|
||||||
|
Completed Provisions
|
||||||
|
</h3>
|
||||||
|
<table class="table table-hover table-dark">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">#</th>
|
||||||
|
<th scope="col">Default URL</th>
|
||||||
|
<th scope="col">Added</th>
|
||||||
|
<th scope="col">Prov. Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
foreach ($hanging_list ?? [] as $pr) {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?= $pr->id ?></th>
|
||||||
|
<td><?= $pr->internal_url ?></td>
|
||||||
|
<td><?= $pr->added ?></td>
|
||||||
|
<td><?= $pr->status ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<table class="table table-hover table-dark">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col">#</th>
|
|
||||||
<th scope="col">First</th>
|
|
||||||
<th scope="col">Last</th>
|
|
||||||
<th scope="col">Handle</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<th scope="row">1</th>
|
|
||||||
<td>Mark</td>
|
|
||||||
<td>Otto</td>
|
|
||||||
<td>@mdo</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th scope="row">2</th>
|
|
||||||
<td>Jacob</td>
|
|
||||||
<td>Thornton</td>
|
|
||||||
<td>@fat</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th scope="row">3</th>
|
|
||||||
<td colspan="2">Larry the Bird</td>
|
|
||||||
<td>@twitter</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user