665 |
|
|
666 |
} |
} |
667 |
|
|
668 |
|
/* |
669 |
|
* |
670 |
|
*/ |
671 |
|
/** |
672 |
|
* Récupère la lettre type lié à un événement |
673 |
|
* @param integer $evenement L'identifiant de l'événement |
674 |
|
* @return integer Retourne l'idenfiant de la lettre-type ou true |
675 |
|
*/ |
676 |
|
function getLettreType($evenement){ |
677 |
|
|
678 |
|
$lettretype = NULL; |
679 |
|
|
680 |
|
$sql = |
681 |
|
"SELECT |
682 |
|
lettretype |
683 |
|
FROM |
684 |
|
".DB_PREFIXE."evenement |
685 |
|
WHERE |
686 |
|
evenement = $evenement"; |
687 |
|
|
688 |
|
$this->addToLog("getLettreType() : db->query(\"".$sql."\")", VERBOSE_MODE); |
689 |
|
$res = $this->db->query($sql); |
690 |
|
if ( database::isError($res)){ |
691 |
|
die(); |
692 |
|
} |
693 |
|
|
694 |
|
if ( $res->numrows() > 0 ){ |
695 |
|
|
696 |
|
$row=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
697 |
|
$lettretype = $row['lettretype']; |
698 |
|
} |
699 |
|
|
700 |
|
return $lettretype; |
701 |
|
} |
702 |
|
|
703 |
|
/** |
704 |
|
* Retourne le type de dossier d'autorisation du dossier courant : |
705 |
|
* @param $idxDossier Le numéro du dossier d'instruction |
706 |
|
* @return le code du type détaillée de dossier d'autorisation |
707 |
|
**/ |
708 |
|
function getDATDCode($idxDossier) { |
709 |
|
$sql = "SELECT dossier_autorisation_type_detaille.code |
710 |
|
FROM ".DB_PREFIXE."dossier_autorisation_type_detaille |
711 |
|
INNER JOIN ".DB_PREFIXE."dossier_autorisation |
712 |
|
ON dossier_autorisation_type_detaille.dossier_autorisation_type_detaille = |
713 |
|
dossier_autorisation.dossier_autorisation_type_detaille |
714 |
|
INNER JOIN ".DB_PREFIXE."dossier ON dossier.dossier_autorisation = dossier_autorisation.dossier_autorisation |
715 |
|
WHERE dossier.dossier = '".$idxDossier."'"; |
716 |
|
$res = $this->db->getOne($sql); |
717 |
|
$this->addToLog("getDATDCode() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
718 |
|
if ( database::isError($res)){ |
719 |
|
die(); |
720 |
|
} |
721 |
|
return $res; |
722 |
|
} |
723 |
} |
} |
724 |
|
|
725 |
?> |
?> |