?
Current Path : /home1/savoy/public_html/savoyglobal.net/drafthr/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/drafthr/system/application/views/HR/viewstaff.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="addstaff(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="">All</option> <option value="employeeid" <?php if ($searchoption == "employeeid") echo "selected"; ?>>Employee No</option> <option value="name" <?php if ($searchoption == "name") echo "selected"; ?>>Employee Name</option> <option value="designation" <?php if ($searchoption == "designation") echo "selected"; ?>>Designation</option> <option value="department" <?php if ($searchoption == "department") echo "selected"; ?>>Department</option> </select> </label> <label for="submit"> <button type="submit" class="clickimage" id="submit" onclick="searchstaff(document.getElementById('search').value,document.getElementById('selectsearch').value);">Search</button></label> </div> <table class="sort" cellpadding="0" cellspacing="0"> <caption>Staff</caption> <thead><tr> <th>Sl No.</th> <th>Employee no</th> <th>Name</th> <th>Designation</th> <th>Department</th> <th width="15%" class="last">Action</th> </tr> <?php if($searchinfo == "") { if ($viewinfo->num_rows() > 0) { $z=1; foreach ($viewinfo->result() as $row) { if($z%2==0) { $alt="alt"; } else $alt="alt1"; $stfemp=$this->mastermodel->get_data_srow('staffemployeedetails',$row->id,'staffid'); $desg = $this->mastermodel->get_data_srow('designation',$stfemp->designationid,'id'); $dept= $this->mastermodel->get_data_srow('department',$stfemp->deptid,'id'); echo '<tr class="'.$alt.'"><td>'.$no.'</td><td>'.$row->employeeid.'</td><td>';?> <a href="javascript:void(0)" onclick="singlestaff(0,<?=$row->id?>)"><?php echo $row->name?></a><?php echo '</td> <td>';if(!empty($desg)) { echo $desg->designation; } echo '</td><td>'; if(!empty($dept)) { echo $dept->departmentname; } echo '</td><td >'; $value='1~'.$row->id.'~'.$row->employeeid; ?> <div id="console_fronticons" style="float:left"> <div class="fronticons"> <img src="<?=base_url()?>/assets/images/upload.png" title="Upload" width="20" height="20" alt="Upload" align = "center" class="clickimage uploadform" onclick="showuploadform(<?=$row->id?>,'staff_files','staffid')" alt="" /> </div> <div class="fronticons"> <img src="<?=base_url()?>/assets/images/edit-icon.gif" class = "clickimage" title="Edit" width="20" height="20" alt="Edit" align = "center" onclick="editstaff(1,<?=$row->id?>)" /> </div> <div class="fronticons" style="float:left"> <?=anchor('hr/delete/staffpersonaldetails/'.$row->id.'/40', '<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> </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"; $stfemp=$this->mastermodel->get_data_srow('staffemployeedetails',$row['id'],'staffid'); $desg = $this->mastermodel->get_data_srow('designation',$stfemp->designationid,'id'); $dept= $this->mastermodel->get_data_srow('department',$stfemp->deptid,'id'); echo '<tr class="'.$alt.'"><td>'.$no.'</td><td>'.$row['employeeid'].'</td><td>';?> <a href="javascript:void(0)" onclick="singlestaff(0,<?=$row['id']?>)"><?php echo $row['name']?></a><?php echo '</td> <td>'.$desg->designation.'</td> <td>'.$dept->departmentname.'</td> <td >';?> <div id="console_fronticons"> <div class="fronticons"><img src="<?=base_url()?>/assets/images/edit-icon.gif" class = "clickimage" title="Edit" width="20" height="20" alt="Edit" align = "center" onclick="editstaff(1,<?=$row['id']?>)" /></div><div> <?=anchor('hr/delete/staffpresonaldetails/'.$row['id'].'/40', '<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></div> <?php echo '</td></tr>' ; $no++; $z++; } } } ?> </table> <ul class="paginate"> <li class="pagsel"onclick="paginationstaffsearch('1','<?=$searchoption?>','<?=$searchtxt?>')"> <img src="<?php echo base_url() ?>/assets/images/first.gif"/> </li> <li class="pagsel" <?php if($pagenum>1){ ?> onclick="paginationstaffsearch('<?=$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="paginationstaffsearch('<?=$i?>','<?=$searchoption?>','<?=$searchtxt?>')"><?=$i?></li> <?php } else {?> <li class="pag" onclick="paginationstaffsearch('<?=$i?>','<?=$searchoption?>','<?=$searchtxt?>')"><?=$i?></li> <?php } } ?> <li class="pagsel" <?php if($pagenum<$pages){ ?> onclick="paginationstaffsearch(<?=$pagenum+1?>,'<?=$searchoption?>','<?=$searchtxt?>')"<?php } ?>> <img style="vertical-align:top" src="<?php echo base_url() ?>/assets/images/next.gif"/> </li> <li class="pagsel" onclick="paginationstaffsearch('<?=$pages?>','<?=$searchoption?>','<?=$searchtxt?>')"><img src="<?php echo base_url() ?>/assets/images/last.gif"/> </li> </ul>