Ver Mensaje Individual
  #4 (permalink)  
Antiguo 13/11/2016, 10:18
digracom
 
Fecha de Ingreso: mayo-2005
Mensajes: 23
Antigüedad: 19 años
Puntos: 1
Respuesta: Alert() Sencilla por Alert() Elegante

Autorespondido tengo esta
Código PHP:
<?php 
$tipo_p
=inputSeguro($_POST['tipo_p']); 
  if(
$tipo_p==0){ 
        echo 
"<script>alert('Seleccione El tipo de Personal .'); window.location.href=\"index.php\"</script>"
            
session_destroy(); 

?>
Cambie por esto
Código PHP:
<head>
<
script src="sweetalert.min.js"></script>
<script src="sweetalert-dev.js"></script>
<link rel="stylesheet" type="text/css" href="sweetalert.css">
</head> 

if($tipo_p==0){
     echo '<script type="text/javascript">
           setTimeout(function () { 
            swal({
              title: "ERROR!",
              text: "Seleccione El tipo de Personal!",
              type: "error",
              confirmButtonText: "OK"
            },
            function(isConfirm){
              if (isConfirm) {
                window.location.href = "http://localhost:8089/fad/sgcd/";
              }
            }); }, 500);
            
            </script>';
            session_destroy();
    }