/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ $(".card_qwikclock_myshifts").each(function () { var card = $(this); $(this).find(".card_title").prepend("Shifts | "); var shiftbox = $(this).find(".shift-box"); var shifttable = $(this).find(".shift-table"); var url = $(this).data("apiurl"); $.post(url, { username: getuser(), password: getAPIKey(), action: "getassignedshifts" }, function (resp) { if (resp.status == "OK") { var shifts = resp.shifts; if (shifts.length > 0) { shifttable.html('Shift Start End Days'); shifttable.append(""); for (var shift in shifts) { var days = ""; for (var day in shifts[shift]["day_list"]) { days += " " + shifts[shift]["day_list"][day]; } days = days.trim(); shifttable.append('' + shifts[shift]['shiftname'] + '' + shifts[shift]['start_f'] + '' + shifts[shift]['end_f'] + '' + days + ''); } shifttable.append(""); } else { shifttable.html('
No shifts assigned.
'); } } else { showmsg(resp.msg, "danger"); } }, "json").fail(function () { card.css("display", "none"); }); });