<?php
 include('modules/gcm/view/include.php');
 
 
 
 
 $msg=false;
 $msgIns=false;
 
 
 
 

?>

<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>
 
<form action="" method="post" name="frm1">
    <table width="803" height="48" border="0">
        <tr>
            <td>Inicio: <input type="date" name="start" id="start" required/></td>
            <td>Fin: <input type="date" name="end" id="end" required/></td>
            <td><input type="submit" value="Enviar" class="btn_submit"/></td>
        </tr>
    </table>
</form>
<?php
    if($_POST)
    {
        $start = $obj->postVars('start');
        $end = $obj->postVars('end');
        
        ?>
        <table>
            <tr>
                <th>ID</th>
                <th>Fecha</th>
                <th>LOG</th>
                <th>Token</th>
                <th>Titulo</th>
                <th>Mensaje</th>
            </tr>
            <?php
                $row = $obj->getGcmLogs($start, $end);
                if(count($row)>0)
                {
                    foreach($row as $row)
                    {
                        ?>
                        <tr>
                            <td><?php echo $row['gcml_id']?></td>
                            <td><?php echo $row['gcml_date']?></td>
                            <td><?php echo $row['gcml_log']?></td>
                            <td><?php echo $row['gcml_token']?></td>
                            <td><?php echo $row['gcml_title']?></td>
                            <td><?php echo $row['gcml_msg']?></td>
                        </tr>
                        <?php
                    }
                }
            ?>
        </table>
        <?php
    }
?>

</div>
