Ejemplo n.º 1
0
        if ($id_key_unic == null) {
            $tableau[] = $datas;
        } else {
            $tableau[$datas[$id_key_unic]] = $datas;
        }
    }
    return $tableau;
}
/*****/
include '../connect_db.php';
$sql = "SELECT * FROM cpas_codes order by libelle;";
var_dump($sql);
$result = mysqli_query($lien, $sql);
//ferme la connection//
mysqli_close($lien);
$tab_codes = fn_ResultToArray($result, "id_code");
/****************************************************************/
$outStr = "";
$headStr = "<?php \n";
$nomTable = "array_code";
$initialisation = "\$" . $nomTable . "=array(); \n";
$outStr .= "\$" . $nomTable . "[0]='---'; \n";
foreach ($tab_codes as $key => $value) {
    $outStr .= "\$" . $nomTable . "[" . $value['id_code'] . "]=\"" . $value['libelle'] . "\"; \n";
    //$outStr.="$".$nomTable."[".$value['id_code']."]['N']=\"".$value['libelle_N']."\"; \n";
}
$footStr = "?>";
$totalStr = $headStr;
$totalStr .= $initialisation;
$totalStr .= "\n";
$totalStr .= $outStr;
/**********DEPARTEMENTS**********************************/
$sql = "select * from cpas_departements order by label_F;\n\t";
$result = mysqli_query($lien, $sql);
if (!$result) {
    echo "erreur dans la requete:<i>" . $sql . "</i>";
    exit;
}
$tab_dep = fn_ResultToArray($result, 'id_dep');
/**********HORS DEPARTEMENTS**********************************/
$sql = "select * from cpas_hors_departements order by label_F;\n\t";
$result = mysqli_query($lien, $sql);
if (!$result) {
    echo "erreur dans la requete:<i>" . $sql . "</i>";
    exit;
}
$tab_hors_dep = fn_ResultToArray($result, 'id_hors_dep');
mysqli_close($lien);
include '../arrays_libelle/array_article_budgetaire.php';
include '../arrays_libelle/array_hors_departement.php';
include '../arrays_libelle/array_departement.php';
include '../arrays_libelle/array_service.php';
include '../arrays_libelle/array_cellule.php';
if ($id_mvt_service == 0) {
    $titre = 'Ajout d\'un mouvement de service';
    // vérifie s'il s'agit du 1er mvt
    include '../connect_db.php';
    $sql = "select * from cpas_mouvements_services\n\twhere id_contrat=" . $id_contrat . ";\n\t";
    $result = mysqli_query($lien, $sql);
    if (mysqli_num_rows($result) == 0) {
        // si c'est la 1ère fois => date de début du contrat = date début mvt
        $sql = "select start_date from cpas_contrats\n\t\twhere id_contrat=" . $id_contrat . ";\n\t\t";
Ejemplo n.º 3
0
        if ($id_key_unic == null) {
            $tableau[] = $datas;
        } else {
            $tableau[$datas[$id_key_unic]] = $datas;
        }
    }
    return $tableau;
}
/*****/
include '../connect_db.php';
$sql = "SELECT * FROM cpas_grades order by libelle_F;";
var_dump($sql);
$result = mysqli_query($lien, $sql);
//ferme la connection//
mysqli_close($lien);
$tab_grades = fn_ResultToArray($result, "id_grade");
/****************************************************************/
$outStr = "";
$headStr = "<?php \n";
$nomTable = "array_grade";
$initialisation = "\$" . $nomTable . "=array(); \n";
$outStr .= "\$" . $nomTable . "[0]['F']='---'; \n";
$outStr .= "\$" . $nomTable . "[0]['N']='---'; \n";
foreach ($tab_grades as $key => $value) {
    $outStr .= "\$" . $nomTable . "[" . $value['id_grade'] . "]['F']=\"" . $value['libelle_F'] . "\"; \n";
    $outStr .= "\$" . $nomTable . "[" . $value['id_grade'] . "]['N']=\"" . $value['libelle_N'] . "\"; \n";
}
$footStr = "?>";
$totalStr = $headStr;
$totalStr .= $initialisation;
$totalStr .= "\n";
/************************************************************************
**************Construction des effectifs à une date donnée************
************************************************************************/
include 'creation_table_effectifs.php';
/***************Lecture des contrats****************************************/
include '../connect_db.php';
$sql = "\nselect \n*\nfrom \ncpas_contrats \nwhere \nstart_date <= '" . $date_effectif . "'\nAND\n(end_date >= '" . $date_effectif . "' or end_date='0000-00-00' or end_date='' or end_date is null)\nAND\nstatut='N';\n;\n";
$result = mysqli_query($lien, $sql);
$tab_contrats = fn_ResultToArray($result, "id_contrat");
/**************************Lecture agents + signalétiques****************************************************/
$result = array();
$sql = "select \n*\nfrom \ncpas_effectifs_" . $new_date_effectif . "\nwhere registre_id<990000\norder by nom,prenom;";
//var_dump($sql);
$result = mysqli_query($lien, $sql);
mysqli_close($lien);
$Row = fn_ResultToArray($result, "id_agent");
$nb_agents = count($Row) + 1;
/*********************************************/
$tab_dep = array();
$tab_ser = array();
$tab_cel = array();
$tab_OE = array();
$tab_grade = array();
$tab_fct = array();
$tab_cat = array();
$tab_bareme = array();
$tab_code = array();
$tab_date_code = array();
$tab_statut = array();
$tab_date_statut = array();
$tab_regime = array();
Ejemplo n.º 5
0
include '../arrays_libelle/array_bareme.php';
include '../arrays_libelle/array_code.php';
include '../arrays_libelle/array_fonction.php';
//include('../arrays_libelle/array_statut.php');
//include('../arrays_libelle/array_regime.php');
/*************/
$date_effectif = transformDate($date_situation_effectifs);
/*******Connexion database***************/
include '../connect_db.php';
/*******Lire places au cadre*****************************/
$sql = "\nSELECT * from \ncpas_places_cadre\nwhere id_cadre=" . $id_cadre . " and statut='N' order by type_cadre desc,id_dep asc,id_ser asc;\n\n";
//var_dump( $sql);
$result = mysqli_query($lien, $sql);
/********Close connexion***************/
mysqli_close($lien);
$tab_cadres = fn_ResultToArray($result, 'id_place_cadre');
echo "\n<table>\n\t<tr style='height:50px;padding-top:5px;margin-top:5px;background-color:#E4F8D2;'>\n\t\t\n\t\t<td>HORS DEP./DEP.</td>\n\t\t<td>SERVICE</td>\n\t\t<td>BAREME</td>\n\t\t<td>FONCTION</td>\n\t\t<td>GRADE</td>\n\t\t<td>TYPE CADRE</td>\n\t\t<td>ARTICLE BUDGETAIRE</td>\n\t\t<td>EQUIV. TEMPS PLEIN</td>\n\t</tr>\n\n";
//echo '<table>';
$i = 0;
foreach ($tab_cadres as $key => $value) {
    $i++;
    if ($i % 2 == 0) {
        echo '<tr style="background-color:#ddd;">';
    } else {
        echo '<tr style="background-color:#fff;">';
    }
    if ($value['id_hors_dep'] == 0 || $value['id_hors_dep'] == '' || $value['id_hors_dep'] == null) {
        echo '<td>' . $array_departement[$value['id_dep']]['F'] . '</td>';
    } else {
        echo '<td>' . $array_hors_departement[$value['id_hors_dep']]['F'] . '</td>';
    }
        if ($id_key_unic == null) {
            $tableau[] = $datas;
        } else {
            $tableau[$datas[$id_key_unic]] = $datas;
        }
    }
    return $tableau;
}
/*****/
include '../connect_db.php';
$sql = "SELECT * FROM cpas_types_primes order by label_F;";
var_dump($sql);
$result = mysqli_query($lien, $sql);
//ferme la connection//
mysqli_close($lien);
$tab_types_primes = fn_ResultToArray($result, "id_type_prime");
/****************************************************************/
$outStr = "";
$headStr = "<?php \n";
$nomTable = "array_type_prime";
$initialisation = "\$" . $nomTable . "=array(); \n";
$outStr .= "\$" . $nomTable . "[0]['F']='---'; \n";
$outStr .= "\$" . $nomTable . "[0]['N']='---'; \n";
foreach ($tab_types_primes as $key => $value) {
    $outStr .= "\$" . $nomTable . "[" . $value['id_type_prime'] . "]['F']=\"" . addslashes($value['label_F']) . "\"; \n";
    $outStr .= "\$" . $nomTable . "[" . $value['id_type_prime'] . "]['N']=\"" . addslashes($value['label_N']) . "\"; \n";
}
$footStr = "?>";
$totalStr = $headStr;
$totalStr .= $initialisation;
$totalStr .= "\n";
        if ($id_key_unic == null) {
            $tableau[] = $datas;
        } else {
            $tableau[$datas[$id_key_unic]] = $datas;
        }
    }
    return $tableau;
}
/*****/
include '../connect_db.php';
$sql = "SELECT * FROM cpas_grades_cadre order by libelle;";
var_dump($sql);
$result = mysqli_query($lien, $sql);
//ferme la connection//
mysqli_close($lien);
$tab_grades_cadre = fn_ResultToArray($result, "id_grade_cadre");
/****************************************************************/
$outStr = "";
$headStr = "<?php \n";
$nomTable = "array_grade_cadre";
$initialisation = "\$" . $nomTable . "=array(); \n";
$outStr .= "\$" . $nomTable . "[0]='---'; \n";
foreach ($tab_grades_cadre as $key => $value) {
    $outStr .= "\$" . $nomTable . "[" . $value['id_grade_cadre'] . "]=\"" . $value['libelle'] . "\"; \n";
    //$outStr.="$".$nomTable."[".$value['id_code']."]['N']=\"".$value['libelle_N']."\"; \n";
}
$footStr = "?>";
$totalStr = $headStr;
$totalStr .= $initialisation;
$totalStr .= "\n";
$totalStr .= $outStr;
Ejemplo n.º 8
0
            $tableau[$datas[$id_key_unic]] = $datas;
        }
    }
    return $tableau;
}
/****************************/
include '../connect_db.php';
/**************DEPARTEMENTS*******************************************/
$sql = "\n\t\tselect * from cpas_departements where actif=1 order by label_F;\n";
//var_dump($sql);
$result = mysqli_query($lien, $sql);
if (mysqli_num_rows($result) == 0) {
    echo 'No result';
    exit;
}
$tab_dep = fn_ResultToArray($result, 'id_dep');
?>
<style>
#DIV_CLOSE_PANNEL #box_close {
		
		/* position absolute so that z-index can be defined and able to move this item using javascript */
		position:absolute;
		top:0px;
		left:0px;
		z-index:200; 

		/* image of the right rounded corner */
		background: url(./tail.gif) no-repeat right top; 
		height:52px;
		/*border:1px solid red;*/
         $txt = "Nommé";
     } else {
         $txt = "Contractuel";
     }
     $table->addCell(1500)->addText(html_entity_decode(iconv('UTF-8', 'windows-1252', $txt)));
 }
 /*****************************************************
 	Lecture des Mouvements régimes
 	********************************************************/
 $sql = "\n\t\tselect\n\t\t*\n\t\tfrom cpas_mouvements_regimes\n\t\twhere statut='N' and id_contrat=" . $value['id_contrat'] . " order by date_debut_regime desc;\n\t\t";
 //var_dump($sql);
 $result = mysqli_query($lien, $sql);
 if (mysqli_num_rows($result) == 0) {
     echo "Aucun mvt<br><br>";
 }
 $tab_mvt_regimes = fn_ResultToArray($result, 'id_mvt_regime');
 /********Titre mouvements régimes + titre colonnes**********************************/
 $section->addText(html_entity_decode(iconv('UTF-8', 'windows-1252', '')), array('spaceAfter' => 200));
 $txt = "Mouvements de régime";
 $section->addText(html_entity_decode(iconv('UTF-8', 'windows-1252', $txt)), 'rStyle', 'pStyle_left');
 $PHPWord->addTableStyle('myOwnTableStyle', $styleTable, $styleFirstRow);
 // Add table
 $table = $section->addTable('myOwnTableStyle');
 $table->addRow();
 $txt = "Début";
 $table->addCell(1500)->addText(html_entity_decode(iconv('UTF-8', 'windows-1252', $txt)));
 $txt = "Echéance";
 $table->addCell(1500)->addText(html_entity_decode(iconv('UTF-8', 'windows-1252', $txt)));
 $txt = "Régime";
 $table->addCell(2000)->addText(html_entity_decode(iconv('UTF-8', 'windows-1252', $txt)));
 $txt = "Equiv. temps plein";
