Пример #1
0
    $FraisInsert->trajet = $trajet;
    $FraisInsert->km = $kms;
    $FraisInsert->coutPeage = $cpeages;
    $FraisInsert->coutRepas = $crepas;
    $FraisInsert->coutHebergement = $chebergement;
    $FraisInsert->coutTrajet = $kms * $indemniteQuery[0]->tarifKilometrique;
    $FraisInsert->coutTotal = $cpeages + $crepas + $chebergement + $kms * $indemniteQuery[0]->tarifKilometrique;
    $FraisInsert->idIndemnite = $indemniteQuery[0]->idIndemnite;
    $FraisInsert->idDemandeur = $_SESSION['idDemandeur'];
    $ligne->update($FraisInsert);
    $template->assign_var('MESSAGE', "Note de frais mise à jour !");
    $template->assign_var('UPDATESUCCES', TRUE);
}
$lignesfrais = new LignefraisMySqlDAO();
$lignesQuery = $lignesfrais->load($id);
$date = $lignesQuery->date;
$idIndemnite = $lignesQuery->idIndemnite;
$idMotif = $lignesQuery->idMotif;
$trajet = $lignesQuery->trajet;
$kms = $lignesQuery->km;
$cpeages = $lignesQuery->coutPeage;
$crepas = $lignesQuery->coutRepas;
$chebergement = $lignesQuery->coutHebergement;
$indemnites = new IndemniteMySqlDAO();
$indemniteQuery = $indemnites->load($idIndemnite);
$annee = $indemniteQuery->annee;
$motifs = new MotifMySqlDAO();
$motifQuery = $motifs->load($idMotif);
$motif = $motifQuery->libelle;
$template->assign_vars(array('IDLIGNE' => $id, 'DATE' => $date, 'ANNEE' => $annee, 'MOTIF' => $motif, 'TRAJET' => $trajet, 'KMS' => $kms, 'CPEAGE' => $cpeages, 'CREPAS' => $crepas, 'CHEB' => $chebergement));
$template->display('body');