Exemplo n.º 1
0
/**
 * Footer Information
 *
 * @since Create 0.2
 */
function create_footer_info()
{
    ?>
	<div class="site-info">
		<?php 
    create_copyright();
    ?>
		<?php 
    create_seperator();
    ?>
		<?php 
    create_profile();
    ?>
	</div><!-- .site-info -->
	
<?php 
}
Exemplo n.º 2
0
require_once 'function/data_holder.php';
require_once 'includes/output.html.php';
require_once 'database/connection.php';
// get old location from user.
define("route", "http://localhost.com/ajax_loader");
$conn = connection();
add_header("Home");
if (!$conn) {
    echo "Could not establish connection to database.";
    exit;
}
if (isset($_SESSION['valid_user'])) {
    $sql = " SELECT email, active FROM users WHERE email = '" . $_SESSION['valid_user'] . "'";
    $result = $conn->query($sql);
    if (!$result) {
        echo "connection to the database couldn't be establish";
        exit;
    }
    while ($row = $result->fetch_assoc()) {
        extract($row);
        if ($active == 0) {
            user_active();
            break;
        }
    }
    if (!check_profile()) {
        create_profile();
    }
} else {
    header("Location:login.php");
}
//====================================================================================
global $l;
if (!AJAX) {
    require_once 'views/users_views.php';
    require_once 'views/profile_create_form.php';
    show_users_left_menu('ms_add_profile');
    echo '<div class="right-content">';
    if (!is_writable(DOCUMENT_REAL_ROOT . '/config/profiles')) {
        msg_error($l->g(2116));
    } else {
        show_profile_create_form();
    }
    echo '</div>';
} else {
    require_once 'lib/profile_functions.php';
    if (!is_writable(DOCUMENT_REAL_ROOT . '/config/profiles')) {
        $response = array('status' => 'error', 'message' => $l->g(2116));
    } else {
        if ($errors = validate_profile_create_form($_POST)) {
            $response = array('status' => 'error', 'message' => $l->g(1404), 'errors' => $errors);
        } else {
            if ($profile_id = create_profile($_POST)) {
                $response = array('status' => 'success', 'message' => $l->g(1405), 'profile_id' => $profile_id);
            } else {
                $response = array('status' => 'error', 'message' => $l->g(1406));
            }
        }
    }
    header('Content-type: application/json');
    echo json_encode($response);
}