SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Sophal SPA');
$pdf->SetTitle('EVALUATION ANNUELLE');
$pdf->SetSubject('EVALUATION ANNUELLE');
// add a page
$pdf->AddPage();
$pdf->SetFont('helvetica', '', 11);
$res = get_entete($idrfe);
$user = getUserId($res[0]['id_candidat']);
$annee = is_numeric(get_annee($idrfe)) ? get_annee($idrfe) : '' ;
$List = callWebService($user['matricule'] , 'get_MonDossierRH');
$profile_riasec = getRiasecTestResults($res[0]['id_candidat'],$annee);
// $profile_riasec = getRiasecTestResults(458,$annee);
//supprimer UTF-8-BOM
for ($i = 0; $i <= 31; ++$i) {
$List = str_replace(chr($i), "", $List);
}
$List = str_replace(chr(127), "", $List);
if (0 === strpos(bin2hex($List), 'efbbbf')) {
$List = substr($List, 3);
}
//supprimer UTF-8-BOM
$List = json_decode($List,true);
//print_r($List);
//print_r($allNotes);
//$imageContent = file_get_contents($List['photo']);
//$path = tempnam(sys_get_temp_dir(), 'prefix');
//file_put_contents ($path, $imageContent);
$titre_document = '
|
EVALUATION ANNUELLE '.$annee.' |
|
';
$pdf->writeHTML($titre_document, true, false, false, false, '');
$employer_details = '
| Nom & Prenom |
: '.$List['employe']['employe_name'].' |
 . ') |
