Beispiel #1
0
function editcollecte($idcontrat, $paiement, $date, $pj)
{
    global $db;
    $usrid = $_SESSION['userid'];
    $nextid = getnextidtable('collecte');
    //$date1=date_create($date);
    //$datep=date_format($date1,"Y-m-d");
    $date_paiement = date('Y-m-d-', strtotime($date));
    $values["mode_paiement"] = MySQL::SQLValue($paiement);
    $values["date_paiement"] = MySQL::SQLValue($date_paiement);
    $where["id"] = MySQL::SQLValue($idcontrat);
    if (!$db->UpdateRows("collecte", $values, $where)) {
        $db->Kill($db->Error());
        return false;
    } else {
        $sql = $db->BuildSQLInsert("collecte", $values);
        logg('Enregistrement collecte ', 201, $nextid, $_SESSION['userid']);
        if ($pj != "") {
            $basedir = "upload/collecte";
            if (!file_exists($basedir)) {
                mkdir($basedir, 0, true);
            }
            $newdir = $basedir . "/";
            copyfile($pj, $nextid, $newdir, "collecte");
            autoarchive($newdir . changnom($pj, $nextid, 'collecte'), "Fichier joint collecte {$nextid}", 201, $nextid, "collecte", "piece_jointe", $_SESSION['userid'], cryptage(session::get('service'), 0));
        }
        return true;
    }
}
Beispiel #2
0
function setcontrat($id, $date, $pj)
{
    global $db;
    $etat = "Résilié";
    $nextid = getnextidtable('contrat_location_villa');
    $date = date('Y-m-d-', strtotime($date));
    $values["date_resiliation"] = MySQL::SQLValue($date);
    $values["etat"] = MySQL::SQLValue($etat);
    $where["id"] = MySQL::SQLValue($id);
    if (!$db->UpdateRows("contrat_location_villa", $values, $where)) {
        $db->Kill($db->Error());
        return false;
    } else {
        $sql = $db->BuildSQLInsert("contrat_location_villa", $values);
        logg('Enregistrement Location Villa ', 233, $id, $_SESSION['userid']);
        if ($pj != "") {
            $basedir = "upload/location";
            if (!file_exists($basedir)) {
                mkdir($basedir, 0, true);
            }
            $newdir = $basedir . "/";
            copyfile($pj, $id, $newdir, "Attachement_location_");
            autoarchive($newdir . changnom($pj, $id, 'Attachement_location_'), "Fichier joint location ville {$id}", 233, $id, "contrat_location_villa", "pj_resiliation", $_SESSION['userid'], cryptage(session::get('service'), 0));
        }
        return true;
    }
}
Beispiel #3
0
function addaemploi($id_aemploi, $montant, $date_paiement, $mode_paiement, $ref_pj, $pj)
{
    global $db;
    $nextid = getnextidtable('autorisation_emploi');
    $usrid = $_SESSION['userid'];
    $date = date('Y-m-d-', strtotime($date_paiement));
    $values["pj"] = MySQL::SQLValue($pj);
    $values["ref_pj"] = MySQL::SQLValue($ref_pj);
    $values["id_aemploi"] = MySQL::SQLValue($id_aemploi);
    $values["mode_paiement"] = MySQL::SQLValue($mode_paiement);
    $values["date_paiement"] = MySQL::SQLValue($date);
    $values["montant"] = MySQL::SQLValue($montant);
    $values["addby"] = MySQL::SQLValue($usrid);
    if (!$db->InsertRow("autorisation_emploi", $values)) {
        $db->Kill($db->Error());
        return false;
    } else {
        $sql = $db->BuildSQLInsert("autorisation_emploi", $values);
        logg('Enregistrement Autorisation Emploi ', 246, $nextid, $_SESSION['userid']);
        if ($pj != "") {
            $basedir = "upload/Autorisation";
            if (!file_exists($basedir)) {
                mkdir($basedir, 0, true);
            }
            $newdir = $basedir . "/";
            copyfile($pj, $nextid, $newdir, "Attachement_autorisation_");
            autoarchive($newdir . changnom($pj, $nextid, 'Attachement_autorisation_'), "Fichier joint autorisation emploi {$nextid}", 246, $nextid, "autorisation_emploi", "pj", $_SESSION['userid'], cryptage(session::get('service'), 0));
        }
    }
    return true;
}
Beispiel #4
0
function addcontenu($titrfr, $titren, $titrar, $contfr, $conten, $contar, $module, $img, $id, $vod, $fileuploadid, $dat)
{
    $next_id_vod = getnextidtable('vod');
    global $db;
    $newdir = "../upload/contenu/image/";
    $date = date('Y-m-d-', strtotime($dat));
    $values["titrfr"] = MySQL::SQLValue($titrfr);
    $values["titren"] = MySQL::SQLValue($titren);
    $values["titrar"] = MySQL::SQLValue($titrar);
    $values["contfr"] = MySQL::SQLValue($contfr);
    $values["conten"] = MySQL::SQLValue($conten);
    $values["contar"] = MySQL::SQLValue($contar);
    $values["modul"] = MySQL::SQLValue($module);
    $values["app"] = MySQL::SQLValue('?_tsk=page&id=' . $id);
    if ($vod != "") {
        $values["video"] = MySQL::SQLValue($next_id_vod);
    }
    $values["dat"] = MySQL::SQLValue($date);
    $values["img"] = MySQL::SQLValue(changnom($newdir . $img, $id, 'contenu_'));
    // Execute the insert
    $result = $db->InsertRow("contenu", $values);
    // If we have an error
    if (!$result) {
        // Show the error and kill the script
        $db->Kill('error');
        return false;
    } else {
        if ($img != "") {
            $basedir = "upload/contenu/image";
            if (!file_exists($basedir)) {
                mkdir($basedir, 0, true);
            }
            if (!file_exists($newdir)) {
                mkdir($newdir, 0, true);
            }
            copyfile($img, $id, $newdir, "contenu_");
        }
        if ($fileuploadid != "") {
            $basedir = "upload/contenu/doc";
            if (!file_exists($basedir)) {
                mkdir($basedir, 0, true);
            }
            $newdir = "../upload/contenu/doc/";
            if (!file_exists($newdir)) {
                mkdir($newdir, 0, true);
            }
            copyfile($fileuploadid, $id, $newdir, "document_");
            $file = "./upload/contenu/doc/" . changnom($fileuploadid, $id, 'document_');
            autoarchive($file, "Document Contenu {$id} ", 12, $id, "contenu", "document", $_SESSION['userid'], cryptage(session::get('service'), 0));
        }
        if ($vod != "") {
            addvod($titrfr, $titren, $titrar, $vod);
        }
        return true;
    }
}
Beispiel #5
0
function addnews($titrfr, $titren, $titrar, $contfr, $conten, $contar, $img, $id, $autfr, $auten, $autar, $slider, $dat, $flash, $lien, $photot)
{
    global $db;
    $basedir = UPLD_REP . "news";
    if (!file_exists($basedir)) {
        mkdir($basedir, 0, true);
    }
    $newdir = $basedir . "/";
    $next_id_vod = getnextidtable('vod');
    $date = date('Y-m-d-', strtotime($dat));
    $values["titrfr"] = MySQL::SQLValue($titrfr);
    $values["titren"] = MySQL::SQLValue($titren);
    $values["titrar"] = MySQL::SQLValue($titrar);
    $values["contfr"] = MySQL::SQLValue($contfr);
    $values["conten"] = MySQL::SQLValue($conten);
    $values["contar"] = MySQL::SQLValue($contar);
    $values["autfr"] = MySQL::SQLValue($autfr);
    $values["auten"] = MySQL::SQLValue($auten);
    $values["autar"] = MySQL::SQLValue($autar);
    $values["modul"] = MySQL::SQLValue("9");
    $values["slider"] = MySQL::SQLValue($slider);
    $values["flash"] = MySQL::SQLValue($flash);
    $values["arch"] = MySQL::SQLValue("0");
    if ($lien != "") {
        $values["video"] = MySQL::SQLValue($next_id_vod);
    }
    $values["img"] = MySQL::SQLValue(changnom($newdir . $img, $id, 'nws_'));
    $values["img_d"] = MySQL::SQLValue(changnom($newdir . $photot, $id, 'nwst_'));
    $values["app"] = MySQL::SQLValue('?_tsk=news&id=' . $id);
    $values["dat"] = MySQL::SQLValue($date);
    // Execute the insert
    $result = $db->InsertRow("contenu", $values);
    // If we have an error
    if (!$result) {
        // Show the error and kill the script
        $db->Kill($db->Error());
        return false;
    } else {
        if ($img != "") {
            copyfile($img, $id, $newdir, "nws_");
        }
        if ($photot != "") {
            copyfile($photot, $id, $newdir, "nwst_");
        }
        if ($lien != "") {
            addvod($titrfr, $titren, $titrar, $lien);
        }
        return true;
    }
}
Beispiel #6
0
function editcontrat($id, $responsable, $adresse, $tel, $mail)
{
    global $db;
    $usrid = $_SESSION['userid'];
    $nextid = getnextidtable('contrat_location_villa');
    $values["nomresponsable"] = MySQL::SQLValue($responsable);
    $values["adresse"] = MySQL::SQLValue($adresse);
    $values["tel"] = MySQL::SQLValue($tel);
    $values["mail"] = MySQL::SQLValue($mail);
    $where["id"] = MySQL::SQLValue($id);
    if (!$db->UpdateRows("contrat_location_villa", $values, $where)) {
        $db->Kill($db->Error());
        return false;
    } else {
        $sql = $db->BuildSQLInsert("contrat_location_villa", $values);
        return true;
    }
}
Beispiel #7
0
function editlocation($id, $nomination, $responsable, $adresse, $pj, $tel, $mail, $date_debut, $date_fin, $cycle_paiement, $montant, $depot_garantie)
{
    global $db;
    $usrid = $_SESSION['userid'];
    $nextid = getnextidtable('contrat_location_villa');
    $datefin = date('Y-m-d-', strtotime($date_fin));
    $dated = date('Y-m-d-', strtotime($date_debut));
    $values["nomlocataire"] = MySQL::SQLValue($nomination);
    $values["nomresponsable"] = MySQL::SQLValue($responsable);
    $values["adresse"] = MySQL::SQLValue($adresse);
    $values["tel"] = MySQL::SQLValue($tel);
    $values["mail"] = MySQL::SQLValue($mail);
    $values["date_debut"] = MySQL::SQLValue($dated);
    $values["date_fin"] = MySQL::SQLValue($datefin);
    $values["montant"] = MySQL::SQLValue($montant);
    $values["cycle_paiement"] = MySQL::SQLValue($cycle_paiement);
    $values["depot_garantie"] = MySQL::SQLValue($depot_garantie);
    //$idvilla = $db->QuerySingleValue0("SELECT idvilla FROM contrat_location_villa where id ='".tg('id')."'");
    $where["id"] = MySQL::SQLValue($id);
    if (!$db->UpdateRows("contrat_location_villa", $values, $where)) {
        $db->Kill($db->Error());
        return false;
    } else {
        $sql = $db->BuildSQLInsert("contrat_location_villa", $values);
        logg('Enregistrement Location Villa ', 100, $nextid, $_SESSION['userid']);
        if ($pj != "") {
            $basedir = "upload/location";
            if (!file_exists($basedir)) {
                mkdir($basedir, 0, true);
            }
            $newdir = $basedir . "/";
            copyfile($pj, $nextid, $newdir, "Attachement_location_");
            autoarchive($newdir . changnom($pj, $id, 'Attachement_location_'), "Fichier joint location ville {$id}", 100, $id, "contrat_location_villa", "pj", $_SESSION['userid'], cryptage(session::get('service'), 0));
        }
        return true;
    }
}
Beispiel #8
0
<?php

