<?php
include_once "../info/infosys_global.php";
include_once 
"../class/clsConnection.php";
include_once 
"../class/clsDB.php";
include_once 
"../ums/clsUmUser.php";
include_once 
"../ums/clsUmUserGroup.php";

$fn = (! isset($_GET['fn'])? "" $_GET['fn']);
$psId = (! isset($_GET['psId'])? "" $_GET['psId']);
$gpId = (! isset($_GET['gpId'])? "" $_GET['gpId']);

// ********** START KK, IIS **********
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_UMS'], $GLOBALS['DBUSER_UMS'], $GLOBALS['DBPASS_UMS']);

// ********** END KK, IIS **********


$oUs = new umuser($oC);
$oUg = new umusergroup($oC);

if(
$fn == "psStGpId2ndex") {
    
$oUs->SearchByPersonID($psId);
    if(
$oUs->GetRecord()) {
        
$nGpArr = array(10 => 011 => 012 => 013 => 014 => 015 => 0101 => 0);
        
$gpArr = array();
        
$i 0;
        
$oUg->RSgroupByUs($oUs->UsID"UgGpID");
        while(
$oUg->GetRecord()) {
            if(!isset(
$nGpArr[$oUg->UgGpID])) {
                
$gpArr[$oUg->UgGpID] = $i;

                
$i++;
            }
        }

        echo 
$gpArr[$gpId];
    }
    else
        echo 
"";
}
?>