<?php 
include_once 'Framework.php';
class Options extends Framework {
    /* Save page layout data (page layout, copyright, top menu) */
    public function save_page() {
        update_option($this->prefix.'acc_info',$_POST);
        echo "<script>window.location = 'themes.php?page=theme_options&sub_page=options';</script>";
    }
    
    /* Get page layout data */
    public function get_page_data() {
        return get_option($this->prefix.'acc_info');
    }
 
    /* Get shop data */
    public function get_shop_setup_data() {
        return get_option($this->prefix.'shop_setup');
    }
    /* Save page setup data (error, blog, portfolio page) */
    public function save_page_setup() { 
        update_option($this->prefix.'page_setup',$_POST);
        update_option('anps_vc_legacy',$_POST['anps_vc_legacy']);
        echo "<script>window.location = 'themes.php?page=theme_options&sub_page=options_page_setup';</script>";
    }
    
    /* Get page setup data */
    public function get_page_setup_data() {
        return get_option($this->prefix.'page_setup');
    }
    
    /* Save social account data */
    public function save_social() {
        update_option($this->prefix.'social_info', $_POST);
        echo "<script>window.location = 'themes.php?page=theme_options&sub_page=options_social_accounts';</script>";
    }
    
    /* Save page setup data (error, blog, portfolio page) */
    public function save_shop_setup() {
        $anps_page_data = $this->get_shop_setup_data(); 
        update_option($this->prefix.'shop_setup',$_POST);
        echo "<script>window.location = 'themes.php?page=theme_options&sub_page=shop_settings';</script>";
    }
    
    /* Get social account data */
    public function get_social() {
        return get_option($this->prefix."social_info");     
    }
    
    /* Save media*/
    public function save_media() {
        update_option($this->prefix.'media_info', $_POST);
        echo "<script>window.location = 'themes.php?page=theme_options&sub_page=options_media';</script>";
    }
    
    /* Get media */
    public function get_media() {
        return get_option($this->prefix.'media_info');
    }
}
$options = new Options();