Ejemplo n.º 1
0
<?php

ob_start();
define('INCLUDES', '/includes');
define('ABSPATH', realpath(dirname(__FILE__) . '/../'));
require ABSPATH . INCLUDES . '/basic-load.php';
if (!$BLOCK) {
    require ABSPATH . '/' . ADMIN . INCLUDES . '/admin-load.php';
    require ABSPATH . INCLUDES . '/basic-doit.php';
} else {
    redirect(BASE_URL);
}
$out = ob_get_clean();
echo str_insert('output-messages">', get_output_result_messages(), $out);
Ejemplo n.º 2
0
function ajax_make_res($param = 'success', $body = '', $title = '', $data = '', $error = false)
{
    $custom = array('status' => '', 'body' => $body, 'title' => $title, 'data' => $data, 'error' => $error);
    if (is_merged($param)) {
        $custom = set_merge($custom, $param);
    } else {
        $custom['status'] = $param;
    }
    if ($custom['error']) {
        $custom['body'] .= get_output_result_messages('error', true);
    }
    unset($custom['error']);
    return json_val_encode($custom);
}