Added query

This commit is contained in:
CHIEFSOFT\ameye
2025-09-22 16:49:57 -04:00
parent 979ea25b10
commit 69b8f0c64e
2 changed files with 133 additions and 33 deletions
+34
View File
@@ -2,11 +2,39 @@
namespace App\Controllers;
use function MongoDB\BSON\toJSON;
class Home extends BaseController
{
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["hanging_list"] = $this->getProvisionList(20);
return view('welcome_message',$data);
}
@@ -16,6 +44,12 @@ class Home extends BaseController
// echo env('CI_ENVIRONMENT');
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_path = FCPATH;