Location: PHPKode > projects > E-hris > permissions.php
<?
  session_start();
/*
   * e-hris (Electonic-Human Resource Information System v 1.3.0 Alpha) Is an open source human resource information management system
   * developed to automate all aspects of human resource management, with the dual benefits of reducing the workload of the HR department as well as increasing the efficiency of the department by standardising
   * HR processes for any organization from small-enterprises to large scale organizations.
   * Copyright (C) 2008  David Muturi

   * This program is free software: you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
   * the Free Software Foundation, either version 3 of the License, or
   * (at your option) any later version.

   * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.

   * You should have received a copy of the GNU General Public License
   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
?>
<!DOCTYPE html
	PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>E-HRIS - Add Users</title>
	<link rel="stylesheet" type="text/css" href="css/employees.css" />
	<link rel="stylesheet" type="text/css" href="css/main.css"/>
	<link rel="stylesheet" href="js/example.css" TYPE="text/css" MEDIA="screen">
	<link href="css/text.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.info   { color: black; background-color: transparent; font-weight: normal; }
  .warn   { color: rgb(120,0,0); background-color: transparent; font-weight: normal; }
  .error  { color: red; background-color: transparent; font-weight: bold }
-->
</style>
 
 <link rel="stylesheet" type="text/css" href="css/epoch_styles.css"/>

 <link rel="stylesheet" type="text/css" href="css/epoch_styles.css"/>
 <link rel="stylesheet" type="text/css" href="css/jqueryslidemenu.css" />
 <link rel="stylesheet" type="text/css" href="ajaxtabs/ajaxtabs.css" />


<!--[if lte IE 7]>
<style type="text/css">
html .jqueryslidemenu{height: 1%;} /*Holly Hack for IE7 and below*/
</style>
<![endif]-->

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jqueryslidemenu.js"></script>

<script type="text/javascript" src="ajaxtabs/ajaxtabs.js">

/***********************************************
* Ajax Tabs Content script v2.2- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>
 <script type="text/javascript" src="css/epoch_classes.js"></script>
 <script type="text/javascript" src="js/formval.js"></script> 
 <script language="JavaScript" src="js/calendar1.js"></script><!--  -->
<script type="text/Javascript">
 

 function validateOnSubmit() {
	var elem;
    var errs=0;
	// execute all element validations in reverse order, so focus gets
    // set to the first one in error.
	
	if (!validatePresent(document.forms.addbankfrm.bank,'inf_bank'))  errs += 1; 
		    
	if (errs>1)  alert('There are fields which need correction before submitting');
    if (errs==1) alert('There is a field which needs correction before submitting');
	
  return (errs==0);
 }
 
 </script>
 
</head>
<body bgcolor="#FFFFFF">
<? 
  if (empty($_SESSION["username"]))
    die("<meta http-equiv='refresh' content='1;url=login.php'>");
 else
   $user = $_SESSION["username"];
   
  include "includes/functions.php";
  include "includes/config.php";
  require_once "includes/db.php";
  
  $d = new dbC();
  $d->connect($db_host, $db_user, $db_pass, $db); 
    
  if (!empty($user))
  {
    
    $sqlstr="select * from hrusers where username='$user'";
	$sqlresult=$d->query($sqlstr);
	$row=$d->fetch_object($sqlresult);
	
	$usersname = $row->username;
	$email=$row->email;
	$isadmin=$row->isadmin;
    $id=  $row->id;
  }
  
  if (!$isadmin)
      die("<meta http-equiv='refresh' content='1;url=index.php'>");
  
  createmenu($empid,$user,$d);
 ?>
<span>&nbsp;<br><br><? if (!empty($dispname)) echo $dispname; ?></span>
 <table  id="main" cellspacing="0" cellpadding="0" align="center" width="50%" >
   <tr>
     <td   bgcolor="#FFFFFF" >&nbsp;</td>
   </tr>
  <tr>
    <td  bgcolor="#FFFFFF" ><table width="100%"  border="0">
    <tr>
       
        <th width="2%">User </th>
		<th width="5%"><div align="center">Email</div></th>
		<th width="5%"><div align="center">Set</div></th>
		</tr>
	  <?
	    	
		 //count active staff for now	
		$sqlstr="select * from hrusers order by id";		  
		 
		  $result=$d->query($sqlstr) or die(mysql_error());
				
		  while ($row=$d->fetch_object($result))
		  {
		    echo "<tr>";
			echo "<td>".$row->username."</td>";
		    echo "<td>".$row->email."</td>";
		    echo "<td><a href=\"javascript:setperms($row->id)\"> Set </a></td>";
		  }
		
	     
	  ?>
    </table></td>
  </tr>
  <tr>
    <td  bgcolor="#FFFFFF" >&nbsp;</td>
  </tr>
 </table>
<?
  $d->close();
  footer();
?>
<script language="JavaScript">
 function setperms(userid)
	 {
        var url = "setperms.php?userid="+userid;
   
        newwin = window.open(url,'Add','width=350,height=400,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=2,resizable=0');
        newwin.focus();
     }
</script>

</body>

</html>



Return current item: E-hris