| Département |
: '.$List['employe']['DEPARTEMENT'].' |
| Fonction |
: '.$List['employe']['Libelle'].' |
| Service |
: '.$List['employe']['SERVICE'].' |
| Matricule |
: '.$List['employe']['MATRICULE'].' |
| Téléphone |
: '.$List['employe']['NUMTELEPHONE'].' |
| Date de recrutement |
: '.date("d-m-Y", strtotime($List['employe']['DateRecrutement'])).' | ;
';
// print_r($List['postes']);
// print_r(count($List['postes']));
$blank_lines_count = 8; //6 - count($List['postes']);
$pdf->writeHTML($employer_details, true, false, false, false, '');
$postes = '
| Différents postes de travail : |
Notes |
';
foreach($List['postes'] as $val){
$postes = $postes.'- '.$val['poste'].'
';
}
$postes = $postes.' | - Note Competence : '.$compNote.'/7
- Note Finale : '.$finalNote.'/10
|
';
$pdf->writeHTML($postes, true, false, false, false, '');
$profile = "Contribution operationnel";
if($compNote > 2 & $compNote < 4)
$profile = "Apport tactique";
if($compNote >= 4 & $compNote < 6)
$profile = "Apport stratégique";
if($compNote >= 6)
$profile = "Contribution visionnaire";
$profile_eval = '
| Profile : |
';
$profile_eval = $profile_eval.'- '.$profile.'
|
';
$pdf->writeHTML($profile_eval, true, false, false, false, '');
$profile_psycho = '
| Profile Psychotechnique : |
|
';
$riasec_score = "N/A";
$riasec_date = "";
if($profile_riasec){
$riasec_score = $profile_riasec['score'];
$riasec_date = ' (Date d\'evaluation '.date('d-m-Y',strtotime($profile_riasec['test_date'])).')';
}
$explaine =' | ';
$profile_psycho = $profile_psycho.'- '.$riasec_score.$riasec_date.'
| '.$explaine.'
';
$pdf->writeHTML($profile_psycho, true, false, false, false, '');
$spacing = '';
for($i = 0; $i < $blank_lines_count ; $i++){
$spacing = $spacing.'| | | |
';
}
$spacing = $spacing.'
';
if($blank_lines_count > 0)
$pdf->writeHTML($spacing, true, false, false, false, 'C');
$charts = '
| Resultats de l\'evaluation |
';
$pdf->writeHTML($charts, true, false, false, false, 'C');
if($image_all_note != 'data:,')
//$pdf->writeHTML('
', true, false, false, false, 'C');
if($graph != 'data:,')
$pdf->writeHTML('
', true, false, false, false, 'C');
$titre_tableau = '';
for($p = 0; $p < count($res) ; $p++){
$debut ='';
if($res[$p]['question'] == '1. Performances' ||
$res[$p]['question'] == '2. Compétences' ||
$res[$p]['question'] == 'Examen du plan de Formation' ||
$res[$p]['question'] == '3. Evaluation RH' ||
$res[$p]['question'] == 'Objectifs'
){
$debut = '
'.$debut;
}
if($res[$p]['question'] == '1. Performances' || $res[$p]['question'] == 'Plan de Developpement de Carrière'){
$titre_tableau='
| '.$res[$p]['question'].' |
';
}elseif($res[$p]['question'] == 'Objectifs'){
$titre_tableau='
| '.$res[$p]['question'].' '.(intval($annee)+1).' |
';
}else{
$titre_tableau ='
| '.$res[$p]['question'].' |
';
}
$s = '';
$ligne = get_lignes($res[$p]['id'],$idrfe) ;
$objectifs_count = 0;
if(count($ligne) > 0){
for($ps = 0; $ps < count($ligne) ; $ps++){
if(is_numeric($ligne[$ps]['question']) && $ligne[$ps]['reponses'] != "[2]" && $res[$p]['question'] == '1. Performances'){
if($ligne[$ps]['reponse'] != '' ){
$s = $s.'
| '.$ligne[$ps]['reponse'].' |
'.$ligne[$ps]['observation'].' |
'.$ligne[$ps]['date'].' |
'.$ligne[$ps]['eval'].' |
';
}
}elseif(!is_numeric($ligne[$ps]['question']) && $ligne[$ps]['reponses'] != "[2]"){
$s = $s.'
| '.$ligne[$ps]['question'].' |
'.$ligne[$ps]['reponse'].' |
';
}elseif(is_numeric($ligne[$ps]['question']) && $ligne[$ps]['reponses'] == "[2]"){
$new = explode(",", $ligne[$ps]['reponse']);
if($new[0] != '[' && $new[1] != ']'){
$s = $s.'
| '.ltrim($new[0], '[').' |
'.rtrim($new[1], "]").' |
';
}
}elseif(is_numeric($ligne[$ps]['question']) && $ligne[$ps]['reponses'] != "[2]" && $res[$p]['question'] == 'Objectifs'){
if($ligne[$ps]['reponse'] != '' ){
$objectifs_count += 1;
$s = $s.'
| '.$ligne[$ps]['reponse'].' |
'.$ligne[$ps]['date'].' |
';
}
}elseif(is_numeric($ligne[$ps]['question']) && $ligne[$ps]['reponses'] == "[4]"){
$new = explode(",", $ligne[$ps]['reponse']);
if($new[0] != '[' && $new[1] != ']'){
$s = $s.'
| '.ltrim($new[0], '[').' |
'.$new[1].' |
'.$new[2].' |
'.rtrim($new[3], "]").' |
';
}
}
}
}
$fin = '
';
$pdf->writeHTML($debut.$titre_tableau.$s.$fin, true, false, false, false, '');
}
$spacing = '';
$blank_object_count = 26 - $objectifs_count;
for($i = 0; $i < $blank_object_count ; $i++){
$spacing = $spacing.'| | | |
';
}
$spacing = $spacing.'
';
if($blank_object_count>0)
$pdf->writeHTML($spacing, true, false, false, false, 'C');
$user_superviser = getUserID($user['users_id_supervisor']);
$signature = '
Signature du Salarié ('.$user['fullname'].') |
Signature du Responsable ('.$user_superviser['fullname'].') |
';
$pdf->writeHTML($signature, true, false, false, false, 'C');
//Close and output PDF document
$pdf->Output('EVALUATION ANNUELLE '.$annee.'.pdf', 'I');