コード例 #1
0
ファイル: update.php プロジェクト: adrianosilvareis/intranet
<div class="content form_create">

    <article>

        <h1>Atualizar Usuário!</h1>

        <?php 
$ClienteData = filter_input_array(INPUT_POST, FILTER_DEFAULT);
$User = filter_input(INPUT_GET, 'users', FILTER_VALIDATE_INT);
if ($ClienteData && $ClienteData['SendPostForm']) {
    unset($ClienteData['SendPostForm']);
    require_once '_models/AdminUsers.class.php';
    $AdminUsers = new AdminUsers();
    $AdminUsers->ExeUpdate($User, $ClienteData);
    WSErro($AdminUsers->getError()[0], $AdminUsers->getError()[1]);
} else {
    $Read = new WsUsers();
    $Read->setUser_id($User);
    $Read->Execute()->Query("#user_id#");
    if ($Read->Execute()->getResult()) {
        $ClienteData = (array) $Read->Execute()->getResult()[0];
        unset($ClienteData['user_password']);
    }
}
$checkCreate = filter_input(INPUT_GET, 'create', FILTER_VALIDATE_BOOLEAN);
if ($checkCreate && empty($AdminUsers)) {
    WSErro("O Usuário <b>{$ClienteData['user_name']}</b> foi cadastrado com sucesso no sistema!", WS_ACCEPT);
}
?>

        <form action = "" method = "post" name = "UserCreateForm">
コード例 #2
0
, atualize seu perfíl!</h1>

        <?php 
$ClienteData = filter_input_array(INPUT_POST, FILTER_DEFAULT);
$UserId = $_SESSION['userlogin']['user_id'];
if ($ClienteData && $ClienteData['SendPostForm']) {
    unset($ClienteData['SendPostForm']);
    extract($ClienteData);
    require '_models/AdminUsers.class.php';
    $cadastra = new AdminUsers();
    $ClienteData['user_level'] = null;
    $cadastra->ExeUpdate($UserId, $ClienteData);
    if ($cadastra->getResult()) {
        WSErro("Seus dados foram atualizados com sucesso! <i>O sistema será atualizado no próximo login!!!</i>", WS_ACCEPT);
    } else {
        WSErro($cadastra->getError()[0], $cadastra->getError()[1]);
    }
} else {
    extract($_SESSION['userlogin']);
}
?>

        <form action = "" method = "post" name = "UserEditForm">

            <label class="label">
                <span class="field">Nome:</span>
                <input
                    type = "text"
                    name = "user_name"
                    value = "<?php 
echo $user_name;