<?php

$idUser = $_REQUEST['id'];
$etapa = $_REQUEST['et'];
$name = '';

if($idUser != 0)
{
    $cnx = new PDO("mysql:host=localhost:3306;dbname=qpsec_SIGPROI","qpsec_usrSIGPROI", "MabeLuis2602");
    
    $sql= "Update users set etapaCuenta=$etapa where id=$idUser";
    $cnx->prepare($sql)->execute();  
    
    $res=$cnx->query("SELECT name FROM users WHERE id=$idUser");

    foreach ($res as $row){
        $name=utf8_encode($row['name']);
    }
    
    header("location: https://sigproi.qps.ec/usuarios?search=$name");
}

?>