Пример #1
0
<div class="container">
    <article class="row">
        <?php 
if ($userlogin['user_level'] == NV_SADMIN || $userlogin['user_level'] == NV_ADMIN || $userlogin['user_level'] == NV_SOCIOPEDAGOGIA) {
    $log = new Log($userlogin['user_id']);
    $log->RecordLog("Acesso: " . filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_DEFAULT), "Sucesso");
    $UserData = filter_input_array(INPUT_POST, FILTER_DEFAULT);
    $userId = filter_input(INPUT_GET, 'userid', FILTER_VALIDATE_INT);
    if ($UserData && $UserData['SendPostForm']) {
        unset($UserData['SendPostForm']);
        $UserData['user_capa'] = null;
        unset($UserData['confirm_password']);
        require '_models/AdminUser.class.php';
        $cadastra = new AdminUser();
        $cadastra->setUserlevel($userlogin['user_level']);
        $cadastra->ExeUpdate($userId, $UserData);
        $logData = $log->setData($UserData);
        $log->RecordLog("Edição: dados de educador: " . $logData, "Sucesso: " . $cadastra->getError()[0]);
        WSErro($cadastra->getError()[0], $cadastra->getError()[1]);
        extract($UserData);
    } else {
        $ReadUser = new Read();
        $ReadUser->ExeRead(DB_USERS, "WHERE user_id = :userid", "userid={$userId}");
        if ($ReadUser->getResult()) {
            $UserData = $ReadUser->getResult()[0];
            unset($UserData['user_password']);
            extract($UserData);
        }
    }
    $checkCreate = filter_input(INPUT_GET, 'create', FILTER_VALIDATE_BOOLEAN);
    if ($checkCreate && empty($cadastra)) {