Delete Budgets
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user