Example #1
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');
}
?>
 
Example #2
0
<?php

if (tg('bulletin') == '1') {
    global $db;
    global $db1;
    global $db3;
    if (!$db->Query("SELECT max(id) as idetat FROM etat_paiement")) {
        $db->Kill('Error1');
    }
    $array = $db->RowArray();
    $id_paiement = $array['idetat'];
    model::load('salarie', 'addsalaire');
    if (!addsalaire(tp('id'), tp('salaire_base'), tp('nouveau_salaire'), tp('prime'), tp('indem'), tp('redevance'), tp('numero_compte'), $id_paiement)) {
        exit("0");
    } else {
        if (!editavance(tp('idsalarie'), tp('idredevance'), tp('redevance'))) {
            exit("2");
        } else {
            addetatsalaire($id_paiement);
            exit("1");
        }
    }
    //Creat Bulletin de paie
    $model_name = "table_b_paie";
    require_once LIB_REP . "/excel/template/" . $model_name . "_xls.php";
    creat_document($model_name, 8);
    $id_fiche_pdf = $db->QuerySingleValue0("select fiche_bulletin  from salaire where id = 8");
    exit("4#{$id_fiche_pdf}");
} else {
    view::load('salarie', 'addsalaire');
}