Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @if($table->record->isNotEmpty())
- <table class="table table-bordered">
- <thead>
- <tr>
- <th>Pavadinimas</th>
- @foreach($tableCalendar['day'] as $day)
- <th>{{ $day }}</th>
- @endforeach
- </tr>
- </thead>
- @php
- $modifiedRecords= array();
- foreach($table->record as $record)
- {
- if(!in_array($record->table_id,$modifiedRecords)){
- $sameRecordsCount=0;
- $SameRecordsInfo=array();
- array_push($sameRecordsInfo,array($record->date,$record->liters));
- foreach($table->record as $TemporaryRecord)
- {
- if( $record->table_id == $TemporaryRecord->table_id
- &&
- $record->id != $TemporaryRecord->id){
- $sameRecordsCount++;
- array_push($sameRecordsInfo,array($TemporaryRecord->date,$Temporaryrecord->liters));
- }
- }
- if($sameRecordsCount==0){
- echo "<tbody>
- <tr>
- <td>". $record->title ."</td>";
- foreach($tableCalendar['full_date'] as $fullDate)
- {
- echo "<td>";
- if($fullDate == $record->date){
- array_push($modifiedRecords,$record->table_id);
- echo $record->liters ;
- }
- else
- echo "-";
- echo "</td>";
- }
- echo "</tr>
- </tbody>";
- }
- else{
- echo "<tbody>
- <tr>
- <td>". $record->title ."</td>";
- array_push($modifiedRecords,$record->table_id);
- $x=0;
- foreach($tableCalendar['full_date'] as $fullDate)
- {
- echo "<td>";
- if($fullDate == $sameRecordsInfo[$x][0]){
- echo $sameRecordsInfo[$x][1];
- $x++;
- }
- else
- echo "-";
- echo "</td>";
- }
- echo "</tr>
- </tbody>";
- }
- }
- }
- @endphp
- </table>
- @else
- <p>Nėra įrašų.</p>
- @endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement