Example #1
0
 try {
     $noticias = $cliente->getNews("");
     unset($noticiasS);
     if (is_array($noticias)) {
         if (count($noticias) > 0) {
             foreach ($noticias as $n) {
                 $noticiasS[$n->id] = $n;
             }
         }
     }
 } catch (Exception $e) {
     showAlert($e->getMessage());
     exit(1);
 }
 try {
     $dispositivosS = $cliente->getDispositivos();
 } catch (Exception $e) {
     showAlert($e->getMessage());
     exit(1);
 }
 try {
     $myDispositivosS = $cliente->getMyDispositivos();
 } catch (Exception $e) {
     showAlert($e->getMessage());
     exit(1);
 }
 if (is_array($myDispositivosS)) {
     if (count($myDispositivosS) > 0) {
         //Creamos un vector con los dispositivos del usuario en javascript
         echo "<script type=\"text/javascript\">\n\t\t\t\t\t\tdispositivos = new Array(" . count($myDispositivosS) . ");\n\t\t\t\t\t\ti = 0;";
         //Recorremos todos los dispositivos para ir almacenandolos en el vector