$sql = "\n\t\tselect * from cpas_mouvements_services where id_contrat=" . $id_contrat . " and statut='N' order by date_debut_service desc,id_mvt_service desc;\n";
//var_dump($sql);
$result = mysqli_query($lien, $sql);
if (mysqli_num_rows($result) == 0) {
    //echo '<div class="td_list_title"> >> Mouvement(s) de service <span style="background-color:#B0F276;color:black;font-weight:bold;height:30px;width:30px;" title="Ajout d\'un mouvement dans le temps" onclick="DisplayFormMvt(\'DIV_FORM_MVT_SER\',\'service\','.$id_agent.','.$id_contrat.');">&nbsp;+&nbsp;</span></div>';
    echo "Il n'y a pas encore de mouvement encodé pour cet agent. ";
    echo 'Cliquez sur le bouton "+" pour ajouter un mouvement de service.';
    echo "<br><br>";
    //echo '<input type="button" value="Ajout d\'un mouvement ultérieur" onclick="DisplayFormMvt(\'service\',\''.$id_agent.'\');" />';
    exit;
}
/*else
{*/
mysqli_close($lien);
//$dernier_mvt_services=mysqli_fetch_assoc($result);
$tab_mvt_services = fn_ResultToArray($result, 'id_mvt_service');
/***********************************************************/
include '../arrays_libelle/array_article_budgetaire.php';
include '../arrays_libelle/array_hors_departement.php';
include '../arrays_libelle/array_departement.php';
include '../arrays_libelle/array_service.php';
include '../arrays_libelle/array_cellule.php';
//$tab_cel=array();
if ($tab_mvt_services != null) {
    //echo '<div class="td_list_title"> >> Mouvement(s) de service <span style="background-color:#B0F276;color:black;font-weight:bold;height:30px;width:30px;" title="Ajout d\'un mouvement dans le temps" onclick="DisplayFormMvt(\'DIV_FORM_MVT_SER\',\'service\','.$id_agent.','.$id_contrat.');">&nbsp;+&nbsp;</span></div>';
    echo '<div style="position:absolute;">';
    echo '<table border="0" cellpadding="0" cellspacing="0">';
    echo '<tr>';
    echo '<td class="td_list" style="width:95px;padding:5px;text-align:center;">Date de début</td>';
    echo '<td class="td_list" style="width:95px;padding:5px;text-align:center;">Date d\'échéance</td>';
    //echo '<td class="td_list" style="width:100px;padding:5px;text-align:center;">Id-contrat</td>';
    }
    return $tableau;
}
include '../connect_db.php';
$sql = "\n\t\tselect * from cpas_mouvements_fonctions where id_contrat=" . $id_contrat . " and statut='N' order by date_debut_fonction desc;\n";
//var_dump($sql);
$result = mysqli_query($lien, $sql);
if (mysqli_num_rows($result) == 0) {
    //echo '<div class="td_list_title"> >> Mouvement(s) de fonction <span style="background-color:#B0F276;color:black;font-weight:bold;height:30px;width:30px;" title="Ajout d\'un mouvement dans le temps" onclick="DisplayFormMvt(\'DIV_FORM_MVT_FCT\',\'fonction\','.$id_agent.','.$id_contrat.');">&nbsp;+&nbsp;</span></div>';
    echo "Il n'y a pas encore de mouvement encodé pour cet agent. ";
    echo 'Cliquez sur le bouton "+" pour ajouter un mouvement de fonction.';
    echo "<br><br>";
    exit;
}
mysqli_close($lien);
$tab_mvt_fonctions = fn_ResultToArray($result, 'id_mvt_fonction');
include '../arrays_libelle/array_fonction.php';
if ($tab_mvt_fonctions != null) {
    echo '<div style="position:absolute;">';
    echo '<table border="0" cellpadding="0" cellspacing="0">';
    echo '<tr>';
    echo '<td class="td_list" style="width:95px;padding:5px;text-align:center;">Date de début</td>';
    echo '<td class="td_list" style="width:95px;padding:5px;text-align:center;">Date d\'échéance</td>';
    //echo '<td class="td_list" style="width:100px;padding:5px;text-align:center;">Id-contrat</td>';
    echo '<td class="td_list" style="width:155px;padding:5px;text-align:center;">Fonction</td>';
    echo '<td class="td_list" style="width:55px;padding:5px;text-align:center;">O/E</td>';
    echo '<td class="td_list" style="width:95px;padding:5px;text-align:center;">Catégorie</td>';
    echo '<td class="td_list" style="width:80px;padding:5px;text-align:center;">Resp.</td>';
    echo '<td class="td_list" style="width:45px;padding:5px;text-align:center;"></td>';
    //echo '<td class="td_list" style="width:110px;padding:5px;text-align:center;">Créé par</td>';
    //echo '<td class="td_list" style="width:110px;padding:5px;text-align:center;"">Modifié par</td>';
if (mysqli_num_rows($result) == 0) {
    echo "alert('Aucun contrat entre ces 2 dates');";
    exit;
}
$array_nb_contrats = fn_ResultToArray($result, 'id_agent');
/***************************************************/
$sql = "\nselect \ncpas_agents.id_agent\n,nom\n,prenom\n,date_naissance \n,registre_id\n,start_date\n,id_statut\n,id_regime\n,id_fonc\n,id_ser\n,id_cel\n,id_dep\n,id_hors_dep\nfrom cpas_agents\njoin cpas_signaletiques_agents\non cpas_agents.id_agent=cpas_signaletiques_agents.id_agent\nJOIN\ncpas_contrats\non cpas_contrats.id_agent=cpas_agents.id_agent\nWHERE\nstart_date>='" . transformDate($date_debut) . "' and start_date<='" . transformDate($date_fin) . "'\nand registre_id<990000\norder by nom;\n";
//var_dump($sql);
$result = mysqli_query($lien, $sql);
if (mysqli_num_rows($result) == 0) {
    echo "alert('Aucun contrat entre ces 2 dates');";
    exit;
}
$nb_records = mysqli_num_rows($result);
$nb_records = $nb_records + 1;
$array_contrats = fn_ResultToArray($result, 'id_agent');
mysqli_close($lien);
$tab_nb_contrats = array();
foreach ($array_nb_contrats as $key => $value) {
    $tab_nb_contrats[$value['nom'] . '-' . $value['prenom']] = $value['nb_contrats'];
}
/**********************************************************/
include '../arrays_libelle/array_departement.php';
include '../arrays_libelle/array_hors_departement.php';
include '../arrays_libelle/array_service.php';
include '../arrays_libelle/array_cellule.php';
include '../arrays_libelle/array_statut.php';
include '../arrays_libelle/array_fonction.php';
include '../arrays_libelle/array_regime.php';
/***********************************************************/
// LETTRE COLONNE  ****** TITRE COLONNE CORRESPONDANTE  *****/
Ejemplo n.º 13
0
        if ($id_key_unic == null) {
            $tableau[] = $datas;
        } else {
            $tableau[$datas[$id_key_unic]] = $datas;
        }
    }
    return $tableau;
}
/*****/
include '../connect_db.php';
$sql = "SELECT * FROM cpas_regimes order by libelle_F;";
var_dump($sql);
$result = mysqli_query($lien, $sql);
//ferme la connection//
mysqli_close($lien);
$tab_regimes = fn_ResultToArray($result, "id_regime");
/****************************************************************/
$outStr = "";
$headStr = "<?php \n";
$nomTable = "array_regime";
$initialisation = "\$" . $nomTable . "=array(); \n";
$outStr .= "\$" . $nomTable . "[0]['F']='---'; \n";
$outStr .= "\$" . $nomTable . "[0]['N']='---'; \n";
foreach ($tab_regimes as $key => $value) {
    $outStr .= "\$" . $nomTable . "[" . $value['id_regime'] . "]['F']=\"" . $value['libelle_F'] . "\"; \n";
    $outStr .= "\$" . $nomTable . "[" . $value['id_regime'] . "]['N']=\"" . $value['libelle_N'] . "\"; \n";
}
$footStr = "?>";
$totalStr = $headStr;
$totalStr .= $initialisation;
$totalStr .= "\n";
            $tableau[] = $datas;
        } else {
            $tableau[$datas[$id_key_unic]] = $datas;
        }
    }
    return $tableau;
}
/*****/
include '../connect_db.php';
//$sql="SELECT * FROM cpas_equivalents_temps_plein order by libelle;";
$sql = "SELECT * FROM cpas_regimes order by libelle_F;";
var_dump($sql);
$result = mysqli_query($lien, $sql);
//ferme la connection//
mysqli_close($lien);
$tab_equiv_tp = fn_ResultToArray($result, "id_regime");
/****************************************************************/
$outStr = "";
$headStr = "<?php \n";
$nomTable = "array_equivalent_temps_plein";
$initialisation = "\$" . $nomTable . "=array(); \n";
$outStr .= "\$" . $nomTable . "[0]='---'; \n";
foreach ($tab_equiv_tp as $key => $value) {
    $outStr .= "\$" . $nomTable . "[" . $value['id_regime'] . "]=\"" . $value['equiv_tp'] . "\"; \n";
    //$outStr.="$".$nomTable."[".$value['id_code']."]['N']=\"".$value['libelle_N']."\"; \n";
}
$footStr = "?>";
$totalStr = $headStr;
$totalStr .= $initialisation;
$totalStr .= "\n";
$totalStr .= $outStr;
            $tableau[] = $datas;
        } else {
            $tableau[$datas[$id_key_unic]] = $datas;
        }
    }
    return $tableau;
}
/*****/
include '../connect_db.php';
//$sql="SELECT * FROM v_departements_services_cellules where cellule_actif=1 order by service_F,service_N;";
$sql = "SELECT * FROM cpas_cellules; ";
//var_dump($sql);
$result = mysqli_query($lien, $sql);
//ferme la connection//
mysqli_close($lien);
$tab_cel = fn_ResultToArray($result, "id_cel");
/****************************************************************/
$outStr = "";
$headStr = "<?php \n";
$nomTable = "array_cellule";
$initialisation = "\$" . $nomTable . "=array(); \n";
$outStr .= "\$" . $nomTable . "[0]['F']='---'; \n";
$outStr .= "\$" . $nomTable . "[0]['N']='---'; \n";
foreach ($tab_cel as $key => $value) {
    //if($value['actif']==1)
    //{
    /* $outStr.="$".$nomTable."[".$value['id_cel']."]['F']=\"".$value['service_F'].' - '.$value['cellule_F']."\"; \n";
    
    		$outStr.="$".$nomTable."[".$value['id_cel']."]['N']=\"".$value['service_N'].' - '.$value['cellule_N']."\"; \n"; */
    $outStr .= "\$" . $nomTable . "[" . $value['id_cel'] . "]['F']=\"" . $value['label_F'] . "\"; \n";
    $outStr .= "\$" . $nomTable . "[" . $value['id_cel'] . "]['N']=\"" . $value['label_N'] . "\"; \n";
 *******************************************************************************/
 $tab_cellules = fn_ResultToArray($result, 'id_cel');
 //var_dump($tab_cellules);
 foreach ($tab_cellules as $key3 => $value3) {
     $styleCell = array('valign' => 'center', 'bgColor' => 'cccccc');
     $PHPWord->addTableStyle('myOwnTableStyle', $styleTable, $styleFirstRow);
     $table = $section->addTable('myOwnTableStyle');
     //$title=html_entity_decode(iconv('UTF-8', 'windows-1252',$array_service[$value['id_ser']]['F']));
     $table->addRow(500);
     //$table->setMTitle($title);
     $table->addCell(5000, $styleCell)->addText(html_entity_decode(iconv('UTF-8', 'windows-1252', $array_cellule[$value3['id_cel']]['F'])), $fontStyle);
     $sql = "select \n\t\t\t\t*\n\t\t\t\tfrom \n\t\t\t\tcpas_effectifs_" . $new_date_effectif . "\n\t\t\t\twhere \n\t\t\t\tid_cel=" . $value3['id_cel'] . " \n\t\t\t\tand registre_id<990000\n\t\t\t\torder by nom,prenom;";
     //var_dump($sql);
     $result = mysqli_query($lien, $sql);
     if (mysqli_num_rows($result) > 0) {
         $tab_agents_cel = fn_ResultToArray($result, 'id_contrat');
         //var_dump($tab_agents_cel);
         foreach ($tab_agents_cel as $key_agents_cel => $value_agents_cel) {
             $i++;
             $table->addRow();
             $table->addCell(2000)->addText(html_entity_decode(iconv('UTF-8', 'windows-1252', $i . ' - ' . $value_agents_cel['nom'] . " " . $value_agents_cel['prenom'])));
             if ($value_agents_cel['date_echeance_regime'] == '0000-00-00' || $value_agents_cel['date_echeance_regime'] == '00-00-0000') {
                 $table->addCell(2000)->addText(html_entity_decode(iconv('UTF-8', 'windows-1252', $array_regime[$value_agents_cel['id_regime']]['F'])));
             } else {
                 $table->addCell(2000)->addText(html_entity_decode(iconv('UTF-8', 'windows-1252', $array_regime[$value_agents_cel['id_regime']]['F'] . ' ' . $value_agents_cel['date_echeance_regime'])));
             }
             $table->addCell(1000)->addText($value_agents_cel['langue']);
             $table->addCell(3000)->addText(html_entity_decode(iconv('UTF-8', 'windows-1252', $array_grade[$value_agents_cel['id_grade']]['F'])));
             if ($value_agents_cel['id_statut_special'] == 0) {
                 $table->addCell(2000)->addText(html_entity_decode(iconv('UTF-8', 'windows-1252', $array_statut[$value_agents_cel['id_statut']]['F'])));
             } else {
include '../arrays_libelle/array_service.php';
include '../arrays_libelle/array_cellule.php';
include '../arrays_libelle/array_grade.php';
include '../arrays_libelle/array_bareme.php';
include '../arrays_libelle/array_code.php';
include '../arrays_libelle/array_fonction.php';
/**********Params***************************************/
include 'params.php';
/********************************/
include '../connect_db.php';
$sql = "SELECT * FROM cpas_contrats \n\t\n\twhere id_agent=" . $id_agent . " and statut='N' order by start_date desc;";
//var_dump($sql);
$result = mysqli_query($lien, $sql);
//ferme la connection//
mysqli_close($lien);
$tab_contrats = fn_ResultToArray($result, 'id_contrat');
/*************************/
$string_dep = '';
if ($tab_contrats == null) {
    echo 'Pas encore de contrat<br>';
} else {
    foreach ($tab_contrats as $key => $value) {
        echo '<div class="modif_contrat" onclick="DisplayFormContratModif(' . $value['id_contrat'] . ',' . $id_agent . ');">';
        if ($value['actif'] == 1) {
            $actif = "<span style='color:green;'>Contrat actif</span>";
        } else {
            $actif = "<i>Contrat inactif</i>";
        }
        $string_dep = '';
        /*********DEPARTEMENT*************/
        if (array_key_exists($value['id_dep'], $array_departement)) {
        if ($id_key_unic == null) {
            $tableau[] = $datas;
        } else {
            $tableau[$datas[$id_key_unic]] = $datas;
        }
    }
    return $tableau;
}
/*****/
include '../connect_db.php';
$sql = "SELECT * FROM cpas_fonctions order by label_F;";
var_dump($sql);
$result = mysqli_query($lien, $sql);
//ferme la connection//
mysqli_close($lien);
$tab_fonc = fn_ResultToArray($result, "id_fonc");
/****************************************************************/
$outStr = "";
$headStr = "<?php \n";
$nomTable = "array_fonction";
$initialisation = "\$" . $nomTable . "=array(); \n";
$outStr .= "\$" . $nomTable . "[0]['F']='---'; \n";
$outStr .= "\$" . $nomTable . "[0]['N']='---'; \n";
$outStr .= "\$" . $nomTable . "[1000]['F']='Autre type de fonction'; \n";
$outStr .= "\$" . $nomTable . "[1000]['N']='Andere functie'; \n";
foreach ($tab_fonc as $key => $value) {
    if ($value['actif'] == 1) {
        $outStr .= "\$" . $nomTable . "[" . $value['id_fonc'] . "]['F']=\"" . $value['label_F'] . "\"; \n";
        $outStr .= "\$" . $nomTable . "[" . $value['id_fonc'] . "]['N']=\"" . $value['label_N'] . "\"; \n";
    }
}
    }
    return $tableau;
}
include '../connect_db.php';
$sql = "\n\t\tselect * from cpas_mouvements_baremes where id_contrat=" . $id_contrat . " and statut='N' order by date_debut_bareme desc;\n";
//var_dump($sql);
$result = mysqli_query($lien, $sql);
if (mysqli_num_rows($result) == 0) {
    //echo '<div class="td_list_title"> >> Mouvement(s) de bareme <span style="background-color:#B0F276;color:black;font-weight:bold;height:30px;width:30px;" title="Ajout d\'un mouvement dans le temps" onclick="DisplayFormMvt(\'DIV_FORM_MVT_BAREME\',\'bareme\','.$id_agent.','.$id_contrat.');">&nbsp;+&nbsp;</span></div>';
    echo "Il n'y a pas encore de mouvement encodé pour cet agent. ";
    echo 'Cliquez sur le bouton "+" pour ajouter un mouvement de barème et grade.';
    echo "<br><br>";
    exit;
}
mysqli_close($lien);
$tab_mvt_baremes = fn_ResultToArray($result, 'id_mvt_bareme');
include '../arrays_libelle/array_bareme.php';
include '../arrays_libelle/array_code.php';
include '../arrays_libelle/array_grade.php';
include '../arrays_libelle/array_type_cadre.php';
//Mvt effectué
if ($tab_mvt_baremes != null) {
    //echo '<div class="td_list_title"> >> Mouvement(s) de barème <span style="background-color:#B0F276;color:black;font-weight:bold;height:30px;width:30px;" title="Ajout d\'un mouvement dans le temps" onclick="DisplayFormMvt(\'DIV_FORM_MVT_BAREME\',\'bareme\','.$id_agent.','.$id_contrat.');">&nbsp;+&nbsp;</span></div>';
    echo '<div style="position:absolute;">';
    echo '<table border="0" cellpadding="0" cellspacing="0">';
    echo '<tr>';
    echo '<td class="td_list" style="width:95px;padding:5px;text-align:center;">Date de début</td>';
    echo '<td class="td_list" style="width:95px;padding:5px;text-align:center;">Date d\'échéance</td>';
    //echo '<td class="td_list" style="width:100px;padding:5px;text-align:center;">Id-contrat</td>';
    echo '<td class="td_list" style="width:95px;padding:5px;text-align:center;">Barème/Code</td>';
    echo '<td class="td_list" style="width:100px;padding:5px;text-align:center;">Grade</td>';
function fn_ResultToArray($result = null, $id_key_unic = null)
{
    //verifier validité de $result
    if ($result == null) {
        echo "pas de paramètre result";
        return false;
    }
    $tableau = array();
    while ($datas = mysqli_fetch_assoc($result)) {
        if ($id_key_unic == null) {
            $tableau[] = $datas;
        } else {
            $tableau[$datas[$id_key_unic]] = $datas;
        }
    }
    return $tableau;
}
include '../connect_db.php';
$sql = "\n\t\tselect * from cpas_services where id_dep=" . $id_dep . " and actif=1 order by label_F;\n";
//var_dump($sql);
$result = mysqli_query($lien, $sql);
if (mysqli_num_rows($result) == 0) {
    echo "<option value='0'>---</option>";
    exit;
}
mysqli_close($lien);
$tab_ser = fn_ResultToArray($result, 'id_ser');
echo '<option value="0">---</option>';
foreach ($tab_ser as $key => $value) {
    echo '<option value="' . $value['id_ser'] . '" >' . $value['label_F'] . '</option>';
}
    }
    return $tableau;
}
include '../connect_db.php';
$sql = "\n\t\tselect * from cpas_mouvements_statuts where id_contrat=" . $id_contrat . " and statut='N' order by date_debut_statut desc;\n";
//var_dump($sql);
$result = mysqli_query($lien, $sql);
if (mysqli_num_rows($result) == 0) {
    //echo '<div class="td_list_title"> >> Mouvement(s) de statut <span style="background-color:#B0F276;color:black;font-weight:bold;height:30px;width:30px;" title="Ajout d\'un mouvement dans le temps" onclick="DisplayFormMvt(\'DIV_FORM_MVT_STATUT\',\'statut\','.$id_agent.','.$id_contrat.');">&nbsp;+&nbsp;</span></div>';
    echo "Il n'y a pas encore de mouvement encodé pour cet agent. ";
    echo 'Cliquez sur le bouton "+" pour ajouter un mouvement de statut.';
    echo "<br><br>";
    exit;
}
mysqli_close($lien);
$tab_mvt_statuts = fn_ResultToArray($result, 'id_mvt_statut');
include '../arrays_libelle/array_statut.php';
include '../arrays_libelle/array_contractuel_nomme.php';
if ($tab_mvt_statuts != null) {
    //Mvt
    //echo '<div class="td_list_title"> >> Mouvement(s) de statut <span style="background-color:#B0F276;color:black;font-weight:bold;height:30px;width:30px;" title="Ajout d\'un mouvement dans le temps" onclick="DisplayFormMvt(\'DIV_FORM_MVT_STATUT\',\'statut\','.$id_agent.','.$id_contrat.');">&nbsp;+&nbsp;</span></div>';
    echo '<div style="position:absolute;">';
    echo '<table border="0" cellpadding="0" cellspacing="0">';
    echo '<tr>';
    echo '<td class="td_list" style="width:95px;padding:5px;text-align:center;">Date de début</td>';
    //echo '<td class="td_list" style="width:100px;padding:5px;text-align:center;">Id-contrat</td>';
    echo '<td class="td_list" style="width:95px;padding:5px;text-align:center;">Date d\'échéance</td>';
    echo '<td class="td_list" style="width:120px;padding:5px;text-align:center;">Statut</td>';
    echo '<td class="td_list" style="width:120px;padding:5px;text-align:center;">Statut spécial</td>';
    echo '<td class="td_list" style="width:100px;padding:5px;text-align:center;">Contractuel/nommé</td>';
    echo '<td class="td_list" style="width:66px;padding:5px;text-align:center;"></td>';
Ejemplo n.º 22
0
        if ($id_key_unic == null) {
            $tableau[] = $datas;
        } else {
            $tableau[$datas[$id_key_unic]] = $datas;
        }
    }
    return $tableau;
}
/*****/
include '../connect_db.php';
$sql = "SELECT * FROM cpas_baremes order by libelle;";
var_dump($sql);
$result = mysqli_query($lien, $sql);
//ferme la connection//
mysqli_close($lien);
$tab_baremes = fn_ResultToArray($result, "id_bareme");
/****************************************************************/
$outStr = "";
$headStr = "<?php \n";
$nomTable = "array_bareme";
$initialisation = "\$" . $nomTable . "=array(); \n";
$outStr .= "\$" . $nomTable . "[0]='---'; \n";
foreach ($tab_baremes as $key => $value) {
    $outStr .= "\$" . $nomTable . "[" . $value['id_bareme'] . "]=\"" . $value['libelle'] . "\"; \n";
    //$outStr.="$".$nomTable."[".$value['id_code']."]['N']=\"".$value['libelle_N']."\"; \n";
}
$footStr = "?>";
$totalStr = $headStr;
$totalStr .= $initialisation;
$totalStr .= "\n";
$totalStr .= $outStr;
        if ($id_key_unic == null) {
            $tableau[] = $datas;
        } else {
            $tableau[$datas[$id_key_unic]] = $datas;
        }
    }
    return $tableau;
}
/*****/
include '../connect_db.php';
$sql = "SELECT * FROM cpas_articles_budgetaires order by code;";
var_dump($sql);
$result = mysqli_query($lien, $sql);
//ferme la connection//
mysqli_close($lien);
$tab_articles_budgetaires = fn_ResultToArray($result, "id_article_budgetaire");
/****************************************************************/
$outStr = "";
$headStr = "<?php \n";
$nomTable = "array_article_budgetaire";
$initialisation = "\$" . $nomTable . "=array(); \n";
$outStr .= "\$" . $nomTable . "[0]['F']='---'; \n";
$outStr .= "\$" . $nomTable . "[0]['N']='---'; \n";
foreach ($tab_articles_budgetaires as $key => $value) {
    $outStr .= "\$" . $nomTable . "[" . $value['id_article_budgetaire'] . "]['F']=\"" . $value['code'] . ' - ' . addslashes($value['libelle_F']) . "\"; \n";
    $outStr .= "\$" . $nomTable . "[" . $value['id_article_budgetaire'] . "]['N']=\"" . $value['code'] . ' - ' . addslashes($value['libelle_N']) . "\"; \n";
}
$footStr = "?>";
$totalStr = $headStr;
$totalStr .= $initialisation;
$totalStr .= "\n";
/********/
include 'connect_db.php';
/*if($nom_champ=="id_dep")
{
	$flag='flag_resp_dep=1';
}	
else
{
	$flag='flag_resp_ser=1';
}*/
$sql = "\nSELECT id_agent,nom,prenom,id_dep,id_ser,id_cel,flag_resp_dep,flag_resp_ser,actif FROM cpas_agents where " . $nom_champ . "=" . $valeur_champ . " and actif=1 order by nom;\n";
$result = mysqli_query($lien, $sql);
//echo $sql.'<br>';
if (mysqli_num_rows($result) == 0) {
    echo 'Pas de responsable connu';
    exit;
}
mysqli_close($lien);
//$tab_resp=fn_ResultToArray($result,'id_agent');
$tab_personnel = fn_ResultToArray($result, 'id_agent');
//echo $sql;
echo '<br>';
foreach ($tab_personnel as $key => $value) {
    if ($value['flag_resp_ser'] == 1) {
        $style = 'style="color:#fd0000;background-color:white;"';
        //echo '<span >Responsable : '.$value['nom'].' '.$value['prenom'].'</span><br>';
    } else {
        $style = 'background-color:white;';
    }
    echo '<div ' . $style . ' >' . $value['nom'] . ' ' . $value['prenom'] . '</div>';
}
Ejemplo n.º 25
0
        } else {
            $tableau[$datas[$id_key_unic]] = $datas;
        }
    }
    return $tableau;
}
/********/
include 'connect_db.php';
$sql = "\nSELECT * FROM cpas_cellules where id_ser=" . $id_ser . " and actif=1 order by label_F;\n";
$result = mysqli_query($lien, $sql);
if (mysqli_num_rows($result) == 0) {
    echo 'Pas de cellule<br>';
    exit;
}
mysqli_close($lien);
$tab_cel = fn_ResultToArray($result, 'id_cel');
echo '<ul>';
foreach ($tab_cel as $key => $value) {
    echo '<div id="DIV_id_cel_' . $value['id_cel'] . '" style="margin-top:-5px;margin-left:20px;background-color:white;z-index:30;"></div>';
    echo '<li><div id="info_id_cel_' . $value['id_cel'] . '" onmouseover="document.getElementById(\'bnt_edit_del_cel_' . $value['id_cel'] . '\').style.visibility=\'visible\';" onmouseout="document.getElementById(\'bnt_edit_del_cel_' . $value['id_cel'] . '\').style.visibility=\'hidden\';" >
					
		<a class="info" onclick="DisplayResponsable(\'id_cel\',' . $value['id_cel'] . ');">' . $value['label_F'] . '</a>';
    echo '<div id="bnt_edit_del_cel_' . $value['id_cel'] . '" style="cursor:default;visibility:hidden;height:63px;margin-top:2px;margin-left:10px;padding-left:10px;">';
    //echo '<span class="bnt_ajout_ser" title="Ajouter un service" onclick="LoadFormService(0,\''.$value_dep['id_dep'].'\');">&nbsp;</span>';
    echo '<span class="bnt_modif" title="Modifier cette cellule"  onclick="LoadFormCellule(\'' . $value['id_cel'] . '\',\'' . $value['id_ser'] . '\',\'' . $value['id_dep'] . '\');">&nbsp;</span>';
    echo '<span class="bnt_suppr" title="Supprimer cette cellule" onclick="SupprCellule(\'' . $value['id_cel'] . '\');">&nbsp;</span>';
    echo ' </div>';
    echo '</div>';
    echo '</li>';
    //echo '<div id="DIV_id_cel_'.$value['id_cel'].'" style="background-color:white;"></div>';
}
 $tab_mvt_regimes = fn_ResultToArray($result, 'id_mvt_regime');
 //var_dump( $tab_mvt_fct);
 if ($tab_mvt_regimes != null) {
     foreach ($tab_mvt_regimes as $key_regimes => $value_regimes) {
         $champs_insert .= ",id_regime,id_equiv_tp";
         $valeurs_insert .= "," . $value_regimes['id_regime'] . ",'" . $value_regimes['id_equiv_tp'] . "'";
     }
 } else {
     $champs_insert .= ",id_regime,id_equiv_tp";
     $valeurs_insert .= ",0,0";
 }
 /****************Mvt domicile*****************************/
 $sql = "select * from cpas_mouvements_domiciles \n\twhere \n\t((cpas_mouvements_domiciles.id_agent = " . $value['id_agent'] . ") and (cpas_mouvements_domiciles.date_mvt <= '" . $date_effectif . "')) \n\tand cpas_mouvements_domiciles.statut='N'\n\torder by cpas_mouvements_domiciles.date_mvt desc LIMIT 0,1;";
 //var_dump( $sql);
 $result = mysqli_query($lien, $sql);
 $tab_mvt_domiciles = fn_ResultToArray($result, 'id_mvt_domicile');
 //var_dump( $tab_mvt_fct);
 if ($tab_mvt_domiciles != null) {
     foreach ($tab_mvt_domiciles as $key_domiciles => $value_domiciles) {
         $champs_insert .= ",adresse_domicile\n\t\t\t\t\t\t\t,num_domicile,bte_domicile\n\t\t\t\t\t\t\t,code_postal,localite\n\t\t\t\t\t\t\t,region,bxl_hbxl";
         $valeurs_insert .= ",'" . addslashes($value_domiciles['adresse_domicile']) . "'\n\t\t\t,'" . addslashes($value_domiciles['num_domicile']) . "','" . addslashes($value_domiciles['bte_domicile']) . "'\n\t\t\t," . $value_domiciles['code_postal'] . ",'" . addslashes($value_domiciles['localite']) . "'\n\t\t\t,'" . addslashes($value_domiciles['region']) . "','" . $value_domiciles['bxl_hbxl'] . "'";
     }
 } else {
     $champs_insert .= ",adresse_domicile\n\t\t\t\t\t\t\t,num_domicile,bte_domicile\n\t\t\t\t\t\t\t,code_postal,localite\n\t\t\t\t\t\t\t,region,bxl_hbxl";
     $valeurs_insert .= ",'','','',0,'','',''";
 }
 /********************************************************************************************
  ***************	Insertion de tous les records correspondant aux effectifs demandés************
  *********************************************************************************************/
 $requetes_insert = "insert into cpas_effectifs_" . $new_date_effectif . " (" . $champs_insert . ") values (" . $valeurs_insert . ");";
 //echo $requetes_insert;
