function ooffice_write_etudiant($record)
{
    global $odt;
    if ($record) {
        // DEBUG
        // echo "";
        // print_r($record);
        // add header
        //
        $id = trim($record->id);
        $userid = trim($record->userid);
        $ref_etablissement = trim($record->ref_etablissement);
        $num_etudiant = trim($record->num_etudiant);
        $ddn_etudiant = trim($record->ddn_etudiant);
        $lieu_naissance = trim($record->lieu_naissance);
        $departement_naissance = trim($record->departement_naissance);
        $adresse_etudiant = trim($record->adresse_etudiant);
        $login = trim(referentiel_get_user_login($record->userid));
        if ($num_etudiant == $login) {
            $snum = $num_etudiant;
        } elseif ($num_etudiant == '') {
            $snum = $login;
        } else {
            $snum = $num_etudiant . " (" . $login . ")";
        }
        // Etablissement
        $record_etablissement = referentiel_get_etablissement($record->ref_etablissement);
        if ($record_etablissement) {
            ooffice_write_etablissement($record_etablissement);
        }
        $odt->SetFont('Arial', 'N', 10);
        // DEBUG
        $texte = '<b>' . referentiel_get_user_info($record->userid) . '</b><br />' . get_string('num_etudiant', 'referentiel') . ' : <i>' . $snum . '</i><br />' . '<br />' . get_string('ddn_etudiant', 'referentiel') . ' : ' . $ddn_etudiant . '<br />' . get_string('lieu_naissance', 'referentiel') . ' : ' . $lieu_naissance . '<br />' . get_string('departement_naissance', 'referentiel') . ' : ' . $departement_naissance;
        $texte .= '<br />' . get_string('adresse_etudiant', 'referentiel') . ' : ' . $adresse_etudiant;
        $texte = recode_utf8_vers_latin1($texte);
        $odt->WriteParagraphe(0, $texte);
        return true;
    }
    return false;
}
Beispiel #2
0
 function write_etudiant($record)
 {
     // initial string;
     $expout = "";
     // add comment
     //$expout .= "\n\n<!-- etudiant: $record->id  -->\n";
     if ($record) {
         // DEBUG
         // echo "<br />\n";
         // print_r($record);
         $id = $this->writeraw($record->id);
         $userid = $this->writeraw($record->userid);
         $ref_etablissement = $this->writeraw($record->ref_etablissement);
         $num_etudiant = $this->writeraw($record->num_etudiant);
         $ddn_etudiant = $this->writeraw($record->ddn_etudiant);
         $lieu_naissance = $this->writeraw($record->lieu_naissance);
         $departement_naissance = $this->writeraw($record->departement_naissance);
         $adresse_etudiant = $this->writeraw($record->adresse_etudiant);
         $login = referentiel_get_user_login($record->userid);
         /*
                     if ($num_etudiant==$login){
                             $texte=$num_etudiant;
                     }
                     elseif ($num_etudiant==''){
                             $texte=$login;
                     }
                     else{
                             $texte=$num_etudiant." (".$login.")";
                     }
         */
         if (!$this->format_condense) {
             $expout .= "<etudiant>\n";
             $expout .= "<id>{$id}</id>\n";
             $expout .= "<userid>{$userid}</userid>\n";
             $expout .= "<login>{$login}</login>\n";
             $expout .= "<num_etudiant>{$num_etudiant}</num_etudiant>\n";
             $expout .= "<lastname>" . referentiel_get_user_nom($record->userid) . "</lastname>\n";
             $expout .= "<firstname>" . referentiel_get_user_prenom($record->userid) . "</firstname>\n";
             $expout .= "<ddn_etudiant>{$ddn_etudiant}</ddn_etudiant>\n";
             $expout .= "<lieu_naissance>{$lieu_naissance}</lieu_naissance>\n";
             $expout .= "<departement_naissance>{$departement_naissance}</departement_naissance>\n";
             $expout .= "<adresse_etudiant>{$adresse_etudiant}</adresse_etudiant>\n";
             $expout .= "<ref_etablissement>{$ref_etablissement}</ref_etablissement>\n";
             // Etablissement
             $record_etablissement = referentiel_get_etablissement($record->ref_etablissement);
             if ($record_etablissement) {
                 $expout .= $this->write_etablissement($record_etablissement);
             }
             $expout .= "</etudiant>\n\n";
         } elseif ($this->format_condense == 1) {
             $expout .= "<userid>{$userid}</userid>\n";
             $expout .= "<login>{$login}</login>\n";
             $expout .= "<num_etudiant>{$num_etudiant}</num_etudiant>\n";
             $expout .= "<lastname>" . referentiel_get_user_nom($record->userid) . "</lastname>\n";
             $expout .= "<firstname>" . referentiel_get_user_prenom($record->userid) . "</firstname>\n";
         } elseif ($this->format_condense == 2) {
             $expout .= "<login>{$login}</login>\n";
             $expout .= "<num_etudiant>{$num_etudiant}</num_etudiant>\n";
             $expout .= "<lastname>" . referentiel_get_user_nom($record->userid) . "</lastname>\n";
             $expout .= "<firstname>" . referentiel_get_user_prenom($record->userid) . "</firstname>\n";
         }
     }
     return $expout;
 }
