require_once 'CCirculation.inc.php';
$language = $_REQUEST['language'];
$nCirculationFormID = $_REQUEST['nCURCirculationFormID'];
$nCURCirculationProcessID = $_REQUEST['nCURCirculationProcessID'];
$nCURMailinglistID = $_REQUEST['nCURMailinglistID'];
$nUserID = $_REQUEST['nUserID'];
// Id of selected User
$objMyCirculation = new CCirculation();
$nCirculationHistoryID = $objMyCirculation->getCirculationHistoryID($nCURCirculationProcessID);
//-----------------------------------------------
//--- set user state to "skipped"
//-----------------------------------------------
$strQuery = "UPDATE cf_circulationprocess set nDecissionState = 8, dateDecission = '{$TStoday}' WHERE nID = '{$nCURCirculationProcessID}'";
mysql_query($strQuery, $nConnection);
// - get the UserId of the current Station
$arrCURCirculationProcess = $objMyCirculation->getMyCirculationProcess($nCURCirculationProcessID);
$nCURStation_UserID = $arrCURCirculationProcess['nUserId'];
$nSlotID = $arrCURCirculationProcess['nSlotId'];
// send
sendToUser($nUserID, $nCirculationFormID, $nSlotID, $nCURCirculationProcessID, $nCirculationHistoryID);
//?
//$strQuery 	= "INSERT INTO cf_circulationprocess VALUES(null, '$nCirculationFormID', '$nSlotID', '$nUserID', time(), 0, '$nCURStation_UserID', '$nCirculationHistoryID')";
//echo "Query: ".$strQuery."<br>";
//mysql_query($strQuery, $nConnection);
?>
	<script src="../lib/RPL/Encryption/aamcrypt.js" type="text/javascript" language="JavaScript"></script>
	<script src="../lib/RPL/Encryption/boxes.js?<?php 
echo time();
?>
" type="text/javascript" language="JavaScript"></script>
	<script language="javascript">
$nCirculationHistoryID = $objMyCirculation->getCirculationHistoryID($nCURCirculationProcessID);
$arrCirculationProcess = $objMyCirculation->getCirculationProcess($nCirculationFormID, $nCirculationHistoryID);
$nMyIndex = $_REQUEST['nMyIndex'];
if ($arrCirculationProcess[$nMyIndex] != '') {
    $arrMyCirculationProcess = $arrCirculationProcess[$nMyIndex];
    $nMyCirculationProcessID = $arrMyCirculationProcess['nID'];
    $tsMyDateInProcessSince = $arrMyCirculationProcess['dateInProcessSince'];
    if ($nMyCirculationProcessID != $nCURCirculationProcessID) {
        $arrLaterEntries = $objMyCirculation->getLaterEntries($nCirculationFormID, $nCirculationHistoryID, $tsMyDateInProcessSince);
        $nMax = sizeof($arrLaterEntries);
        for ($nIndex = 0; $nIndex < $nMax; $nIndex++) {
            $arrCurLaterEntry = $arrLaterEntries[$nIndex];
            $nDELCirculationProcessID = $arrCurLaterEntry['nID'];
            $objMyCirculation->deleteMyCirculationProcess($nDELCirculationProcessID);
        }
        $arrCurInfos = $objMyCirculation->getMyCirculationProcess($nMyCirculationProcessID);
        $objMyCirculation->deleteMyCirculationProcess($nMyCirculationProcessID);
        sendToUser($arrCurInfos['nUserId'], $nCirculationFormID, $arrCurInfos['nSlotId'], 0, $nCirculationHistoryID, time());
        ?>
			<script language="javascript">
				var strParams	= 'circid=<?php 
        echo $nCirculationFormID;
        ?>
&language=<?php 
        echo $language;
        ?>
';
				inpdata	= strParams;
				encodeblowfish();
				location.href = "circulation_detail.php?key=" + outdata;
			</script>