Ejemplo n.º 27
0
        if ($id_key_unic == null) {
            $tableau[] = $datas;
        } else {
            $tableau[$datas[$id_key_unic]] = $datas;
        }
    }
    return $tableau;
}
/*****/
include '../connect_db.php';
$sql = "SELECT * FROM cpas_statuts order by libelle_F;";
//var_dump($sql);
$result = mysqli_query($lien, $sql);
//ferme la connection//
mysqli_close($lien);
$tab_statuts = fn_ResultToArray($result, "id_statut");
/****************************************************************/
$outStr = "";
$headStr = "<?php \n";
$nomTable = "array_statut";
$nomTable2 = "array_statut_special";
$initialisation = "\$" . $nomTable . "=array(); \n";
$initialisation .= "\$" . $nomTable2 . "=array(); \n";
$outStr .= "\$" . $nomTable . "[0]['F']='---'; \n";
$outStr .= "\$" . $nomTable . "[0]['N']='---'; \n";
$outStr .= "\$" . $nomTable2 . "[0]['F']='---'; \n";
$outStr .= "\$" . $nomTable2 . "[0]['N']='---'; \n";
foreach ($tab_statuts as $key => $value) {
    if ($value['statut_special'] == 1) {
        $outStr .= "\$" . $nomTable2 . "[" . $value['id_statut'] . "]['F']=\"" . $value['libelle_F'] . "\"; \n";
        $outStr .= "\$" . $nomTable2 . "[" . $value['id_statut'] . "]['N']=\"" . $value['libelle_N'] . "\"; \n";
Ejemplo n.º 28
0
        if ($id_key_unic == null) {
            $tableau[] = $datas;
        } else {
            $tableau[$datas[$id_key_unic]] = $datas;
        }
    }
    return $tableau;
}
/*****/
include '../connect_db.php';
$sql = "SELECT * FROM cpas_selor order by libelle_F;";
var_dump($sql);
$result = mysqli_query($lien, $sql);
//ferme la connection//
mysqli_close($lien);
$tab_selor = fn_ResultToArray($result, "id_selor");
/****************************************************************/
$outStr = "";
$headStr = "<?php \n";
$nomTable = "array_selor";
$initialisation = "\$" . $nomTable . "=array(); \n";
//$outStr.="$".$nomTable."[0]['F']='---'; \n";
//$outStr.="$".$nomTable."[0]['N']='---'; \n";
foreach ($tab_selor as $key => $value) {
    $outStr .= "\$" . $nomTable . "[" . $value['id_selor'] . "]['F']=\"" . $value['libelle_F'] . "\"; \n";
    $outStr .= "\$" . $nomTable . "[" . $value['id_selor'] . "]['N']=\"" . $value['libelle_N'] . "\"; \n";
}
$footStr = "?>";
$totalStr = $headStr;
$totalStr .= $initialisation;
$totalStr .= "\n";
        } else {
            $tableau[$datas[$id_key_unic]] = $datas;
        }
    }
    return $tableau;
}
/****************Lecture liste des cadres********************/
include '../connect_db.php';
$sql = "select * from cpas_cadres order by date_situation desc;\n\t";
$result = mysqli_query($lien, $sql);
if (!$result) {
    echo "erreur dans la requete:<i>" . $sql . "</i>";
    exit;
}
mysqli_close($lien);
$tab_cadre = fn_ResultToArray($result, 'id_cadre');
/**********PARAMS******************/
include 'params.php';
include 'verification.php';
ob_clean();
header('Content-Type: text/html; charset=utf-8');
?>

