Exemplo n.º 1
0
$smarty->assign('listPeriode', $listPeriode);
$periode_debut = $listPeriode[$id_periode - 1]['date_debut'];
$periode_fin = $listPeriode[$id_periode - 1]['date_fin'];
if ($action == 'lister') {
    $journal = $compta->obtenirJournal('', $periode_debut, $periode_fin);
    $smarty->assign('journal', $journal);
} elseif ($action == 'debit') {
    $journal = $compta->obtenirJournal(1, $periode_debut, $periode_fin);
    $smarty->assign('journal', $journal);
} elseif ($action == 'credit') {
    $journal = $compta->obtenirJournal(2, $periode_debut, $periode_fin);
    $smarty->assign('journal', $journal);
} elseif ($action == 'ajouter' || $action == 'modifier') {
    $formulaire =& instancierFormulaire();
    if ($action == 'modifier') {
        $champsRecup = $compta->obtenir($_GET['id']);
        $champs['idcompte'] = $champsRecup['idcompte'];
        $champs['date_saisie'] = $champsRecup['date_ecriture'];
        $champs['idoperation'] = $champsRecup['idoperation'];
        $champs['idcategorie'] = $champsRecup['idcategorie'];
        $champs['nom_frs'] = $champsRecup['nom_frs'];
        $champs['montant'] = $champsRecup['montant'];
        $champs['description'] = $champsRecup['description'];
        $champs['numero'] = $champsRecup['numero'];
        $champs['idmode_regl'] = $champsRecup['idmode_regl'];
        $champs['date_reglement'] = $champsRecup['date_regl'];
        $champs['obs_regl'] = $champsRecup['obs_regl'];
        $champs['idevenement'] = $champsRecup['idevenement'];
        //$formulaire->setDefaults($champsRecup);
        $formulaire->addElement('hidden', 'id', $_GET['id']);
    } else {
Exemplo n.º 2
0
    $events[0] = "-- À déterminer --";
    $smarty->assign('events', $events);
    // Payment methods
    $paymentMethods = $compta->obtenirListReglements();
    $paymentMethods[0] = "-- À déterminer --";
    $smarty->assign('payment_methods', $paymentMethods);
} elseif ($action == 'debit') {
    $journal = $compta->obtenirJournal(1, $periode_debut, $periode_fin);
    $smarty->assign('journal', $journal);
} elseif ($action == 'credit') {
    $journal = $compta->obtenirJournal(2, $periode_debut, $periode_fin);
    $smarty->assign('journal', $journal);
} elseif ($action == 'ajouter' || $action == 'modifier') {
    $formulaire =& instancierFormulaire();
    if ($action == 'modifier') {
        $champsRecup = $compta->obtenir($_GET['id']);
        $champs['idcompte'] = $champsRecup['idcompte'];
        $champs['date_saisie'] = $champsRecup['date_ecriture'];
        $champs['idoperation'] = $champsRecup['idoperation'];
        $champs['idcategorie'] = $champsRecup['idcategorie'];
        $champs['nom_frs'] = $champsRecup['nom_frs'];
        $champs['montant'] = $champsRecup['montant'];
        $champs['description'] = $champsRecup['description'];
        $champs['numero'] = $champsRecup['numero'];
        $champs['idmode_regl'] = $champsRecup['idmode_regl'];
        $champs['date_reglement'] = $champsRecup['date_regl'];
        $champs['obs_regl'] = $champsRecup['obs_regl'];
        $champs['idevenement'] = $champsRecup['idevenement'];
        $champs['comment'] = $champsRecup['comment'];
        //$formulaire->setDefaults($champsRecup);
        $formulaire->addElement('hidden', 'id', $_GET['id']);