Beispiel #1
0
function ri_shortcode()
{
    ob_start();
    $messagePackage = ri_form();
    processFormData($messagePackage);
    return ob_get_clean();
}
            case 2:
                //data that isn't collab
                $data[$fieldInfo[0]][$fieldInfo[1]] = $value;
                break;
            case 3:
                //collab
                $data[$fieldInfo[0]][$fieldInfo[1]][$fieldInfo[2]] = $value;
                break;
            default:
                //invalid
                $errors[] = $errorMessages['badForm'];
                break;
        }
    }
}
processFormData($data);
function processFormData($data)
{
    global $con, $insertQueries, $errors, $errorMessages;
    $formType = $data['formType'];
    $entryID = getEntryID($data['initials'], $formType == 'spaceUse');
    for ($i = 1; $i < count($data) - 1; $i++) {
        $space = getSpaceFromData($data, $i);
        if ($formType == "spaceUse" && $space['use']) {
            insertSpaceUse($space, $entryID);
        }
        insertSpaceTraffic($space, $entryID);
    }
}
function getSpaceFromData($data, $spaceID)
{