Beispiel #3
0
 function write_etudiant($record)
 {
     // initial string;
     $expout = "";
     // add comment
     $expout .= "\n\n<!-- etudiant: {$record->id}  -->\n";
     if ($record) {
         // DEBUG
         // echo "<br />\n";
         // print_r($record);
         // add header
         $expout .= "<div class=\"referentiel\">\n";
         $expout .= "<h4>Etudiant</h4>\n";
         //
         $expout .= "<ul>\n";
         //
         $id = trim($record->id);
         $userid = trim($record->userid);
         $ref_etablissement = trim($record->ref_etablissement);
         $num_etudiant = trim($record->num_etudiant);
         $ddn_etudiant = trim($record->ddn_etudiant);
         $lieu_naissance = trim($record->lieu_naissance);
         $departement_naissance = trim($record->departement_naissance);
         $adresse_etudiant = trim($record->adresse_etudiant);
         $login = trim(referentiel_get_user_login($record->userid));
         if ($num_etudiant == $login) {
             $texte = $num_etudiant;
         } elseif ($num_etudiant == '') {
             $texte = $login;
         } else {
             $texte = $num_etudiant . " (" . $login . ")";
         }
         if ($this->format_condense) {
             $expout .= " <li><b>" . get_string('userid', 'referentiel') . "</b> : {$userid}</li>\n";
             $expout .= " <li><b>" . get_string('nom_prenom', 'referentiel') . "</b> : " . referentiel_get_user_info($record->userid) . "</li>\n";
             $expout .= " <li><b>" . get_string('num_etudiant', 'referentiel') . "</b> : {$texte}</li>\n";
         } else {
             $expout .= " <li><b>" . get_string('id', 'referentiel') . "</b> : {$id}</li>\n";
             $expout .= " <li><b>" . get_string('userid', 'referentiel') . "</b> : {$userid}</li>\n";
             $expout .= " <li><b>" . get_string('nom_prenom', 'referentiel') . "</b> : " . referentiel_get_user_info($record->userid) . "</li>\n";
             $expout .= " <li><b>" . get_string('num_etudiant', 'referentiel') . "</b> : {$texte}</li>\n";
             $expout .= " <li><b>" . get_string('ddn_etudiant', 'referentiel') . "</b> : {$ddn_etudiant}</li>\n";
             $expout .= " <li><b>" . get_string('lieu_naissance', 'referentiel') . "</b> : {$lieu_naissance}</li>\n";
             $expout .= " <li><b>" . get_string('departement_naissance', 'referentiel') . "</b> : {$departement_naissance}</li>\n";
             $expout .= " <li><b>" . get_string('adresse_etudiant', 'referentiel') . "</b> : {$adresse_etudiant}</li>\n";
             $expout .= " <li><b>" . get_string('ref_etablissement', 'referentiel') . "</b> : {$ref_etablissement}</li>\n";
             // Etablissement
             $record_etablissement = referentiel_get_etablissement($record->ref_etablissement);
             if ($record_etablissement) {
                 $expout .= $this->write_etablissement($record_etablissement);
             }
         }
         $expout .= " </ul>\n";
         $expout .= "</div>\n\n";
         //
     }
     return $expout;
 }
