Created
October 21, 2015 08:14
-
-
Save morad7/7c6b21c55c414c62f703 to your computer and use it in GitHub Desktop.
Drupal : Print a view as a document
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $base_path; | |
if (isset($data->field_field_civilite[0]['rendered']['#markup'])) { | |
$civilite = $data->field_field_civilite[0]['rendered']['#markup']; | |
} | |
else { | |
$civilite = 'no civilite'; | |
} | |
if (isset($data->field_field_prenom[0]['raw']['value'])) { | |
$prenom = $data->field_field_prenom[0]['raw']['value']; | |
} | |
else { | |
$prenom = 'no prenom'; | |
} | |
if (isset($data->field_field_nom[0]['raw']['value'])) { | |
$nom = $data->field_field_nom[0]['raw']['value']; | |
} else { | |
$nom = 'no nom'; | |
} | |
if (isset($data->field_field_no_cin[0]['raw']['value'])) { | |
$cin = $data->field_field_no_cin[0]['raw']['value']; | |
} else { | |
$cin = 'no cin'; | |
} | |
if (isset($data->field_field_fonction[0]['raw']['value'])) { | |
$fonction = $data->field_field_fonction[0]['raw']['value']; | |
} else { | |
$fonction = 'no fonction'; | |
} | |
if (isset($data->field_field_date_embauche[0]['raw']['value'])) { | |
$date_embauche = new DateTime($data->field_field_date_embauche[0]['raw']['value']); | |
} else { | |
$date_embauche = 'no date embauche'; | |
} | |
$today = date('d/m/Y'); | |
?> | |
<div class="attestation"> | |
<div><img src="<?php print $base_path ?>sites/default/files/stm.png" alt="LOGO-PRINT" style="height: 85px;float:left"></div><div style="font-weight:bold;line-height:28px">Société<br>Tangéroise de<br>Maintenance</div> | |
<div style="float:none"></div> | |
<h1 style="text-align:center;margin:40px 0">ATTESTATION DE TRAVAIL</h1> | |
<p>Je soussigné Monsieur Tarik MOUDNI, directeur général de la Société Tangéroise de Maintenance (STM), sise à 68 Bd la Résistance, 90000 Tanger. Certifie que :</p> | |
<p style="text-align:center"><strong><?php print $civilite.' '.$prenom.' '.$nom; ?></strong></p> | |
<p>Titulaire de la CIN N° <strong><?php print $cin; ?></strong>, est employé au sein de notre société en qualité de <strong><?php print $fonction; ?></strong> depuis le <strong><?php print $date_embauche->format('d/m/Y'); ?></strong>. </p> | |
<p>Cette attestation est délivrée à l’intéressé pour servir et valoir ce que de droit.</p><br><br> | |
<p class="signature"><em>Fait à Tanger, le <?php print $today; ?><em><br><br> | |
<strong>Tarik MOUDNI <br> | |
Directeur Général<strong></p> | |
<div style="text-align:center;border-top:1px solid;margin-top:230px"> | |
68, bd de la résistance 90000-Tanger Tél : 039 32 41 71 Fax : 039 32 44 61 | |
Capital 500 000 DHS .RC: 13957. IF : 04904396. CNSS : 6043814</div> | |
<div style="text-align:center"><img style="height:40px" src="<?php print $base_path ?>sites/default/files/IBM.png" alt="IBM"> <img style="height:40px" src="<?php print $base_path ?>sites/default/files/COMPAQ.png" alt="COMPAQ" > <img style="height:40px" src="<?php print $base_path ?>sites/default/files/HP.png" alt="HP"> <img style="height:40px" src="<?php print $base_path ?>sites/default/files/XERO.png" alt="XERO"> <img style="height:40px" src="<?php print $base_path ?>sites/default/files/INTEL.png" alt="INTEL"> <img style="height:40px" src="<?php print $base_path ?>sites/default/files/WANADOO.png" alt="WANADOO"></div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment