Produktion filter list

This commit is contained in:
OpenXE 2022-11-11 15:14:59 +00:00
parent 822960b9f0
commit e1b8b7864f
2 changed files with 107 additions and 6 deletions

View File

@ -1,5 +1,48 @@
<div id="tabs-1"> <div id="tabs">
[MESSAGE] <ul>
[TAB1] <li><a href="#tabs-1">[TABTEXT1]</a></li>
[TAB1NEXT] </ul>
<div id="tabs-1">
[MESSAGE]
<form action="#tabs-1" id="frmauto" name="frmauto" method="post">
<div class="filter-box filter-usersave">
<div class="filter-block filter-inline">
<div class="filter-title">{|Filter|}</div>
<ul class="filter-list">
[STATUSFILTER]
<li class="filter-item">
<label for="angelegte" class="switch">
<input type="checkbox" id="angelegte">
<span class="slider round"></span>
</label>
<label for="angelegte">{|Angelegt|}</label>
</li>
<li class="filter-item">
<label for="offene" class="switch">
<input type="checkbox" id="offene">
<span class="slider round"></span>
</label>
<label for="offene">{|Offen|}</label>
</li>
<li class="filter-item">
<label for="geschlossene" class="switch">
<input type="checkbox" id="geschlossene">
<span class="slider round"></span>
</label>
<label for="geschlossene">{|Abgeschlossen|}</label>
</li>
<li class="filter-item">
<label for="stornierte" class="switch">
<input type="checkbox" id="stornierte">
<span class="slider round"></span>
</label>
<label for="stornierte">{|Papierkorb|}</label>
</li>
</ul>
</div>
</div>
</form>
[TAB1]
[TAB1NEXT]
</div>
</div> </div>

View File

@ -29,7 +29,7 @@ class Produktion {
} }
static function TableSearch(&$app, $name, $erlaubtevars) { public function TableSearch(&$app, $name, $erlaubtevars) {
switch ($name) { switch ($name) {
case "produktion_list": case "produktion_list":
$allowed['produktion_list'] = array('list'); $allowed['produktion_list'] = array('list');
@ -83,7 +83,65 @@ class Produktion {
FROM produktion p FROM produktion p
"; ";
$where = " 1 "; $where = "0";
// Toggle filters
$this->app->Tpl->Add('JQUERYREADY', "$('#angelegte').click( function() { fnFilterColumn1( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#offene').click( function() { fnFilterColumn2( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#geschlossene').click( function() { fnFilterColumn3( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#stornierte').click( function() { fnFilterColumn4( 0 ); } );");
for ($r = 1;$r <= 4;$r++) {
$this->app->Tpl->Add('JAVASCRIPT', '
function fnFilterColumn' . $r . ' ( i )
{
if(oMoreData' . $r . $name . '==1)
oMoreData' . $r . $name . ' = 0;
else
oMoreData' . $r . $name . ' = 1;
$(\'#' . $name . '\').dataTable().fnFilter(
\'\',
i,
0,0
);
}
');
}
$more_data1 = $this->app->Secure->GetGET("more_data1");
if ($more_data1 == 1) {
$where .= " OR p.status IN ('angelegt')";
} else {
}
$more_data2 = $this->app->Secure->GetGET("more_data2");
if ($more_data2 == 1) {
$where .= " OR p.status IN ('freigegeben','gestartet')";
}
else {
}
$more_data3 = $this->app->Secure->GetGET("more_data3");
if ($more_data3 == 1) {
$where .= " OR p.status IN ('abgeschlossen')";
}
else {
}
$more_data4 = $this->app->Secure->GetGET("more_data4");
if ($more_data4 == 1) {
$where .= " OR p.status IN ('storniert')";
}
else {
}
// END Toggle filters
if ($where=='0') {
$where = " p.status IN ('freigegeben','gestartet')";
}
$count = "SELECT count(DISTINCT p.id) FROM produktion p INNER JOIN produktion_position pp ON pp.produktion = pp.id WHERE $where"; $count = "SELECT count(DISTINCT p.id) FROM produktion p INNER JOIN produktion_position pp ON pp.produktion = pp.id WHERE $where";
// $groupby = ""; // $groupby = "";