?
Current Path : /home1/savoy/public_html/savoyglobal.net/drafthr/system/application/views/Settings/ |
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/drafthr/system/application/views/Settings/fiscalpage.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?> <script> function add_fiscal(rwd) { $("#ck_permission").load("<?= site_url('master/check_permissions/') ?>"+"/"+rwd,function(data) { if(data==1) { $("#fiscaldiv").load("<?= site_url('settings/addfiscalpage/') ?>"); } }); } function editfiscalyear(rwd,id,pageno,field,text) { $("#ck_permission").load("<?= site_url('master/check_permissions/') ?>"+"/"+rwd,function(data) { if(data==1) { $("#fiscaldiv").load("<?= site_url('settings/Get_fiscal_data/') ?>" +"/" + id + "/" + pageno+"/" + field+ "/" + text); } }); } function insert_fiscal() { if(validateform('startdate','enddate')) { var startdate=document.getElementById('startdate').value ; var enddate=document.getElementById('enddate').value ; var close=document.getElementById('close').value ; var sdate= startdate.split('-'); var stdate=sdate[2]+'-'+sdate[1]+'-'+sdate[0]; var edate= enddate.split('-'); var endate=edate[2]+'-'+edate[1]+'-'+edate[0]; if(stdate>=endate) { alert('Begin Date is greater'); // document.getElementById('startdate').value='' ; // document.getElementById('enddate').value='' ; return false; } $("#ck_permission").load("<?= site_url('settings/fiscal_date/') ?>"+"/"+startdate +"/"+enddate,function(data) { if(data>=1) { alert('Fiscal Year already exist for this date'); // document.getElementById('startdate').value='' ; // document.getElementById('enddate').value='' ; return false; } else { $.post("<?php echo site_url('settings/insertfiscal/'); ?>", { 'startdate':startdate,'enddate':enddate,'close':close }, function(data) { alert(data); showfiscal(1,'closed',''); }); } }); } } function update_fiscal() { var id=document.getElementById('id').value ; var close=document.getElementById('close').value ; $.post("<?php echo site_url('settings/chekunpostedtransaction/'); ?>",function(data){ if(data>0) { alert("You Have Some Unposted Transactions") return false; } else { $.post("<?php echo site_url('settings/updatefiscal/'); ?>", { 'id':id,'close':close }, function(data) { alert(data); showfiscal(1,'closed',''); }); } }); } function date_diff(date1,date2) { var oneDay=1000*60*60*24; var value =Math.ceil((date1.getTime()-date2.getTime())/oneDay); return value; } function delfiscal(rwd,closed,table,id,pageno) { if(closed==1) { $("#ck_permission").load("<?= site_url('master/check_permissions/') ?>"+"/"+rwd,function(data) { if(data==1) { $("#fiscaldiv1").load("<?= site_url('settings/deletefiscal/') ?>" +"/" +table + "/" + id+ "/" + pageno,function(dat){ if(dat==1) { var htm="<div style=\"background-color:#fff;padding-left:25px; border:2px solid green; width:300px;height:20px;\" ><font color=\"green\" >Fiscal Year Deleted</font></div>"; } else { var htm="<div style=\"background-color:#fff;padding-left:25px; border:2px solid red; width:300px;height:20px;\" ><font color=\"red\" >Delete Previous Fiscal Year First</font></div>"; } function success_load() { $("#successdiv").fadeIn(1500,0); $("#successdiv").html(htm); hide_success(); } //Hide Loading Image function hide_success() { $("#successdiv").fadeOut(3000,0); }; success_load(); showfiscal(pageno,'closed',''); }); } }); } else { var htm="<div style=\"background-color:#fff;padding-left:25px; border:2px solid red; width:300px;height:20px;\" ><font color=\"red\" >This Fiscal Year is Not Closed</font></div>"; function success_load() { $("#successdiv").fadeIn(1500,0); $("#successdiv").html(htm); hide_success(); } //Hide Loading Image function hide_success() { $("#successdiv").fadeOut(3000,0); }; success_load(); showfiscal(pageno,'closed',''); } } </script> <style> .select { background-color:#f8f8f8; } </style> <div id="successdiv" align="center"></div> <div id="fiscaldiv1" style="display:none"></div> <div class="select-bar"> <label> <img src="<?=base_url()?>/assets/images/add-icon.png" title="Add New" class="clickimage" onclick="add_fiscal(1)" alt="Add New" align = "top" width="25" height="25" /></label> <label> Search For <input type="text" name="search" id="search" style="background-image: none;"> in <select id ="selectsearch" name="selectsearch"> <option value="all">All</option> <option value="begin">Begin Date</option> <option value="end">End Date</option> </select> </label> <label for="submit"> <button type="submit" class="clickimage" id="submit" onclick="showfiscal(<?=$currpage ?>,document.getElementById('selectsearch').value,document.getElementById('search').value);">Search</button></label> </div> <table class="sort"> <caption>FISCAL YEAR</caption> <tr> <th width="10%">Sl No.</th> <th width="15%">Begin Date</th> <th width="15%">End Date</th> <th width="10%">Closed</th> <th width="10%">Action</th> </tr> <?php $fyear=$this->accountingsmodel->fiscalyear(); $i=(($currpage-1) * 10); foreach ($fiscallist as $fiscal) { $i=$i+1; $endate=$fiscal['end']; $dateends = $this->mastermodel->convdatformat($endate); $stdate=$fiscal['begin']; $datestarts = $this->mastermodel->convdatformat($stdate); echo "<tr ><td >".$i."</td>"; $status=$fiscal['closed']; if($status==0) $sta='NO'; else $sta='YES'; ?> <?php echo " <td>".$datestarts."</td><td>".$dateends."</td><td>".$sta."</td><td>"; if($sta!='YES') { ?> <img src="<?=base_url()?>/assets/images/edit-icon.gif" id="editfiscal" title="Edit" width="20" height="20" alt="Edit" align = "center" onclick="editfiscalyear(1,<?=$fiscal['id']?>,<?php echo $currpage ?>,'<?=$field ?>','<?=$text?>');" class="clickimage" /> <?php } if($fyear!=$fiscal['id']) { ?> <img src="<?=base_url()?>/assets/images/delete-icon.png" title="Delete" width="20" height="20" alt="Delete" class="clickimage" onclick="return delfiscal(2,'<?=$fiscal['closed']?>','fiscal_year',<?=$fiscal['id']?>,<?php echo $currpage ?>)" align = "center"/> <?php } echo "</td></tr>"; } ?> </table> <div style="width:75%; height:30px; float:right;"> <ul> <li class="pagsel" onclick="showfiscal('1','<?=$field ?>','<?=$text ?>')"> <img src="<?php echo base_url() ?>/assets/images/first.gif"/> </li> <li class="pagsel" <?php if($currpage>0){ ?> onclick="showfiscal('<?php echo $currpage-1 ?>','<?=$field ?>','<?=$text ?>')" <?php } ?> > <img src="<?php echo base_url() ?>/assets/images/prev.gif"/> </li> <?php $totpage=ceil($totrecord/10); $arr= $this->settingsmodel->getmaxminlist($currpage,$totpage,4); $myarray=$arr['listnos']; for($i=$myarray[0]; $i<=$myarray[1]; $i++) { if($currpage==$i ) { ?> <li class="pagsel"> <?php echo $i ?></li> <?php } else { ?> <li class="pag" onclick="showfiscal('<?php echo $i ?>','<?=$field ?>','<?=$text ?>')"> <?php echo $i ?></li> <?php } } ?> <li class="pagsel" <?php if($currpage<$totpage){ ?> onclick="showfiscal('<?php echo $currpage+1 ?>','<?=$field ?>','<?=$text ?>')"<?php } ?>> <img style="vertical-align:top" src="<?php echo base_url() ?>/assets/images/next.gif"/> </li> <li class="pagsel" onclick="showfiscal('<?php echo $totpage ?>','<?=$field ?>','<?=$text ?>')"><img src="<?php echo base_url() ?>/assets/images/last.gif"/> </li> </ul> </div>