$results[$i]["chambre"] = addslashes(trim($line[1])); $results[$i]["nom"] = addslashes(trim($line[2])); $results[$i]["nomcomplet"] = @addslashes(trim($line[3])); $results[$i]["error"] = 0; // Service $service = new CService(); $service->nom = $results[$i]["service"]; $service->group_id = CGroups::loadCurrent()->_id; $service->loadMatchingObject(); if (!$service->_id) { $service->urgence = 0; $service->uhcd = 0; $service->hospit_jour = 0; $service->externe = 0; $service->cancelled = 0; $msg = $service->store(); if ($msg) { CAppUI::setMsg($msg, UI_MSG_ERROR); $results[$i]["error"] = $msg; $i++; continue; } CAppUI::setMsg("Service créé", UI_MSG_OK); } // Chambre $chambre = new CChambre(); $chambre->nom = $results[$i]["chambre"]; $chambre->service_id = $service->_id; $chambre->loadMatchingObject(); if (!$chambre->_id) { $chambre->lits_alpha = 0;