Beispiel #4
0
 function write_etudiant($record, $nbchamps_referentiel)
 {
     // initial string;
     $s1 = '';
     $s2 = '';
     $nbchamps = 0;
     $expout = "";
     // add comment
     if ($record) {
         // DEBUG
         // echo "<br />\n";
         // print_r($record);
         // add header
         //
         $id = trim($record->id);
         $userid = trim($record->userid);
         $login = trim(referentiel_get_user_login($record->userid));
         $ref_etablissement = trim($record->ref_etablissement);
         $num_etudiant = trim($record->num_etudiant);
         $ddn_etudiant = trim($record->ddn_etudiant);
         $lieu_naissance = trim($record->lieu_naissance);
         $departement_naissance = trim($record->departement_naissance);
         $adresse_etudiant = trim($record->adresse_etudiant);
         if ($num_etudiant == $login) {
             $texte = $num_etudiant;
         } elseif ($num_etudiant == '') {
             $texte = $login;
         } else {
             $texte = $num_etudiant . " (" . $login . ")";
         }
         $s2 = '';
         $s2 .= $id . ';';
         if ($this->certificat_sel_param->certificat_sel_etudiant_nom_prenom) {
             $s2 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes(referentiel_get_user_nom($record->userid))) . ";" . $this->purge_sep(stripslashes(referentiel_get_user_prenom($record->userid))))) . ";";
         }
         if ($this->certificat_sel_param->certificat_sel_etudiant_numero) {
             $s2 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes($texte)))) . ";";
         }
         if ($this->certificat_sel_param->certificat_sel_etudiant_ddn) {
             $s2 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes($ddn_etudiant)))) . ";";
         }
         if ($this->certificat_sel_param->certificat_sel_etudiant_lieu_naissance) {
             $s2 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes($lieu_naissance)))) . ";";
             $s2 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes($departement_naissance)))) . ";";
         }
         if ($this->certificat_sel_param->certificat_sel_etudiant_adresse) {
             $s2 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes($adresse_etudiant)))) . ";";
         }
         $s1 .= $s2;
         $s1 .= " \n";
         // Etablissement
         $record_etablissement = referentiel_get_etablissement($record->ref_etablissement);
         if ($record_etablissement) {
             if ($this->certificat_sel_param->certificat_sel_etudiant_etablissement) {
                 $s1 .= $this->write_etablissement($record_etablissement, $nbchamps_referentiel);
             }
         }
         $expout .= $s1;
     }
     return $expout;
 }
