Added from-to patrol time within sequence title on guard_patrol_entry_data_table

This commit is contained in:
dhanabalan
2025-06-24 17:32:00 +05:30
parent be466cfdc2
commit 97d43ac8cf
2 changed files with 120 additions and 60 deletions

View File

@@ -34,6 +34,16 @@ class GuardPatrolEntryDataTable extends Component
public $sequence7;
public $sequence8;
public $sequence9;
public $seqTime;
public $seqTime1;
public $seqTime2;
public $seqTime3;
public $seqTime4;
public $seqTime5;
public $seqTime6;
public $seqTime7;
public $seqTime8;
public $seqTime9;
public $startSeqCheckPoint1;
public $startSeqCheckPoint2;
public $startSeqCheckPoint3;
@@ -77,6 +87,16 @@ class GuardPatrolEntryDataTable extends Component
$this->sequence7 = null;
$this->sequence8 = null;
$this->sequence9 = null;
$this->seqTime = null;
$this->seqTime1 = null;
$this->seqTime2 = null;
$this->seqTime3 = null;
$this->seqTime4 = null;
$this->seqTime5 = null;
$this->seqTime6 = null;
$this->seqTime7 = null;
$this->seqTime8 = null;
$this->seqTime9 = null;
if(!$plantId || !$date)
{
@@ -115,11 +135,30 @@ class GuardPatrolEntryDataTable extends Component
'Sequence_6' => $this->sequence6,
'Sequence_7' => $this->sequence7,
'Sequence_8' => $this->sequence8,
'Sequence_9' => $this->sequence9
'Sequence_9' => $this->sequence9,
'Sequence_Time_1' => $this->seqTime1,
'Sequence_Time_2' => $this->seqTime2,
'Sequence_Time_3' => $this->seqTime3,
'Sequence_Time_4' => $this->seqTime4,
'Sequence_Time_5' => $this->seqTime5,
'Sequence_Time_6' => $this->seqTime6,
'Sequence_Time_7' => $this->seqTime7,
'Sequence_Time_8' => $this->seqTime8,
'Sequence_Time_9' => $this->seqTime9
//'created_at' => $record->created_at,
];
}
$this->seqTime1 = null;
$this->seqTime2 = null;
$this->seqTime3 = null;
$this->seqTime4 = null;
$this->seqTime5 = null;
$this->seqTime6 = null;
$this->seqTime7 = null;
$this->seqTime8 = null;
$this->seqTime9 = null;
$this->guardName = $guardName;
$this->startTime = Carbon::parse($record->patrol_time)->toTimeString(); //"2025-06-01 00:07:12"
$this->start = Carbon::parse($record->patrol_time);
@@ -129,6 +168,7 @@ class GuardPatrolEntryDataTable extends Component
$this->end = Carbon::parse($record->patrol_time);
$this->labTime = (int)$this->start->diffInMinutes($this->finish);
$this->minDiff = (int)$this->begin->diffInMinutes($this->end);
$this->seqTime = $this->begin->toTimeString(). " - " . $this->end->toTimeString();
$this->seqNo = 0;
$this->newNameFound = false;
$this->isSequenced = true;
@@ -140,6 +180,7 @@ class GuardPatrolEntryDataTable extends Component
$this->end = Carbon::parse($record->patrol_time);
$this->labTime = (int)$this->start->diffInMinutes($this->finish);
$this->minDiff = (int)$this->begin->diffInMinutes($this->end);
$this->seqTime = $this->begin->toTimeString(). " - " . $this->end->toTimeString();
$this->begin = Carbon::parse($record->patrol_time);
// $this->seqNo = 0;
}
@@ -173,6 +214,7 @@ class GuardPatrolEntryDataTable extends Component
}
}
else if ($this->seqNo == 2) {
$this->seqTime1 = $this->seqTime;
if ($checkPointName == $this->startSeqCheckPoint2->checkPointNames1->name) {//"CANTEEN"
if ($this->isSequenced) {
$this->sequence1 = $this->minDiff;
@@ -200,6 +242,7 @@ class GuardPatrolEntryDataTable extends Component
}
}
else if ($this->seqNo == 3) {
$this->seqTime2 = $this->seqTime;
if ($checkPointName == $this->startSeqCheckPoint3->checkPointNames1->name) {//"D BLOCK BACK GATE"
if ($this->isSequenced) {
$this->sequence2 = $this->minDiff;
@@ -225,6 +268,7 @@ class GuardPatrolEntryDataTable extends Component
}
}
else if ($this->seqNo == 4) {
$this->seqTime3 = $this->seqTime;
if ($checkPointName == $this->startSeqCheckPoint4->checkPointNames1->name) {//"C BLOCK PACKING END"
if ($this->isSequenced) {
$this->sequence3 = $this->minDiff;
@@ -248,6 +292,7 @@ class GuardPatrolEntryDataTable extends Component
}
}
else if ($this->seqNo == 5) {
$this->seqTime4 = $this->seqTime;
if ($checkPointName == $this->startSeqCheckPoint5->checkPointNames1->name) {//"EXPORT WINDING FRONT"
if ($this->isSequenced) {
$this->sequence4 = $this->minDiff;
@@ -268,7 +313,8 @@ class GuardPatrolEntryDataTable extends Component
$this->sequence9 = "X";
}
}
elseif ($this->seqNo == 6) {
else if ($this->seqNo == 6) {
$this->seqTime5 = $this->seqTime;
if ($checkPointName == $this->startSeqCheckPoint6->checkPointNames1->name) {//"DOMESTIC WINDING FRONT"
if ($this->isSequenced) {
$this->sequence5 = $this->minDiff;
@@ -287,7 +333,8 @@ class GuardPatrolEntryDataTable extends Component
$this->sequence9 = "X";
}
}
elseif ($this->seqNo == 7) {
else if ($this->seqNo == 7) {
$this->seqTime6 = $this->seqTime;
if ($checkPointName == $this->startSeqCheckPoint7->checkPointNames1->name) {//"POWER HOUSE FRONT"
if ($this->isSequenced) {
$this->sequence6 = $this->minDiff;
@@ -304,7 +351,8 @@ class GuardPatrolEntryDataTable extends Component
$this->sequence9 = "X";
}
}
elseif ($this->seqNo == 8) {
else if ($this->seqNo == 8) {
$this->seqTime7 = $this->seqTime;
if ($checkPointName == $this->startSeqCheckPoint8->checkPointNames1->name) {//"B BLOCK BUFFING FRONT"
if ($this->isSequenced) {
$this->sequence7 = $this->minDiff;
@@ -319,7 +367,8 @@ class GuardPatrolEntryDataTable extends Component
$this->sequence9 = "X";
}
}
elseif ($this->seqNo == 9) {
else if ($this->seqNo == 9) {
$this->seqTime8 = $this->seqTime;
if ($checkPointName == $this->startSeqCheckPoint9->checkPointNames1->name) {//"D BLOCK DESPATCH FRONT"
if ($this->isSequenced) {
$this->sequence8 = $this->minDiff;
@@ -332,7 +381,8 @@ class GuardPatrolEntryDataTable extends Component
$this->sequence9 = "X";
}
}
elseif ($this->seqNo == 10) {
else if ($this->seqNo == 10) {
$this->seqTime9 = $this->seqTime;
if ($checkPointName == $this->startSeqCheckPoint9->checkPointNames2->name) {//"D 72 END"
if ($this->isSequenced) {
$this->sequence9 = $this->minDiff;