Location: PHPKode > projects > E-hris > location.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" />

	<title> Employees Data/Profile</title>
<style type="text/css">
<!--
.style2 {font-size: x-small}
.style3 {	color: #FFFFFF;
	font-weight: bold;
}
.style4 {color: #FFFFFF}
.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>
 <style type="text/css">
<!--
.style7 {
	color: #FF0000;
	font-size: 9px;
	font-family: "Courier New", Courier, mono;
}
.style8 {
	background-color: transparent;
	color: red;
	font-size: 12px;
}
-->
 </style>
 <link rel="stylesheet" type="text/css" href="css/epoch_styles.css"/>
<style type="text/css">
<!--
.style3 {color: #FFFFFF;
	font-weight: bold;
}
.style4 {color: #FFFFFF}
-->
</style>

 <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>
 <script type="text/javascript">
/*You can also place this code in a separate file and link to it like epoch_classes.js*/
	var dp_cal,dob_cal,d_iss,d_exp,d_eff,d_act,d_qdate;
		  
    window.onload = function () {
	dp_cal  = new Epoch('epoch_popup','popup',document.getElementById('empdate'));
	dob_cal  = new Epoch('epoch_popup','popup',document.getElementById('dob'));
	d_iss  = new Epoch('epoch_popup','popup',document.getElementById('issuedate'));
	d_exp = new Epoch('epoch_popup','popup',document.getElementById('expdate'));
	d_eff = new Epoch('epoch_popup','popup',document.getElementById('effdate'));
	d_act = new Epoch('epoch_popup','popup',document.getElementById('actdate'));
	d_qdate= new Epoch('epoch_popup','popup',document.getElementById('qdate'));
  };
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 (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>

 <style type="text/css">
<!--
.style8 {
	font-family: "Bookman Old Style";
	font-size: large;
	font-weight: bold;
}
.style9 {font-size: xx-small}
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;
}

-->
 </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"];
	
  //if (!empty($_GET["action"]))
    $action="update_go";
	
   if (!empty($_REQUEST["empid"]))
  {
    $id=$_REQUEST["empid"];
	$action = "update_go";
    $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);
	 
	
  }

?>
<form action="employees.php" method="post" name="locationsfrm">
<table width="100%"  border="0" bgcolor="#F7F7F7">
  <tr>
    <td><div align="right"><strong>Mailing Address</strong></div></td>
    <td><input name="curr_res" type="text" id="curr_res" size="40" <?php if (!empty($curr_res)) echo "value=\"$curr_res\""; ?>>
    <td><div align="right"><strong>Home Res</strong></div>
    <td><input name="homeres" type="text" id="homeres" size="40" <? if (!empty($homeres)) echo "value='$homeres'" ?> >
  </tr>
  <tr>
    <td><div align="right"><strong>Physical Address</strong></div></td>
    <td><input name="physical" type="text" id="physical" size="40" <?php if (!empty($physical)) echo "value=\"$physical\""; ?>>
    <td><div align="right"><strong>State</strong> </div>
    <td><input name="province" type="text" id="province" size="40"  <? if (!empty($province)) echo "value='$province'" ?>>
  </tr>
  <tr>
    <td><div align="right"><strong>Description</strong></div></td>
    <td><input name="currdescrip" type="text" id="currdescrip" size="40" <? if (!empty($currdescrip)) echo "value=\"$currdescrip\""; ?>>
    <td><div align="right"><strong>Home Phone</strong> </div>
    <td><input name="district" type="text" id="district" size="40" <? if (!empty($district)) echo "value='$district'" ?>>
  </tr>
  <tr>
    <td><div align="right"><strong>Street</strong></div></td>
    <td><input name="street" type="text" id="street" size="40" <?php  if (!empty($street)) echo "value=\"$street\""; ?>>
    <td><div align="right"><strong>Division</strong></div>
    <td><input name="division" type="text" id="division" size="40" <?  if (!empty($division)) echo "value='$division'" ?>>
  </tr>
  <tr>
    <td><div align="right"><strong>County</strong></div></td>
    <td><input name="estate" type="text" id="estate" size="40" <? if (!empty($estate)) echo "value='$estate'" ?>>
    <td><div align="right"><strong> </strong> <strong>Location</strong> </div>
    <td><input name="location" type="text" id="location" size="40" <? if (!empty($location)) echo "value='$location'" ?>>
  </tr>
  <tr>
    <td><div align="right"><strong>City</strong></div></td>
    <td><input name="town" type="text" id="town" size="40" <? if (!empty($town)) echo "value='$town'" ?>>
    <td><div align="right"><strong>Nextel No</strong> </div>
    <td><input name="sublocation" type="text" id="sublocation" size="40" <? if (!empty($sublocation)) echo "value='$sublocation'" ?>>
  </tr>
  <tr>
    <td><div align="right"><strong>Zip Code</strong></div></td>
    <td><input name="padress" type="text" id="padress" size="40" <? if (!empty($postaladdr)) echo "value='$postaladdr'" ?>>
    <td><div align="right"><strong>Phone No</strong></div></td>
    <td><input name="phonenum" type="text" id="phonenum" size="40" <?  if (!empty($phonenum)) echo "value='$phonenum'" ?>>
  </tr>
  <tr>
          <td scope="col">&nbsp;</td>
          <td scope="col">&nbsp;</td>
          <td colspan="2"  scope="col"><div align="right">
            <input type="reset" name="Reset" value="Reset">
            <input type="submit" name="Submit" value="Submit">
			<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=RES" ?>>
          </div></td>
        </tr>

</table>
</form>
<?
 $d->close();
?>
</body>
</html>
Return current item: E-hris