function pdf_write_etudiant($record, $param)
{
    global $Refpdf;
    if ($record) {
        // DEBUG
        // echo "";
        // print_r($record);
        // add header
        //
        $id = trim($record->id);
        $userid = trim($record->userid);
        $ref_etablissement = trim($record->ref_etablissement);
        $num_etudiant = trim($record->num_etudiant);
        $ddn_etudiant = trim($record->ddn_etudiant);
        $lieu_naissance = trim($record->lieu_naissance);
        $departement_naissance = trim($record->departement_naissance);
        $adresse_etudiant = trim($record->adresse_etudiant);
        $login = trim(referentiel_get_user_login($record->userid));
        if ($num_etudiant == $login) {
            $snum = $num_etudiant;
        } elseif ($num_etudiant == '') {
            $snum = $login;
        } else {
            $snum = $num_etudiant . " (" . $login . ")";
        }
        // Etablissement
        $record_etablissement = referentiel_get_etablissement($record->ref_etablissement);
        if ($record_etablissement) {
            if ($param->certificat_sel_etudiant_etablissement) {
                pdf_write_etablissement($record_etablissement);
            }
        }
        if ($param->certificat_sel_etudiant_numero) {
            $Refpdf->SetFont('helvetica', '', 10);
            $texte = get_string('num_etudiant', 'referentiel') . " : " . $snum;
            $Refpdf->Write(6, $texte);
            $Refpdf->Ln(6);
        }
        if ($param->certificat_sel_etudiant_nom_prenom) {
            $Refpdf->SetFont('helvetica', '', 12);
            $Refpdf->Write(6, referentiel_get_user_info($record->userid));
            $Refpdf->SetFont('helvetica', '', 10);
            $Refpdf->Ln(6);
        }
        if ($param->certificat_sel_etudiant_ddn || $param->certificat_sel_etudiant_lieu_naissance) {
            $texte = '';
            if ($param->certificat_sel_etudiant_ddn) {
                $texte .= get_string('ddn_etudiant', 'referentiel') . " " . $ddn_etudiant . " ";
            }
            if ($param->certificat_sel_etudiant_lieu_naissance) {
                $texte .= get_string('lieu_naissance', 'referentiel') . " : " . $lieu_naissance . ", " . get_string('departement_naissance', 'referentiel') . " : " . $departement_naissance;
            }
            $Refpdf->Write(6, $texte);
            $Refpdf->Ln(6);
        }
        if ($param->certificat_sel_etudiant_adresse) {
            $texte = get_string('adresse_etudiant', 'referentiel') . " : " . $adresse_etudiant;
            $Refpdf->Write(6, $texte);
            $Refpdf->Ln(6);
        }
    }
}
Beispiel #6
0
 function write_etudiant($record)
 {
     // initial string;
     $expout = "";
     // add comment
     if ($record) {
         // DEBUG
         // echo "<br />\n";
         // print_r($record);
         $id = trim($record->id);
         $userid = trim($record->userid);
         $ref_etablissement = trim($record->ref_etablissement);
         $num_etudiant = trim($record->num_etudiant);
         $ddn_etudiant = trim($record->ddn_etudiant);
         $lieu_naissance = trim($record->lieu_naissance);
         $departement_naissance = trim($record->departement_naissance);
         $adresse_etudiant = trim($record->adresse_etudiant);
         $login = trim(referentiel_get_user_login($record->userid));
         if ($num_etudiant == $login) {
             $texte = $num_etudiant;
         } elseif ($num_etudiant == '') {
             $texte = $login;
         } else {
             $texte = $num_etudiant . " (" . $login . ")";
         }
         if (!$this->format_condense) {
             $expout .= "\n\n<!-- record etudiant: {$id}  -->\n";
             $expout .= "<table class=\"referentiel\">\n";
             $expout .= "<tr><td colspan='9'><b>Etudiant</b></td></tr>\n";
             $expout .= "<tr><td><b>" . get_string('id', 'referentiel') . "</b></td>\n<td><b>" . get_string('userid', 'referentiel') . "</b></td>\n<td><b>" . get_string('nom_prenom', 'referentiel') . "</b></td>\n<td><b>" . get_string('num_etudiant', 'referentiel') . "</b></td>\n<td><b>" . get_string('ddn_etudiant', 'referentiel') . "</b></td>\n<td><b>" . get_string('lieu_naissance', 'referentiel') . "</b></td\n<td><b>" . get_string('departement_naissance', 'referentiel') . "</b></td>\n<td><b>" . get_string('adresse_etudiant', 'referentiel') . "</b></td>\n<td><b>" . get_string('ref_etablissement', 'referentiel') . "</b></td>\n</td>\n<tr>\n";
             $expout .= " <td> {$id}</td><td> {$userid}</td><td> " . referentiel_get_user_info($record->userid) . "</td>\n<td> {$texte}</td><td> {$ddn_etudiant}</td><td> {$lieu_naissance}</td><td> {$departement_naissance}</td>\n<td> {$adresse_etudiant}</td><td> {$ref_etablissement}</td>\n";
             // Etablissement
             $record_etablissement = referentiel_get_etablissement($record->ref_etablissement);
             if ($record_etablissement) {
                 $expout .= $this->write_etablissement($record_etablissement);
             }
             $expout .= "</table>\n\n";
         } else {
             if ($this->format_condense == 1) {
                 $expout .= "<tr><td> {$userid}</td><td>" . referentiel_get_user_login($userid) . "</td><td> " . referentiel_get_user_info($record->userid) . "</td><td> {$num_etudiant}</td>";
             } else {
                 $expout .= "<tr><td>{$login}</td><td>{$num_etudiant}</td><td>" . referentiel_get_user_nom($userid) . "</td><td> " . referentiel_get_user_prenom($record->userid) . "</td>";
             }
         }
     }
     return $expout;
 }