if (tp('verif') == 1) {
    $nextid = getnextidtable('users_sys');
    model::load('admin', 'user');
    if (!adduser(tp('username'), tp('firstname'), tp('lastname'), tp('password'), tp('email'), tp('service'), tp('signid'), $nextid, tp('agence'), tp('tel'), tp('imgid'))) {
        exit("0");
    } else {
        exit("1");
    }
} else {
    view::load('admin', 'adduser');
}
Beispiel #9
0
<?php

if (tp('verif') == 1) {
    $nextid = getnextidtable('synthese');
    model::load('synthese', 'addsynthese');
    if (!addsyn(tp('titrfr'), tp('titren'), tp('titrar'), tp('contfr'), tp('conten'), tp('contar'), $nextid, tp('dat'))) {
        exit("0");
    } else {
        exit("1");
    }
} else {
    view::load('synthese', 'addsynthese');
}
Beispiel #10
0
<?php

if (tp('verif') == 1) {
    //verif file exist
    if (tp('noteid') == "") {
        exit('2');
    }
    // Next ID
    $nextid = getnextidtable("noteservice");
    model::load('note', 'addnote');
    if (!addnote(tp('objet'), tp('noteid'), $nextid, tp('dat'))) {
        exit("0");
    } else {
        exit("1");
    }
} else {
    view::load('note', 'addnote');
}
Beispiel #11
0
<?php

