diff --git a/registration-system/index.php b/registration-system/index.php index 989923a77e059dee8f0b4772a67f8625c246cc2f..700d903fab0f40fdc5bb2ba60264948b76a505f5 100644 --- a/registration-system/index.php +++ b/registration-system/index.php @@ -105,18 +105,18 @@ function index_form_to_db($data){ $data['abday'] = date('Y-m-d', DateTime::createFromFormat('d.m.Y',$data['abday'])->getTimestamp()); // === check regstration full === - $res = $index_db->select("fahrten", ["regopen", "max_bachelor"], ["fahrt_id" => $config_current_fahrt_id]); - if (!$res || $res[0]['regopen'] != "1") + $res = $index_db->get("fahrten", ["regopen", "max_bachelor"], ["fahrt_id" => $config_current_fahrt_id]); + if (!$res || $res['regopen'] != "1") return false; $index_db->exec("LOCK TABLES fahrten, bachelor WRITE"); // count should not be calculated in two scripts at once $cnt = $index_db->count("bachelor", ["AND" => ["backstepped" => NULL, "fahrt_id" => $config_current_fahrt_id]]); - $insertOk = $cnt < $res[0]['max_bachelor']; + $insertOk = $cnt < $res['max_bachelor']; - if ($cnt+1 >= $res[0]['max_bachelor']) // registration is full already or after the following insert - $index_db->update("fahrten", ["regopen" => 0], ["fahrt_id" => $config_current_fahrt_id]); + /*if ($cnt+1 >= $res['max_bachelor']) // registration is full already or after the following insert + $index_db->update("fahrten", ["regopen" => 0], ["fahrt_id" => $config_current_fahrt_id]); */ if ($insertOk) $index_db->insert("bachelor", $data);