?
Current Path : /home1/savoy/public_html/savoyglobal.net/eldertree/application/views/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/public_html/savoyglobal.net/eldertree/application/views/commonfunctions.php |
<script type="text/javascript"> function viewdata(controller,controllerfunction,modelfunction,page,pagenum) { if(arguments[5]) { var divid=arguments[5]; } else { var divid="inner_content"; } $("#"+divid).empty().html('<CENTER><img src="<?= base_url() ?>assets/img/loading.gif" class="loading"/></CENTER>'); $("#"+divid).load("<?= site_url() ?>/"+controller+'/'+controllerfunction+'/'+modelfunction+'/'+page+'/'+pagenum); } function addformdisplay(page,directory) { $("#inner_content").empty().html('<CENTER><img src="<?= base_url() ?>assets/img/loading.gif" class="loading"/></CENTER>'); $("#inner_content").load("<?= site_url('master/addformdisplay/') ?>/" +page+'/'+directory); } function view_page(directory,page,div) { $("#"+div).empty().html('<CENTER><img src="<?= base_url() ?>assets/img/loading.gif" class="loading"/></CENTER>'); $("#"+div).load("<?= site_url('master/view/') ?>/" +directory+'/'+page); } function student_class_details(controller,controllerfunction,id,field,page) { $("#inner_content").empty().html('<CENTER><img src="<?= base_url() ?>assets/img/loading.gif" class="loading"/></CENTER>'); $("#inner_content").load("<?= site_url() ?>/"+controller+'/'+controllerfunction+'/'+id+'/'+field+'/'+page); } function editformdata(controller,controllerfunction,id,table,field,page) { $("#inner_content").empty().html('<CENTER><img src="<?= base_url() ?>assets/img/loading.gif" class="loading"/></CENTER>'); $("#inner_content").load("<?= site_url() ?>/"+controller+'/'+controllerfunction+'/'+id+'/'+table+'/'+field+'/'+page); } function displayformdata(controller,controllerfunction,id,table,field,page) { $("#inner_content").empty().html('<CENTER><img src="<?= base_url() ?>assets/img/loading.gif" class="loading"/></CENTER>'); $("#inner_content").load("<?= site_url() ?>/"+controller+'/'+controllerfunction+'/'+id+'/'+table+'/'+field+'/'+page); } function viewformdata(controller,controllerfunction,id) { $("#inner_content").empty().html('<CENTER><img src="<?= base_url() ?>assets/img/loading.gif" class="loading"/></CENTER>'); $("#inner_content").load("<?= site_url() ?>/" +controller+'/'+controllerfunction+'/'+id); } function uploadformdata(controller,controllerfunction,master_id,return_function,return_page) { $("#inner_content").empty().html('<CENTER><img src="<?= base_url() ?>assets/img/loading.gif" class="loading"/></CENTER>'); $("#inner_content").load("<?= site_url() ?>/master/upload_form/"+controller+'/'+controllerfunction+'/'+master_id+"/"+return_function+"/"+return_page); } function deletedata(deltable,id,delfield,controller,controllerfunction,modelfunction,page,table,field,value) { var clicked = function(){ if(value) { var val=value; } else { var val= id; } if(table != "" && field != "") { $.ajax({ type: "POST", dataType:"json", url: "<?= site_url('master/checkexistencearray/') ?>/" +table+'/'+field+'/'+val, success: function(msg){ if(msg!=0) { alert("Record cannot be deleted due to associated data"); } else { $.ajax({ type: "POST", dataType:"json", url: "<?= site_url('master/deletedata/') ?>/"+deltable+"/"+id+"/"+delfield, success: function(msg) { viewdata(controller,controllerfunction,modelfunction,page,'1'); } }); alert('Record Deleted Successfully!!!'); } } }); } else { $.ajax({ type: "GET", dataType:"json", url: "<?= site_url('master/deletedata/') ?>/"+deltable+"/"+id+"/"+delfield, success: function(msg){ alert('Record Deleted Successfully!!!'); viewdata(controller,controllerfunction,modelfunction,page,'1'); } }); } }; if(confirmDelete()) { clicked(); } } function confirmDelete() { if (confirm("Are you sure you want to delete")) return 1; else return 0; } function addformdata1(formid) { if(callvalidate(formid)) { return true; } else { return false; } } function addformdata(formid) { if(arguments[1]) { var divid=arguments[1]; } else { var divid="inner_content"; } if(callvalidate(formid)) { $('#'+formid).ajaxForm({ beforeSubmit:function(){ $('button[type="submit"]').attr('disabled', 'disabled'); return true; }, success:function(data) { $("#"+divid).html(data); $('html, body, #'+divid).animate({scrollTop:0}, 'slow'); $('#table-example').dataTable(); // close_modal(); }, error:function(data){ } }); } else { return false; } return false; } function callvalidate(formid) { $("#"+formid).validate(); return $("#"+formid).valid(); } function checkexistence(table,field,value) { $("#success-panel").empty().html('<CENTER><img src="<?= base_url() ?>assets/img/loading.gif" class="loading"/></CENTER>'); $("#success-panel").load("<?= site_url('master/checkexistence/') ?>/" +table+'/'+field+'/'+value,function(data){ if(data==1) { $("input#"+field).val(""); $("select#"+field).val(""); $("#"+field).css('border','solid 1px red'); $("#"+field).focus(); $("#success-panel").fadeIn(900,0); $("#success-panel").html("Duplicate Entry Recorded"); $("#success-panel").fadeOut(2000,0); } else { $("#"+field).css('border','solid 1px gray'); } }); } function checkdatavalidity(jid, field, comment) { if (jid == "") { alert(comment) $('input#' + field).val(""); return false; } else { return true; } } function empty_text(tag) { $('#'+tag).val(""); } function empty(divid) { $(divid).html(""); } function empty_div(divid) { $('#' + divid).val(""); } function showPreloader(divid) { $("#"+divid).empty().html('<CENTER><img src="<?= base_url() ?>assets/img/loading.gif" class="loading"/></CENTER>'); } function hidePreloader(divid) { $("#"+divid).empty().html(''); } function generateReport(url){ $('form').attr('action', '<?= site_url() ?>/'+url); $('form').submit; } function generate_pdf(url){ $('#report_div').html(''); if(callvalidate('validateform')){ $.ajax({ type: "POST", url: '<?= site_url() ?>/'+url, data: $('form').serialize(), success: function(msg){ if(msg==0){ alert("No result Found"); }else{ $('#report_div').html(msg); } } }); } } </script>