?
Current Path : /home1/savoy/public_html/savoyglobal.net/sec/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/sec/application/views/settings/display_alert_old.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $this->load->view('settings/settingsfunctions'); $this->load->view('documentreadyfunctions'); ?> <script type="text/javascript"> $(document).ready(function() { $('#tab-panel-1').createTabs(); }); function buildTable(alertlist) { var obj = JSON.parse(alertlist); var a=1,b=1,c=1,d=1,date,new_date; for(var i =0; i<obj.length;i++) { // date=new Date(date); // date = [date.getDate(), date.getMonth()+1, date.getFullYear()].join('-'); date=obj[i].alert_date; dArr=date.split("-"); new_date=dArr[2]+ "-" +dArr[1]+ "-" +dArr[0]; if(obj[i].alert_master_id == 1) { $('#table-rent').append('<tr><td>' + a + '</td><td>' + obj[i].building_name + '</td><td>' + new_date + '</td><td><img src="<?=base_url()?>assets/images/delete-icon.png" title="Delete" width="20" height="20" onclick="remove_alert('+obj[i].alert_id+')"/></td></tr>'); a++; } if(obj[i].alert_master_id == 2) { $('#table-tenanancy').append('<tr><td>' + b + '</td><td>' + obj[i].building_name + '</td><td>' + new_date + '</td><td><img src="<?=base_url()?>assets/images/delete-icon.png" title="Delete" width="20" height="20" onclick="remove_alert('+obj[i].alert_id+')"/></td></tr>'); b++; } if(obj[i].alert_master_id == 4) { $('#table-visa').append('<tr><td>' + c + '</td><td>' + obj[i].employee_name + '</td><td>' + new_date + '</td><td><img src="<?=base_url()?>assets/images/delete-icon.png" title="Delete" width="20" height="20" onclick="remove_alert('+obj[i].alert_id+')"/></td></tr>'); c++; } if(obj[i].alert_master_id == 5) { $('#table-labor').append('<tr><td>' + d + '</td><td>' + obj[i].employee_name + '</td><td>' + new_date + '</td><td>' + date + '</td><td>' + obj[i].employee_labour_card_no + '</td><td><img src="<?=base_url()?>assets/images/delete-icon.png" title="Delete" width="20" height="20" onclick="remove_alert('+obj[i].alert_id+')"/></td></tr>'); d++; } } $('.table').dataTable(); } </script> <div class="grid_12"> <div class="box" id="tab-panel-1"> <div class="header"> <h3>Alerts</h3> <ul> <li><a href="#tab-1">Rent Alerts</a></li> <li><a href="#tab-2">Tenancy Agreement Renewal</a></li> <li><a href="#tab-3">Visa Renewal</a></li> <li><a href="#tab-4">Labor Card Renewal</a></li> </ul> </div> <div class="content"> <div id="tab-1" class="tab-content"> <table id="table-rent" class="table"> <thead> <tr> <th id="sl">Sl No</th> <th>Building Name</th> <th>Date</th> <th>Remove</th> </tr> </thead> <tbody> </tbody> </table> </div> <div id="tab-2" class="tab-content"> <table id="table-tenanancy" class="table"> <thead> <tr> <th id="sl">Sl No</th> <th>Building Name</th> <th style="width:650px">Date</th> <th>Remove</th> </tr> </thead> <tbody> </tbody> </table> </div> <div id="tab-3" class="tab-content"> <table id="table-visa" class="table"> <thead> <tr> <th id="sl">Sl No</th> <th>Employee Name</th> <th style="width:650px">Date</th> <th>Remove</th> </tr> </thead> <tbody> </tbody> </table> </div> <div id="tab-4" class="tab-content"> <table id="table-labor" class="table"> <thead> <tr> <th id="sl">Sl No</th> <th>Employee Name</th> <th>Employee No</th> <th>Expiry Date</th> <th>Labour Card No</th> <th>Remove</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div> </div> //<?php echo "<script type='text/javascript'> $(document).ready(function() { buildTable('" . json_encode($detail) ."'); }); </script>"; ?>