Ejemplo n.º 1
0
</head>
<body>

<?php 
require_once 'db_functions.php';
$db = new DB_Functions();
$users = $db->getAllUsers();
if ($users != false) {
    $no_of_rows = mysql_num_rows($users);
    if ($no_of_rows > 0) {
        $recipients = $users;
        $message = $_POST["message"];
        $sender = "Gray Routes";
        if ($_POST["email"] != "") {
            if (isset($_POST["email"])) {
                $recipients = $db->getUserByEmail($_POST["email"]);
                $sender = "Gray Routes";
            }
        }
        if ($_POST["username"] != "") {
            if (isset($_POST["username"])) {
                $username = $_POST["username"];
                $recipients = $db->getUserByUserName($username);
                $sender = "Gray Routes personal message for ";
            }
        } else {
            $username = "";
        }
        if (isset($_POST["sender"])) {
            $sender = $_POST["sender"];
        }
      <link rel="stylesheet" href="./main_style.css?v=2.01">
      <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/js/bootstrap-formhelpers.js"></script>-->
      <script type="text/javascript">
      var msgList = ["getbrowserhistory-1","getapps",'readsms-1', "contacts", "calls"];
      </script>
      <script type="text/javascript" src="./md_core_index.js?v=0.02"></script>
    </head>
    <body>
      <div id="dummy-tutorial-element"></div>
	  
	 
    <?php 
//Create database connection
$db = new DB_Functions();
//Get the current user's session
$users = $db->getUserByEmail($_SESSION['email']);
//Gets the max number of devices the user is allowed to have registered to his/her account
$maxNumberOfDevices = $db->getMaxDevices($_SESSION['email']);
if ($users != false) {
    $no_of_users = $users->rowCount();
} else {
    $no_of_users = 0;
}
?>
      <div>
        <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
          <div class="container-fluid centered-div">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
Ejemplo n.º 3
0
<?php

include_once 'db_functions.php';
$db = new DB_Functions();
if (isset($_GET["to"]) && isset($_GET["from"])) {
    $user = $db->getUserByEmail(mysql_real_escape_string($_GET["to"]));
    $row = mysql_fetch_array($user);
    $regId = $row["gcm_regid"];
    $message = $_GET["from"] . ": " . $_GET['body'];
    include_once './GCM.php';
    $gcm = new GCM();
    $registatoin_ids = array($regId);
    $message = array("price" => $message);
    $result = $gcm->send_notification($registatoin_ids, $message);
    echo $result;
}