?
Current Path : /home1/savoy/www/savoyglobal.net/sibs_draft/system/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/www/savoyglobal.net/sibs_draft/system/application/views/commonfunctions.php |
<?php /* * To change this template, choose Tools | Templates * and open the template in the editor. */ ?> <script type="text/javascript" src="<?=base_url()?>/assets/js/autonumeric.js"></script> <script type="text/javascript"> function showuploadform(id,table,field) { $("#inline_example1").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#inline_example1").load("<?= site_url('master/showuploadform/') ?>"+"/" +id+"/"+table+"/"+field); $(".uploadform").colorbox({width:"70%",height:"90%", inline:true, href:"#inline_example1"}); } function uploadform(id,table,field) { if(validateform('documentname')) { $('.new1').ajaxForm({ beforeSubmit: showPreloader, success: function(data) { $("#ressuccess").html(data); getfolderstructure('','',id,table,field); } }); } else { return false; } } function showPreloader() { $("#ressuccess").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" border="0"/></CENTER>'); } function showPreloaderform(divid) { //$('html, body').animate({scrollTop:0}, 'slow'); // for scrolling to the top of the page $("#"+divid).empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); } function hidePreloaderform(divid) { //$('html, body').animate({scrollTop:0}, 'slow'); // for scrolling to the top of the page $("#"+divid).empty().html(''); } function getfolderstructure(id,parentid,companyid,table,field) { if(parentid=='0') { parentid='1'; id='1'; } if(parentid!='0') { if(id=="") { id=1; } $("#Folderss").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#subpathname").load("<?= site_url('master/uploadpathfind/') ?>/"+ id,function(data){ $("input#subpathname").val(data); }); if(companyid!=0) { $("#Folderss").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#Folderss").load("<?= site_url('documents/getfolderlistcompany/folderexplorer/') ?>/"+table+"/"+field+"/"+id+"/"+companyid,function(){ $("input#dirid").val(id); }); } else { $("#Folderss").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#Folderss").load("<?= site_url('master/getfolderlist/folderexplorer') ?>/"+ id,function(){ $("input#dirid").val(id); }); } } } function createsubdir(name,dir,parentid,companyid,table,field) { $("#createdsubdir").load("<?= site_url('master/createsubdir/') ?>" +"/" +dir+"/" +companyid+"/" +name,function(data) { alert(data); getfolderstructure(dir,parentid,companyid,table,field); }); } function deletedirectory(dirid,parentid,dir,companyid,table,field) { if(dir=="") { alert("No directory Selected"); return false; } $("#createdsubdir").load("<?= site_url('master/deletedirectory/') ?>" +"/"+table+"/" +dir,function(data) { alert(data); getfolderstructure(dirid,parentid,companyid,table,field); }); } function renamedirectory(dir) { if(dir=="") { alert("No directory Selected"); return false; } else { showDiv('div23'); } } function renamefolder(newdirname,id,parentid,companyid,table,field) { //alert('gotinrename'); if(id=="") { id=1; } $("#createdsubdir").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#createdsubdir").load("<?= site_url('master/renamefolder/') ?>/"+ id+"/"+newdirname,function(data){ alert(data); getfolderstructure(parentid,'',companyid,table,field); }); } function changeclass(id) { if(document.getElementById('lastselected').value!="") { val=document.getElementById('lastselected').value; document.getElementById(val).className='operationdiv1'; } document.getElementById(id).className='selectedoperationdiv1'; document.getElementById('lastselected').value=id; } function showDiv(divname) { var divstyle = new String(); divstyle = document.getElementById(divname).style.display; if(divstyle.toLowerCase()=="none" || divstyle == "") { document.getElementById(divname).style.display="block"; } else { document.getElementById(divname).style.display="none"; } } function showDivfolder() { var divstyle = new String(); divstyle = document.getElementById("div2").style.display; if(divstyle.toLowerCase()=="none" || divstyle == "") { document.getElementById("div2").style.display="block"; } else { document.getElementById("div2").style.display="none"; } } function showfolderstruct() { var divstyle = new String(); divstyle = document.getElementById("div3").style.display; if(divstyle.toLowerCase()=="none" || divstyle == "") { document.getElementById("div3").style.display="block"; } else { document.getElementById("div3").style.display="none"; } } function downloadfile(id) { $("#Folderss").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#Folderss").load("<?= site_url('master/downloadfile/') ?>/"+ id,function(data){ alert(data); }); } function viewfolderstructure(id,parentid,companyid,table,field) { if(parentid=='0') { parentid='1'; id='1'; } if(parentid!='0') { if(id=="") { id=1; } $("#Folderssv").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#subpathname").load("<?= site_url('master/uploadpathfind/') ?>/"+ id,function(data){ $("input#subpathname").val(data); }); if(companyid!=0) { $("#Folderssv").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#Folderssv").load("<?= site_url('documents/getfolderlistcompany/folderexplorerview/') ?>/"+table+"/"+field+"/"+id+"/"+companyid,function(){ $("input#dirid").val(id); }); } else { $("#Folderssv").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#Folderssv").load("<?= site_url('master/getfolderlist/folderexplorerview') ?>/"+ id,function(){ $("input#dirid").val(id); }); } } } function viewfolderstructurecustomer(id,parentid,companyid,table,field) { if(parentid=='0') { parentid='1'; id='1'; } if(parentid!='0') { if(id=="") { id=1; } $("#Folderssvcustomer").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#subpathname").load("<?= site_url('master/uploadpathfind/') ?>/"+ id,function(data){ $("input#subpathname").val(data); }); if(companyid!=0) { $("#Folderssvcustomer").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#Folderssvcustomer").load("<?= site_url('documents/getfolderlistcompany/folderexplorerview/') ?>/"+table+"/"+field+"/"+id+"/"+companyid,function(){ $("input#dirid").val(id); }); } else { $("#Folderssvcustomer").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#Folderssvcustomer").load("<?= site_url('master/getfolderlist/folderexplorerview') ?>/"+ id,function(){ $("input#dirid").val(id); }); } } } function usepolicybyno(code) { if(code=="") { alert("Please enter the Policy No") return false; } else { code=code.replace(/\//gi,"~"); $.ajax({ type: "POST", url: "<?= site_url('policies/findpolicybyno/') ?>/"+code, success: function(msg){ if(msg=="") { alert("No Policy with policy no "+code) } else { var retresult=msg.split('~'); $.ajax({ type: "POST", url: "<?= site_url('policies/cancel_count/') ?>/"+retresult[1], success: function(msg){ if(msg>0) { alert("Policy has already been cancelled"); return false; } else { $("input#policyno").val(retresult[0]); $("input#policyid").val(retresult[1]); $.fn.colorbox.close(); document.getElementById('enddet').innerHTML="<fieldset><li><label>Customer Name</label>"+retresult[2]+"</li>\n\ <li><label>Cover Name</label>"+retresult[4]+"</li><li><label>Quotation Reference</label>"+retresult[3]+"</li>\n\ <li><label>Endorsement Ref. No</label><label>--Auto Generated--</label></li><input type='hidden' name='endref' value='"+retresult[3]+"'/></li></fieldset>"; } } }); } } }); } } function usepolicybynocanc(code) { if(code=="") { alert("Please enter the Policy No") return false; } else { code=code.replace(/\//gi,"~"); $.ajax({ type: "POST", url: "<?= site_url('policies/findpolicybyno/') ?>/"+code, success: function(msg){ if(msg=="") { alert("No Policy with policy no "+code) } else { var retresult=msg.split('~'); $("input#policyno").val(retresult[0]); $("input#policyid").val(retresult[1]); $.fn.colorbox.close(); document.getElementById('enddet').innerHTML="<fieldset><li><label>Customer Name</label>"+retresult[2]+"</li>\n\ <li><label>Cover Name</label>"+retresult[4]+"</li><li><label>Quotation Reference</label>"+retresult[3]+"</li>\n\ <li><label>Cancellation Ref. No</label><label>--Auto Generated--</label></li><input type='hidden' name='canref' value='"+retresult[3]+"'/></li></fieldset>"; } } }); } } </script>