77 lines
2.6 KiB
PHP
77 lines
2.6 KiB
PHP
|
|
$(".update-status").click(function() {
|
|
var scheduleNum = $(this).attr('snum');
|
|
var new_status = $(this).attr('status');
|
|
|
|
switch (new_status) {
|
|
case 'Pending':
|
|
new_text = "<?php displayLanguageText('TEXT-PENDING'); ?>";
|
|
break;
|
|
case 'Active':
|
|
new_text = "<?php displayLanguageText('TEXT-ACTIVE'); ?>";
|
|
break;
|
|
case 'Completed':
|
|
new_text = "<?php displayLanguageText('TEXT-COMPLETED'); ?>";
|
|
break;
|
|
case 'Closed':
|
|
new_text = "<?php displayLanguageText('TEXT-CLOSED'); ?>";
|
|
break;
|
|
case 'Deleted':
|
|
new_text = "<?php displayLanguageText('TEXT-DELETED'); ?>";
|
|
break;
|
|
}
|
|
|
|
var data = "table_name=hotlunch_schedules" +
|
|
"&record_num=" + scheduleNum +
|
|
"&status=" + new_status;
|
|
$.getJSON("ajax.DataRecord.Update.php", data,
|
|
function(results) {
|
|
$("#status-"+scheduleNum).html(new_text);
|
|
$("#status-"+scheduleNum).attr('status', new_status);
|
|
}
|
|
);
|
|
});
|
|
|
|
$(document).on('click touch','.status-span',function(e) {
|
|
e.preventDefault();
|
|
|
|
var scheduleNum = $(this).attr('rnum');
|
|
var status = $(this).attr('status');
|
|
var new_status;
|
|
var new_text;
|
|
|
|
switch (status) {
|
|
case 'Pending':
|
|
new_status = 'Active';
|
|
new_text = "<?php displayLanguageText('TEXT-ACTIVE'); ?>";
|
|
break;
|
|
case 'Active':
|
|
new_status = 'Completed';
|
|
new_text = "<?php displayLanguageText('TEXT-COMPLETED'); ?>";
|
|
break;
|
|
case 'Completed':
|
|
new_status = 'Closed';
|
|
new_text = "<?php displayLanguageText('TEXT-CLOSED'); ?>";
|
|
break;
|
|
case 'Closed':
|
|
new_status = 'Deleted';
|
|
new_text = "<?php displayLanguageText('TEXT-DELETED'); ?>";
|
|
break;
|
|
case 'Deleted':
|
|
new_status = 'Pending';
|
|
new_text = "<?php displayLanguageText('TEXT-PENDING'); ?>";
|
|
break;
|
|
}
|
|
|
|
var data = "table_name=hotlunch_schedules" +
|
|
"&record_num=" + scheduleNum +
|
|
"&status=" + new_status;
|
|
$.getJSON("ajax.DataRecord.Update.php", data,
|
|
function(results) {
|
|
$("#status-"+scheduleNum).html(new_text);
|
|
$("#status-"+scheduleNum).attr('status', new_status);
|
|
}
|
|
);
|
|
});
|
|
|