Beispiel #1
0
function send_to_alias($data, $alias = array('liudanking'))
{
    $receiver_value = '';
    foreach ($alias as $key => $value) {
        $receiver_value = $receiver_value . $value . ',';
    }
    $title = $data['title'];
    $content = $data['content'];
    dataConnect();
    $sql = "SELECT max(id) from " . DB_TAB . "";
    $result = mysql_query($sql);
    $result = mysql_fetch_array($result);
    $sendno = $result[0] + 1;
    $platform = platform;
    $msg_content = json_encode(array('n_builder_id' => 0, 'n_title' => $title, 'n_content' => $content));
    $obj = new jpush(masterSecret, appkeys);
    $res = $obj->send($sendno, 3, $receiver_value, 1, $msg_content, $platform);
}
Beispiel #2
0
                return false;
            }
		 
        </script>     
    </head>
    <body>
    	<div class="head">
         <h1>Andriod消息推送管理</h1>
         <span><a href="index.php">发送推送消息</a></span>
         <span><a href="index.php?action=pushList">查看发送记录</a></span>
          <hr/>
        </div>    
         <?php 
include_once 'config.inc.php';
include_once 'db.class.php';
dataConnect();
$sql = "SELECT * FROM " . DB_TAB . " ORDER BY `created` DESC";
$users = mysql_query($sql);
//$info1 = mysql_fetch_row($users);
//print_r($info1);
if ($users != false) {
    $no_of_users = mysql_num_rows($users);
} else {
    $no_of_users = 0;
}
switch ($_REQUEST['action']) {
    case 'pushList':
        ?>
      			<div class="container list">            
				 <ul class="devices">
                 <p style="font-weight:bold; color:#06F;"><span>序号</span><span style="width:150px;">发送时间</span><span style="width:400px;">消息内容</span><span>发送结果</span><span>满足条件</span><span>推送成功</span></p>