Beispiel #1
0
    $date_d = new DateTime(tp("date_debut"));
    $dat_f = new DateTime(tp("date_fin"));
    if ($date_d > $dat_f) {
        exit("3");
    }
    if ($dat_f->format('m') != $date_d->format('m')) {
        exit("4");
    }
    model::load('salaire', 'salaire');
    if (!$db->Query("SELECT * FROM `etat_paiement`ORDER BY id DESC LIMIT 1")) {
        $db->Kill($db->Error());
    }
    $array = $db->RowArray();
    $date = date('d-m-Y', strtotime($array['date_fin']));
    //$date= date('d-m-Y',strtotime($date));
    //$date = new DateTime($date);
    //$interval=$dat_f->diff($date);
    // $nbr= $interval->format('%m'); //Retourne le nombre de mois
    $date_verif = date('d-m-Y', strtotime("+ 1 months", strtotime($date)));
    $date_verif = new DateTime($date_verif);
    if ($date_verif->format('m') != $dat_f->format('m') or $date_verif->format('o') != $dat_f->format('o')) {
        exit("5");
    }
    if (!addetatsalaire($dat_f->format('m'), $dat_f->format('o'), tp('date_debut'), tp('date_fin'))) {
        exit("0");
    } else {
        exit("1");
    }
} else {
    view::load('salaire', 'addetat');
}
Beispiel #2
0
<?php

if (tp('verif') == 1) {
    global $db;
    global $db1;
    global $db3;
    $nextid = getnextidtable('salaire');
    $id_etat_paiement = tp('etat');
    model::load('salarie', 'addsalaire');
    if (!addsalaire(tp('id'), tp('salaire_base'), tp('nouveau_salaire'), tp('taux'), tp('indem'), tp('redevance'), tp('numero_compte'), $id_etat_paiement)) {
        exit("0");
    } else {
        if (!editavance(tp('id'), tp('idredevance'), tp('redevance'))) {
            exit("2");
        } else {
            addetatsalaire($id_etat_paiement);
            $model_name = "table_b_paie";
            require_once LIB_REP . "/excel/template/" . $model_name . "_xls.php";
            creat_document($model_name, $nextid, $id_etat_paiement, tp('id'), tp('taux'));
            $id_fiche_pdf = $db->QuerySingleValue0("select fiche_bulletin  from salaire where id = {$nextid}");
            exit("4#{$id_fiche_pdf}");
        }
    }
    //Creat Bulletin de paie
} else {
    view::load('salarie', 'detailsal');
}
?>