$(document).ready(function () {
    
    $.post("API.php", { dashboard: "SUBSCRIPTION_TYPE"}, function (data) {
        if(data.response){
            plan_type = data.subscription_type;
            alert(plan_type);

            $("#id-benefits-title").html("Benefits - " + plan_type + " Level");
            
            if(plan_type != "Innovator"){
                document.getElementById("id-online-courses").style.display = "none";
            }
        }
    },"json");

    $.post("API.php",{project: "LIST"}, function(data){
        PROJECT_LIST = data;

        console.log(JSON.stringify(PROJECT_LIST));
        var listView=document.createElement('ol');
        for(i =0 ; i<PROJECT_LIST.length; i++){
            var list  = document.createElement('li');
            var listViewItem=document.createElement('a');
            list.style.cssText = "margin: 20px 0;";
            listViewItem.appendChild(document.createTextNode(PROJECT_LIST[i].project_title));
            listViewItem.href = "print_solutions.php?id=" + PROJECT_LIST[i].project_id;
            list.append(listViewItem);
            listView.appendChild(list)
        }
        document.getElementById("project-list-id").appendChild(listView);
        document.getElementById("project-list-id").style()
    },"json");
});;