229 lines
10 KiB
PHP
229 lines
10 KiB
PHP
<?php if(isset($blockGroup)) {
|
|
$blockGroupColumns = [];
|
|
|
|
foreach($blockGroup AS $blockTitle => $columns) {
|
|
foreach($columns AS $column) {
|
|
$blockGroupColumns[] = $column;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
?>
|
|
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
{{$listDatas->appends($_GET)->links()}}
|
|
</div>
|
|
<div class="col-md-6 ">
|
|
<?php if(getisset("filter")) {
|
|
|
|
foreach($get AS $getColumn => $getValues) {
|
|
?>
|
|
<div class="btn btn-sm btn-outline-primary"><i class="fa fa-filter"></i> {{e2($getColumn)}} {{implode(', ', $getValues)}}</div>
|
|
<?php
|
|
/*
|
|
foreach($getValues AS $getValue) {
|
|
?>
|
|
<div class="btn btn-sm btn-outline-primary"><i class="fa fa-times"></i> {{$getColumn}} : {{$getValue}}</div>
|
|
|
|
<?php
|
|
}
|
|
*/
|
|
}
|
|
|
|
?>
|
|
|
|
<a href="{{url('admin/types/' . $id)}}" class="btn btn-danger btn-sm float-right"><i class="fa fa-trash"></i> {{e2("Clear All Filter")}}</a>
|
|
|
|
<?php
|
|
} ?>
|
|
</div>
|
|
</div>
|
|
<a name="table"></a>
|
|
<div class="table-responsive mt-10 mb-10">
|
|
<table style="table-layout:fixed;width:{{$tableWidth}}" class=" table table-sm table-bordered table-striped table-hover">
|
|
<thead>
|
|
<tr class="table-light">
|
|
<form action="#table" method="get">
|
|
<input type="hidden" name="filter" value="ok">
|
|
<?php if(isset($prependColumns)) {
|
|
foreach($prependColumns AS $columnName => $columnArray) {
|
|
?>
|
|
<th data-resizable-column-id="{{str_slug($columnName)}}">{{e2($columnName)}}
|
|
|
|
</th>
|
|
<?php
|
|
}
|
|
} ?>
|
|
<th>{{e2("ID")}}</th>
|
|
<?php
|
|
|
|
foreach($columnsList AS $column) {
|
|
$column = $column['name'];
|
|
$show = true;
|
|
if(isset($blockGroupColumns)) {
|
|
if(!in_array($column, $blockGroupColumns)) $show=false;
|
|
}
|
|
if($show) {
|
|
|
|
?>
|
|
<th class="position-relative" data-resizable-column-id="{{str_slug($column)}}">{{e2($column)}}
|
|
<?php if(isset($tableDifferentValues[$column])) {
|
|
?>
|
|
<div class="dropdown filter-list">
|
|
<button class="btn btn-secondary btn-sm text-dark float-right dropdown-toggle" type="button" id="{{str_slug($column)}}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
<i class="fa fa-filter d-none"></i>
|
|
</button>
|
|
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="{{str_slug($column)}}">
|
|
<input type="text" placeholder="{{e2("Search")}}" class="form-control search">
|
|
<div class="dropdown-sublist">
|
|
<?php foreach($tableDifferentValues[$column] AS $tableDifferentValue) {
|
|
?>
|
|
<label class="dropdown-item" href="#">
|
|
<input type="checkbox"
|
|
<?php if(getisset($column)) {
|
|
if(in_array($tableDifferentValue, $_GET[$column])) {
|
|
echo "checked";
|
|
}
|
|
} ?>
|
|
name="{{$column}}[]" value="{{$tableDifferentValue}}"> {{$tableDifferentValue}}
|
|
</label>
|
|
<?php } ?>
|
|
</div>
|
|
|
|
<button class="btn btn-outline-primary btn-sm">{{e2("Filter")}}</button>
|
|
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
</th>
|
|
<?php } ?>
|
|
<?php } ?>
|
|
<?php if(!isset($summaryTable)) { ?>
|
|
<th data-resizable-column-id="opt">{{e2("Opt")}}</th>
|
|
<?php } ?>
|
|
</form>
|
|
</tr>
|
|
</thead>
|
|
|
|
<?php if(!isset($summaryTable)) { ?>
|
|
<?php $rowName = "new-tr"; ?>
|
|
<tr class="table-warning {{$rowName}}">
|
|
|
|
<form action="{{url("admin/create/$tableName")}}" method="post">
|
|
@csrf
|
|
<?php if(isset($prependColumns)) {
|
|
foreach($prependColumns AS $columnName => $columnArray) {
|
|
?>
|
|
<td>#</td>
|
|
<?php
|
|
}
|
|
} ?>
|
|
<td>#</td>
|
|
<?php foreach($columnsList AS $column) {
|
|
$show = true;
|
|
if(isset($blockGroupColumns)) {
|
|
if(!in_array($column['name'], $blockGroupColumns)) $show=false;
|
|
}
|
|
if($show) {
|
|
|
|
?>
|
|
<td>
|
|
|
|
@include("components.columns.{$column['type']}")
|
|
</td>
|
|
<?php } ?>
|
|
<?php } ?>
|
|
<td><button class="btn btn-outline-success btn-sm"><i class="fa fa-plus"></i></button></td>
|
|
</form>
|
|
|
|
</tr>
|
|
<?php } ?>
|
|
<tbody>
|
|
<?php foreach($listDatas AS $listData) {
|
|
$rowName = "row" . $listData->id;
|
|
?>
|
|
<tr id="t{{$listData->id}}" data-row="{{$rowName}}">
|
|
<?php if(isset($prependColumns)) {
|
|
foreach($prependColumns AS $columnName => $columnArray) { ?>
|
|
<td data-resizable-column-id="{{str_slug($columnName)}}">
|
|
@include("components.prepend-columns.{$columnArray['type']}")
|
|
</td>
|
|
<?php
|
|
}
|
|
} ?>
|
|
<?php if(!in_array("id", $excepts)) {
|
|
?>
|
|
<td class="id">{{$listData->id}}</td>
|
|
<?php } ?>
|
|
<?php foreach($columnsList AS $column) {
|
|
|
|
$show = true;
|
|
if(isset($blockGroupColumns)) {
|
|
if(!in_array($column['name'], $blockGroupColumns)) $show=false;
|
|
}
|
|
if($show) {
|
|
|
|
?>
|
|
<td>
|
|
<?php if(!isset($summaryTable)) {
|
|
?>
|
|
<?php if(isset($onlyShowColumn)) {
|
|
$thisColumnName = $column['name'];
|
|
?>
|
|
{{$listData->$thisColumnName}}
|
|
|
|
<?php
|
|
} else {
|
|
?>
|
|
@include("components.columns.{$column['type']}")
|
|
<?php
|
|
} ?>
|
|
|
|
<?php } else {
|
|
$thisColumnName = $column['name'];
|
|
?>
|
|
{{$listData->$thisColumnName}}
|
|
<?php
|
|
} ?>
|
|
</td>
|
|
<?php } ?>
|
|
<?php } ?>
|
|
<?php if(!isset($summaryTable)) { ?>
|
|
<td>
|
|
<a href="{{url("admin/delete/$tableName/{$listData->id}")}}" ajax="#t{{$listData->id}}" {{delete_teyit()}} class="btn btn-outline-danger btn-sm"><i class="fa fa-remove"></i></a>
|
|
</td>
|
|
<?php } ?>
|
|
</tr>
|
|
<?php
|
|
} ?>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-12">
|
|
{{$listDatas->appends($_GET)->links()}}
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
$(function() {
|
|
$(".filter-list .search").on("keyup", function(){
|
|
var bu = $(this);
|
|
var parent = bu.parent().parent();
|
|
var value = $(this).val().toLowerCase();
|
|
parent.find('.dropdown-sublist .dropdown-item').filter(function() {
|
|
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
|
|
});
|
|
|
|
});
|
|
$("table tbody .id").on("dblclick", function(){
|
|
var id = $(this).text();
|
|
location.href="?{!! http_build_query($_GET) !!}&detail=" + id;
|
|
});
|
|
});
|
|
</script>
|