Beispiel #7
0
 function write_etudiant($record, $nbchamps_referentiel)
 {
     // initial string;
     $s1 = '';
     $s2 = '';
     $nbchamps = 0;
     $expout = "";
     // add comment
     if ($record) {
         // DEBUG
         // echo "<br />\n";
         // print_r($record);
         // add header
         //
         $id = trim($record->id);
         $userid = trim($record->userid);
         $login = trim(referentiel_get_user_login($record->userid));
         $ref_etablissement = trim($record->ref_etablissement);
         $num_etudiant = trim($record->num_etudiant);
         $ddn_etudiant = trim($record->ddn_etudiant);
         $lieu_naissance = trim($record->lieu_naissance);
         $departement_naissance = trim($record->departement_naissance);
         $adresse_etudiant = trim($record->adresse_etudiant);
         if ($num_etudiant == $login) {
             $texte = $num_etudiant;
         } elseif ($num_etudiant == '') {
             $texte = $login;
         } else {
             $texte = $num_etudiant . " (" . $login . ")";
         }
         if ($this->certificat_sel_param->certificat_sel_etudiant_nom_prenom) {
             $nbchamps++;
             $s2 .= "<th class='referentiel'>" . get_string('lastname') . " " . get_string('firstname') . "</th>\n";
         }
         if ($this->certificat_sel_param->certificat_sel_etudiant_numero) {
             $nbchamps++;
             $s2 .= "<th class='referentiel'>" . get_string('num_etudiant', 'referentiel') . "</th>\n";
         }
         if ($this->certificat_sel_param->certificat_sel_etudiant_ddn) {
             $nbchamps++;
             $s2 .= "<th class='referentiel'>" . get_string('ddn_etudiant', 'referentiel') . "</th>\n";
         }
         if ($this->certificat_sel_param->certificat_sel_etudiant_lieu_naissance) {
             $s2 .= "<th class='referentiel'>" . get_string('lieu_naissance', 'referentiel') . "</th>\n";
             $s2 .= "<th class='referentiel'>" . get_string('departement_naissance', 'referentiel') . "</th>\n";
             $nbchamps += 2;
         }
         if ($this->certificat_sel_param->certificat_sel_etudiant_adresse) {
             $nbchamps++;
             $s2 .= "<th class='referentiel' colspan='2'>" . get_string('adresse_etudiant', 'referentiel') . "</th>\n";
         }
         $s1 .= "\n\n<!-- etudiant: {$record->id}  -->\n";
         $s1 .= "<tr class='referentiel'><td class='referentiel' colspan='" . $nbchamps_referentiel . "'><b>" . get_string('etudiant', 'referentiel') . "</b></td></tr>\n";
         $s1 .= "<tr class='referentiel'><td class='referentiel' colspan='" . $nbchamps_referentiel . "'>\n";
         $s1 .= "<table class='referentiel'>\n<tr class='referentiel'>\n";
         $s1 .= $s2;
         $s1 .= "</tr>\n<tr class='referentiel'>\n";
         $s2 = '';
         if ($this->certificat_sel_param->certificat_sel_etudiant_nom_prenom) {
             $s2 .= " <td class='referentiel'>" . referentiel_get_user_info($record->userid) . "</td>\n";
         }
         if ($this->certificat_sel_param->certificat_sel_etudiant_numero) {
             $s2 .= " <td class='referentiel'>{$texte}</td>\n";
         }
         if ($this->certificat_sel_param->certificat_sel_etudiant_ddn) {
             $s2 .= " <td class='referentiel'>{$ddn_etudiant}</td>\n";
         }
         if ($this->certificat_sel_param->certificat_sel_etudiant_lieu_naissance) {
             $s2 .= " <td class='referentiel'>{$lieu_naissance}</td>\n";
             $s2 .= " <td class='referentiel'>{$departement_naissance}</td>\n";
         }
         if ($this->certificat_sel_param->certificat_sel_etudiant_adresse) {
             $s2 .= " <td class='referentiel' colspan='2'>{$adresse_etudiant}</td>\n";
         }
         $s1 .= $s2;
         $s1 .= " </tr>\n";
         $s1 .= "</table>\n";
         $s1 .= "</td></tr>\n";
         // Etablissement
         $record_etablissement = referentiel_get_etablissement($record->ref_etablissement);
         if ($record_etablissement) {
             if ($this->certificat_sel_param->certificat_sel_etudiant_etablissement) {
                 $s1 .= $this->write_etablissement($record_etablissement, $nbchamps_referentiel);
             }
         }
         $expout .= $s1;
     }
     return $expout;
 }