Location: PHPKode > projects > E-hris > empothers.php
<? 
  session_start();
  /*
   * e-hris (E-Human Resource Information System v 1.2.1) 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.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Location</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="../corehrmis/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"/>


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

 <style type="text/css">
<!--
h2
{
	color:#51790E;
	font-family: "Times New Roman", Times, serif;
	font-size: 30px;
	line-height: 30px;
	padding: 0px;
	margin-top: 20px;
	margin-right: 0px;
	margin-bottom: 20px;
	margin-left: 0px;
}
.style10 {font-weight: bold}

-->
 </style>
</head>

<body>
<?   

 if (empty($_SESSION["username"]))
    die("<center><font color=red>You have not yet Logged in.<a href=login.php>Please click here to log in.</a></font></center>");
 else
   $username = $_SESSION["username"];
   
  $today=date("Y-m-d h:m:s");
  
  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($_GET["empid"])){
    $id=$_GET["empid"];
	 
	$sqlstr="select * from prmember where rowid = '$id'";
	$sqlresult=$d->query($sqlstr);
	
	
	    $row=$d->fetch_object($sqlresult);
	 
	    $emptitle = $row->emptitle;  
		$rowid = $row->rowid;
	    $fname=$row->LastName;
		 if (empty($row->OtherNames)){
		  $othernames=explode(" ",$row->FullName);
		}  
		else
		{
		  $othernames=explode(" ",$row->OtherNames);
		  $mname=$othernames[0];
		}   
		
	    $lname=$othernames[1];
	    $empnum=$row->MemberNo;
	    
	    $prefnames=$fname;
	    $dob=datetimeconvert($row->BirthDate,2);
	    $placeofbirth=$row->placeofbirth;
	   
	     if (stristr($row->Sex,'Male') || stristr($row->Sex,'M'))
		   $gender='m';
		   
		if (stristr($row->Sex,'Female') || stristr($row->Sex,'F'))
		   $gender='f';;
		     
	   // $gender=$row->Sex;
	    $marital_status=$row->MaritalStatus;
	    $pin=$row->PINNumber;
	    $nssfnum=$row->NSSFNo;
	   
		$nationality=$row->nationality;
		$nhifnum=$row->NHIFNO;
		$empdate=datetimeconvert($row->EmpDate,2);
		$idnum=$row->IDNumber;
		$curr_res=$row->curr_res;
		$homeres=$row->homeres;
		
		$physical=$row->physical;
		$province=$row->province;
		$currdescrip=$row->currdescrip;
		$district=$row->district;
		$street=$row->street;
		
		$division=$row->division;
		$estate=$row->estate;
		$location=$row->location;
		$town=$row->town;
	    $sublocation=$row->sublocation;
		$postaladdr=$row->postaladdr;
		$phonenum=$row->phonenum;
		$unit_fk=$row->unit_fk;
		$suspended=$row->Suspended;
		
		$dlnum=$row->dlnum;
		$empstatus_fk=$row->empstatus_fk;
		$bankcode=$row->BankCode;
		
		if (!empty($datedlissued)) 
		  $datedlissued=dateconvert($row->datedlissued,2);
				  
		$position_fk=$row->position_fk;
		$dlclasses=$row->dlclasses;
		$dept=$row->Dept;
		
		$bank=$row->bankid_fk;
		$basicpay=$row->BasicPay;
		$branch=$row->branchid_fk;
		$accnum=$row->AccountNo;
		$jobgroup=$row->JobGroup;
		$numhrs=$row->M_days_Hrs;
		$monthid=$row->IncrMonth;
		$hpayrate=$row->Hr_PayRate;
		$housed = $row->Housed;
		
		$rentpayemp=$row->HouseCost;
		$stationcode = $row->Station;
		
		if (!empty($row->QuitDate)) 
	    $expdate=datetimeconvert($row->QuitDate,2);
	    
		$termsid=$row->termsid_fk;
		
		if (!empty($row->effdate)) 
		  $effdate=datetimeconvert($row->effdate,2);
	  
	   $actpos=$row->actposition;
	   $actscale=$row->actscale;
	 
	   if (!empty($row->acteffdate)) 
	     $acteffdate=datetimeconvert($row->acteffdate,2);
 
       if (!empty($row->expdate)) 
	     $expdate=datetimeconvert($row->expdate,2);
		 
	$action='update_go';
  }
  
  
?>
<form action="employees.php" method="post" name="empothersfrm">
<table width="100%"  border="0" bgcolor="#F7F7F7">
        <tr>
          <td width="22%"><div align="right"><strong>Department</strong></div></td>
          <td width="22%" colspan="1"><span class="highlight">
            <select name="DeptName" id="DeptName">
              <option value="">--SELECT--</option>
              <? Loadlookup("deptcode","Deptcode","prdept",$dept,$d); ?>
            </select>
          </span>            
          <td><div align="right"><strong>Station/Section</strong></div>
          <td><select name="stationcode" id="stationcode">
              <option value="">--SELECT--</option>
              <? Loadlookup("stationcode","stationcode","prstn",$stationcode,$d); ?>
          </select></td>
        </tr>
        <tr>
          <td><div align="right"><strong>Terms of Service</strong></div></td>
          <td colspan="1"><span class="highlight">
            <select name="terms" id="terms" onChange="Checkexpdate(this.value)">
              <option value="">--SELECT--</option>
              <? Loadlookup("id","terms","tbl_terms",$termsid,$d); ?>
            </select>
            </span>
          
          <td><div align="right"><strong>Scale</strong></div>
          <td><select name="scale" id="scale" >
              <option value="">--SELECT--</option>
              <? Lookup("jobgroup","jobgroup",$actscale,"select  jobgroup from jobgroup ",$d); ?>
          </select></td>
        </tr>
        <tr>
          <td><div align="right"><span class="style10">Date of Employment </span></div></td>
          <td colspan="1"><input name="effdate" type="text" id="effdate" <? if (!empty($effdate)) echo "value=$effdate" ?>>
              <div class="highlight" id="inf_effdate">&nbsp; </div>          
          <td><div align="right"><strong>Contract ExpiryDate</strong></div>
          <td><input name="expdate" type="text" id="expdate" <? if (!empty($expdate)) echo "value=$expdate" ?>>
              <div class="highlight" id="inf_expdate">&nbsp; </div>
    </tr>
        <tr>
          <td><div align="right">
              <input name="action" type="hidden" id="action" <? if (!empty($action)) echo "value=$action"?>>
              <input type="hidden" name="id" <? if (!empty($id)) echo "value=$id"; ?>>
              <input type="hidden" name="rowid" <? if (!empty($rowid)) echo "value=$rowid"; ?>>
              <strong>Quit Date</strong> </div>
          <td><div align="left"> </div>
              <div class="highlight" id="inf_stn">
                  <input name="qdate" type="text" id="qdate" <? if (!empty($expdate)) echo "value=$expdate" ?>>
            </div>          
          <td><div align="right"><strong>Acting Position</strong></div></td>
          <td colspan="1"><span class="highlight">
            <select name="actpos" id="actpos" onChange="Checkacteffdate(this.value)">
              <option value="">--SELECT--</option>
              <? Loadlookup("id","designation","designation",$actpos,$d); ?>
            </select>
          </span>                   </tr>
        <tr>
          <td><div align="right"><strong>Acting Start Date </strong></div>
          <td nowrap><span class="highlight">
            <input name="actdate" type="text" id="actdate" <? if (!empty($acteffdate)) echo "value=$acteffdate" ?>>
            </span>
          
          <td><div align="right"><strong>Hrs worked per month</strong></div></td>
          <td colspan="1"><input name="numhrs" type="text" id="numhrs" <? if (!empty($numhrs))  echo "value=$numhrs" ?> OnBlur="Checkvalue(this.value,'numhrs')" >
          </tr>
        <tr>
          <td><div align="right"><strong>Hourly Pay Rate </strong> </div>
          <td><input name="hpayrate" type="text" id="hpayrate" <? if (!empty($hpayrate))  echo "value=$hpayrate" ?> OnBlur="Checkvalue(this.value,'hpayrate')" readonly="true">
          
          <td><div align="right"><strong>Housed</strong></div></td>
          <td colspan="1"><input name="housed" type="radio" value="-1" <? if (!empty($housed) && $housed==-1) echo "checked"?> readonly="true">
  Yes
    <input name="housed" type="radio" value="0" <? if (!empty($housed) && $housed==0) echo "checked"?> OnBlur="Checkrent(this.value)" readonly="true">
  No        
        </tr>
        <tr>
          <td><div align="right"><strong>If Yes Rent paid By Employer </strong> </div>
          <td><input name="rentpayemp" type="text" id="rentpayemp" <? if (!empty($rentpayemp))  echo "value=$rentpayemp" ?> readonly="true">
          
          <td><div align="right"><strong>Drivers Licence No</strong></div></td>
          <td colspan="1"><input name="dlnum" type="text" id="dlnum" <? if (!empty($dlnum))  echo "value=$dlnum" ?>>
          </tr>
        <tr>
          <td><div align="right"><strong>Date of Issue</strong> </div>
          <td><input name="issuedate" type="text" id="issuedate" <? if (!empty($datedlissued))  echo "value=$datedlissued" ?>>
          
          <td><div align="right"><strong> License Expiry Date </strong></div>
          <td><input name="expdate" type="text" id="expdate" <? if (!empty($expdate))  echo "value=$expdate" ?>>          
        </tr>
        <tr>
          <td><div align="right"><strong>Driving Class(es) </strong> </div></td>
          <td colspan="1"><input name="class" type="text" id="class" <? if (!empty($dlclasses)) echo "value=$dlclasses"?>>
          
          <td><div align="right"><strong>Incremental Month</strong>        
          </div>
          <td><select name="incmonth" id="incmonth" readonly="true">
            <option value="">--SELECT--</option>
            <? Loadlookup("id","monthname","tbl_months",$monthid,$d); ?>
          </select>        
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td colspan="1">          
          <td>        
          <td><div align="right">
              <input type="reset" name="Reset" value="Reset">
              <input type="submit" name="Submit" value="Submit" onclick="">
			  <input name="action" type="hidden" <? if (!empty($action)) echo "value=$action" ?>>
			  <input name="empid" type="hidden" <? if (!empty($id)) echo "value=$id" ?>>   
			  <input name="tabfrom" type="hidden" <? echo "value=EMP" ?>>     
            </div>
        </tr>
</table>
</form>
<?
  $d->close();
?>

</body>
</html>
Return current item: E-hris