<!doctype html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta name="author" content="Matt Everson of Astuteo, LLC – http://astuteo.com/slickmap" />
	<title>Cadre/effectifs CPAS</title>
	<link rel="stylesheet" type="text/css" media="screen, print" href="../slickmap.css" />
	<link rel='stylesheet' type='text/css' href='../css/css_onglets.css' />
$options_dupliquer = '';
if ($id_cadre == 0) {
    echo '<div class="td_list_title" style="padding:5px;text-align:center;">Ajout d\'un cadre</div>';
    $date_situation = '00-00-0000';
    // Options pour dupliquer un cadre
    include '../connect_db.php';
    $sql = "select * from cpas_cadres order by date_situation desc;\n\t";
    $result = mysqli_query($lien, $sql);
    if (!$result) {
        echo "erreur dans la requete:<i>" . $sql . "</i>";
        exit;
    }
    if (mysqli_num_rows($result) == 0) {
        $options_dupliquer = '';
    } else {
        $tab_options_dupliquer = fn_ResultToArray($result, 'id_cadre');
        $options_dupliquer = '
			<tr>
				<td>' . dico("dupliquer_cadre?", "F") . ': </td>
				<td>
		';
        $options_dupliquer .= '<select name="id_cadre_a_dupliquer" id="id_cadre_a_dupliquer">';
        $options_dupliquer .= '<option value="0" selected>---</option>';
        foreach ($tab_options_dupliquer as $key => $value) {
            $options_dupliquer .= '<option value="' . $value['id_cadre'] . '">' . transformDate($value['date_situation']) . '</option>';
        }
        $options_dupliquer .= '
			</select>
			</td>
		</tr>
		';