product listing

This commit is contained in:
CHIEFSOFT\ameye
2024-10-26 11:32:32 -04:00
parent 9a9d313cc7
commit a978096520
3 changed files with 52 additions and 44 deletions
+3 -10
View File
@@ -6,19 +6,12 @@ namespace App\Controllers;
class Provider extends SecureBaseController
{
//var $patient_model;
protected \App\Models\Product_model $product_model;
public function StartProviders() {
$this->product_model = new \App\Models\Product_model();
$data = array();
// $out = array();
// $this->load->model('patient_model');
// $out = $this->patient_model->getPatientList();
// $data["patient_list"] = $out["patient_list"];
// $_SESSION['patient_count'] = 5;
// $this->load->model('encounter_model');
// $out = $this->encounter_model->getEncounterList();
// $data["encounter_list"] = $out["encounter_list"];
$data['product_array'] = $this->product_model->getProducts(); // $product_array;
return $this->renderProviderSecurePage('dash', $data);
// return view('template/provider_page');
// print_r($_SESSION);
}
+16
View File
@@ -0,0 +1,16 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class Product_model extends Model
{
public function getProducts() {
$mysql = "SELECT * FROM products ORDER BY id ASC ";
$db = db_connect();
$query = $db->query($mysql);
return $query->getResult('array');
}
}
@@ -1,47 +1,46 @@
<?php
$product_array = [
[
"name" => "Personal Website",
"description" => "Product description here",
"status" => 0,
"product" => 'A000001'
],
[
"name" => "Professional Website",
"description" => "Product description here",
"status" => 0,
"product" => 'A000002'
],
[
"name" => "Personal Blog",
"description" => "Product description here",
"status" => 0,
"product" => 'A000003'
],
[
"name" => "Professional Blog",
"description" => "Product description here",
"status" => 0,
"product" => 'A000004'
],
[
"name" => "Practice EMR",
"description" => "Product description here",
"status" => 0,
"product" => 'A000005'
]
];
//$product_array = [
// [
// "name" => "Personal Website",
// "description" => "Product description here",
// "status" => 0,
// "product" => 'A000001'
// ],
// [
// "name" => "Professional Website",
// "description" => "Product description here",
// "status" => 0,
// "product" => 'A000002'
// ],
// [
// "name" => "Personal Blog",
// "description" => "Product description here",
// "status" => 0,
// "product" => 'A000003'
// ],
// [
// "name" => "Professional Blog",
// "description" => "Product description here",
// "status" => 0,
// "product" => 'A000004'
// ],
// [
// "name" => "Practice EMR",
// "description" => "Product description here",
// "status" => 0,
// "product" => 'A000005'
// ]
//];
?>
<div class="row">
<?php
//for ($i=0; $i<5; $i++)
foreach ($product_array as $row)
{
?>
<div class="col-lg-6 col-xxl-6 m-b-30" style=" min-width: 200px;">
<div style="padding: 2px; border-radius: 10px;">
<a href="/product/<?=$row['product']?>">
<a href="/product/<?=$row['product_id']?>">
<div class="card card-statistics h-25 mb-0" style="background-color: aliceblue;">
<div class="card-header d-flex justify-content-between">
<div class="card-heading" style="padding: 1px;">