Changed HTML table to Tablewidget

This commit is contained in:
Cris
2023-03-07 14:06:00 +01:00
parent 479feea8aa
commit ba31a0b5b0
3 changed files with 152 additions and 105 deletions
@@ -57,31 +57,11 @@ $this->load->view('templates/FHC-Header', $includesArray);
</button>
</div>
<!--Tabelle-->
<div class="row col-6">
<table class="table table-condensed mt-3" id="azrTable">
<thead>
<tr>
<th><?php echo $this->p->t('lehre', 'studiensemester'); ?></th>
<th><?php echo $this->p->t('anrechnung', 'anrechnungszeitraumStart'); ?></th>
<th><?php echo $this->p->t('anrechnung', 'anrechnungszeitraumEnde'); ?></th>
<th><?php echo $this->p->t('ui', 'aktion'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach($anrechnungszeitraum_arr as $azr):?>
<tr data-anrechnungszeitraum_id="<?php echo $azr->anrechnungszeitraum_id ?>">
<td class="studiensemester_kurzbz"><?php echo $azr->studiensemester_kurzbz ?></td>
<td class="anrechnungstart"><?php echo $azr->anrechnungstart ?></td>
<td class="anrechnungende"><?php echo $azr->anrechnungende ?></td>
<td>
<button class="btn btn-outline-secondary azrOpenModal" data-bs-toggle="modal" data-bs-target="#azrModal" value="update"><i class="fa fa-edit"></i></button>
<button type="button" class="btn btn-outline-secondary ms-1 azrDeleteBtn"><i class="fa fa-times"></i></button>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<!-- Tabelle -->
<div class="row">
<div class="col-6">
<?php $this->load->view('lehre/anrechnung/adminAnrechnungData.php'); ?>
</div>
</div>
<!-- Modal (für insert und update von Anrechnungszeitraum)-->
@@ -120,7 +100,7 @@ $this->load->view('templates/FHC-Header', $includesArray);
</div>
</div>
<div class="modal-footer">
<button type="button" id="azrInsertOrUpdateBtn" class="btn btn-primary" value=""><?php echo $this->p->t('ui', 'speichern'); ?></button>
<button type="button" id="azrInsertBtn" class="btn btn-primary" value=""><?php echo $this->p->t('ui', 'speichern'); ?></button>
</div>
</div>
</div>
@@ -0,0 +1,45 @@
<?php
$query = '
SELECT *
FROM lehre.tbl_anrechnungszeitraum
ORDER BY anrechnungstart DESC
';
$filterWidgetArray = array(
'query' => $query,
'tableUniqueId' => 'adminAnrechnung',
'requiredPermissions' => 'admin',
'datasetRepresentation' => 'tabulator',
'columnsAliases' => array(
'AzrID',
ucfirst($this->p->t('lehre', 'studiensemester')),
ucfirst($this->p->t('anrechnung', 'anrechnungszeitraumStart')),
ucfirst($this->p->t('anrechnung', 'anrechnungszeitraumEnde')),
ucfirst($this->p->t('ui', 'bearbeitetAm')),
ucfirst($this->p->t('ui', 'bearbeitetVon')),
),
'datasetRepOptions' => '{
height: func_height(this),
layout: "fitColumns", // fit columns to width of table
//persistentLayout:true,
autoResize: false, // prevent auto resizing of table (false to allow adapting table size when cols are (de-)activated
headerFilterPlaceholder: " ",
index: "anrechnungszeitraum_id", // assign specific column as unique id (important for row indexing)
selectable: false, // allow row selection
//tableWidgetHeader: true,
tableBuilt: function(){
func_tableBuilt(this);
},
}',
'datasetRepFieldsDefs' => '{
anrechnungszeitraum_id: {visible: false, headerFilter:"input"},
studiensemester_kurzbz: {headerFilter:"input"},
anrechnungstart: {headerFilter:"input"},
anrechnungende: {headerFilter:"input"},
insertamum: {visible: false, headerFilter:"input"},
insertvon: {visible: false, headerFilter:"input"}
}'
);
echo $this->widgetlib->widget('TableWidget', $filterWidgetArray);