            %%[[if preview]]%%
            <span>preview</span>
        %%[[endif]]%%
%%[[if publish]]%%
    <?php
     if (strlen(session_id()) < 1) {
session_start();
}
require '%relativeSiteAssetPath%/sc_assets/Database.php';
require '%relativeSiteAssetPath%/sc_assets/Post.php';
$_SESSION['db_name'] = '%relativeSiteAssetPath%/sc_assets/db/calendar.db';

        //passing record id in url
        if(isset($_GET['cid'])) {
            $myid = $_GET['cid'];
            } else {
                 _log('Retreive Record: No Record ID Was Passed');
                   
                    }
                    
                    // Instantiate DB & connect
                     $database = new Database();
                     $db = $database->connect();

                     // Instantiate post object
                     $post = new Post($db);
                      $query = "SELECT * FROM  `events2` WHERE `id` =  ' $myid' ";
                        _log('Retreive Query is:'.$query);

                    $stmt = $db->prepare($query);

                            $stmt->execute();
                                $fetch = $stmt->fetch();
        
        ?>
%%[[endif]]%%
