Exemple #1
0
    $rel[] = $relQ->fetch();
}
$relQ->freeResult();
while ($aux = array_shift($rel)) {
    $relQ->delete($idPatient, $aux[1]);
}
$relQ->close();
unset($relQ);
unset($rel);
/**
 * Delete patient
 */
$patQ = new Query_Page_Patient();
if (defined("OPEN_DEMO") && !OPEN_DEMO) {
    if (!$patQ->select($idPatient)) {
        $patQ->close();
        FlashMsg::add(_("That patient does not exist."), OPEN_MSG_ERROR);
        header("Location: " . $returnLocation);
        exit;
    }
    $patient = $patQ->fetch();
    if (!$patient) {
        $patQ->close();
        Error::fetch($patQ);
    }
    $historyQ = new Query_History();
    $historyQ->selectPersonal($idPatient);
    $historyP = $historyQ->fetch();
    $historyQ->selectFamily($idPatient);
    $historyF = $historyQ->fetch();
    //Error::debug($patient); Error::debug($historyP); Error::debug($historyF, "", true);
Exemple #2
0
 /**
  * mixed Patient(int $id = 0)
  *
  * Constructor
  *
  * @param int $id (optional)
  * @return mixed void if not argument, null if not exists patient, object otherwise
  * @access public
  */
 public function Patient($id = 0)
 {
     $this->_trans = array_flip(get_html_translation_table(HTML_SPECIALCHARS));
     if ($id) {
         $_patQ = new Query_Page_Patient();
         if (!$_patQ->select($id)) {
             return null;
         }
         foreach (get_object_vars($_patQ->fetch()) as $key => $value) {
             $this->{$key} = $value;
         }
         $_patQ->freeResult();
         $_patQ->close();
     }
 }