<?php
 ?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie-edge">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/7.12.11/sweetalert2.css">
    <title>BRASMEX - Inversiones</title>
  </head>
  <body>
<?php
$mensaje = htmlentities($_GET['msj']);
$c = htmlentities($_GET['c']);
$p = htmlentities($_GET['p']);
$t = htmlentities($_GET['t']);

switch ($c) {
  case 'cotiza':
    $carpeta = '../../';
    break;
}

switch ($p) {
  case 'cotiza':
    $pagina = 'solicitudes';
    break;
}

$dir = $carpeta.$pagina;

if ($t == "error"){
  $titulo = "Oppss..";
}else{
  $titulo = "Buen trabajo!";
}
 ?>



    <script
      src="http://code.jquery.com/jquery-3.3.1.min.js"
      integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
      crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/7.12.11/sweetalert2.js"></script>
<script>
  swal({
  title: '<?php echo $titulo ?>',
  text: "<?php echo $mensaje ?>",
  type: '<?php echo $t ?>',
  confirmButtonColor: '#3085d6',
  confirmButtonText: 'Ok!'
}).then(function () {
location.href='<?php echo $dir ?>';
});

$(document).click(function() {
  location.href='<?php echo $dir ?>';
});

$(document).keyup(function(e) {
  if (e.which == 27){
    location.href='<?php echo $dir ?>';
  }
});

</script>
  </body>
</html>
