Delete Budgets

This commit is contained in:
2018-04-09 15:45:39 +02:00
parent 4c83767fe7
commit a350bc7228
8 changed files with 399 additions and 115 deletions

View File

@@ -1,7 +1,7 @@
<?php
//debug($data);
for($i=0;$i<sizeof($data);$i++) {
$data[$i][0] = $this->Html->link($data[$i][0],array('controller' => 'schools', 'action' => 'showbudgets',$data[$i][0]));
$data[$i][1] = $this->Html->link($data[$i][1],array('controller' => 'schools', 'action' => 'showbudgets',$data[$i][0]));
}
echo '<h2>' . $budget['wl_kurz_bezeichnung'] .'</h2>';
//debug($data);
@@ -29,7 +29,7 @@ var data = <?php echo json_encode($data); ?>;
wordWrap: false,
colHeaders: ['SNR','Name','Count','Comment'] ,
colWidths: ['50','500','50','500'],
columns: [{renderer: "html", readOnly: true},{renderer: "text", readOnly: true},{renderer: "text"},{renderer: "text"}],
columns: [{renderer: "text", readOnly: true},{renderer: "html", readOnly: true},{renderer: "text"},{renderer: "text"}],
filters: true,
dropdownMenu: true
});

View File

@@ -1,29 +1,39 @@
<?php
//$test = '["<a href=\"test\">SNR<\/a>","Schule","RS Modellversuch","RS geb. Ganztagsklassen","RS St\u00fctzpunktschule Schulsport","RS Partnerschule Wintersport","RS Sonderp\u00e4d. F\u00f6rderbedarf","Abordnung Grundschullehrkraft","Bilingualer Unterricht","Inklusion","sonstige Budgetzuschl\u00e4ge","RS Koop. mit and. Schulart","RS Integrierte Lehrerres.","RS Bestenf\u00f6rderung","MINT","Musikrealschule"]';
$cols = array();
$columns = array();
array_push($cols,'SNR');
array_push($columns,['renderer' => 'text', 'readOnly' => true]);
array_push($cols,'Schule');
array_push($columns,['renderer' => 'html', 'readOnly' => true]);
$col_width = array();
array_push($col_width,'50');
array_push($col_width,'300');
foreach($wlBudgets as $budget) {
array_push($cols,$budget);
//debug($budget);die;
array_push($cols,$this->Html->link($budget['wl_kurz_bezeichnung'],array('controller' => 'budget', 'action' => 'edit-budget',$budget['id'])));
array_push($col_width,'30');
array_push($columns,['renderer' => 'text']);
}
for($i=0;$i<sizeof($data);$i++) {
$data[$i][1] = $this->Html->link($data[$i][1],array('controller' => 'schools', 'action' => 'showbudgets',$data[$i][0]));
}
//debug($columns);
//debug(json_encode($columns));die;
//debug(json_encode($cols));
?>
<div class="controls">
<button name="load" id="load" class="intext-btn">Load</button>
<button name="save" id="save" class="intext-btn">Save</button>
<label><input name="autosave" id="autosave" checked="checked" autocomplete="off" type="checkbox">Autosave</label>
</div>
<pre id="example1console" class="console">Data loaded</pre>
<div id="example"></div>
<div id="overview"></div>
<script>
var data = <?php echo json_encode($data); ?>;
var container = document.getElementById('example');
var exampleConsole = document.getElementById('example1console');
var autosave = document.getElementById('autosave');
var container = document.getElementById('overview');
var load = document.getElementById('load');
var save = document.getElementById('save');
var autosaveNotification;
@@ -35,6 +45,7 @@ var data = <?php echo json_encode($data); ?>;
height: 1000,
rowHeaders: true,
wordWrap: false,
columns: <?php echo json_encode($columns) ?> ,
colHeaders: <?php echo json_encode($cols) ?> ,
colWidths: <?php echo json_encode($col_width) ?>,
filters: true,
@@ -51,7 +62,8 @@ var data = <?php echo json_encode($data); ?>;
//console.log(hot.getData());
//console.log(JSON.stringify({data: hot.getData()}));
$.ajax({
url: "sajax",
//url: "sajax",
url: "<?php echo $this->Url->build(array('controller' => 'budget', 'action' => 'sajax',$budget['id']), true); ?>",
data: JSON.stringify(hot.getData()),
type: 'POST',
success: function (res) {