forked from science-ation/science-ation
Don't let admin remove scheduled events if they have teams registered
This commit is contained in:
parent
dd230b2cdf
commit
bbf46aa47f
@ -155,10 +155,15 @@
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if($_GET['action']=="deleteevent") {
|
else if($_GET['action']=="deleteevent") {
|
||||||
//FIXME: dont let it delete an event that is already in use!
|
|
||||||
//FIXME: and if we do, delete everything that its been linked to!
|
|
||||||
$id=intval($_POST['id']);
|
$id=intval($_POST['id']);
|
||||||
mysql_query("DELETE FROM schedule WHERE conferences_id='{$conference['id']}' AND id='{$id}'");
|
$q=mysql_query("SELECT * FROM schedule_registrations WHERE schedule_id='{$id}' AND conferences_id='{$conference['id']}'");
|
||||||
|
if(mysql_num_rows($q)) {
|
||||||
|
error_("Cannot remove an event that has teams registered for it. Remove the teams first");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mysql_query("DELETE FROM schedule WHERE conferences_id='{$conference['id']}' AND id='{$id}'");
|
||||||
|
happy_("Event successfully removed from the schedule");
|
||||||
|
}
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -289,7 +294,7 @@
|
|||||||
function deleteEvent(event,id) {
|
function deleteEvent(event,id) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
if(confirmClick('Are you sure you want to delete this event from the schedule?')) {
|
if(confirmClick('Are you sure you want to remove this event from the schedule?')) {
|
||||||
$("#debug").load('schedule.php?action=deleteevent',{id:id},function() {
|
$("#debug").load('schedule.php?action=deleteevent',{id:id},function() {
|
||||||
changeDate();
|
changeDate();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user