Merge branch 'ConstructionConsent/add-electric-approval-filter' into 'master'
added filter electric_approval to ConstructionConsent See merge request fronk/thetool!1169
This commit is contained in:
@@ -99,6 +99,18 @@ $pagination_entity_name = "Zustimmungserklärungen";
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_electric_approval">Elektriker freigegeben</label>
|
||||
<select name="filter[electric_approval]" id="filter_electric_approval" class="form-control">
|
||||
<option value="">Alle</option>
|
||||
<option value="!NULL" <?=(array_key_exists("electric_approval", $filter) && $filter["electric_approval"] == "!NULL") ? "selected='selected'" : ""?>>Ja</option>
|
||||
<option value="NULL" <?=(array_key_exists("electric_approval", $filter) && $filter["electric_approval"] == "NULL") ? "selected='selected'" : ""?>>Nein</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_conduit_installed_ftu">Leerrohr bis HAK</label>
|
||||
<select name="filter[conduit_installed_ftu]" id="filter_conduit_installed_ftu" class="form-control">
|
||||
@@ -108,10 +120,7 @@ $pagination_entity_name = "Zustimmungserklärungen";
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
|
||||
<div class="col-2">
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="filter_inhouse_cabling">Inhouse erledigt</label>
|
||||
<select name="filter[inhouse_cabling]" id="filter_inhouse_cabling" class="form-control">
|
||||
<option value="">Alle</option>
|
||||
|
||||
@@ -607,6 +607,15 @@ FROM ConstructionConsent
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("electric_approval", $filter)) {
|
||||
$inhouse_cabling = $filter["electric_approval"];
|
||||
if($inhouse_cabling == "!NULL") {
|
||||
$where .= " AND (inspection_electrician IS NOT NULL AND inspection_electrician != 0)";
|
||||
} elseif($inhouse_cabling == "NULL") {
|
||||
$where .= " AND (inspection_electrician IS NULL OR inspection_electrician = 0)";
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists("cwo", $filter) && !empty($filter['cwo'])) {
|
||||
$where .= "
|
||||
AND EXISTS (
|
||||
|
||||
Reference in New Issue
Block a user