forked from Claudio/integracao
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.2 KiB
32 lines
1.2 KiB
<?php |
|
include 'IxcSoft.php'; |
|
$ixc = new IxcSoft(); |
|
|
|
$idcliente = $ixc->agi()->get_variable('CODCLIENTE', true); |
|
$unlock = false; |
|
$nomenclatura = $ixc->agi()->get_variable('NOMENCLATURA', true); |
|
$contratos = $ixc->listarContrato($idcliente); |
|
|
|
|
|
foreach ($contratos['registros'] as $item){ |
|
if ($item['status_internet'] == 'CA'){ |
|
$ret_unlock = $ixc->desbloqueiaCliente($item['id']); |
|
if ($ret_unlock['tipo'] == 'sucesso'){ |
|
$unlock = true; |
|
} |
|
}else if ($item['status_internet'] == 'FA'){ |
|
$ret_unlock = $ixc->retirarReducao($item['id']); |
|
if ($ret_unlock['type'] == 'success'){ |
|
$unlock = true; |
|
} |
|
} |
|
} |
|
|
|
if($unlock){ |
|
$redirecionamento_dados = $ixc->db()->redirectUraDestino("REDIR_DESBLOQUEIA_CLIENTE", "SUCESSO", $nomenclatura); //SUCESSO |
|
}else{ |
|
$redirecionamento_dados = $ixc->db()->redirectUraDestino("REDIR_DESBLOQUEIA_CLIENTE", "FALHA", $nomenclatura); //FALHA |
|
} |
|
|
|
$ixc->executarFluxo($redirecionamento_dados["TIPO"], $redirecionamento_dados["NOME"]); |
|
?>
|