<?php require_once('includes/requirecompere.inc.php'); require_once('includes/courseinfo.inc.php'); $cs_id=0+TGET('cs_id'); $mb_id=current_mb_id(); $dataset['DELETED']=array(0); $dataset['CONFIRMING']=array(0); $dataset['MANAGABLE']=array(0); $DBConn->connect(); $course=db_load_course_by_id($DBConn,$cs_id); if ($course['mb_id_owner']!=$mb_id) { redirect("./"); return; } $DBConn->begin(true); $lecture_count=db_count_lectures_of_course($DBConn,$cs_id); $dataset+=db_load_compere($DBConn,$course['mb_id_owner']); if ($lecture_count) { redirect("qx-cmd-course.delete.confirm-cs_id-".$cs_id.".html"); } else { db_delete_course($DBConn,$cs_id); redirect("qx-cmd-course.deleted-cs_id-".$cs_id.".html"); } $DBConn->commit(); ?>