<?php $__env->startSection('title', 'Dashboard'); ?>

    

<?php $__env->startSection('content'); ?>



<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>



<br>



<div class="row g-3">    

    <div class="col">

        <?php

        $auth_basic = base64_encode("ventas@sydesoft.cl:4Fh51RXrD8hh");



        $curl = curl_init();

        

        $telefono1 = "56972177378";

        $telefono2 = "56965095650";

         //$telefono3 = "56962497598"; 

        

         $telefono4 = "56992820117";

         $telefono5 = "56956906947";

         $telefono6 = "56998703494";

         $telefono7 = "56941701966";

        

         $telefono1 = "56934477175";

         $telefono2 = "56962497598";

         $telefono3 = "56978994637";

         $telefono4 = "56984847283";

         $telefono5 = "56965095650";

         $telefono6 = "56991589465";

         $telefono7 = "56934477175";

         $telefono8 = "56972177378";

     //   for($i=0;$i<count($contacts);$i++){


        curl_setopt_array($curl, array(

          CURLOPT_URL => "https://api.labsmobile.com/json/send",

          CURLOPT_RETURNTRANSFER => true,

          CURLOPT_ENCODING => "",

          CURLOPT_MAXREDIRS => 10,

          CURLOPT_TIMEOUT => 30,

          CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,

          CURLOPT_CUSTOMREQUEST => "POST",

          //CURLOPT_POSTFIELDS => '{"message":"¡ADVERTENCIA! \n \nVulneración de Seguridad en FAENA TRÁNSITO! \nPersonal de Seguridad en Peligro!", "tpoa":"Sender","recipient":[{"msisdn":"'.$contactos[0][4].'"},{"msisdn":"'.$contactos[1][4].'"}]}',

          //CURLOPT_POSTFIELDS => '{"message":"¡ADVERTENCIA DE EMERGENCIA! \n \nGUARDIA DE SEGURIDAD EN PELIGRO! \nRecinto Vulnerado!", "tpoa":"Sender","recipient":[{"msisdn":"'.$telefono8.'"}]}', 

      CURLOPT_POSTFIELDS => '{"message":"¡ADVERTENCIA DE EMERGENCIA! \n \nGUARDIA DE SEGURIDAD EN PELIGRO! \nRecinto Vulnerado!", "tpoa":"Sender","recipient":[{"msisdn":"'.$telefono1.'"},{"msisdn":"'.$telefono2.'"},{"msisdn":"'.$telefono4.'"},{"msisdn":"'.$telefono5.'"},{"msisdn":"'.$telefono3.'"},{"msisdn":"'.$telefono6.'"},{"msisdn":"'.$telefono7.'"},{"msisdn":"'.$telefono8.'"}]}', 

          CURLOPT_HTTPHEADER => array(

            "Authorization: Basic ".$auth_basic,

            "Cache-Control: no-cache",

            "Content-Type: application/json"

          ),

        ));

        

        $response = curl_exec($curl);

        $err = curl_error($curl);

        

        curl_close($curl);

        

        if ($err) {

          echo "cURL Error #:" . $err;

        } else {

          //echo "Enviadas";

         ?>
            <form action="<?php echo e(route('empleado.dashboard')); ?>" method="GET" id="autoForm">
            <?php echo csrf_field(); ?>
        </form>

      <script>
          window.addEventListener('DOMContentLoaded', () => {
              document.getElementById('autoForm').submit();
          });
      </script>
              <?php

   //     }

      }

        ?>

    </div>

</div>
<?php echo $__env->make('layouts.dashboard', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/ofertasv/public_html/botondepanico/resources/views/enviar_alertas/sms.blade.php ENDPATH**/ ?>