account_tab_key);
if(isset($_POST['selfpushoptions']) && !empty($_POST['selfpushoptions'])){
$postid = $_POST['selfpushoptions'];
$disableBulkSend = $accountOptions[pw_mobile_app_settings::$disableBulkSend];
//echo "Bulk Send'".!($disableBulkSend == 1)."'";
if(isset($_POST['immediate']) && $_POST['immediate'] == '1'){
_e('Push notification Logs','androapp');
echo "
";
require_once PW_MOBILE_PATH.'gcm/send_message.php';
sendPushNotification(array("post_id" => $postid, "title" => "New Post $postid", "notification_type" => "stack"),
$accountOptions[ANDROAPP_GCM_API_KEY], !($disableBulkSend == 1));
echo " ";
}else{
$this->schedule_push_notification($postid, "New post $postid", $accountOptions[ANDROAPP_GCM_API_KEY],
!($disableBulkSend == 1));
$this->show_success_message("Scheduled Push Notification");
}
}
?>
prefix . 'androapp_stats';
$time = "7days";
if(isset($_GET['time'])){
$time = $_GET['time'];
}
$date = date('Y-m-d', strtotime('-6 days'));
$date .= " 00:00:00";
$todate = null;
$last7days = "".
__('Last 7 Days','androapp')."";
$thismonth = "".
__('This Month','androapp')."";
$lastmonth = "".
__('Last Month','androapp')."";
$alltime = "".
__('All Time','androapp')."";
if(empty($time) || $time == "7days"){
$last7days = "".__('Last 7 Days','androapp')."";
}
if($time == "currentmonth"){
$m = date('m');
$y = date('Y');
$date = $y."-".$m."-01 00:00:00";
$thismonth = "".__('This Month','androapp')."";
}else if($time == 'lastmonth'){
$m = date('m');
$y = date('Y');
$todate = $y."-".$m."-01 00:00:00";
$m = intval($m) - 1;
if($m == 0){
$m = 12;
}
if($m < 10){
$m = "0".strval($m);
}else{
$m = strval($m);
}
$date = $y."-".$m."-01 00:00:00";
$lastmonth = "".__('Last Month','androapp')."";
}else if($time == 'alltime'){
$date = null;
$alltime = "".__('All Time','androapp')."";
}
$query = "SELECT * FROM $stats_table";
if(!empty($date)){
$query .= " where created_at > '$date'";
}
if(!empty($todate)){
$query.= " and created_at < '$todate'";
}
//echo "Query ".$query;
$result = $wpdb->get_results($query);
//echo ""; print_r($result); echo "
";
echo $last7days . $thismonth . $lastmonth.$alltime;
if(empty($result)){
echo "".__('No Records found for the duration','androapp')." ";
}else{
?>
|
|
|
* |
|
|
|
|
|
$row->title | $row->created_at | $row->eligible | ";
echo "$row->bulk_sent | $row->success | $row->notRegistered | $row->mismatchsenderid | $row->other | $row->status | ";
}
?>
*Bulk Sent might not reflect the exact send count as it does not take care of un-installs and other errors.