Added export button to Pipework
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
<div class="card-body mb-3">
|
||||
<h4 class="header-title mb-3">Filter</h4>
|
||||
|
||||
<form method="get" action="<?=self::getUrl("Pipework")?>">
|
||||
<form method="get" id="filterform" action="<?=self::getUrl("Pipework")?>">
|
||||
<div class="row">
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="filter_network_id">Netzgebiet</label>
|
||||
@@ -91,10 +91,23 @@
|
||||
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<div class="col">
|
||||
<div>
|
||||
<button type="submit" class="btn btn-primary">Filter anwenden</button>
|
||||
<a class="btn btn-secondary" href="<?=self::getUrl("Pipework")?>">Filter zurücksetzen</a>
|
||||
</div>
|
||||
<div style="width: 512px;">
|
||||
<?php if($me->isAdmin()): ?>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<button type="button" id="export-button" class="form-control btn btn-outline-success ml-2" onclick="exportButtonClick()">
|
||||
<div id="export-button-label"><i class="fas fa-download mr-1"></i> Download als .xls</div>
|
||||
<div id="progress-bar" class="progress-bar progress-bar-striped progress-bar-animated bg-primary hidden" style="width: 0%;">Bitte warten... 0%</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -293,6 +306,105 @@ $('select[name=wfitem_pipework_finished]').each(function() {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
var export_uid = "";
|
||||
var export_progress = 0;
|
||||
var downloadUrl;
|
||||
|
||||
$('#filterform').change(function() {
|
||||
downloadUrl = "";
|
||||
});
|
||||
|
||||
/*
|
||||
* Eport button click
|
||||
*/
|
||||
function exportButtonClick() {
|
||||
if(downloadUrl) {
|
||||
document.location.href = '<?=self::getUrl("Pipework","downloadExport")?>?uid=' + export_uid
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var form = $('#filterform');
|
||||
var actionUrl = '<?=self::getUrl("Pipework", "export")?>';
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: actionUrl,
|
||||
data: form.serialize(),
|
||||
dataType: "json",
|
||||
success: function(success) {
|
||||
if(success.status = "OK") {
|
||||
if(success.uid) {
|
||||
export_uid = success.uid;
|
||||
export_progress = success.progress;
|
||||
//$('#progress-bar-wrapper').show();
|
||||
$('#export-button-label').hide();
|
||||
$('#progress-bar').show();
|
||||
setTimeout(updateExportProgress, 200);
|
||||
$('#export-button').addClass("bg-dark");
|
||||
$('#export-button').prop("onclick", null).off("click");
|
||||
//$('#export-button').prop("disabled", true);
|
||||
} else {
|
||||
console.log("no uid returned");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function updateExportProgress() {
|
||||
if(!export_uid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$.get("<?=self::getUrl("Pipework", "exportProgress")?>",
|
||||
{
|
||||
uid: export_uid
|
||||
},
|
||||
function(success) {
|
||||
if(success.status == "OK") {
|
||||
updateProgressBar(success.progress);
|
||||
if(success.progress >= 100) {
|
||||
downloadUrl = '<?=self::getUrl("Pipework","downloadExport")?>?uid=' + export_uid;
|
||||
setTimeout(() => {document.location.href = '<?=self::getUrl("Pipework","downloadExport")?>?uid=' + export_uid}, 200);
|
||||
setTimeout(clearProgressBar, 5000);
|
||||
} else {
|
||||
setTimeout(updateExportProgress, 500);
|
||||
}
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
|
||||
function updateProgressBar(progress) {
|
||||
$('#progress-bar').css("width", progress + "%");
|
||||
$('#progress-bar').text("Bitte warten... " + progress + "%");
|
||||
|
||||
/*if(progress > 50) {
|
||||
$('#progress-bar').removeClass("text-secondary");
|
||||
}*/
|
||||
|
||||
if(progress >= 100) {
|
||||
$('#progress-bar').addClass("bg-success").removeClass("bg-primary");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function clearProgressBar() {
|
||||
//$('#progress-bar-wrapper').hide();
|
||||
$('#progress-bar').css("width", "0%");
|
||||
$('#progress-bar').text("Bitte warten... 0%");
|
||||
$('#progress-bar').addClass("bg-primary").removeClass("bg-success");
|
||||
$('#export-button').prop("disabled", false);
|
||||
$('#progress-bar').hide();
|
||||
$('#export-button').removeClass("bg-dark");
|
||||
$('#export-button').click(exportButtonClick);
|
||||
$('#export-button-label').show();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
440
Layout/default/Pipework/export_progress.xls.php
Normal file
440
Layout/default/Pipework/export_progress.xls.php
Normal file
@@ -0,0 +1,440 @@
|
||||
<?php
|
||||
|
||||
// progress
|
||||
$lineMax = 0;
|
||||
foreach($networks as $terminations) {
|
||||
$lineMax += count($terminations);
|
||||
}
|
||||
|
||||
$filename = "tiefbau-".date('Y-m-d_H-i-s')."-".uniqid().".xlsx";
|
||||
|
||||
if($export_uid) {
|
||||
$progress = new WorkflowExport();
|
||||
$progress->loadByUid($export_uid);
|
||||
$progress->filename = $filename;
|
||||
}
|
||||
|
||||
|
||||
$col = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','AA','AB','AC','AD','AE','AF','AG','AH','AI','AJ','AK','AL','AM','AN','AO','AP','AQ','AR','AS','AT','AU','AV','AW','AX','AY','AZ','BA',
|
||||
'BB','BC','BD','BE','BF','BG','BH','BI','BJ','BK','BL','BM','BN','BO','BP','BQ','BR','BS','BT','BU','BV','BW','BX','BY','BZ'
|
||||
);
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
use PhpOffice\PhpSpreadsheet\Style\Alignment;
|
||||
use PhpOffice\PhpSpreadsheet\Style\Border;
|
||||
use PhpOffice\PhpSpreadsheet\Style\Color;
|
||||
|
||||
$lightgreen = "f5ffeb";
|
||||
|
||||
$xls = new Spreadsheet();
|
||||
$sheet = $xls->getActiveSheet();
|
||||
|
||||
// header
|
||||
$i = 0;
|
||||
|
||||
$sheet->setCellValue($col[$i++].'1', "id");
|
||||
$sheet->setCellValue($col[$i++].'1', "Netzgebiet");
|
||||
$sheet->setCellValue($col[$i++].'1', "PLZ");
|
||||
$sheet->setCellValue($col[$i++].'1', "Ort");
|
||||
$sheet->setCellValue($col[$i++].'1', "Bauabschnitt");
|
||||
$sheet->setCellValue($col[$i++].'1', "Straße");
|
||||
$sheet->setCellValue($col[$i++].'1', "Gebäudecode");
|
||||
$sheet->setCellValue($col[$i++].'1', "GPS Breite");
|
||||
$sheet->setCellValue($col[$i++].'1', "GPS Länge");
|
||||
$sheet->setCellValue($col[$i++].'1', "Gebäudestatus Code");
|
||||
$sheet->setCellValue($col[$i++].'1', "Gebäudestatus");
|
||||
|
||||
$sheet->setCellValue($col[$i++].'1', "Kontakt");
|
||||
$sheet->setCellValue($col[$i++].'1', "Telefon");
|
||||
$sheet->setCellValue($col[$i++].'1', "Email");
|
||||
|
||||
$sheet->setCellValue($col[$i++].'1', "Baufreigabe");
|
||||
|
||||
$sheet->setCellValue($col[$i++].'1', "AP-Typ (Planung)");
|
||||
$sheet->setCellValue($col[$i++].'1', "AP-Typ (Ist-Zustand)");
|
||||
$sheet->setCellValue($col[$i++].'1', "AP-Name (Planung)");
|
||||
$sheet->setCellValue($col[$i++].'1', "AP-Name (Ist-Zustand)");
|
||||
$sheet->setCellValue($col[$i++].'1', "AP GPS Breite (Planung)");
|
||||
$sheet->setCellValue($col[$i++].'1', "AP GPS Länge (Planung)");
|
||||
$sheet->setCellValue($col[$i++].'1', "AP GPS Breite (Ist-Zustand)");
|
||||
$sheet->setCellValue($col[$i++].'1', "AP GPS Länge (Ist-Zustand)");
|
||||
$sheet->setCellValue($col[$i++].'1', "Rohrverband (Planung)");
|
||||
$sheet->setCellValue($col[$i++].'1', "Rohrverband (Ist-Zustand)");
|
||||
$sheet->setCellValue($col[$i++].'1', "Rohrtyp (Planung)");
|
||||
$sheet->setCellValue($col[$i++].'1', "Rohrtyp (Ist-Zustand)");
|
||||
$sheet->setCellValue($col[$i++].'1', "Rohrfarbe (Planung)");
|
||||
$sheet->setCellValue($col[$i++].'1', "Rohrfarbe (Ist-Zustand)");
|
||||
|
||||
$sheet->setCellValue($col[$i++].'1', "Kommentar Tiefbau");
|
||||
//$sheet->setCellValue($col[$i++].'1', "Kommentar Leitungsbau");
|
||||
|
||||
$sheet->getStyle("A1:".$col[$i]."1")->getFont()->setBold(true);
|
||||
|
||||
$sheet->getRowDimension(1)->setRowHeight(16);
|
||||
|
||||
|
||||
$line = 2;
|
||||
|
||||
foreach($networks as $networkname => $buildings) {
|
||||
|
||||
foreach($buildings as $building) {
|
||||
$i = 0;
|
||||
|
||||
$sheet->setCellValue($col[$i].$line, $building->id)->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $networkname);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $building->zip);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $building->city);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $building->networksection->name);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $building->street);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $building->code)->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $building->gps_lat)->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_RIGHT);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $building->gps_long)->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_LEFT);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $building->status->code)->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $building->status->name)->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$i++;
|
||||
|
||||
$sheet->setCellValue($col[$i].$line, $building->contact);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $building->phone);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $building->email);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $building->pipework_enabled);
|
||||
$i++;
|
||||
|
||||
|
||||
$sheet->setCellValue($col[$i].$line, $building->getWorkflowvalue("anschlusspunkt_typ"))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $building->getWorkflowvalue("ist_anschlusspunkt_typ"))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
$sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
$i++;
|
||||
|
||||
$sheet->setCellValue($col[$i].$line, $building->getWorkflowvalue('anschlusspunkt_name'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
$i++;
|
||||
|
||||
$sheet->setCellValue($col[$i].$line, $building->getWorkflowvalue('ist_anschlusspunkt_name'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
$sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
$i++;
|
||||
|
||||
$gps = explode(";", $building->getWorkflowvalue('anschlusspunkt_gps'));
|
||||
if(is_array($gps) & count($gps) == 2) {
|
||||
$sheet->setCellValue($col[$i].$line, $gps[0])->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
}
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_RIGHT);
|
||||
if(is_array($gps) & count($gps) == 2) {
|
||||
$sheet->setCellValue($col[$i+1].$line, $gps[1])->getStyle($col[$i+1].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
}
|
||||
$sheet->getStyle($col[$i+1].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($col[$i+1].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_LEFT);
|
||||
$i += 2;
|
||||
|
||||
$gps = explode(";", $building->getWorkflowvalue('ist_anschlusspunkt_gps'));
|
||||
if(is_array($gps) & count($gps) == 2) {
|
||||
$sheet->setCellValue($col[$i].$line, $gps[0])->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
}
|
||||
$sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_RIGHT);
|
||||
if(is_array($gps) & count($gps) == 2) {
|
||||
$sheet->setCellValue($col[$i+1].$line, $gps[1])->getStyle($col[$i+1].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
}
|
||||
$sheet->getStyle($col[$i+1].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
$sheet->getStyle($col[$i+1].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($col[$i+1].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_LEFT);
|
||||
$i += 2;
|
||||
|
||||
$sheet->setCellValue($col[$i].$line, $building->getWorkflowvalue('rohrverband_name'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $building->getWorkflowvalue('ist_rohrverband_name'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
$sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $building->getWorkflowvalue('rohrtype'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
$i++;
|
||||
$sheet->setCellValue($col[$i].$line, $building->getWorkflowvalue('ist_rohrtype'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
$sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
$i++;
|
||||
|
||||
|
||||
$color = $building->getWorkflowvalue('rohrfarbe');
|
||||
if($color) {
|
||||
if(TT_CABLE_COLORS[$color]["mark"]) {
|
||||
$sheet->setCellValue($col[$i].$line, "----- ".ucfirst($color)." -----");
|
||||
} else {
|
||||
$sheet->setCellValue($col[$i].$line, ucfirst($color));
|
||||
}
|
||||
$sheet->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10)->getColor()->setARGB(TT_CABLE_COLORS[$color]["hexfg"]);
|
||||
$sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB(TT_CABLE_COLORS[$color]["hex"]);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
}
|
||||
$i++;
|
||||
|
||||
$color = $building->getWorkflowvalue('ist_rohrfarbe');
|
||||
if($color) {
|
||||
if(TT_CABLE_COLORS[$color]["mark"]) {
|
||||
$sheet->setCellValue($col[$i].$line, "----- ".ucfirst($color)." -----");
|
||||
} else {
|
||||
$sheet->setCellValue($col[$i].$line, ucfirst($color));
|
||||
}
|
||||
$sheet->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10)->getColor()->setARGB(TT_CABLE_COLORS[$color]["hexfg"]);
|
||||
$sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB(TT_CABLE_COLORS[$color]["hex"]);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
}
|
||||
$i++;
|
||||
|
||||
|
||||
//
|
||||
// /*
|
||||
// * Linework data
|
||||
// */
|
||||
// $sheet->setCellValue($col[$i].$line, ($term->getWorkflowvalue('pop_id')) ? (new Pop($term->getWorkflowvalue('pop_id')))->name : "");
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_LEFT);
|
||||
// $i++;
|
||||
// $sheet->setCellValue($col[$i].$line, ($term->getWorkflowvalue('ist_pop_id')) ? (new Pop($term->getWorkflowvalue('ist_pop_id')))->name : "");
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_LEFT);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('schrank'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('ist_schrank'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('baugruppe'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('ist_baugruppe'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('modul'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('ist_modul'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('ports'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('ist_ports'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('abschlusstyp'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('ist_abschlusstyp'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('bb_kabel'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('ist_bb_kabel'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('bb_kabel_steps'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('ist_bb_kabel_steps'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('bb_fasern'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('ist_bb_fasern'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('kundenkabel_typ'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('ist_kundenkabel_typ'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('kundenkabel_fasern'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('ist_kundenkabel_fasern'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('backbone_finished'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('backbone_setup_date'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('customer_setup_date'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('bep_deployed'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('customer_cable_injected'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('spliced_network'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('spliced_customer'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('ont_deployed'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('ont_sn'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
// $sheet->setCellValue($col[$i].$line, $term->getWorkflowvalue('customer_passive_finished'))->getStyle($col[$i].$line)->getFont()->setName("monospace")->setSize(10);
|
||||
// $sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
|
||||
// $sheet->getStyle($col[$i].$line)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
// $i++;
|
||||
//
|
||||
|
||||
$sheet->setCellValue($col[$i].$line, $building->workflow_comment);
|
||||
$sheet->getStyle($col[$i].$line)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB($lightgreen);
|
||||
$i++;
|
||||
|
||||
$sheet->getRowDimension($line)->setRowHeight(16);
|
||||
$line++;
|
||||
|
||||
|
||||
// progress
|
||||
if($progress) {
|
||||
$progress_percent = floor(($line * 100) / $lineMax);
|
||||
$progress->progress = $progress_percent;
|
||||
if($progress_percent >= 100) {
|
||||
$progress->progress = 99;
|
||||
}
|
||||
$progress->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$sheet->getColumnDimension($col[$i-1])->setWidth(6, "in");
|
||||
|
||||
$sheet->getStyle("A2:".$col[$i].$line)->getBorders()->getAllBorders()->setBorderStyle(Border::BORDER_HAIR)->setColor(new Color("C0C0C0"));
|
||||
$sheet->freezePane("A2");
|
||||
|
||||
|
||||
for($c = 0; $c < $i-1; $c++) {
|
||||
$sheet->getColumnDimension($col[$c])->setAutoSize(true);
|
||||
}
|
||||
|
||||
|
||||
//$writer = new Xls($xls);
|
||||
$writer = new Xlsx($xls);
|
||||
|
||||
//header("Content-type: application/vnd.ms-excel");
|
||||
//header("Content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
|
||||
//header('Content-disposition: attachment; filename="leitungsbau-'.date('Y-m-d_H-i-s').'-'.uniqid().'.xlsx"');
|
||||
$writer->save($path."/".$filename);
|
||||
|
||||
$progress->progress = 100;
|
||||
$progress->save();
|
||||
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user