diff --git a/.env b/.env
index 491b9638..f5fb8331 100755
--- a/.env
+++ b/.env
@@ -18,7 +18,7 @@ DB_PORT=3306
# Alteracoes para funcionar com o servidor, porem não funciona na firma
DB_HOST=ispt-innovation.com
-DB_DATABASE=ispt40
+DB_DATABASE=ispt40_backup
DB_USERNAME=ispt40
DB_PASSWORD=qu3ro3ntr@r
diff --git a/app/Http/Controllers/WorkstationsJobsController.php b/app/Http/Controllers/WorkstationsJobsController.php
index 5872a37a..77620a59 100644
--- a/app/Http/Controllers/WorkstationsJobsController.php
+++ b/app/Http/Controllers/WorkstationsJobsController.php
@@ -1,366 +1,13 @@
email;
-
-// // $equipmentsTodo= DB::select("
-// // WITH equipments_multiple_rows AS (
-// // SELECT
-// // e.equipment_id,
-// // e.equipment_tag,
-// // COALESCE(MAX(oet.elemental_tasks_id), MAX(oet.further_tasks_id)) AS equipment_all_tasks
-// // FROM
-// // users u
-// // JOIN
-// // construction_workstations cw ON u.user_name = cw.name_workstations
-// // JOIN
-// // workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
-// // JOIN
-// // equipments e ON wat.company_projects_id = e.company_projects_id
-// // JOIN
-// // ordered_equipment_tasks oet ON e.equipment_id = oet.equipment_id
-// // WHERE
-// // u.email = :email
-// // AND
-// // oet.execution_order = 1
-// // GROUP BY
-// // e.equipment_id,
-// // e.equipment_tag
-// // ),
-
-// // workstations_multiple_rows AS (
-// // SELECT
-// // cw.id_workstations,
-// // cw.name_workstations,
-// // COALESCE(wat.elemental_tasks_id, wat.further_tasks_id) AS all_tasks
-// // FROM
-// // users u
-// // JOIN
-// // construction_workstations cw ON u.user_name = cw.name_workstations
-// // JOIN
-// // workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
-// // WHERE
-// // u.email = :email
-// // ),
-
-// // workstations_control_all_tasks AS (
-// // SELECT
-// // cew.control_equipment_workstation_id,
-// // cew.equipment_id,
-// // CASE
-// // WHEN cew.id_workstations IS NULL THEN NULL
-// // WHEN cew.id_workstations IN (
-// // SELECT wat.id_workstations
-// // FROM workstations_association_tasks wat
-// // JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
-// // JOIN users u ON u.user_name = cw.name_workstations
-// // WHERE u.email = :email
-// // ) THEN cew.id_workstations
-// // ELSE NULL
-// // END AS control_id_workstations,
-// // COALESCE(cew.elemental_tasks_id, cew.further_tasks_id) AS control_workstation_all_tasks,
-// // cew.equipment_comments_id,
-// // cew.entry_date,
-// // cew.departure_date
-// // FROM
-// // control_equipment_workstation cew
-// // WHERE
-// // cew.id_workstations IS NULL
-// // OR cew.id_workstations IN (
-// // SELECT wat.id_workstations
-// // FROM workstations_association_tasks wat
-// // JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
-// // JOIN users u ON u.user_name = cw.name_workstations
-// // WHERE u.email = :email
-// // )
-// // )
-
-// // SELECT
-// // emr.equipment_id,
-// // emr.equipment_tag
-// // FROM
-// // equipments_multiple_rows emr
-// // WHERE
-// // (
-// // emr.equipment_all_tasks IN (SELECT all_tasks FROM workstations_multiple_rows)
-// // AND NOT EXISTS (
-// // SELECT 1
-// // FROM workstations_control_all_tasks wc
-// // WHERE wc.equipment_id = emr.equipment_id
-// // AND wc.control_id_workstations IN (SELECT id_workstations FROM workstations_multiple_rows)
-// // )
-// // )
-// // OR
-// // (
-// // emr.equipment_id IN (
-// // SELECT equipment_id
-// // FROM workstations_control_all_tasks
-// // WHERE control_id_workstations IS NULL
-// // AND entry_date IS NULL
-// // AND departure_date IS NULL
-// // AND control_workstation_all_tasks IN (SELECT all_tasks FROM workstations_multiple_rows)
-// // )
-// // AND NOT EXISTS (
-// // SELECT 1
-// // FROM workstations_control_all_tasks wc
-// // WHERE wc.equipment_id = emr.equipment_id
-// // AND wc.control_id_workstations IS NOT NULL
-// // GROUP BY wc.equipment_id
-// // HAVING COUNT(DISTINCT wc.control_id_workstations) > 1
-// // )
-// // )
-// // GROUP BY
-// // emr.equipment_id,
-// // emr.equipment_tag
-// // ORDER BY
-// // emr.equipment_id ASC;
-// // ", ['email' => $userEmail]);
-
-
-// $equipmentsDone = DB::select("
-// WITH equipments_multiple_rows AS (
-// SELECT
-// e.equipment_id,
-// e.equipment_tag,
-// COALESCE(MAX(oet.elemental_tasks_id), MAX(oet.further_tasks_id)) AS equipment_all_tasks
-// FROM
-// users u
-// JOIN
-// construction_workstations cw ON u.user_name = cw.name_workstations
-// JOIN
-// workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
-// JOIN
-// equipments e ON wat.company_projects_id = e.company_projects_id
-// JOIN
-// ordered_equipment_tasks oet ON e.equipment_id = oet.equipment_id
-// WHERE
-// u.email = :email
-// AND
-// oet.execution_order = 1
-// GROUP BY
-// e.equipment_id,
-// e.equipment_tag
-// ),
-
-// workstations_multiple_rows AS (
-// SELECT
-// cw.id_workstations,
-// cw.name_workstations,
-// COALESCE(wat.elemental_tasks_id, wat.further_tasks_id) AS all_tasks
-// FROM
-// users u
-// JOIN
-// construction_workstations cw ON u.user_name = cw.name_workstations
-// JOIN
-// workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
-// WHERE
-// u.email = :email
-// ),
-
-// workstations_control_all_tasks AS (
-// SELECT
-// cew.control_equipment_workstation_id,
-// cew.equipment_id,
-// CASE
-// WHEN cew.id_workstations IS NULL THEN NULL
-// WHEN cew.id_workstations IN (
-// SELECT wat.id_workstations
-// FROM workstations_association_tasks wat
-// JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
-// JOIN users u ON u.user_name = cw.name_workstations
-// WHERE u.email = :email
-// ) THEN cew.id_workstations
-// ELSE NULL
-// END AS control_id_workstations,
-// COALESCE(cew.elemental_tasks_id, cew.further_tasks_id) AS control_workstation_all_tasks,
-// cew.equipment_comments_id,
-// cew.entry_date,
-// cew.departure_date
-// FROM
-// control_equipment_workstation cew
-// WHERE
-// cew.id_workstations IS NULL
-// OR cew.id_workstations IN (
-// SELECT wat.id_workstations
-// FROM workstations_association_tasks wat
-// JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
-// JOIN users u ON u.user_name = cw.name_workstations
-// WHERE u.email = :email
-// )
-// )
-
-// SELECT
-// emr.equipment_id,
-// emr.equipment_tag
-// FROM
-// equipments_multiple_rows emr
-// WHERE
-// EXISTS (
-// SELECT 1
-// FROM workstations_control_all_tasks wc
-// JOIN workstations_multiple_rows wmr ON wc.control_id_workstations = wmr.id_workstations
-// WHERE wc.equipment_id = emr.equipment_id
-// AND wc.control_workstation_all_tasks = wmr.all_tasks
-// AND wc.entry_date IS NOT NULL
-// AND wc.departure_date IS NOT NULL
-// AND wc.control_id_workstations IS NOT NULL
-// )
-// AND NOT EXISTS (
-// SELECT 1
-// FROM workstations_control_all_tasks wc
-// WHERE wc.equipment_id = emr.equipment_id
-// AND wc.control_workstation_all_tasks IN (SELECT all_tasks FROM workstations_multiple_rows)
-// AND wc.control_id_workstations IS NULL
-// )
-// GROUP BY
-// emr.equipment_id,
-// emr.equipment_tag
-// ORDER BY
-// emr.equipment_id ASC;
-// ", ['email' => $userEmail]);
-
-
-// $equipmentsReturned = DB::select("
-// WITH equipments_multiple_rows AS (
-// SELECT
-// e.equipment_id,
-// e.equipment_tag,
-// COALESCE(MAX(oet.elemental_tasks_id), MAX(oet.further_tasks_id)) AS equipment_all_tasks
-// FROM
-// users u
-// JOIN
-// construction_workstations cw ON u.user_name = cw.name_workstations
-// JOIN
-// workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
-// JOIN
-// equipments e ON wat.company_projects_id = e.company_projects_id
-// JOIN
-// ordered_equipment_tasks oet ON e.equipment_id = oet.equipment_id
-// WHERE
-// u.email = :email
-// AND
-// oet.execution_order = 1
-// GROUP BY
-// e.equipment_id,
-// e.equipment_tag
-// ),
-
-// workstations_multiple_rows AS (
-// SELECT
-// cw.id_workstations,
-// cw.name_workstations,
-// COALESCE(wat.elemental_tasks_id, wat.further_tasks_id) AS all_tasks
-// FROM
-// users u
-// JOIN
-// construction_workstations cw ON u.user_name = cw.name_workstations
-// JOIN
-// workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
-// WHERE
-// u.email = :email
-// ),
-
-// workstations_control_all_tasks AS (
-// SELECT
-// cew.control_equipment_workstation_id,
-// cew.equipment_id,
-// CASE
-// WHEN cew.id_workstations IS NULL THEN NULL
-// WHEN cew.id_workstations IN (
-// SELECT wat.id_workstations
-// FROM workstations_association_tasks wat
-// JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
-// JOIN users u ON u.user_name = cw.name_workstations
-// WHERE u.email = :email
-// ) THEN cew.id_workstations
-// ELSE NULL
-// END AS control_id_workstations,
-// COALESCE(cew.elemental_tasks_id, cew.further_tasks_id) AS control_workstation_all_tasks,
-// cew.equipment_comments_id,
-// cew.entry_date,
-// cew.departure_date
-// FROM
-// control_equipment_workstation cew
-// WHERE
-// cew.id_workstations IS NULL
-// OR cew.id_workstations IN (
-// SELECT wat.id_workstations
-// FROM workstations_association_tasks wat
-// JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
-// JOIN users u ON u.user_name = cw.name_workstations
-// WHERE u.email = :email
-// )
-// )
-
-// SELECT
-// emr.equipment_id,
-// emr.equipment_tag
-// FROM
-// equipments_multiple_rows emr
-// WHERE
-// emr.equipment_id IN (
-// SELECT equipment_id
-// FROM workstations_control_all_tasks
-// WHERE control_id_workstations IS NULL
-// AND entry_date IS NULL
-// AND departure_date IS NULL
-// AND control_workstation_all_tasks IN (SELECT all_tasks FROM workstations_multiple_rows)
-// AND EXISTS (
-// SELECT 1
-// FROM workstations_control_all_tasks wc
-// WHERE wc.equipment_id = emr.equipment_id
-// AND wc.control_id_workstations IS NOT NULL
-// GROUP BY wc.equipment_id
-// HAVING COUNT(DISTINCT wc.control_id_workstations) >= 2
-// )
-// )
-// GROUP BY
-// emr.equipment_id,
-// emr.equipment_tag
-// ORDER BY
-// emr.equipment_id ASC;
-// ", ['email' => $userEmail]);
-
-// $workstationNameQuery = DB::select("
-// SELECT construction_workstations.nomenclature_workstation
-// FROM construction_workstations
-// JOIN users
-// WHERE construction_workstations.name_workstations = users.user_name
-// AND users.email = :email;
-// ", ['email' => $userEmail]);
-
-// $workstationName = $workstationNameQuery[0]->nomenclature_workstation;
-
-// //Counting of equipments
-// // $equipmentsTodoCount = count($equipmentsTodo);
-// $equipmentsDoneCount = count($equipmentsDone);
-// $equipmentsReturnedCount = count($equipmentsReturned);
-
-// //Returning values of the queries to workstations layout
-// return view('workstations.index', [
-// // 'equipmentsTodo' => $equipmentsTodo, 'equipmentsTodoCount' => $equipmentsTodoCount,
-// 'equipmentsDone' => $equipmentsDone, 'equipmentsDoneCount' => $equipmentsDoneCount,
-// 'equipmentsReturned' => $equipmentsReturned, 'equipmentsReturnedCount' => $equipmentsReturnedCount,
-// 'workstationName' => $workstationName
-// ]);
-// }
-// }
-
-
-
-
namespace App\Http\Controllers;
+use App\Models\ConstructionWorkstation;
+use App\Models\ControlEquipmentWorkstation;
+use App\Models\ElementalTasks;
+use App\Models\Equipment;
+use App\Models\workstationsTaskAnswers;
+
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
@@ -370,365 +17,188 @@ class WorkstationsJobsController extends Controller
{
public function index()
{
- $userEmail = Auth::user()->email;
+ return view('workstations.start');
+ }
- $equipmentsTodo = DB::select("
- WITH equipments_multiple_rows AS (
- SELECT
- e.equipment_id,
- e.equipment_tag,
- COALESCE(MAX(oet.elemental_tasks_id), MAX(oet.further_tasks_id)) AS equipment_all_tasks
- FROM
- users u
- JOIN
- construction_workstations cw ON u.user_name = cw.name_workstations
- JOIN
- workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
- JOIN
- equipments e ON wat.company_projects_id = e.company_projects_id
- JOIN
- ordered_equipment_tasks oet ON e.equipment_id = oet.equipment_id
- WHERE
- u.email = :email1
- AND
- oet.execution_order = 1
- GROUP BY
- e.equipment_id,
- e.equipment_tag
- ),
-
- workstations_multiple_rows AS (
- SELECT
- cw.id_workstations,
- cw.name_workstations,
- COALESCE(wat.elemental_tasks_id, wat.further_tasks_id) AS all_tasks
- FROM
- users u
- JOIN
- construction_workstations cw ON u.user_name = cw.name_workstations
- JOIN
- workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
- WHERE
- u.email = :email2
- ),
-
- workstations_control_all_tasks AS (
- SELECT
- cew.control_equipment_workstation_id,
- cew.equipment_id,
- CASE
- WHEN cew.id_workstations IS NULL THEN NULL
- WHEN cew.id_workstations IN (
- SELECT wat.id_workstations
- FROM workstations_association_tasks wat
- JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
- JOIN users u ON u.user_name = cw.name_workstations
- WHERE u.email = :email3
- ) THEN cew.id_workstations
- ELSE NULL
- END AS control_id_workstations,
- COALESCE(cew.elemental_tasks_id, cew.further_tasks_id) AS control_workstation_all_tasks,
- cew.equipment_comments_id,
- cew.entry_date,
- cew.departure_date
- FROM
- control_equipment_workstation cew
- WHERE
- cew.id_workstations IS NULL
- OR cew.id_workstations IN (
- SELECT wat.id_workstations
- FROM workstations_association_tasks wat
- JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
- JOIN users u ON u.user_name = cw.name_workstations
- WHERE u.email = :email4
- )
- )
-
- SELECT
- emr.equipment_id,
- emr.equipment_tag
- FROM
- equipments_multiple_rows emr
- WHERE
- (
- emr.equipment_all_tasks IN (SELECT all_tasks FROM workstations_multiple_rows)
- AND NOT EXISTS (
- SELECT 1
- FROM workstations_control_all_tasks wc
- WHERE wc.equipment_id = emr.equipment_id
- AND wc.control_id_workstations IN (SELECT id_workstations FROM workstations_multiple_rows)
- )
- )
- OR
- (
- emr.equipment_id IN (
- SELECT equipment_id
- FROM workstations_control_all_tasks
- WHERE control_id_workstations IS NULL
- AND entry_date IS NULL
- AND departure_date IS NULL
- AND control_workstation_all_tasks IN (SELECT all_tasks FROM workstations_multiple_rows)
- )
- AND NOT EXISTS (
- SELECT 1
- FROM workstations_control_all_tasks wc
- WHERE wc.equipment_id = emr.equipment_id
- AND wc.control_id_workstations IS NOT NULL
- GROUP BY wc.equipment_id
- HAVING COUNT(DISTINCT wc.control_id_workstations) > 1
- )
- )
- GROUP BY
- emr.equipment_id,
- emr.equipment_tag
- ORDER BY
- emr.equipment_id ASC;
- ", [
- 'email1' => $userEmail,
- 'email2' => $userEmail,
- 'email3' => $userEmail,
- 'email4' => $userEmail
- ]);
+ public function controlEquipment()
+ {
+ // A partir deste dado consigo receber os valores do WS,TE e Equipment
+ $controlEquipmentWorkstationId = 33;
+ $receiveEquipment = Equipment::where('equipment_id', 1443)->first();
- $equipmentsReturned = DB::select("
- WITH equipments_multiple_rows AS (
- SELECT
- e.equipment_id,
- e.equipment_tag,
- COALESCE(MAX(oet.elemental_tasks_id), MAX(oet.further_tasks_id)) AS equipment_all_tasks
- FROM
- users u
- JOIN
- construction_workstations cw ON u.user_name = cw.name_workstations
- JOIN
- workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
- JOIN
- equipments e ON wat.company_projects_id = e.company_projects_id
- JOIN
- ordered_equipment_tasks oet ON e.equipment_id = oet.equipment_id
- WHERE
- u.email = :email1
- AND
- oet.execution_order = 1
- GROUP BY
- e.equipment_id,
- e.equipment_tag
- ),
-
- workstations_multiple_rows AS (
- SELECT
- cw.id_workstations,
- cw.name_workstations,
- COALESCE(wat.elemental_tasks_id, wat.further_tasks_id) AS all_tasks
- FROM
- users u
- JOIN
- construction_workstations cw ON u.user_name = cw.name_workstations
- JOIN
- workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
- WHERE
- u.email = :email2
- ),
-
- workstations_control_all_tasks AS (
- SELECT
- cew.control_equipment_workstation_id,
- cew.equipment_id,
- CASE
- WHEN cew.id_workstations IS NULL THEN NULL
- WHEN cew.id_workstations IN (
- SELECT wat.id_workstations
- FROM workstations_association_tasks wat
- JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
- JOIN users u ON u.user_name = cw.name_workstations
- WHERE u.email = :email3
- ) THEN cew.id_workstations
- ELSE NULL
- END AS control_id_workstations,
- COALESCE(cew.elemental_tasks_id, cew.further_tasks_id) AS control_workstation_all_tasks,
- cew.equipment_comments_id,
- cew.entry_date,
- cew.departure_date
- FROM
- control_equipment_workstation cew
- WHERE
- cew.id_workstations IS NULL
- OR cew.id_workstations IN (
- SELECT wat.id_workstations
- FROM workstations_association_tasks wat
- JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
- JOIN users u ON u.user_name = cw.name_workstations
- WHERE u.email = :email4
- )
- )
-
- SELECT
- emr.equipment_id,
- emr.equipment_tag
- FROM
- equipments_multiple_rows emr
- WHERE
- emr.equipment_id IN (
- SELECT equipment_id
- FROM workstations_control_all_tasks
- WHERE control_id_workstations IS NULL
- AND entry_date IS NULL
- AND departure_date IS NULL
- AND control_workstation_all_tasks IN (SELECT all_tasks FROM workstations_multiple_rows)
- AND EXISTS (
- SELECT 1
- FROM workstations_control_all_tasks wc
- WHERE wc.equipment_id = emr.equipment_id
- AND wc.control_id_workstations IS NOT NULL
- GROUP BY wc.equipment_id
- HAVING COUNT(DISTINCT wc.control_id_workstations) >= 2
- )
- )
- GROUP BY
- emr.equipment_id,
- emr.equipment_tag
- ORDER BY
- emr.equipment_id ASC;
-
- ", [
-
- 'email1' => $userEmail,
- 'email2' => $userEmail,
- 'email3' => $userEmail,
- 'email4' => $userEmail
-
- ]);
-
-
- $equipmentsDone = DB::select("
- WITH equipments_multiple_rows AS (
- SELECT
- e.equipment_id,
- e.equipment_tag,
- COALESCE(MAX(oet.elemental_tasks_id), MAX(oet.further_tasks_id)) AS equipment_all_tasks
- FROM
- users u
- JOIN
- construction_workstations cw ON u.user_name = cw.name_workstations
- JOIN
- workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
- JOIN
- equipments e ON wat.company_projects_id = e.company_projects_id
- JOIN
- ordered_equipment_tasks oet ON e.equipment_id = oet.equipment_id
- WHERE
- u.email = :email1
- AND
- oet.execution_order = 1
- GROUP BY
- e.equipment_id,
- e.equipment_tag
- ),
-
- workstations_multiple_rows AS (
- SELECT
- cw.id_workstations,
- cw.name_workstations,
- COALESCE(wat.elemental_tasks_id, wat.further_tasks_id) AS all_tasks
- FROM
- users u
- JOIN
- construction_workstations cw ON u.user_name = cw.name_workstations
- JOIN
- workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
- WHERE
- u.email = :email2
- ),
-
- workstations_control_all_tasks AS (
- SELECT
- cew.control_equipment_workstation_id,
- cew.equipment_id,
- CASE
- WHEN cew.id_workstations IS NULL THEN NULL
- WHEN cew.id_workstations IN (
- SELECT wat.id_workstations
- FROM workstations_association_tasks wat
- JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
- JOIN users u ON u.user_name = cw.name_workstations
- WHERE u.email = :email3
- ) THEN cew.id_workstations
- ELSE NULL
- END AS control_id_workstations,
- COALESCE(cew.elemental_tasks_id, cew.further_tasks_id) AS control_workstation_all_tasks,
- cew.equipment_comments_id,
- cew.entry_date,
- cew.departure_date
- FROM
- control_equipment_workstation cew
- WHERE
- cew.id_workstations IS NULL
- OR cew.id_workstations IN (
- SELECT wat.id_workstations
- FROM workstations_association_tasks wat
- JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
- JOIN users u ON u.user_name = cw.name_workstations
- WHERE u.email = :email4
- )
- )
-
- SELECT
- emr.equipment_id,
- emr.equipment_tag
- FROM
- equipments_multiple_rows emr
- WHERE
- EXISTS (
- SELECT 1
- FROM workstations_control_all_tasks wc
- JOIN workstations_multiple_rows wmr ON wc.control_id_workstations = wmr.id_workstations
- WHERE wc.equipment_id = emr.equipment_id
- AND wc.control_workstation_all_tasks = wmr.all_tasks
- AND wc.entry_date IS NOT NULL
- AND wc.departure_date IS NOT NULL
- AND wc.control_id_workstations IS NOT NULL
- )
- AND NOT EXISTS (
- SELECT 1
- FROM workstations_control_all_tasks wc
- WHERE wc.equipment_id = emr.equipment_id
- AND wc.control_workstation_all_tasks IN (SELECT all_tasks FROM workstations_multiple_rows)
- AND wc.control_id_workstations IS NULL
- )
- GROUP BY
- emr.equipment_id,
- emr.equipment_tag
- ORDER BY
- emr.equipment_id ASC;
- ", [
- 'email1' => $userEmail,
- 'email2' => $userEmail,
- 'email3' => $userEmail,
- 'email4' => $userEmail
- ]);
-
- $workstationNameQuery = DB::select("
- SELECT construction_workstations.nomenclature_workstation
- FROM construction_workstations
- JOIN users
- WHERE construction_workstations.name_workstations = users.user_name
- AND users.email = :email;
- ", ['email' => $userEmail]);
-
- $workstationName = $workstationNameQuery[0]->nomenclature_workstation;
-
- //Counting of equipments
- $equipmentsTodoCount = count($equipmentsTodo);
- $equipmentsDoneCount = count($equipmentsDone);
- $equipmentsReturnedCount = count($equipmentsReturned);
-
- //Returning values of the queries to workstations layout
- return view('workstations.start', [
- 'equipmentsTodo' => $equipmentsTodo, 'equipmentsTodoCount' => $equipmentsTodoCount,
- 'equipmentsDone' => $equipmentsDone, 'equipmentsDoneCount' => $equipmentsDoneCount,
- 'equipmentsReturned' => $equipmentsReturned, 'equipmentsReturnedCount' => $equipmentsReturnedCount,
- 'workstationName' => $workstationName
+ $task_todo = 1;
+ return view('workstations.workstations', [
+ 'task_todo' => $task_todo,
+ 'controlEquipmentWorkstationId' => $controlEquipmentWorkstationId,
+ 'receiveEquipment' => $receiveEquipment
]);
}
-}
\ No newline at end of file
+
+ // public function receiveAnswersEquipment(Request $request)
+ // {
+ // $receiveAnswersElementalTasks = new workstationsTaskAnswers;
+
+ // $receiveAnswersElementalTasks->control_equipment_workstation_id = $request->control_equipment_workstation_id;
+ // $receiveAnswersElementalTasks->answer_json =
+
+ // }
+
+ // Recebe as perguntas e respostas e deve criar um linha nova.
+ public function receiveAnswersEquipment(Request $request)
+ {
+ // Primeiro ele deve criar a associação entre id atual do control + perguntas e respostas
+ $receiveAnswersElementalTasks = new workstationsTaskAnswers;
+ $receiveAnswersElementalTasks->control_equipment_workstation_id = $request->control_equipment_workstationid;
+
+ // Inicializando o array que vai armazenar os objetos JSON
+ $answersArray = [];
+
+ foreach ($request->all() as $key => $value) {
+ // Ignorando a chave control_equipment_workstation_id
+ if ($key !== 'control_equipment_workstation_id') {
+ // Verificando se $key contém '-'
+ if (strpos($key, '-') === false) {
+ // Se não contiver, pular esta iteração
+ continue;
+ }
+ // Dividindo a chave em duas partes: question e type
+ list($question, $type) = explode('-', $key);
+
+ // Adicionando um novo objeto JSON ao array
+ $answersArray[] = [
+ 'type' => $type,
+ 'value' => $value,
+ 'question' => $question
+ ];
+ }
+ }
+
+ // Convertendo o array em uma string JSON
+ $jsonString = json_encode($answersArray);
+
+ // Armazenando a string JSON no banco de dados
+ $receiveAnswersElementalTasks->answer_json = $jsonString;
+ $receiveAnswersElementalTasks->save();
+
+ // update departure_date value
+ $receiveDataControlWs = ControlEquipmentWorkstation::find($request->control_equipment_workstationid);
+ $receiveDataControlWs->departure_date = now();
+ $receiveDataControlWs->save();
+
+ //FINALIZOU A TAREFA ANTERIOR COM DEPARTURE
+
+ //Busca o Email
+ $userEmail = Auth::user()->email;
+
+ //Busca o id Anterior
+ $control_ew_id = $request->control_equipment_workstationid;
+
+ // Busca a Ws com base no id recebido da tabela Control.
+ $recebeDataControlId = ControlEquipmentWorkstation::find($request->control_equipment_workstationid);
+
+ //Chama o procedimento
+ $controlTasks = DB::select('CALL ManageNextTask(?, ?)', [$userEmail, $control_ew_id]);
+
+ //Saving the values to a variable
+ if (count($controlTasks) > 0) {
+ $current_workstation = $controlTasks[0]->id_workstations;
+ $next_workstation = $controlTasks[0]->next_workstation;
+ $next_todo = $controlTasks[0]->next_todo;
+ } else {
+ //It should always exist, but you never know :)
+ $next_todo = null;
+ }
+ //RECEBE OS VALORES DA PROXIMA WS E PROXIMA TAREFA
+
+ // Recebe os dados de cada Tarefa Elementar.
+ $receiveDataElementalTask = ElementalTasks::find($recebeDataControlId->elemental_tasks_id);
+ $receiveDataEquipment = Equipment::find($recebeDataControlId->equipment_id);
+
+ if ($next_todo < 25) {
+ $elemental_tasks_id = $next_todo;
+ $further_tasks_id = null;
+ } else {
+ $elemental_tasks_id = null;
+ $further_tasks_id = $next_todo;
+ }
+ //Se a proxima WS for igual a atual deve criar dados para a ws
+ if ($recebeDataControlId->id_workstations == $next_workstation) {
+
+ $nextEquipmentTask = DB::select("
+ INSERT INTO control_equipment_workstation
+ (equipment_id, id_workstations, elemental_tasks_id, further_tasks_id, equipment_comments_id, entry_date, departure_date)
+ VALUES
+ (:equipment_id,:next_workstation,:elemental_tasks_id,:further_tasks_id,NULL,CURRENT_TIMESTAMP,NULL)
+ ", [
+ 'equipment_id' => $receiveDataEquipment->equipment_id,
+ 'next_workstation' => $next_workstation,
+ 'elemental_tasks_id' => $elemental_tasks_id,
+ 'further_tasks_id' => $further_tasks_id
+ ]);
+ $lastInsertedId = DB::getPdo()->lastInsertId();
+
+ return view('workstations.workstations', [
+ 'receiveDataElementalTask' => $receiveDataElementalTask,
+ 'receiveDataEquipment' => $receiveDataEquipment,
+ 'control_ew_id' => $lastInsertedId,
+ 'task_todo' => $next_todo
+ ]);
+ // Se verificar que a proxima tarefa e Null ele deve apenas voltar ao start
+ } else if($next_todo == null){
+ return view('workstations.start');
+ }
+ else {
+ $nextEquipmentTask = DB::select("
+ INSERT INTO control_equipment_workstation
+ (equipment_id, id_workstations, elemental_tasks_id, further_tasks_id, equipment_comments_id, entry_date, departure_date)
+ VALUES
+ (:equipment_id,NULL,:elemental_tasks_id,:further_tasks_id,NULL,NULL,NULL)
+ ", [
+ 'equipment_id' => $receiveDataEquipment->equipment_id,
+ 'elemental_tasks_id' => $elemental_tasks_id,
+ 'further_tasks_id' => $further_tasks_id
+ ]);
+
+ return view('workstations.start');
+ }
+ }
+
+ // Ao selecionar o equipamento para se inicializar a tarefa deve mostrar os dados relacionados.
+ public function getEquipmentData($equipment_id)
+ { //vai receber o email atual, no caso o da workstation que se encontra
+ $userEmail = Auth::user()->email;
+
+ $receiveDataEquipment = Equipment::where('equipment_id', $equipment_id)->first();
+
+ //Calling the MySQL procedure tthat will return a table with two columns and one row
+
+ //cria a nova linha
+ $equipmentData = DB::select('CALL ManageEquipmentTasks(?, ?)', [$userEmail, $equipment_id]);
+
+ // //Saving the values to a variable
+ if (count($equipmentData) > 0) {
+ $control_ew_id = $equipmentData[0]->control_ew_id;
+ $task_todo = $equipmentData[0]->task_todo;
+ } else {
+ //It should always exist, but you never know :)
+ $control_ew_id = null;
+ $task_todo = null;
+ }
+
+ $recebeDataControlId = ControlEquipmentWorkstation::find($control_ew_id);
+
+ // Recebe os dados de cada Tarefa Elementar.
+ $receiveDataElementalTask = ElementalTasks::find($recebeDataControlId->elemental_tasks_id);
+
+ //Deve recupar os dados da tarefa Atual quando receber o control_id
+
+ //Returning the values to a view "values"
+ return view('workstations.workstations', [
+ 'receiveDataElementalTask' => $receiveDataElementalTask,
+ 'receiveDataEquipment' => $receiveDataEquipment,
+ 'control_ew_id' => $control_ew_id,
+ 'task_todo' => $task_todo
+ ]);
+ }
+}
diff --git a/app/Http/ViewComposers/WorkstationComposer.php b/app/Http/ViewComposers/WorkstationComposer.php
new file mode 100644
index 00000000..16808d5c
--- /dev/null
+++ b/app/Http/ViewComposers/WorkstationComposer.php
@@ -0,0 +1,379 @@
+email;
+
+ $equipmentsTodo = DB::select("
+ WITH equipments_multiple_rows AS (
+ SELECT
+ e.equipment_id,
+ e.equipment_tag,
+ COALESCE(MAX(oet.elemental_tasks_id), MAX(oet.further_tasks_id)) AS equipment_all_tasks
+ FROM
+ users u
+ JOIN
+ construction_workstations cw ON u.user_name = cw.name_workstations
+ JOIN
+ workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
+ JOIN
+ equipments e ON wat.company_projects_id = e.company_projects_id
+ JOIN
+ ordered_equipment_tasks oet ON e.equipment_id = oet.equipment_id
+ WHERE
+ u.email = :email1
+ AND
+ oet.execution_order = 1
+ GROUP BY
+ e.equipment_id,
+ e.equipment_tag
+ ),
+
+ workstations_multiple_rows AS (
+ SELECT
+ cw.id_workstations,
+ cw.name_workstations,
+ COALESCE(wat.elemental_tasks_id, wat.further_tasks_id) AS all_tasks
+ FROM
+ users u
+ JOIN
+ construction_workstations cw ON u.user_name = cw.name_workstations
+ JOIN
+ workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
+ WHERE
+ u.email = :email2
+ ),
+
+ workstations_control_all_tasks AS (
+ SELECT
+ cew.control_equipment_workstation_id,
+ cew.equipment_id,
+ CASE
+ WHEN cew.id_workstations IS NULL THEN NULL
+ WHEN cew.id_workstations IN (
+ SELECT wat.id_workstations
+ FROM workstations_association_tasks wat
+ JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
+ JOIN users u ON u.user_name = cw.name_workstations
+ WHERE u.email = :email3
+ ) THEN cew.id_workstations
+ ELSE NULL
+ END AS control_id_workstations,
+ COALESCE(cew.elemental_tasks_id, cew.further_tasks_id) AS control_workstation_all_tasks,
+ cew.equipment_comments_id,
+ cew.entry_date,
+ cew.departure_date
+ FROM
+ control_equipment_workstation cew
+ WHERE
+ cew.id_workstations IS NULL
+ OR cew.id_workstations IN (
+ SELECT wat.id_workstations
+ FROM workstations_association_tasks wat
+ JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
+ JOIN users u ON u.user_name = cw.name_workstations
+ WHERE u.email = :email4
+ )
+ )
+
+ SELECT
+ emr.equipment_id,
+ emr.equipment_tag
+ FROM
+ equipments_multiple_rows emr
+ WHERE
+ (
+ emr.equipment_all_tasks IN (SELECT all_tasks FROM workstations_multiple_rows)
+ AND NOT EXISTS (
+ SELECT 1
+ FROM workstations_control_all_tasks wc
+ WHERE wc.equipment_id = emr.equipment_id
+ AND wc.control_id_workstations IN (SELECT id_workstations FROM workstations_multiple_rows)
+ )
+ )
+ OR
+ (
+ emr.equipment_id IN (
+ SELECT equipment_id
+ FROM workstations_control_all_tasks
+ WHERE control_id_workstations IS NULL
+ AND entry_date IS NULL
+ AND departure_date IS NULL
+ AND control_workstation_all_tasks IN (SELECT all_tasks FROM workstations_multiple_rows)
+ )
+ AND NOT EXISTS (
+ SELECT 1
+ FROM workstations_control_all_tasks wc
+ WHERE wc.equipment_id = emr.equipment_id
+ AND wc.control_id_workstations IS NOT NULL
+ GROUP BY wc.equipment_id
+ HAVING COUNT(DISTINCT wc.control_id_workstations) > 1
+ )
+ )
+ GROUP BY
+ emr.equipment_id,
+ emr.equipment_tag
+ ORDER BY
+ emr.equipment_id ASC;
+ ", [
+ 'email1' => $userEmail,
+ 'email2' => $userEmail,
+ 'email3' => $userEmail,
+ 'email4' => $userEmail
+ ]);
+
+
+ $equipmentsReturned = DB::select("
+ WITH equipments_multiple_rows AS (
+ SELECT
+ e.equipment_id,
+ e.equipment_tag,
+ COALESCE(MAX(oet.elemental_tasks_id), MAX(oet.further_tasks_id)) AS equipment_all_tasks
+ FROM
+ users u
+ JOIN
+ construction_workstations cw ON u.user_name = cw.name_workstations
+ JOIN
+ workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
+ JOIN
+ equipments e ON wat.company_projects_id = e.company_projects_id
+ JOIN
+ ordered_equipment_tasks oet ON e.equipment_id = oet.equipment_id
+ WHERE
+ u.email = :email1
+ AND
+ oet.execution_order = 1
+ GROUP BY
+ e.equipment_id,
+ e.equipment_tag
+ ),
+
+ workstations_multiple_rows AS (
+ SELECT
+ cw.id_workstations,
+ cw.name_workstations,
+ COALESCE(wat.elemental_tasks_id, wat.further_tasks_id) AS all_tasks
+ FROM
+ users u
+ JOIN
+ construction_workstations cw ON u.user_name = cw.name_workstations
+ JOIN
+ workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
+ WHERE
+ u.email = :email2
+ ),
+
+ workstations_control_all_tasks AS (
+ SELECT
+ cew.control_equipment_workstation_id,
+ cew.equipment_id,
+ CASE
+ WHEN cew.id_workstations IS NULL THEN NULL
+ WHEN cew.id_workstations IN (
+ SELECT wat.id_workstations
+ FROM workstations_association_tasks wat
+ JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
+ JOIN users u ON u.user_name = cw.name_workstations
+ WHERE u.email = :email3
+ ) THEN cew.id_workstations
+ ELSE NULL
+ END AS control_id_workstations,
+ COALESCE(cew.elemental_tasks_id, cew.further_tasks_id) AS control_workstation_all_tasks,
+ cew.equipment_comments_id,
+ cew.entry_date,
+ cew.departure_date
+ FROM
+ control_equipment_workstation cew
+ WHERE
+ cew.id_workstations IS NULL
+ OR cew.id_workstations IN (
+ SELECT wat.id_workstations
+ FROM workstations_association_tasks wat
+ JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
+ JOIN users u ON u.user_name = cw.name_workstations
+ WHERE u.email = :email4
+ )
+ )
+
+ SELECT
+ emr.equipment_id,
+ emr.equipment_tag
+ FROM
+ equipments_multiple_rows emr
+ WHERE
+ emr.equipment_id IN (
+ SELECT equipment_id
+ FROM workstations_control_all_tasks
+ WHERE control_id_workstations IS NULL
+ AND entry_date IS NULL
+ AND departure_date IS NULL
+ AND control_workstation_all_tasks IN (SELECT all_tasks FROM workstations_multiple_rows)
+ AND EXISTS (
+ SELECT 1
+ FROM workstations_control_all_tasks wc
+ WHERE wc.equipment_id = emr.equipment_id
+ AND wc.control_id_workstations IS NOT NULL
+ GROUP BY wc.equipment_id
+ HAVING COUNT(DISTINCT wc.control_id_workstations) >= 2
+ )
+ )
+ GROUP BY
+ emr.equipment_id,
+ emr.equipment_tag
+ ORDER BY
+ emr.equipment_id ASC;
+
+ ", [
+
+ 'email1' => $userEmail,
+ 'email2' => $userEmail,
+ 'email3' => $userEmail,
+ 'email4' => $userEmail
+
+ ]);
+
+
+ $equipmentsDone = DB::select("
+ WITH equipments_multiple_rows AS (
+ SELECT
+ e.equipment_id,
+ e.equipment_tag,
+ COALESCE(MAX(oet.elemental_tasks_id), MAX(oet.further_tasks_id)) AS equipment_all_tasks
+ FROM
+ users u
+ JOIN
+ construction_workstations cw ON u.user_name = cw.name_workstations
+ JOIN
+ workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
+ JOIN
+ equipments e ON wat.company_projects_id = e.company_projects_id
+ JOIN
+ ordered_equipment_tasks oet ON e.equipment_id = oet.equipment_id
+ WHERE
+ u.email = :email1
+ AND
+ oet.execution_order = 1
+ GROUP BY
+ e.equipment_id,
+ e.equipment_tag
+ ),
+
+ workstations_multiple_rows AS (
+ SELECT
+ cw.id_workstations,
+ cw.name_workstations,
+ COALESCE(wat.elemental_tasks_id, wat.further_tasks_id) AS all_tasks
+ FROM
+ users u
+ JOIN
+ construction_workstations cw ON u.user_name = cw.name_workstations
+ JOIN
+ workstations_association_tasks wat ON cw.id_workstations = wat.id_workstations
+ WHERE
+ u.email = :email2
+ ),
+
+ workstations_control_all_tasks AS (
+ SELECT
+ cew.control_equipment_workstation_id,
+ cew.equipment_id,
+ CASE
+ WHEN cew.id_workstations IS NULL THEN NULL
+ WHEN cew.id_workstations IN (
+ SELECT wat.id_workstations
+ FROM workstations_association_tasks wat
+ JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
+ JOIN users u ON u.user_name = cw.name_workstations
+ WHERE u.email = :email3
+ ) THEN cew.id_workstations
+ ELSE NULL
+ END AS control_id_workstations,
+ COALESCE(cew.elemental_tasks_id, cew.further_tasks_id) AS control_workstation_all_tasks,
+ cew.equipment_comments_id,
+ cew.entry_date,
+ cew.departure_date
+ FROM
+ control_equipment_workstation cew
+ WHERE
+ cew.id_workstations IS NULL
+ OR cew.id_workstations IN (
+ SELECT wat.id_workstations
+ FROM workstations_association_tasks wat
+ JOIN construction_workstations cw ON wat.company_projects_id = cw.company_projects_id
+ JOIN users u ON u.user_name = cw.name_workstations
+ WHERE u.email = :email4
+ )
+ )
+
+ SELECT
+ emr.equipment_id,
+ emr.equipment_tag
+ FROM
+ equipments_multiple_rows emr
+ WHERE
+ EXISTS (
+ SELECT 1
+ FROM workstations_control_all_tasks wc
+ JOIN workstations_multiple_rows wmr ON wc.control_id_workstations = wmr.id_workstations
+ WHERE wc.equipment_id = emr.equipment_id
+ AND wc.control_workstation_all_tasks = wmr.all_tasks
+ AND wc.entry_date IS NOT NULL
+ AND wc.departure_date IS NOT NULL
+ AND wc.control_id_workstations IS NOT NULL
+ )
+ AND NOT EXISTS (
+ SELECT 1
+ FROM workstations_control_all_tasks wc
+ WHERE wc.equipment_id = emr.equipment_id
+ AND wc.control_workstation_all_tasks IN (SELECT all_tasks FROM workstations_multiple_rows)
+ AND wc.control_id_workstations IS NULL
+ )
+ GROUP BY
+ emr.equipment_id,
+ emr.equipment_tag
+ ORDER BY
+ emr.equipment_id ASC;
+ ", [
+ 'email1' => $userEmail,
+ 'email2' => $userEmail,
+ 'email3' => $userEmail,
+ 'email4' => $userEmail
+ ]);
+
+ $workstationNameQuery = DB::select("
+ SELECT construction_workstations.nomenclature_workstation
+ FROM construction_workstations
+ JOIN users
+ WHERE construction_workstations.name_workstations = users.user_name
+ AND users.email = :email;
+ ", ['email' => $userEmail]);
+
+ $workstationName = $workstationNameQuery[0]->nomenclature_workstation;
+
+ //Counting of equipments
+ $equipmentsTodoCount = count($equipmentsTodo);
+ $equipmentsDoneCount = count($equipmentsDone);
+ $equipmentsReturnedCount = count($equipmentsReturned);
+
+
+ //Returning values of the queries to workstations layout
+ $view->with([
+ 'equipmentsTodo' => $equipmentsTodo,
+ 'equipmentsTodoCount' => $equipmentsTodoCount,
+ 'equipmentsDone' => $equipmentsDone,
+ 'equipmentsDoneCount' => $equipmentsDoneCount,
+ 'equipmentsReturned' => $equipmentsReturned,
+ 'equipmentsReturnedCount' => $equipmentsReturnedCount,
+ 'workstationName' => $workstationName
+ ]);
+ }
+}
diff --git a/app/Models/ControlEquipmentWorkstation.php b/app/Models/ControlEquipmentWorkstation.php
index 9e8e076a..6ff4d16c 100755
--- a/app/Models/ControlEquipmentWorkstation.php
+++ b/app/Models/ControlEquipmentWorkstation.php
@@ -13,6 +13,8 @@ class ControlEquipmentWorkstation extends Model
protected $table = 'control_equipment_workstation';
+ protected $primaryKey = 'control_equipment_workstation_id';
+
// protected $primaryKey = 'id';
public function equipment()
diff --git a/app/Models/workstationsTaskAnswers.php b/app/Models/workstationsTaskAnswers.php
new file mode 100644
index 00000000..182e3cad
--- /dev/null
+++ b/app/Models/workstationsTaskAnswers.php
@@ -0,0 +1,18 @@
+Email
Tipo de Utilizador |
Ações |
-
+ Empresas
@foreach ($users as $user)
diff --git a/resources/views/Admin/DataManagement/manageassets.blade copy.php b/resources/views/Admin/DataManagement/manageassets.blade copy.php
new file mode 100755
index 00000000..343cebad
--- /dev/null
+++ b/resources/views/Admin/DataManagement/manageassets.blade copy.php
@@ -0,0 +1,450 @@
+@extends('Templates/templateAdmin')
+
+@section('Main-content')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{--
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--}}
+
+
+ {{-- Tabela para se usar com DataTables Yajra --}}
+ {{--
+
+
+ | Tag |
+ Tipo Equipamento |
+ Fábricas |
+ Descrição Equipamento |
+
+
+
--}}
+
+
+
+
+ | Tag |
+ Tipo Equipamento |
+ Fábricas |
+ Descrição Equipamento |
+
+
+
+ @foreach ($equipments as $equipment)
+
+ | {{ $equipment->equipment_tag }} |
+
+
+ @endforeach
+
+
+
+
+
+ {{-- --}}
+
+
+
+ {{--
+
+
+
+
+
+
+
+
Tarefas Selecionadas para o Postos X:
+
+
+
+
+
+
+
+
+
+
+
+
--}}
+
+
+
+
+ {{-- ./cardAssetsTable --}}
+
+
+
+
+
+
+
+
+@endsection
+
+@section('scriptsTemplateAdmin')
+
+
+{{--
+ --}}
+
+ {{-- Script para DataTables Yajra --}}
+ {{-- --}}
+
+
+
+ {{-- --}}
+
+ {{-- --}}
+
+
+@endsection
diff --git a/resources/views/Admin/DataManagement/manageassets.blade.php b/resources/views/Admin/DataManagement/manageassets.blade.php
index 257b1218..aff9ae2e 100755
--- a/resources/views/Admin/DataManagement/manageassets.blade.php
+++ b/resources/views/Admin/DataManagement/manageassets.blade.php
@@ -6,7 +6,7 @@
-
Gestão de ativos
+ Gestão de ativos
@@ -41,264 +41,41 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
| Tag |
Tipo Equipamento |
Fábricas |
Descrição Equipamento |
+ Ações |
+
+
+ @foreach ($equipments as $equipment)
+
+ | {{ $equipment->equipment_tag }} |
+ {{ $equipment->equipmentType->equipment_type_name }} |
+ {{ $equipment->unit->unit_name }} |
+ {{ $equipment->equipment_description }} |
+ Ações |
+
+ @endforeach
+
-
-
- {{-- --}}
-
-
-
- {{--
-
-
-
-
-
-
-
-
Tarefas Selecionadas para o Postos X:
-
-
-
-
-
-
-
-
-
-
-
-
--}}
+
{{-- ./cardAssetsTable --}}
@@ -312,28 +89,41 @@ class="checkboxChoseTasksOficesCV"
@endsection
@section('scriptsTemplateAdmin')
+
+
+ {{--
+ --}}
-
+ --}}
-
- --}}
+
+ {{--
+ --}}
@endsection
diff --git a/resources/views/Admin/profile.blade.php b/resources/views/Admin/profile.blade.php
index 470eeb7e..24b2306d 100755
--- a/resources/views/Admin/profile.blade.php
+++ b/resources/views/Admin/profile.blade.php
@@ -130,8 +130,7 @@ class="col-md-4 col-lg-3 form-label">Actualizar o seu logótipo.
-
+
diff --git a/resources/views/LinksTemplate.blade.php b/resources/views/LinksTemplate.blade.php
deleted file mode 100755
index e8e21ac7..00000000
--- a/resources/views/LinksTemplate.blade.php
+++ /dev/null
@@ -1,276 +0,0 @@
-
-
-
-
-
-
-
-
-{{-- Serve para trabelhar com data e hora no bootstrap , ver se necessario! --}}
-
-{{-- Para estilzar (checkbox) ver se necessario --}}
-
-{{-- EStudar este Plugins --}}
-
-
-
- {{-- Se você precisa de uma interface onde os utilizadors possam selecionar uma série de datas, como para uma reserva de hotel, por exemplo,--}}
-
- {{-- Estudar --}}
-
- {{-- Criacao de interface, Estudar --}}
-
- {{-- --}}
-
- {{-- DataTables --}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{{-- Parte de Cima - Header --}}
-
-
-
-
-
-{{-- PARTE DE baixo no BODY --}}
-
-
-
-
- {{-- DataTables --}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{{-- Segunda Versao : --}}
-
-
-
-
-
-
-
-
-
-
-
-
- {{-- DataTables --}}
-
-
-
-
-
-
-
-
-
-{{-- Parde de Baixo antes de fechar body --}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{{-- DataTables --}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{{-- Plugins-Scripts --}}
-
-
-
-
-
-
-
-
-
-{{-- FUNCIONA REAL --}}
-{{-- PARTE DE CIMA --}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{{-- Parte de Baixo --}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{{--
-
- --}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/resources/views/Templates/templateWorkstations.blade.php b/resources/views/Templates/templateWorkstations.blade.php
index 0177e506..2b5b2164 100644
--- a/resources/views/Templates/templateWorkstations.blade.php
+++ b/resources/views/Templates/templateWorkstations.blade.php
@@ -31,6 +31,15 @@
+
+
@@ -47,19 +56,19 @@
-
- {{-- {{ $equipmentsTodoCount }} --}}
+ {{ $equipmentsTodoCount }}
-
- {{-- {{ $equipmentsReturnedCount }} --}}
+ {{ $equipmentsReturnedCount }}
-
- {{-- {{ $equipmentsDoneCount }} --}}
+ {{ $equipmentsDoneCount }}
@@ -67,7 +76,7 @@
-
- {{--
{{ $workstationName }}
--}}
+ {{ $workstationName }}
-
@@ -140,7 +149,12 @@ class="brand-image img-circle elevation-3" style="opacity: .8">