FIX Subscription must be stopped when max of attendees reached.
This commit is contained in:
parent
e512c9aeee
commit
a8bd198a21
@ -103,14 +103,16 @@ if ($type == 'global') {
|
|||||||
$errmsg .= $project->error;
|
$errmsg .= $project->error;
|
||||||
$errors = array_merge($errors, $project->errors);
|
$errors = array_merge($errors, $project->errors);
|
||||||
} else {
|
} else {
|
||||||
$sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."projet";
|
$sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee";
|
||||||
$sql .= " WHERE ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee = ".((int) $project->id);
|
$sql .= " WHERE fk_project = ".((int) $project->id);
|
||||||
|
|
||||||
$resql = $db->query($resql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($obj) {
|
if ($obj) {
|
||||||
$currentnbofattendees = $obj->nb;
|
$currentnbofattendees = $obj->nb;
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user