');
var post = 'ids=' + ids;
$.post('act_invemail_anyone.php', post, function(data) {
$("div#responce_invemail_anyone").html(data);
});
}
});
}
// ==================== Course Invitation email to existing trainees =================================
function form_trainer_create_course()
{
$('#trainer_Coursecreate').on('click', function() {
$("div#responce_trainer_create_course").html(" Opslaan van gegevens, even geduld ...");
var CTitle = encodeURIComponent($('input#CTitle').val());
var CDesc = encodeURIComponent($('textarea#CDesc').val());
var CLevel = $('select#CLevel').val();
var post='CTitle='+CTitle+ '&CDesc=' + CDesc + '&CLevel=' + CLevel;
$.post('act_step02_trainer_createCourse.php', post, function(data) {
$("div#responce_trainer_create_course").html(data);
});
});
}
// ==================== Trainer Billing information form =================================
function form_billinginfo()
{
$('#trainer_billing').on('click', function() {
$("div#responce_trainer_personalinfo").html(" Opslaan van gegevens, even geduld ...");
var amount = $('input#amount').val();
var pkg_id = $('input#pkg_id').val();
var pkg_name = $('input#pkg_name').val();
var FullName = $('input#FullName').val();
var email = $('input#email').val();
var bill_desc = $('input#bill_desc').val();
var tele_no = $('input#tele_no').val();
var country_code = $("#country option:selected").val();
var country_text = $("#country option:selected").text();
var post='FullName=' + FullName +'&tele_no=' + tele_no +'&amount=' + amount +'&bill_desc=' + bill_desc +'&country_code=' + country_code + '&country_text=' + country_text +'&email=' + email + '&pkg_id=' + pkg_id + '&pkg_name=' + pkg_name ;
$.post('act_billingInfo.php', post, function(data) {
$("div#responce_trainer_personalinfo").html(data);
});
});
}
// ==================== Trainer personal information form =================================
function form_trainer_personalinfo()
{
$('#trainer_personal').on('click', function() {
$("div#responce_trainer_personalinfo").html(" Opslaan van gegevens, even geduld ...");
var inst_name = $('input#inst_name').val();
var FullName = $('input#FullName').val();
var email = $('input#email').val();
var WebsiteAdd = $('input#WebsiteAdd').val();
var tele_no = $('input#tele_no').val();
var st_add = encodeURIComponent($('input#st_add').val());
var zip_code = $('input#zip_code').val();
var city = $('input#city').val();
var state = $('input#state').val();
var country_code = $("#country option:selected").val();
var country_text = $("#country option:selected").text();
var post='U_name=' + U_name +'&inst_name=' + inst_name +'&FullName=' + FullName +'&tele_no=' + tele_no +'&st_add=' + st_add +'&zip_code=' + zip_code +'&city=' + city +'&state=' + state +'&country_code=' + country_code + '&country_text=' + country_text +'&WebsiteAdd=' + WebsiteAdd + '&email=' + email;
$.post('act_trainerPersonalinfoRashid.php', post, function(data) {
$("div#responce_trainer_personalinfo").html(data);
});
});
}
//=============== Trainer Change Password =====================================
function form_trainer_personalinfo_changepassword()
{
$('#trainer_personal_changepwd').on('click', function() {
$("div#responce_trainer_password").html(" Opslaan van gegevens, even geduld ...");
var U_name = $('input#U_name').val();
var old_pwd = $('input#old_pwd').val();
var pwd_1 = $('input#pwd_1').val();
var pwd_2 = $('input#pwd_2').val();
var post='U_name=' + U_name + '&old_pwd=' + old_pwd + '&pwd_1=' + pwd_1 + '&pwd_2=' + pwd_2 ;
$.post('act_trainerPersonalPwd.php', post, function(data) {
$("div#responce_trainer_password").html(data);
});
});
}
// ==================== Trainer course updating =================================
function form_trainer_course()
{
$('#trainer_Coursesend').on('click', function() {
var CTitle = encodeURIComponent($('input#CTitle').val());
var CDesc = encodeURIComponent($('textarea#CDesc').val());
var CDesc_arabic = encodeURIComponent($('textarea#CDesc-arabic').val());
var CCreator = $('input#CCreator').val();
var CEmail = $('input#CEmail').val();
var CFree = $('input#CFree').val();
var Clevel = $("#Clevel option:selected").val();
var CType = $("#CType option:selected").val();
var cCurrency_code = $("#cCurrency option:selected").val();
var cCurrency_text = $("#cCurrency option:selected").text();
var cAssignedTo = $("#cAssignedTo option:selected").val();
var CType = $("#CType option:selected").val();
var Cduration = $('input#Cduration').val();
var Dtype = $("#Dtype option:selected").val();
var CRequirement = $('textarea#CRequirement').val();
var LDesc = encodeURIComponent(CKEDITOR.instances['LDesc'].getData());
// var LDesc = CKEDITOR.instances['LDesc'].getData();
var LDesc_arabic = encodeURIComponent(CKEDITOR.instances['LDesc-arabic'].getData());
var post='CTitle=' + CTitle + '&CDesc=' + CDesc + '&CDesc_arabic=' + CDesc_arabic + '&CFree=' + CFree +'&Clevel=' + Clevel +'&cCurrency_code=' + cCurrency_code +'&cCurrency_text='+ cCurrency_text +'&CType=' + CType +'&Cduration=' + Cduration +'&Dtype=' + Dtype +'&LDesc=' + LDesc + '&LDesc_arabic=' + LDesc_arabic +'&CRequirement=' + CRequirement +'&CCreator=' + CCreator + '&CEmail=' + CEmail + '&cAssignedTo=' + cAssignedTo + '&dt=' + (new Date()).getTime();
// alert (LDesc);
// return false;
$.post('Post_course_trainer.php', post, function(data) {
$("div#responce_trainer_course").html(data);
});
});
$('a#btn-save-course-form').on('click', function() {
var cvForm = $('select#cv-form option:selected').val();
var post = 'cvForm=' + cvForm + '&dt=' + (new Date()).getTime();
// alert (LDesc);
// return false;
$.post('act_SaveCourseFormSelection.php', post, function(data) {
$("div#response-course-form").html(data);
});
});
}
// ==================== Trainer Page =================================
function form_trainer_page()
{
$("#folder_name").change(function(){
$("#message").html(" Controleren ...");
var d_folder=$("#folder_name").val();
$.ajax({
type:"post",
url:"check_domainFolder.php",
data:"d_folder="+d_folder,
success:function(data){
if(data==0){
$("#message").html("beschikbaar");
}
else{
$("#message").html("niet beschikbaar");
}
}
});
});
}
// ==================== Trainer signup =================================
function form_trainer_signup()
{
$("#U_name").change(function(){
$("#message").html(" Controleren ...");
var username = $("#U_name").val();
$.ajax({
type:"post",
url:"check_username.php",
data:"username="+username,
success:function(data){
if(data==0){
$("#message").html("beschikbaar");
}
else{
$("#message").html("niet beschikbaar");
}
}
});
});
$('#trainer_send').on('click', function() {
$("div#responce").html(" Opslaan van gegevens, even geduld ...");
var U_name = $('input#U_name').val();
var pwd_1 = $('input#pwd_1').val();
var pwd_2 = $('input#pwd_2').val();
var FullName = $('input#FullName').val();
var email = $('input#email').val();
var WebsiteAdd = $('input#WebsiteAdd').val();
var post='U_name=' + U_name + '&pwd_1=' + pwd_1 + '&pwd_2=' + pwd_2 + '&FullName=' + FullName + '&WebsiteAdd=' + WebsiteAdd + '&email=' + email;
$.post('act_trainer_signup.php', post, function(data) {
$("div#responce").html(data);
});
});
}
function form_sub_trainer_signup()
{
$("#T_name").change(function(){
$("#message").html(" Controleren ...");
var username = $("#T_name").val();
$.ajax({
type:"post",
url:"check_username.php",
data:"username="+username,
success:function(data){
if(data==0){
$("#message").html("beschikbaar");
}
else{
$("#message").html("niet beschikbaar");
}
}
});
});
$('#sub_trainer_signup').on('click', function() {
$("div#responce").html(" Opslaan van gegevens, even geduld ...");
var U_name = $('input#T_name').val();
var pwd_1 = $('input#pwd_1').val();
var pwd_2 = $('input#pwd_2').val();
var FullName = $('input#FullName').val();
var email = $('input#email').val();
var post='U_name=' + U_name + '&pwd_1=' + pwd_1 + '&pwd_2=' + pwd_2 + '&FullName=' + FullName + '&email=' + email;
// alert (post);
$.post('act_sub_trainer_signup.php', post, function(data) {
$("div#responce").html(data);
});
});
}
function form_assistant_trainer_registration () {
$("#ST_name").change(function(){
$("#message").html(" Controleren ...");
var username = $("#ST_name").val();
$.ajax({
type:"post",
url:"check_username.php",
data:"username="+username,
success:function(data){
if(data==0){
$("#message").html("beschikbaar");
}
else{
$("#message").html("niet beschikbaar");
}
}
});
});
$('#assistant_trainer_signup').on('click', function() {
$("div#responce").html(" Opslaan van gegevens, even geduld ...");
var U_name = $('input#ST_name').val();
var pwd_1 = $('input#pwd_1').val();
var pwd_2 = $('input#pwd_2').val();
var FullName = $('input#FullName').val();
var email = $('input#email').val();
var tel = $('input#tele_no').val();
var post='U_name=' + U_name + '&pwd_1=' + pwd_1 + '&pwd_2=' + pwd_2 + '&FullName=' + FullName + '&email=' + email + '&tel=' + tel;
// alert (post);
$.post('act_assistant_trainer_signup.php', post, function(data) {
$("div#responce").html(data);
});
});
}
// ==================== Institute signup =================================
function Inst_Reg_form()
{
$("#I_name").change(function(){
$("#message").html(" Controleren ...");
var username=$("#I_name").val();
$.ajax({
type:"post",
url:"check_username.php",
data:"username="+username,
success:function(data){
if(data==0){
$("#message").html("beschikbaar");
}
else{
$("#message").html("niet beschikbaar");
}
}
});
});
$("#URLD").change(function(){
$("#message1").html(" Controleren ...");
var instname=$("#URLD").val();
$.ajax({
type:"post",
url:"check_instname.php",
data:"instname="+instname,
success:function(data){
if(data==0){
$("#message1").html("beschikbaar");
}
else{
$("#message1").html("niet beschikbaar");
}
}
});
});
$('#Inst_info').on('click', function() {
$("div#responce").html(" Opslaan van gegevens, even geduld ...");
var Ins_name = $('input#Ins_name').val();
var I_name = $('input#I_name').val();
var pwd_1 = $('input#pwd_1').val();
var pwd_2 = $('input#pwd_2').val();
var FullName = $('input#FullName').val();
var URLD = $('input#URLD').val();
var email = $('input#email').val();
var WebsiteAdd = $('input#WebsiteAdd').val();
var post = 'Ins_name=' + Ins_name + '&U_name=' + I_name + '&pwd_1=' + pwd_1 + '&pwd_2=' + pwd_2 + '&FullName=' + FullName + '&URLD=' + URLD + '&WebsiteAdd=' + WebsiteAdd + '&email=' + email;
$.post('Post_form_institute.php', post, function(data) {
$("div#responce").html(data);
});
});
}
// =================================================================================================================
function SignupTVT_Tabs() {
var arr_signup = new Array();
arr_signup.push({item_key: "Sign Up", item_value: "Aanmelden"});arr_signup.push({item_key: "1 Create Course Videos", item_value: "1 Maak Cursus Video"});arr_signup.push({item_key: "2 Manage Course Information", item_value: "2 Beheer Cursus Informatie"});arr_signup.push({item_key: "3 Manage Course Content", item_value: "3 Beheer Cursus Inhoud"});arr_signup.push({item_key: "4 Publish Course", item_value: "4 Publicatie Course"});arr_signup.push({item_key: "5 Market Course", item_value: "5 Market Course"});
$('.SignupTVT ul.sort li').eq(0).addClass('current');
changeContent ('sign-up');
$('.SignupTVT ul.sort a').click(function() {
$(this).css('outline','none');
$('ul.sort .current').removeClass('current');
$(this).parent().addClass('current');
var item = "";
for (x in arr_signup) {
if (arr_signup[x].item_value == $(this).text()) {
item = arr_signup[x].item_key;
}
}
// var filterVal = $(this).text().toLowerCase().replace(' ','-');
var filterVal = item.toLowerCase().replace(/ /g,'-');
// var filterVal = $(this).text().toLowerCase().replace(/ /g,'-');
changeContent (filterVal);
return false;
});
}
function changeContent (filterVal) {
$('ul.SignupTVT_sort li').each(function() {
if(!$(this).hasClass(filterVal)) {
$(this).fadeOut('normal').addClass('hidden');
} else {
$(this).fadeIn('slow').removeClass('hidden');
}
});
}
function pickvideoTVT_Tabs() {
$('.pickvideoTVT ul.sort li').eq(0).addClass('current');
changeContent ('sign-up');
$('.pickvideoTVT ul.sort a').click(function() {
$(this).css('outline','none');
$('ul.sort .current').removeClass('current');
$(this).parent().addClass('current');
var filterVal = $(this).text().toLowerCase().replace(/ /g,'-');
changeContentVideo (filterVal);
return false;
});
}
function changeContentVideo (filterVal) {
$('ul.pickvideoTVT_sort li').each(function() {
if(!$(this).hasClass(filterVal)) {
$(this).fadeOut('normal').addClass('hidden');
} else {
$(this).fadeIn('slow').removeClass('hidden');
}
});
}
function goto_top() {
$("#footer #sub_footer a.back_to_top").click(function(){
$('html, body').animate({scrollTop:0}, 400);
return false;
});
}
function contact_form()
{
$('#contact_send').on('click', function() {
var name = $('input#name').val();
var email = $('input#email').val();
var message = $('textarea#message').val();
var post = 'name=' + name + '&email=' + email + '&message=' + message;
$.post('sendmail.php', post, function(data) {
$("div#responce").html(data);
});
});
}
function loginTVT() {
$('#loginTVTsend').on('click', function() {
doLogin ();
});
}
function doLogin () {
$("div#responce").html(" Het verwerken van gegevens, even geduld ...");
var U_name = $('input#U_name').val();
var pwd_1 = $('input#pwd_1').val();
var post='U_name=' + U_name + '&pwd_1=' + pwd_1;
$.post('act_login.php', post, function(data) {
$("div#responce").html(data);
});
}
function course_timezone()
{
$('#course_timezone_btn').on('click', function() {
var optionSelected = $(this).find("option:selected");
var valueSelected = optionSelected.val();
var textSelected = optionSelected.text();
confirm("value is changed");
$.ajax({
type:"post",
url:"act_courseTimezone.php",
data:"tzone_off="+valueSelected+"&tzone="+textSelected,
success:function(data){
$("div#responce").html(data);
}
});
});
}
function form_institute_course()
{
$('#institute_Coursesend').on('click', function() {
var CTitle = $('input#CTitle').val();
var CDesc = $('input#CDesc').val();
var CCreator = $('input#CCreator').val();
var CEmail = $('input#CEmail').val();
var post='CTitle=' + CTitle + '&CDesc=' + CDesc + '&CCreator=' + CCreator + '&CEmail=' + CEmail;
$.post('Post_course_institute.php', post, function(data) {
$("div#responce").html(data);
});
});
}
function form_upload_file()
{
$('#SendfileUpload').on('click', function() {
var Fileupload = $('input#Fileupload').val();
var FileDetail = $('input#FileDetail').val();
var post='Fileupload=' + Fileupload + '&FileDetail=' + FileDetail;
$.post('Post_course_file.php', post, function(data) {
$("div#responce").html(data);
});
});
}
function tabs_ui() {
$(".tab_content").hide();
$("ul.tabs_nav li:first").addClass("active").show();
$(".tab_content:first").show();
$("ul.tabs_nav li").click(function() {
$("ul.tabs_nav li").removeClass("active");
$(this).addClass("active");
$(".tab_content").hide();
var activeTab = $(this).find("a").attr("href");
if ($(activeTab).hasClass("courses")) {
// alert ("courses");
LoadAllCourses ();
} else if ($(activeTab).hasClass("course-bundles")) {
// alert ("course-buldles");
LoadAllCourseBundles ();
} else if ($(activeTab).hasClass("add-questions")) {
CKEDITOR.instances['qnTx'].setData('');
$('.option-windows').empty ();
} else if ($(activeTab).hasClass("students-in-groups-tab")) {
LoadStudentsInGroups ();
} else if ($(activeTab).hasClass("students-groups-tab")) {
LoadGroupsList ();
} else if ($(activeTab).hasClass("students-grades-tab")) {
LoadGradesList ();
} else if ($(activeTab).hasClass("course-study-guideline-master-tab")) {
LoadCourseStudyGuidelineMaster ();
} else if ($(activeTab).hasClass("existing-questions")) {
var quiz2 = 0;
$($(activeTab).attr('class').split(' ')).each (function () {
var arr = this.split('-');
if (arr[0] == 'quiz') {
quiz2 = arr[1];
}
});
// alert (quizID + "|" + quiz2);
$('.option-windows').empty ();
getQuizQuestionsData (quiz2);
}
$(activeTab).fadeIn(1000);
return false;
});
}
function getQuizQuestionsData (quizID) {
$("#existing-questions-list").html(" Getting bestaande lijst vragen, even geduld ...");
$.ajax({
url: 'getCourseQuizQuestions.php?quiz_id='+quizID, //Server script to process data
type: 'POST',
success: function (data) {
$("#existing-questions-list").html (data);
// accordion_ui();
question_accordion_ui ();
InitializeSortable (); // Present in Manage_quiz.php
},
error: function() {
$("#existing-questions-list").html ("Kan de lijst van bestaande quizvragen niet op dit moment");
},
// Form data
data: {quiz_id: quizID},
//Options to tell jQuery not to process data or worry about content-type.
cache: false,
contentType: false,
processData: true
});
}
function accordion_ui() {
$(".accordion h3").eq(0).addClass("active");
$(".accordion h3 .icon").eq(0).removeClass("icon-plus").addClass("icon-minus");
$(".acc_content").eq(0).show();
$(".accordion h3").click(function(){
var handle = $(this).next(".acc_content");
$(this).next(".acc_content").slideToggle("slow").siblings(".acc_content:visible").slideUp("slow");
$(this).toggleClass("active");
$(this).siblings("h3").removeClass("active");
$('.accordion h3').each(function(index,value) {
if($('.accordion h3:eq('+index+')').hasClass('active')) {
$('.accordion h3:eq('+index+') .icon').removeClass('icon-plus').addClass('icon-minus');
} else {
$('.accordion h3:eq('+index+') .icon').removeClass('icon-minus').addClass('icon-plus');
}
});
});
}
/*
function question_accordion_ui() {
$(".question.accordion h3").click(function(){
// alert ("called");
var handle = $(this).next(".acc_content");
$(this).next(".acc_content").slideToggle("slow").siblings(".acc_content:visible").slideUp("slow");
$(this).toggleClass("active");
$(this).siblings("h3").removeClass("active");
$('.question.accordion h3').each(function(index,value) {
if($('.question.accordion h3:eq('+index+')').hasClass('active')) {
$('.question.accordion h3:eq('+index+') .icon').removeClass('icon-plus').addClass('icon-minus');
} else {
$('.question.accordion h3:eq('+index+') .icon').removeClass('icon-minus').addClass('icon-plus');
}
});
$('.question.accordion .acc_content span').html("");
var elementID = $(this).attr("id");
if (elementID != null) {
handle.find("span").html(" Getting vraag gegevens, even geduld ...");
var questionID = elementID.split("-")[1];
$.ajax({
url: 'getCourseQuizQuestionInEditMode.php?qid='+questionID, //Server script to process data
type: 'POST',
success: function (data) {
handle.find("span").html(data);
applyEditQuestionFunctions ();
},
error: function() {
alert ("error");
handle.next("span").html ("Kan de lijst van bestaande quizvragen niet op dit moment");
},
// Form data
data: {qid: questionID},
//Options to tell jQuery not to process data or worry about content-type.
cache: false,
contentType: false,
processData: true
});
}
var str = "";
$('.question.accordion .acc_content span').each(function(index,value) {
str += $('.question.accordion .acc_content span:eq('+index+')').html();
});
});
}
*/
function question_accordion_ui() {
$(".question.accordion h3").click(function(){
// alert ("called");
var handle = $(this).next(".acc_content");
$(this).next(".acc_content").slideToggle("slow").siblings(".acc_content:visible").slideUp("slow");
$(this).toggleClass("active");
$(this).parent().siblings("div.group").find('h3').removeClass("active");
$('.question.accordion div.group').each(function(index,value) {
if($(this).find('h3').hasClass('active')) {
$(this).find('h3 .icon').removeClass('icon-plus').addClass('icon-minus');
} else {
$(this).find('h3 .icon').removeClass('icon-minus').addClass('icon-plus');
}
});
$('.question.accordion .acc_content span').html("");
var elementID = $(this).attr("id");
if (elementID != null) {
handle.find("span").html(" Getting vraag gegevens, even geduld ...");
var questionID = elementID.split("-")[1];
$.ajax({
url: 'getCourseQuizQuestionInEditMode.php?qid='+questionID, //Server script to process data
type: 'POST',
success: function (data) {
handle.find("span").html(data);
applyEditQuestionFunctions ();
},
error: function() {
alert ("error");
handle.next("span").html ("Kan de lijst van bestaande quizvragen niet op dit moment");
},
// Form data
data: {qid: questionID},
//Options to tell jQuery not to process data or worry about content-type.
cache: false,
contentType: false,
processData: true
});
}
/*
var str = "";
$('.question.accordion .acc_content span').each(function(index,value) {
str += $('.question.accordion .acc_content span:eq('+index+')').html();
});
*/
});
}
function custom_lists_ui() {
$("ul.arrow li").prepend('');
$("ul.plus li").prepend('');
$("ul.check li").prepend('');
}
var thresholdcolors=[['20%','darkred'], ['10%','red']] //[chars_left_in_pct, CSS color to apply to output]
var uncheckedkeycodes=/(8)|(13)|(16)|(17)|(18)/ //keycodes that are not checked, even when limit has been reached.
thresholdcolors.sort(function(a,b){return parseInt(a[0])-parseInt(b[0])}) //sort thresholdcolors by percentage, ascending
function setformfieldsize($fields, optsize, optoutputdiv){
var $=jQuery
$fields.each(function(i){
var $field=$(this)
$field.data('maxsize', optsize || parseInt($field.attr('data-maxsize'))) //max character limit
var statusdivid=optoutputdiv || $field.attr('data-output') //id of DIV to output status
$field.data('$statusdiv', $('#'+statusdivid).length==1? $('#'+statusdivid) : null)
$field.unbind('keypress.restrict').bind('keypress.restrict', function(e){
setformfieldsize.restrict($field, e)
})
$field.unbind('keyup.show').bind('keyup.show', function(e){
setformfieldsize.showlimit($field)
})
setformfieldsize.showlimit($field) //show status to start
})
}
setformfieldsize.restrict=function($field, e){
var keyunicode=e.charCode || e.keyCode
if (!uncheckedkeycodes.test(keyunicode)){
if ($field.val().length >= $field.data('maxsize')){ //if characters entered exceed allowed
if (e.preventDefault)
e.preventDefault()
return false
}
}
}
setformfieldsize.showlimit=function($field){
if ($field.val().length > $field.data('maxsize')){
var trimmedtext=$field.val().substring(0, $field.data('maxsize'));
$field.val(trimmedtext);
}
if ($field.data('$statusdiv')){
// $field.data('$statusdiv').css('color', '').html($field.val().length);
$field.data('$statusdiv').css('color', '').html(' Current ' + $field.val().length + ' : Remaining ' + ($field.data('maxsize')-$field.val().length));
var pctremaining=($field.data('maxsize')-$field.val().length)/$field.data('maxsize')*100; //calculate chars remaining in terms of percentage
for (var i=0; i" + data + "");
} else {
$("#responce").html ("
Bestand geüpload.
");
$("#existing-course-files").html (" Getting natuurlijk bestanden, even geduld ...");
getCourseFiles ();
}
$('#SendfileUpload1').show();
return false;
},
error: function() {
alert("Error Occurred...");
$('#SendfileUpload1').show();
},
// Form data
data: formData,
//Options to tell jQuery not to process data or worry about content-type.
cache: false,
contentType: false,
processData: false
});
});
$('progress').hide();
getCourseFiles ();
myFancyBox ();
}
function progressHandlingFunction(e){
if(e.lengthComputable){
// $('progress').attr({value:e.loaded,max:e.total});
console.log (e.loaded + ' / ' + e.total);
}
}
function getCourseFiles () {
$.ajax({
url: 'getCourseFiles.php', //Server script to process data
type: 'POST',
success: function (data) {
$("#existing-course-files").html (data);
myFancyBox () ;
},
error: function() {
$("#existing-course-files").html ("Kan de lijst van de bestaande cursus bestanden niet op dit moment.");
},
// Form data
data: false,
//Options to tell jQuery not to process data or worry about content-type.
cache: false,
contentType: false,
processData: false
});
}
function myFancyBox () {
$('.asim.fancybox').fancybox({
'transitionIn' : 'fade',
'transitionOut' : 'fade',
'speedIn' : '800',
'speedOut' : '400',
'overlayShow' : true,
'overlayColor' : '#fcfcfc',
'padding' : '3',
'hideOnContentClick' : true,
'titlePosition' : 'outside',
'titleFormat' : null,
'width' : 500,
'height' : 300,
'onClosed': function () {getCourseFiles ();}
});
}
function getCourseQuizzes () {
$.ajax({
url: 'getCourseQuizzes.php', //Server script to process data
type: 'POST',
success: function (data) {
$("#existing-quizzes").html (data);
ApplyQuizEvents ();
manageQuizFancyBox ();
deleteQuizFancyBox ();
// putCheckMark ('quizzes-list');
ShowQuantity ('quizzes-list');
},
error: function() {
$("#existing-quizzes").html ("Kan de lijst van bestaande quizzen niet krijgen op dit moment.");
},
// Form data
data: false,
//Options to tell jQuery not to process data or worry about content-type.
cache: false,
contentType: false,
processData: false
});
}
function getCourseFilesForTrainerDashboard () {
$.ajax({
url: 'getCourseFilesForTrainerDashboard.php', //Server script to process data
type: 'POST',
success: function (data) {
$("#existing-files").html (data);
editFileFancyBox ();
deleteFileFancyBox ();
putCheckMark ('files-list');
},
error: function() {
$("#existing-files").html ("Kan de lijst van de bestaande cursus bestanden niet op dit moment.");
},
// Form data
data: false,
//Options to tell jQuery not to process data or worry about content-type.
cache: false,
contentType: false,
processData: false
});
}
function addCourseFilePageForTrainerDashboard () {
$('#SendfileUpload2').click(function(){
$(this).hide();
$('progress').show();
$("#responce").html ("");
// StartUploadCourseFile ();
// alert ($('#file').val());
var arr = $('input[type=file]').val().split('\\');
var selected_filename = arr[arr.length-1];
var post = 'f=' + selected_filename;
$.post ('CheckFileExist.php', post, function (data) {
data = data.trim();
if (data == "yes") {
$("#responce").html ("
File already exists, choose some other ...
");
$('#SendfileUpload2').show();
$('progress').hide();
} else if (data == "no") {
StartUploadCourseFile ();
}
});
});
$('progress').hide();
}
function StartUploadCourseFile () {
var formData = new FormData($('form')[0]);
$.ajax({
url: 'uploadScriptForTrainerDashboard.php', //Server script to process data
type: 'POST',
xhr: function() { // Custom XMLHttpRequest
var myXhr = $.ajaxSettings.xhr();
if(myXhr.upload){ // Check if upload property exists
myXhr.upload.addEventListener('progress',progressHandlingFunction, false); // For handling the progress of the upload
}
return myXhr;
},
//Ajax events
// beforeSend: beforeSendHandler,
success: function (data) {
if (data != '0') {
$("#responce").html ("