$(document).ready(function() { /* *** Invalid Image replacement *** */ $('.main img, .main input[type="image"]').error(function() { $(this).unbind("error").attr("src", "themes/AdminLTE/dist/img/image_not_found.png").attr("style", "max-width:250px;").removeAttr('height'); }); $('.main > p:first-of-type').css("background-color", "").css("color", ""); $('p > [href="?m=register&p=form"], p > [href="index.php"]').addClass('btn').addClass('btn-xs').addClass('btn-primary'); }); $(window).load(function() { $('.main [href="?m=simple-billing&p=cart"]').addClass('btn btn-sm btn-primary').prepend(''); $('.main > table').addClass('mb-2'); $('.main .card-body').append('
'); $('.main .card-body > div > div').each(function() { if($(this).find('[type="image"]').length > 0) { var serviceImage = $(this).find('[type="image"]'); }else { var serviceImage = $(this).find('img'); } var serviceId = $(this).find('[name="service_id"]').val(); var serviceTitle = $(this).find('center').first().text(); var serviceCost = $(this).find('center').last().find('em').html(); var serviceImageSrc = $(serviceImage).attr('src'); var serviceImageAlt = $(serviceImage).attr('alt'); var serviceImageVal = $(serviceImage).val(); var newItem = '\
\
\
\

'+serviceTitle+'

\
\
\ '+serviceImageAlt+'\
\ \
\
\ '; $('.main .card-body .shop-items').append(newItem); }); $('.main .card-body > div:not(.shop-items)').remove(); $('.shop-item form').click(function() { $(this).submit(); }); });