?
Current Path : /home1/savoy/public_html/savoyglobal.net/sibs_draft/system/application/views/HR/ |
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/sibs_draft/system/application/views/HR/viewassignleave.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); if(isset($_SESSION['searchoption'])) { if(!empty($_SESSION['searchoption'])) { $searchtxt=$_SESSION['searchtxt']; $searchoption=$_SESSION['searchoption']; } else { $searchtxt = ""; $searchoption = ""; } } else { $searchtxt = ""; $searchoption = ""; } ?> <div class="select-bar"> <label> <img src="<?=base_url()?>/assets/images/add-icon.png" title="Add New" class="clickimage" onclick="addassignleave(1)" alt="Add New" align = "top" width="25" height="25" /></label> <label> Search For <input type="text" name="search" id="search" value="<?=$searchtxt;?>" style="background-image: none;"> in <select id ="selectsearch" name="selectsearch"><option value="staffid">Select</option> <option value="staffid" <?php if ($searchoption == "staffid") echo "selected"; ?>>Name</option> <option value="type" <?php if ($searchoption == "type") echo "selected"; ?>>Leave Type</option> </select> </label> <label for="submit"> <button type="submit" class="clickimage" id="submit" onclick="searchassignleave(document.getElementById('search').value,document.getElementById('selectsearch').value);">Search</button></label> </div> <?php $userid=$_SESSION['userid']; $emp_id= $this->customermodel->getSingleFieldValue('users','staff_id','id',$userid); $repdet= $this->mastermodel->get_data('staffemployeedetails',$emp_id,'reportingtostaffid'); $repid=array(); foreach($repdet as $repval) { $repid[]=$repval['staffid']; } //var_dump($repid); ?> <table class="sort" cellpadding="0" cellspacing="0"> <caption>Leave Applied</caption> <thead><tr> <th>Sl No.</th> <th>Employee Name</th> <th>From Date</th> <th>To Date</th> <th>No of Days</th> <th>Type of Leave</th> <th>Status</th> <th class="last">Action</th> </tr> <?php if($searchinfo == "") { if ($viewinfo->num_rows() > 0) { $z=1; foreach ($viewinfo->result() as $row) { $sta_id=$row->staffid; if($sta_id==$emp_id || in_array($sta_id,$repid) || $userid==1 ) { if($z%2==0) { $alt="alt"; } else $alt="alt1"; $stf=$this->mastermodel->get_data_srow('staffpersonaldetails',$row->staffid,'id'); $lea=$this->mastermodel->get_data_srow('leavetype',$row->type,'id'); $fromdate = $this->mastermodel->convdatformat($row->fromdate); $todate = $this->mastermodel->convdatformat($row->todate); $noofdays=floor((strtotime($todate) - strtotime($fromdate)) / (60 * 60 * 24))+1; echo '<tr class="'.$alt.'"><td>'.$no.'</td><td>';?><?php echo $stf->name;?><?php echo '</td> <td>'.$fromdate.'</td> <td>'.$todate.'</td> <td>'.$noofdays.'</td> <td>'.$lea->leavename.'</td> <td>'.$row->leavestatus.'</td> <td>';?> <div id="console_fronticons_4"> <?php if((in_array($sta_id,$repid) || $userid==1 )&& $row->leavestatus!='Approved') { ?> <div class="fronticons"> <img src="<?=base_url()?>/assets/images/documentinfo.png" title="Status" width="20" class="statusicon" height="20" alt="Status" align = "center" onclick="quickeditassignleave_permit(<?=$row->id;?>)"/></div> <div class="fronticons"> <img src="<?=base_url()?>/assets/images/edit-icon.gif" title="Edit" width="20" height="20" alt="Edit" align = "center" onclick="editassignleave_permit(2,<?=$row->id;?>)"/></div> <div class="fronticons"> <?=anchor('hr/delete/assignleave/'.$row->id.'/48', '<img src="'.base_url().'/assets/images/delete-icon.png" title="Delete" width="20" height="20" align = "center" >',array('class'=>'delete','onclick'=>"return confirm('Are you sure want to delete this record?')"))?></div> <?php } else { if($row->leavestatus!='Approved') { ?> <div class="fronticons"><img src="<?=base_url()?>/assets/images/edit-icon.gif" title="Edit" width="20" height="20" alt="Edit" align = "center" onclick="editassignleave(1,<?=$row->id;?>)"/></div> <div class="fronticons"> <?=anchor('hr/delete/assignleave/'.$row->id.'/48', '<img src="'.base_url().'/assets/images/delete-icon.png" title="Delete" width="20" height="20" align = "center" >',array('class'=>'delete','onclick'=>"return confirm('Are you sure want to delete this record?')"))?></div> <?php } else { ?> <div class="fronticons"><img src="<?=base_url()?>/assets/images/edit-icon.gif" title="Edit" width="20" height="20" alt="Edit" align = "center" onclick="editassignleave(1,<?=$row->id;?>)"/></div> <div class="fronticons"> <?php } } ?> </div> <?php echo '</td></tr>' ; $no++; $z++; } } } } else { $res = mysql_query($searchinfo); if (mysql_num_rows($res) > 0) { $z=1; while ($row = mysql_fetch_array($res)) { if($z%2==0) { $alt="alt"; } else $alt="alt1"; $stf=$this->mastermodel->get_data_srow('staffpersonaldetails',$row['staffid'],'id'); $lea=$this->mastermodel->get_data_srow('leavetype',$row['type'],'id'); $fromdate = $this->mastermodel->convdatformat($row['fromdate']); $todate = $this->mastermodel->convdatformat($row['todate']); $noofdays=(strtotime($todate) - strtotime($fromdate)) / (60 * 60 * 24)+1; echo '<tr class="'.$alt.'"><td>'.$no.'</td><td>';?><?php echo $stf->name;?><?php echo '</td> <td>'.$fromdate.'</td> <td>'.$todate.'</td> <td>'.$noofdays.'</td> <td>'.$lea->leavename.'</td> <td>'.$row['leavestatus'].'</td> <td >';?> <div id="console_fronticons_4"> <?php if((in_array($row['staffid'],$repid) || $userid==1 )&& $row['leavestatus']!='Approved') { ?> <div class="fronticons"> <img src="<?=base_url()?>/assets/images/documentinfo.png" title="Status" width="20" class="statusicon" height="20" alt="Status" align = "center" onclick="quickeditassignleave_permit(<?=$row['id'];?>)"/></div> <div class="fronticons"> <img src="<?=base_url()?>/assets/images/edit-icon.gif" title="Edit" width="20" height="20" alt="Edit" align = "center" onclick="editassignleave_permit(1,<?=$row['id'];?>)"/></div> <div class="fronticons"> <?=anchor('hr/delete/assignleave/'.$row['id'].'/48', '<img src="'.base_url().'/assets/images/delete-icon.png" title="Delete" width="20" height="20" align = "center" >',array('class'=>'delete','onclick'=>"return confirm('Are you sure want to delete this record?')"))?></div> <?php } else { if($row['leavestatus']!='Approved') { ?> <div class="fronticons"><img src="<?=base_url()?>/assets/images/edit-icon.gif" title="Edit" width="20" height="20" alt="Edit" align = "center" onclick="editassignleave(1,<?=$row['id'];?>)"/></div> <div class="fronticons"> <?=anchor('hr/delete/assignleave/'.$row['id'].'/48', '<img src="'.base_url().'/assets/images/delete-icon.png" title="Delete" width="20" height="20" align = "center" >',array('class'=>'delete','onclick'=>"return confirm('Are you sure want to delete this record?')"))?></div> <?php } } ?> </div> <?php echo '</td></tr>' ; $no++; $z++; } } } ?> </table> <ul class="paginate"> <li class="pagsel"onclick="paginationassignleavesearch('1','<?=$searchoption?>','<?=$searchtxt?>')"> <img src="<?php echo base_url() ?>/assets/images/first.gif"/> </li> <li class="pagsel" <?php if($pagenum>1){ ?> onclick="paginationassignleavesearch('<?=$pagenum-1?>','<?=$searchoption?>','<?=$searchtxt?>')" <?php } ?> > <img src="<?php echo base_url() ?>/assets/images/prev.gif"/> </li> <?php //Pagination Numbers for($i=$startpage; $i<=$endpage; $i++) { if($pagenum==$i ) {?> <li class="pagsel" onclick="paginationassignleavesearch('<?=$i?>','<?=$searchoption?>','<?=$searchtxt?>')"><?=$i?></li> <?php } else {?> <li class="pag" onclick="paginationassignleavesearch('<?=$i?>','<?=$searchoption?>','<?=$searchtxt?>')"><?=$i?></li> <?php } } ?> <li class="pagsel" <?php if($pagenum<$pages){ ?> onclick="paginationassignleavesearch(<?=$pagenum+1?>,'<?=$searchoption?>','<?=$searchtxt?>')"<?php } ?>> <img style="vertical-align:top" src="<?php echo base_url() ?>/assets/images/next.gif"/> </li> <li class="pagsel" onclick="paginationassignleavesearch('<?=$pages?>','<?=$searchoption?>','<?=$searchtxt?>')"><img src="<?php echo base_url() ?>/assets/images/last.gif"/> </li> </ul>