<?php
 include('modules/gcm/view/include.php');

 if($obj->getVars('actionDel') == 'true')
 {
     $id = $obj->getVars('id');
     $obj->delGcmQueue($id);
 }


?>

<div class="widget3">
 <div class="widgetlegend">Apps Push notifications </div>
 <?php
  if($msg)
  {
  ?>
   <div class="ui-widget">
	<div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
		<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
		 <?php echo $result?></p>
	</div>
</div>
  <?
  }
 ?>
<p style="width:100">
	<a href="<?php $_SERVER['PHP_SELF'];?>?p=modules/gcm/view/index.php" class="btn_normal" style="float:left; margin:5px;">Volver </a>
</p>
 
<table>
            <tr>
                <th>ID</th>
                <th>Fecha</th>
                <th>Titulo</th>
                <th>Mensaje</th>
                <th>Estado</th>
                <th>Usuarios notificados</th>
                <th>Usuarios sin notificar</th>
                <th>Acciones</th>
                
            </tr>
            <?php
                $row = $obj->getGcmQueue();
                if(count($row)>0)
                {
                    foreach($row as $row)
                    {
                        ?>
                        <tr>
                            <td><?php echo $row['gcmq_id']?></td>
                            <td><?php echo $row['gcmq_date']?></td>
                            <td><?php echo $row['gcmq_title']?></td>
                            <td><?php echo $row['gcmq_message']?></td>
                            <td>
                                <?php 
                                    if($row['gcmq_status'] == '1')
                                    {
                                        ?>
                                        <i class="fa fa-circle" style="color: #0f0"></i>
                                        <?php
                                    }
                                    else
                                    {
                                        ?>
                                        <i class="fa fa-circle" style="color: #f00"></i>
                                        <?php
                                    }
                                ?>
                            </td>
                            <td><?php echo $obj->getGcmQueueUsers(0)?></td>
                            <td><?php echo $obj->getGcmQueueUsers(1)?></td>
                            <td><a href="<?php $_SERVER['PHP_SELF'];?>?p=modules/gcm/view/showQueue.php&id=<?php echo $row['gcmq_id']?>&actionDel=true" class="btn_borrar">Eliminar </a></td>
                        </tr>
                        <?php
                    }
                }
            ?>
        </table>

</div>
