Sintaxis
This commit is contained in:
@@ -525,7 +525,7 @@ function aprobar_agencia()
|
||||
$sqlGetAgenciaId = "SELECT SCOPE_IDENTITY() AS id_agencia";
|
||||
$stmtGetAgenciaId = sqlsrv_query($conn, $sqlGetAgenciaId);
|
||||
$agenciaIdRow = sqlsrv_fetch_array($stmtGetAgenciaId, SQLSRV_FETCH_ASSOC);
|
||||
$id_agencia = $idUsuarioRow['id_agencia'] ?? null;
|
||||
$id_agencia = $agenciaIdRow['id_agencia'] ?? null;
|
||||
|
||||
if (!$id_agencia) {
|
||||
die("❌ No se pudo obtener el ID de la agencia recién creada.");
|
||||
@@ -535,9 +535,7 @@ function aprobar_agencia()
|
||||
$sqlInsert2 = "INSERT INTO usuarios_sistema (nombre, email, password_hash, tipo_usuario, activo, creado_en, dos_factores, creado_por)
|
||||
VALUES (?, ?, ?, ?, 1, GETDATE(), 0, ?)
|
||||
";
|
||||
$stmtInsert2 = sqlsrv_query($conn, $sqlInsert, [
|
||||
$admin_name_encrypt, $admin_email_encrypt, $password_hash, $tipo, $usuario_id
|
||||
]);
|
||||
$stmtInsert2 = sqlsrv_query($conn, $sqlInsert, [$admin_name_encrypt, $admin_email_encrypt, $password_hash, $tipo, $usuario_id]);
|
||||
|
||||
if (!$stmtInsert2) {
|
||||
die("❌ Error al crear usuario administrador: " . print_r(sqlsrv_errors(), true));
|
||||
@@ -576,7 +574,8 @@ function aprobar_agencia()
|
||||
SET request_status = 'approved',
|
||||
approval_date = GETDATE(),
|
||||
approved_by = ?
|
||||
WHERE request_id = ?";
|
||||
WHERE request_id = ?
|
||||
";
|
||||
$stmtUpdate = sqlsrv_query($conn, $sqlUpdate, [$usuario_id, $id]);
|
||||
|
||||
if (!$stmtUpdate) {
|
||||
|
||||
Reference in New Issue
Block a user