Skip to content

Commit

Permalink
Update Itindata_model.php
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlosb committed Mar 1, 2024
1 parent 8079a6b commit 5ea00bc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions application/models/Itindata_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ public function get_clientsplain($where=null) {

public function get_clients($where = null) {

$q = "Select c.*, v.*, is.* from clients_tbl AS c
$q = "Select c.*, v.*, iv.* from clients_tbl AS c
LEFT JOIN vehicles_tbl AS v ON c.id_client = v.client_vhcl
LEFT JOIN inspections_tbl AS is ON v.id_vhcl = is.vehicle_inspection";
LEFT JOIN inspections_tbl AS is ON v.id_vhcl = iv.vehicle_inspection";

if (isset($where))
{
Expand Down Expand Up @@ -159,8 +159,8 @@ public function get_unisnpvehicles(){

public function get_vehiclesfull($where=null)
{
$q = "Select v.*, is.*, c.* from vehicles_tbl AS v
LEFT JOIN inspections_tbl AS is ON v.id_vhcl = is.vehicle_inspection
$q = "Select v.*, iv.*, c.* from vehicles_tbl AS v
LEFT JOIN inspections_tbl AS is ON v.id_vhcl = iv.vehicle_inspection
LEFT JOIN clients_tbl AS c ON v.client_vhcl = c.id_client"
;

Expand Down Expand Up @@ -207,10 +207,10 @@ public function set_inspection($data) {

public function get_inspectionsfull($where=null)
{
$q = "Select is.*, v.*, c.*, u.first_name, u.last_name from inspections_tbl AS is
LEFT JOIN vehicles_tbl AS v ON is.vehicle_inspection = v.id_vhcl
LEFT JOIN clients_tbl AS c ON is.client_inspection = c.id_client
LEFT JOIN users AS u ON is.inspector_inspection = u.id";
$q = "Select iv.*, v.*, c.*, u.first_name, u.last_name from inspections_tbl AS is
LEFT JOIN vehicles_tbl AS v ON iv.vehicle_inspection = v.id_vhcl
LEFT JOIN clients_tbl AS c ON iv.client_inspection = c.id_client
LEFT JOIN users AS u ON iv.inspector_inspection = u.id";

if (isset($where))
{
Expand Down

0 comments on commit 5ea00bc

Please sign in to comment.