예제 #1
0
$eMode = array_key_exists('emode', $_REQUEST) ? $_REQUEST['emode'] : 0;
$isEditor = 0;
if ($symbUid && $collId) {
    if ($isAdmin || array_key_exists("CollAdmin", $userRights) && in_array($collId, $userRights["CollAdmin"]) || array_key_exists("CollEditor", $userRights) && in_array($collId, $userRights["CollEditor"])) {
        $isEditor = 1;
    }
}
$loanManager = new SpecLoans();
if ($collId) {
    $loanManager->setCollId($collId);
}
$statusStr = '';
if ($isEditor) {
    if ($formSubmit) {
        if ($formSubmit == 'Create Loan Out') {
            $statusStr = $loanManager->createNewLoanOut($_POST);
            $loanId = $loanManager->getLoanId();
            $loanType = 'out';
        } elseif ($formSubmit == 'Create Loan In') {
            $statusStr = $loanManager->createNewLoanIn($_POST);
            $loanId = $loanManager->getLoanId();
            $loanType = 'in';
        } elseif ($formSubmit == 'Create Exchange') {
            $statusStr = $loanManager->createNewExchange($_POST);
            $exchangeId = $loanManager->getExchangeId();
            $loanType = 'exchange';
        } elseif ($formSubmit == 'Save Exchange') {
            $statusStr = $loanManager->editExchange($_POST);
            $loanType = 'exchange';
        } elseif ($formSubmit == 'Save Outgoing') {
            $statusStr = $loanManager->editLoanOut($_POST);