<?php
include_once("../../class/clsConnection.php");
include_once(
"../../class/clsDB.php");
include_once 
"../global.php";
include_once 
"../class/clsTable.php";
include_once 
"../class/clsDepartment.php";
include_once 
"../class/clsPerson.php";
include_once 
"../class/clsWorkGroup.php";
include_once 
"../link/function.php";

$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);

$oDP = new Department($oC);
$oPS = new person($oC);
$oWG = new workGroup($oC);

for(
$r=0;$r<=$countfile;$r++){
        
//echo "$r=".$workGpId[$r]."and".$personId[$r]."<br>";
        
$oPS->SearchByKey($personId[$r]);
        
$oPS->GetRecord();
        
$oPS->Edit();
        
$oPS->personId=$personId[$r];
        
$oPS->deptId=$oPS->deptId;
        
$oPS->workGpId=$workGpId[$r];
        
$oPS->prefixId=$oPS->prefixId;
        
$oPS->fName=$oPS->fName;
        
$oPS->lName=$oPS->lName;
        
$oPS->fStatus=$oPS->fStatus;
        
$oPS->adminId=$oPS->adminId;
        
$oPS->fRetire=$oPS->fRetire;
        
$oPS->Save();
}
echo 
"<meta http-equiv='refresh' content='0; URL=addWorkGroupPs.php?deptId=$deptId'>";
?>