if (tp('verif') == 1) {
    global $db;
    $nextid = getnextidtable('depense');
    //Get id Fournisseur
    $rs = str_replace(' ', '', tp('fourn'));
    if (!$db->Query("SELECT id FROM fournisseur where REPLACE(rs, ' ','') = '{$rs}'")) {
        $db->Kill('Error1');
    }
    if ($db->RowCount() == 0) {
        exit("2#Le Fournisseur/ Bénificiare entré n'exist pas dans la base de donnée veuillez vérifier le nom .");
    } else {
        $array = $db->RowArray();
        $fourn = $array["id"];
    }
    //Check if global montant paragraphe = montant globale lines depense.
    $montant_dispo = $db->QuerySingleValue0("select mont_disp from paragraphe where id = " . tp('paragraphe'));
    $montant = tp('montant');
    if ($montant_dispo < $montant) {
        exit("2#Le montant des line est séperieur à la provision");
        // Le montant des line est séperieur à la provision
    }
    model::load('depense', 'depense');
    if (!add_depense($nextid, tp('titre'), $fourn, tp('date_demande'), tp('nbr_depense'), tp('chapitre'), tp('article'), tp('paragraphe'), $montant, tp('pjid'))) {
        exit("2#Erreur Système");
    } else {
        exit("1#Opération réussie");
    }
    /*	 //Creat Fiche Depense
    	$model_name= "fiche_depense";
Beispiel #12
0
<?php

if (tp('verif') == 1) {
    global $db;
    $nextid = getnextidtable('avance_salaire');
    $idsalarie = tp('id');
    $montant_demander = tp('montant');
    $duree = tp('duree');
    $sql = "SELECT nouveau_salaire from info_personnel_budgetaire WHERE id_salarie =" . $idsalarie . " order by id asc ";
    $salaire = $db->QuerySingleValue0($sql);
    if ($salaire == "0") {
        $mess1 = "Enregistrement Impossible de cette Avance";
        exit("1#{$mess1}");
    } else {
        $echiance = $montant_demander / $duree;
        $purcentage = $echiance * 100 / $salaire;
        if ($purcentage >= 50) {
            $mess2 = "Le montant demander supérieur au salaires veuillez Augmenter la Durée de  paiement";
            exit("1#{$mess2}");
        }
    }
    model::load('salarie', 'addavance');
    if (!addavance(tp('Remarque'), tp('montant'), tp('date_op'), tp('id'), tp('duree'))) {
        exit("1");
    } else {
        if (!$db->Query(" SELECT * from avance_salaire WHERE id =" . $nextid . " order by id asc ")) {
            $db->Kill($db->Error);
        }
        $array = $db->RowArray();
        $output = '<tr class="lst" id="lin' . $nextid . '">
<td>' . $nextid . '</td>
Beispiel #13
0
<?php

//addevent($titrfr,$titren,$titrar,$contfr,$conten,$contar,$img,$id,$autfr,$auten,$autar,$slider)
if (tp('verif') == 1) {
    //verif si il y a une image.
    $nextid = getnextidtable('event');
    model::load('event', 'addevent');
    if (!addevent(tp('titrfr'), tp('titren'), tp('titrar'), tp('contfr'), tp('conten'), tp('contar'), tp('photoid'), $nextid, tp('autfr'), tp('auten'), tp('autar'), tp('dat'))) {
        exit("0");
    } else {
        exit("1");
    }
} else {
    view::load('event', 'addevent');
}
Beispiel #14
0
function editnews($titrfr, $titren, $titrar, $contfr, $conten, $contar, $img, $id, $autfr, $auten, $autar, $slider, $dat, $flash, $lien, $idvd, $photot)
{
    global $db;
    $next_id_vod = getnextidtable('vod');
    global $db;
    $newdir = "../upload/news/";
    $date = date('Y-m-d-', strtotime($dat));
    $values["titrfr"] = MySQL::SQLValue($titrfr);
    $values["titren"] = MySQL::SQLValue($titren);
    $values["titrar"] = MySQL::SQLValue($titrar);
    $values["contfr"] = MySQL::SQLValue($contfr);
    $values["conten"] = MySQL::SQLValue($conten);
    $values["contar"] = MySQL::SQLValue($contar);
    $values["autfr"] = MySQL::SQLValue($autfr);
    $values["auten"] = MySQL::SQLValue($auten);
    $values["autar"] = MySQL::SQLValue($autar);
    $values["slider"] = MySQL::SQLValue($slider);
    $values["flash"] = MySQL::SQLValue($flash);
    if ($idvd == null && $lien != null) {
        $values["video"] = MySQL::SQLValue($next_id_vod);
    }
    if ($img != "") {
        $values["img"] = MySQL::SQLValue(changnom($newdir . $img, $id, 'nws_'));
    }
    if ($photot != "") {
        $values["img_d"] = MySQL::SQLValue(changnom($newdir . $photot, $id, 'nwst_'));
    }
    $values["dat"] = MySQL::SQLValue($date);
    $where["id"] = MySQL::SQLValue($id);
    // Execute the insert
    $result = $db->UpdateRows("contenu", $values, $where);
    // If we have an error
    if (!$result) {
        // Show the error and kill the script
        $db->Kill('Error Update');
        return false;
    } else {
        if ($img != "") {
            $basedir = "upload/news";
            if (!file_exists($basedir)) {
                mkdir($basedir, 0, true);
            }
            if (!file_exists($newdir)) {
                mkdir($newdir, 0, true);
            }
            copyfile($img, $id, $newdir, "nws_");
        }
        if ($photot != "") {
            $basedir = "upload/news";
            if (!file_exists($basedir)) {
                mkdir($basedir, 0, true);
            }
            if (!file_exists($newdir)) {
                mkdir($newdir, 0, true);
            }
            copyfile($photot, $id, $newdir, "nwst_");
        }
        if ($idvd == null && $lien != null) {
            addvod($titrfr, $titren, $titrar, $lien);
        } else {
            if ($lien != "") {
                editvod($titrfr, $titren, $titrar, $lien, $idvd);
            }
        }
        return true;
    }
}
Beispiel #15
0
<?php

global $db;
if (tp('del') == 1) {
    $id_villa = tp('lin');
    //Check if have contrat
    $nbr_contrat = $db->QuerySingleValue0("select count(id) from contrat_location_villa where idvilla= {$id_villa} ");
    if ($nbr_contrat > 0) {
        exit("2#{$nbr_contrat}");
    }
    model::load('gestionvilla', 'gestionvilla');
    //Execute Model
    if (!delet($id_villa)) {
        exit("3");
        //Error opération
    } else {
        exit("1");
        //Success Opération
    }
}
$nextid = getnextidtable('contrat_location_villa');
$session = new session();
$session->set('nextid', $nextid);
view::load('gestionvilla', 'gestionvilla');
Beispiel #16
0
<?php

if (tp('verif') == 1) {
    $nextid = getnextidtable('paragraphe');
    $id_article = tp('article');
    $titr_paragraphe = tp('titre');
    //Check if have same Titre and same Article
    $titr_paragraphe_sql = str_replace(' ', '', $titr_paragraphe);
    $nbr_paragraphe_exist = $db->QuerySingleValue0("select count(id) from paragraphe where REPLACE(titre, ' ','') = '{$titr_paragraphe_sql}' and  paragraphe.id_article = {$id_article}  ");
    if ($nbr_paragraphe_exist > 0) {
        exit("3#{$nbr_paragraphe_exist}");
    }
    model::load('budget', 'budget');
    if (!addparagraphe($nextid, tp('chapitre'), tp('article'), tp('titre'), tp('montant'))) {
        exit("2");
    } else {
        exit("1");
    }
} else {
    view::load('budget', 'addparagraphe');
}
Beispiel #17
0
<?php

if (tp('verif') == 1) {
    $nextid = getnextidtable('collecte');
    model::load('collecte', 'addcollecte');
    if (!addcollecte($nextid, tp('location_villa'), tp('prix'), tp('paiement'), tp('pjid'))) {
        exit("0");
    } else {
        exit("1");
    }
} else {
    view::load('collecte', 'addcollecte');
}
Beispiel #18
0
<?php

//addnews($titrfr,$titren,$titrar,$contfr,$conten,$contar,$img,$id,$autfr,$auten,$autar,$slider)
if (tp('verif') == 1) {
    $nextid = getnextidtable('album');
    if (tp('fileuploadid') == "") {
        exit("2");
    }
    model::load('album', 'addalbum');
    if (!addalbum(tp('titrfr'), tp('titren'), tp('fileuploadid'), $nextid, tp('titrar'))) {
        exit("0");
    } else {
        exit("1");
    }
} else {
    view::load('album', 'addalbum');
}
Beispiel #19
0
<?php

if (tp('verif') == 1) {
    global $db;
    $nextid = getnextidtable('depense_lines');
    $depense_id = tp('depense');
    //Check if global montant paragraphe = montant globale lines depense.
    $montant_dispo = $db->QuerySingleValue0("select mont_disp from paragraphe,depense where paragraphe.id =  depense.paragraphe and depense.id = {$depense_id}");
    $montant = tp('mont_lin');
    $qte = tp('qte');
    $mont_unit = tp('mont_unit');
    //Check reel Montant
    if ($montant != $qte * $mont_unit) {
        exit("2#Le montant total n'est pas correcte");
    }
    $mont_tt_line = $db->QuerySingleValue0("select sum(depense_lines.montant) from depense_lines where id_depense = {$depense_id}");
    if ($montant_dispo < $montant + $mont_tt_line) {
        exit("3# Le montant des lignes de cette dépense dépasse les fonds de la source");
        // Le montant des line est séperieur à la provision
    }
    model::load('depense', 'depense');
    if (!add_depense_line($nextid, $depense_id, tp('titre'), tp('fournisseur'), tp('date_demande'), $montant, tp('pjid'), $qte, $mont_unit)) {
        exit("2#Erreur Système");
    }
    $nbr_lin = $db->QuerySingleValue0("select count(depense_lines.id) from depense_lines where id_depense = {$depense_id}");
    $new_mont = $montant + $mont_tt_line;
    exit("1#Enregistrement réussi#{$nbr_lin}#" . is_num($new_mont));
} else {
    view::load('depense', 'add_depense');
}
Beispiel #20
0
<?php

if (tp('verif') == 1) {
    $nextid = getnextidtable('quotpatronal');
    model::load('quotpatronal', 'addquotpatronal');
    $date = tp('date');
    if (verif_quot($date)) {
        exit("3");
        continue;
    } else {
        if (!addquotpatronal($nextid, tp('montant'), tp('pjid'), tp('date'))) {
            exit("2");
        } else {
            exit("1");
        }
    }
} else {
    view::load('quotpatronal', 'addquotpatronal');
}
Beispiel #21
0
<?php

if (tp('verif') == 1) {
    $nextid = getnextidtable('communique');
    model::load('com', 'addcom');
    if (!addcom(tp('titrfr'), tp('titren'), tp('titrar'), tp('contfr'), tp('conten'), tp('contar'), $nextid, tp('dat'))) {
        exit("0");
    } else {
        exit("1");
    }
} else {
    view::load('com', 'addcom');
}
Beispiel #22
0
<?php

if (tp('verif') == 1) {
    global $db;
    $nextid = getnextidtable("info_personnel");
    model::load('salarie', 'addsalarie');
    if (!addsalarie($nextid, tp('firstname'), tp('lastname'), tp('fonction'), tp('salaire'), tp('date_em'), tp('agence'), tp('service'), tp('matricule'), tp('nom_banque'), tp('num_compte'), tp('taux_anc'), tp('status'), tp('photoid'), tp('etatc'), tp('nbrenf'))) {
        exit("1");
    } else {
        if (!addsalarie2($nextid, tp('salaire'), tp('nom_banque'), tp('num_compte'), tp('taux_anc'), tp('iden_eau_elec'), tp('indem_domec'), tp('nouveau_salaire'), tp('idem_log'), tp('indem_caisse'), tp('indem_risque'), tp('indem_resp'), tp('indem_tel'))) {
            exit("3");
        } else {
            exit("2");
        }
    }
} else {
    view::load('salarie', 'addsalarie');
}
?>
 
Beispiel #23
0
<?php

//addnews($titrfr,$titren,$titrar,$contfr,$conten,$contar,$img,$id,$autfr,$auten,$autar,$slider)
if (tp('verif') == 1) {
    $nextid = getnextidtable('vod');
    model::load('vod', 'addvod');
    if (!addvod(tp('titrfr'), tp('titren'), tp('titrar'), tp('vodfr'), tp('voden'), tp('vodar'), $nextid, tp('sindx'))) {
        exit("0");
    } else {
        exit("1");
    }
} else {
    view::load('vod', 'addvod');
}
Beispiel #24
0
<?php

if (isset($_POST['verif']) && $_POST['verif'] == 1) {
    //verif si il y a une image.
    if (tp('photoid') != '') {
        $img = tp('photoid');
    } else {
        $img = '';
    }
    $nextid = getnextidtable('page');
    model::load('page', 'addpage');
    if (!addpage(tp('titrfr'), tp('titren'), tp('titrar'), tp('contfr'), tp('conten'), tp('contar'), tp('parent'), $img, $nextid, tp('titrimgfr'), tp('titrimgar'), tp('ximg'), tp('yimg'))) {
        exit("0");
    } else {
        exit("1");
    }
} else {
    view::load('page', 'addpage');
}
Beispiel #25
0
function autoarchive($file, $titr, $modul, $idm, $table, $col, $usr, $service)
{
    global $db;
    // Next ID
    $nextid = getnextidtable('archiver');
    $values["doc"] = MySQL::SQLValue($file);
    $values["titr"] = MySQL::SQLValue($titr);
    $values["modul"] = MySQL::SQLValue($modul);
    $values["idm"] = MySQL::SQLValue($idm);
    $values["addby"] = MySQL::SQLValue($usr);
    $values["service"] = MySQL::SQLValue($service);
    // Execute the insert
    $result = $db->InsertRow("archiver", $values);
    // If we have an error
    if (!$result) {
        // Show the error and kill the script
        $db->Kill($db->Error() . 'ARCHIVER');
        return false;
    } else {
        $req = "update {$table} set {$col}={$nextid} where id= {$idm}";
        if (!$db->Query($req)) {
            $db->Kill($db->Error() . $req);
        }
    }
}
Beispiel #26
0
<?php

if (tp('verif') == 1) {
    global $db;
    $nextid = getnextidtable('produit_reform');
    model::load('reform', 'addreform');
    if (!addreform($nextid, tp('titre'), tp('desc'), tp('montant'), tp('pjid'), tp('date_op'))) {
        exit("1");
    } else {
        exit("2");
    }
} else {
    view::load('reform', 'addreform');
}
Beispiel #27
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');
}
?>
 
Beispiel #28
0

<?php 
if (tp('verif') == 1) {
    global $db;
    $nextid = getnextidtable('contrat');
    $date_contrat = new DateTime(tp("date"));
    $dat_du_jour = new DateTime(date('d-m-Y'));
    if ($date_contrat > $dat_du_jour) {
        exit("2# La Date du Contrat Invalid ");
    }
    //Check si le montant dépasse les fond dispo
    $montant_dispo = $db->QuerySingleValue0("select mont_disp from paragraphe where id = " . tp('paragraphe'));
    if ($montant_dispo < tp('montant')) {
        exit("2# Le Montant de contrat dépasse les fonds de la source ");
    }
    //Get Id fournisseur
    //Check if have same Titre and same Chapitre
    $nom_fornisseur = str_replace(' ', '', tp('fournisseur'));
    $id_fournisseur = $db->QuerySingleValue0("select id from fournisseur  where REPLACE(rs, ' ','') = '{$nom_fornisseur}'  ");
    if ($id_fournisseur == "0") {
        exit("3#Ce fournisseur n'existe pas dans la base de données");
    }
    model::load('contrat', 'addcontratf');
    if (!add_contrat($nextid, tp('titre'), $id_fournisseur, tp('date'), tp('montant'), tp('article'), tp('paragraphe'), tp('chapitre'), tp('pjid'))) {
        exit("2#Erreur Système");
    } else {
        exit("1#Opération réussie");
    }
} else {
    view::load('contrat', 'addcontratf');
Beispiel #29
0
<?php

//addnews($titrfr,$titren,$titrar,$contfr,$conten,$contar,$img,$id,$autfr,$auten,$autar,$slider)
if (tp('verif') == 1) {
    //verif si il y a une image.
    $nextid = getnextidtable('contenu');
    if (tp('slider') == "1" && tp('photoid') == NULL) {
        exit("2#Pour afficher cette actualité dans le slider il faut insérer une photo !");
    }
    /*if(tp('photoid')!="" )
    	{
    	$slider=tp('slider');
    	}
    	else{
    	$slider='';
    	}*/
    model::load('news', 'addnews');
    if (!addnews(tp('titrfr'), tp('titren'), tp('titrar'), tp('contfr'), tp('conten'), tp('contar'), tp('photoid'), $nextid, tp('autfr'), tp('auten'), tp('autar'), tp('slider'), tp('dat'), tp('flash'), tp('vod'), tp('phototid'))) {
        exit("2#Erreur système");
    } else {
        exit("1#Opération réussie");
    }
} else {
    view::load('news', 'addnews');
}
Beispiel #30
0
<?php

//addnews($titrfr,$titren,$titrar,$contfr,$conten,$contar,$img,$id,$autfr,$auten,$autar,$slider)
if (tp('verif') == 1) {
    $nextid = getnextidtable('document');
    if (tp('fileuploadid') == "") {
        exit("2");
    }
    model::load('doc', 'adddoc');
    if (!addnews(tp('titrfr'), tp('titren'), tp('titrar'), tp('fileuploadid'), $nextid, tp('article'), tp('typ'))) {
        exit("0");
    } else {
        exit("1");
    }
} else {
    view::load('doc', 'adddoc');
}