/** * bool insert(Problem $problem, int $idUser, string $login) * * Inserts a new medical problem into the deleted problems table. * * @param Problem $problem medical problem to insert * @param int $idUser key of user that makes deletion * @param string $login login session of user that makes deletion * @return boolean returns false, if error occurs * @access public */ function insert($problem, $idUser, $login) { $sql = "INSERT INTO " . $this->_table; $sql .= " (id_problem, last_update_date, id_patient, id_member, collegiate_number, order_number, "; $sql .= "opening_date, closing_date, meeting_place, wording, subjective, objective, "; $sql .= "appreciation, action_plan, prescription, create_date, id_user, login) VALUES ("; $sql .= "?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW(), ?, ?);"; $params = array($problem->getIdProblem(), $problem->getLastUpdateDate(), $problem->getIdPatient(), $problem->getIdMember(), urlencode($problem->getCollegiateNumber()), $problem->getOrderNumber(), $problem->getOpeningDate(), $problem->getClosingDate(), urlencode($problem->getMeetingPlace()), $problem->getWording(), urlencode($problem->getSubjective()), urlencode($problem->getObjective()), urlencode($problem->getAppreciation()), urlencode($problem->getActionPlan()), urlencode($problem->getPrescription()), intval($idUser), urlencode($login)); return $this->exec($sql, $params); }
/** * bool insert(Problem $problem) * * Inserts a new medical problem into the problems table. * * @param Problem $problem medical problem to insert * @return boolean returns false, if error occurs * @access public */ function insert($problem) { if (!$problem instanceof Problem) { $this->_error = "Argument is an inappropriate object."; return false; } $sql = "INSERT INTO " . $this->_table; $sql .= " (id_problem, last_update_date, id_patient, id_member, order_number, "; $sql .= "opening_date, closing_date, meeting_place, wording, subjective, objective, "; $sql .= "appreciation, action_plan, prescription) VALUES (NULL, "; $sql .= "?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"; $params = array($problem->getLastUpdateDate(), $problem->getIdPatient(), $problem->getIdMember(), $problem->getOrderNumber(), $problem->getOpeningDate(), $problem->getClosingDate(), urlencode($problem->getMeetingPlace()), $problem->getWording(), urlencode($problem->getSubjective()), urlencode($problem->getObjective()), urlencode($problem->getAppreciation()), urlencode($problem->getActionPlan()), urlencode($problem->getPrescription())); return $this->exec($sql, $params); }