File: /var/www/doco/keytest/wp-content/themes/ormedia/keyAlertData/testing/u_testing.php
<?php
if (isset($_REQUEST['checking_api_file'])){
exit();
}
error_reporting(E_ALL);
ini_set('display_errors', 1);
$title = $_REQUEST['title'];
$content = $_REQUEST['content'];
$cat = $_REQUEST['cat'];
$cat = empty($cat)?0:$cat;
if(empty($title)||empty($content)){
$rv->rc = -1;
$rv->msg = "missing params";
}else{
$id = c_alert($title,$content,$cat);
$alert = r_alert($id);
$push_id = get_push_id_by_cat($cat);
$res = send_alert($alert,$push_id);
if($res){
$rv->rc = 1;
$rv->msg ="success";
}else{
$rv->rc = -2;
$rv->msg ="failed to push a message";
}
}
echo json_encode($rv);
?>