Example #1
0
function admin_Template($pagecontent, $message)
{
    $packJS = get_HtmlHead();
    if (!defined('PLUGINADMIN')) {
        echo '<body class="ui-widget" style="font-size:12px;">' . '<div id="mo-admin-td" class="mo-td-content-width">' . '<noscript><div class="mo-noscript mo-td-content-width ui-state-error ui-corner-all"><div>' . getLanguageValue("error_no_javascript") . '</div></div></noscript>';
        get_Head();
        $border = "";
        if (LOGIN) {
            $border = " mo-ui-tabs";
        }
        echo '<div class="mo-td-content-width ui-tabs ui-widget ui-widget-content ui-corner-all' . $border . '" style="position:relative;">';
        if (LOGIN) {
            get_Tabs();
            echo '<div class="' . ACTION . ' mo-ui-tabs-panel ui-widget-content ui-corner-bottom mo-no-border-top">';
        }
        $menu_fix = "";
        if (is_array($pagecontent)) {
            $menu_fix = '<div id="menu-fix" class="ui-widget ui-widget-content ui-corner-right">' . '<div id="menu-fix-content" class="ui-corner-all">' . $pagecontent[1] . '</div>' . '</div>';
            $pagecontent = $pagecontent[0];
        }
        echo $pagecontent;
        if (LOGIN) {
            echo "</div>";
        }
        echo $menu_fix . "</div>" . '<div class="mo-td-content-width" id="out"></div>';
        if (LOGIN) {
            echo get_Message($message);
        }
        echo '<img class="mo-td-content-width" src="' . ICON_URL_SLICE . '" alt=" " height="1" hspace="0" vspace="0" align="left" border="0" />' . '</div>';
    } else {
        echo '<body class="ui-widget body-pluginadmin" style="font-size:12px;">' . $pagecontent;
        if (LOGIN) {
            echo get_Message($message);
        }
    }
    $javaScriptPacker = new JavaScriptPacker();
    $javaScriptPacker->echoPack($packJS);
    echo "</body></html>";
}
Example #2
0
            //delete all pending messages after sending to SMSSync
            $message_table->update(array('pending' => 0), array('message_id' => $the_msg['message_id']));
        }
        // Send JSON response back to SMSsync
        $response = json_encode(["payload" => ["success" => true, "task" => "send", "secret" => $Secret_Code, "messages" => array_values($msgs)]]);
        write_message_to_file($response);
        send_response($response);
    }
}
function send_response($response)
{
    // Avoid caching
    header("Cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    header("Content-type: application/json; charset=utf-8");
    echo $response;
}
function write_message_to_file($message)
{
    $myFile = "test.txt";
    $fh = fopen($myFile, 'a') or die("can't open file");
    fwrite($fh, $message);
    fclose($fh);
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    get_Message();
} else {
    send_task();
}