$location = $_POST['location'];
        add_hardware($id, $type, $model, $status, $description, $location);
        break;
    case 'Edit Hardware':
        $id = $_POST['id'];
        $type = $_POST['type'];
        $model = $_POST['model'];
        $status = $_POST['status'];
        $description = $_POST['description'];
        $location = $_POST['location'];
        edit_hardware($id, $type, $model, $status, $description, $location);
        break;
    case 'Delete Hardware':
        $id = $_POST['id'];
        delete_hardware($id);
        break;
    case 'Edit Account':
        $user = $_POST['user'];
        $email = $_POST['email'];
        $password = password_hash($_POST['password'], PASSWORD_DEFAULT);
        edit_account($user, $email, $password);
        break;
    case 'Delete Account':
        $user = $_POST['user'];
        $email = $_POST['email'];
        $hash = get_hash($user, $email);
        if (password_verify($_POST['password'], $hash)) {
            delete_account($user, $email);
        }
        break;
}
Example #2
0
                $edit = true;
                $gender_cc = array('' => 'Selecione', 'M' => 'Masculino', 'F' => 'Feminino');
            } else {
                $resultado = $conta;
            }
        }
    }
    if (!empty($_POST) and isset($_POST['edit-account'])) {
        $id = str_replace($letters, "", $_POST["edit-account_id"]);
        $sex = str_replace($letters, "", $_POST["editsex"]);
        $pass = str_replace($letters, "", $_POST["edituser_pass"]);
        $login = str_replace($letters, "", $_POST["edituserid"]);
        $level = str_replace($letters, "", $_POST["editlevel"]);
        $mail = str_replace($letters, "", $_POST["editemail"]);
        $date = str_replace($letters, "", $_POST["editdate"]);
        $resultado = edit_account($con, $id, $sex, $pass, $login, $level, $mail, $date);
    }
}
?>

<form action="" name="proc-edit-account" method="POST" class="generic-form form-search-acc proc-edit-account">
	<input type="hidden" name="aba" value="5">
    <label>
        <span class='label-content'>Digite ACC ID :</span>
        <input type="search" class="ipt ipt-num" name="buscamarota" value='' id="buscamarota" required="required" placeholder="Procurar...">
        <input type="submit" name="proc-edit-account" class="btn proc-edit-account" value="Procurar">
    </label>
</form>
<hr>
<div class="form-editar">
	<form action='' name='edit-account' class='generic-form edit-char' method='post'>