<?php
require_once('_conf/globals.php');
require_once('_conf/db_con.php');
$postData = file_get_contents('php://input');
$postData = json_decode($postData);

if($postData){
    $postAction = $postData->action;
}else{
    $postAction = 'Custom';
}

if($postAction == 'getAdminMessage'){
    require_once('stella_core_class.php');
    $core = new StellaCore();
    $core->getAdminMessage();
}

if($postAction == 'sendMessage'){
    require_once('stella_core_class.php');
    $core = new StellaCore();
    $u_email = isset($postData->u_email) && !empty($postData->u_email) ? $postData->u_email : '';
    $u_message = isset($postData->message) && !empty($postData->message) ? $postData->message : '';
    $u_title = isset($postData->title) && !empty($postData->title) ? $postData->title : '';
    $core->sendMessage($u_email, $u_title, $u_message);
}