Exemplo n.º 1
0
            var_dump($main_db->last_query);
            exit;
        }
    } else {
        if ($post->insert_posts($data)) {
            $session->message("Your tab has been created!");
            safe_redirect(admin_url('new-post') . '?post=tab&id=' . $main_db->insert_id);
        } else {
            var_dump($main_db->last_query);
            exit;
        }
    }
}
$current_post = NULL;
if (isset($_GET['id'])) {
    $current_post = $post->get_post_by_id($_GET['id']);
}
$allPosts = $post->get_post_by('address');
?>

<div class="row main-content special">

    <div class="col-md-8 col-md-offset-1">
        <h3 class="title"> <i class="fa fa-toggle-on"></i> <?php 
echo isset($_GET['id']) ? 'Update Tab' : 'Create A New Tab';
?>
            <?php 
if (isset($_GET['id'])) {
    ?>
                <a class="control" href="<?php 
    echo admin_url('new-post');
function delete_media()
{
    $post = new posts();
    global $main_db, $session;
    if (isset($_POST['action'])) {
        $file = $post->get_post_by_id($_POST['id']);
        unlink(UPLOAD_DIR . $file->post_content);
        if ($post->delete_post($_POST['id'])) {
            echo 'yes';
            $session->message('Your media has been deleted');
        } else {
            echo $main_db->last_query;
        }
    }
}