403Webshell
Server IP : 195.130.67.5  /  Your IP : 216.73.217.154
Web Server : Microsoft-IIS/10.0
System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586
User : IUSR ( 0)
PHP Version : 7.4.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Old Sites/ees_request/externalpages/ams/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Old Sites/ees_request/externalpages/ams/createPDF.php
<?php
require_once('docs/tcpdf/config/lang/eng.php');
require_once('docs/tcpdf/tcpdf.php'); 
require_once('config.php');

    $connect = mysql_connect($host,$username,$password);
    mysql_select_db($db_name,$connect);
    mysql_query("SET NAMES 'utf8'", $connect);
    
    // sql query to retrieving users information
    $checkQ = "SELECT id FROM `jos_users` WHERE id='".$_POST['uid']."'";
    $checkResult = mysql_query($checkQ);
    $checkRow = mysql_fetch_array($checkResult);       
    
    // validate user 
    if( ($_GET['prnt'] != 1) && ($_GET['submited'] !=0) && ($_POST['uid'] != $checkRow['id']) ) {
        exit;
    }
    //--------------
    
    $userId = $_POST['uid'];
    $academicYear = $_POST['year'];
    $departmentId = $_POST['dId'];
    $sectionId = $_POST['sId'];
    
    // check if submited the application_form in order to create PDF
    $submitedQuery = "UPDATE application_form SET submited='1' WHERE departmentId='".$departmentId."' AND sectionId='".$sectionId."' AND academicYear='".$academicYear."' AND userId='".$userId."'"; 
    if ( !mysql_query($submitedQuery) ) { exit; } 
    //--------------------------------------------------------------
     
    $departmentQ = "SELECT * FROM `department` WHERE id='".$departmentId."'";
    $departmentResult = mysql_query($departmentQ);
    $departmentRow = mysql_fetch_array($departmentResult); 
    
    $sectionQ = "SELECT * FROM `section` WHERE id='".$sectionId."'";
    $sectionResult = mysql_query($sectionQ);
    $sectionRow = mysql_fetch_array($sectionResult); 

    // sql query to retrieving users information
    $usrQ = "SELECT *, DATE_FORMAT(`birthday`, '%d-%m-%Y') AS birthday_ FROM `jos_users` WHERE id='".$userId."'";
    $usrResult = mysql_query($usrQ);
    $usrRow = mysql_fetch_array($usrResult); 
    
    // sql query to retrieving information of degree
    $dgrQ = "SELECT degree.id, degree.title, degree.university, degree_level.level, DATE_FORMAT(degree.degreeDate, '%d-%m-%Y') AS degreeDate_,degree.degreeLevelId, degree.grade 
             FROM degree, degree_level
             WHERE degree.userId='".$userId."' AND degree_level.id=degree.degreeLevelId;";                           
    $dgrResult = mysql_query($dgrQ);
    //$dgrRow = mysql_fetch_array($dgrResult);
    
    // sql query to retrieving information of languages  
    $lngQ = "SELECT language.id, language.languageTypeId, language_type.language, language.titleCertificate, language.snCertificate, language.teachability 
          FROM language, language_type
          WHERE language.userId='".$userId."' AND language_type.id=language.languageTypeId";
    $lngResult = mysql_query($lngQ);
    //$lngRow = mysql_fetch_array($lngResult);
    
    // sql query to retrieving information of scientific activity 
    $sntQ = "SELECT * FROM scientific_activity WHERE userId='".$userId."'";         
    $sntResult = mysql_query($sntQ);
    //$sntRow = mysql_query($sntResult);
    
    // sql query to retrieving information about of professiona experience
    $proQ = "SELECT *,DATE_FORMAT(`since`, '%d-%m-%Y') AS since_, DATE_FORMAT(`until`, '%d-%m-%Y') AS until_  FROM pro_experience WHERE userId='".$userId."'";
    $proResult = mysql_query($proQ);
    //$proRow = mysql_query($proResult);
    
    // sql query to retrieving information about of educational experience   
    $eduQ = "SELECT *,DATE_FORMAT(`since`, '%d-%m-%Y') AS since_, DATE_FORMAT(`until`, '%d-%m-%Y') AS until_ FROM educ_experience WHERE userId='".$userId."'";        
    $eduResult = mysql_query($eduQ); 
   // $eduRow = mysql_fetch_array($eduResult);  
    
    // sql query to retrieving information about of availability 
    $availQ = "SELECT * FROM available_hours WHERE userId='".$userId."'";        
    $availResult = mysql_query($availQ);
   // $availRow = mysql_fetch_array($availResult);
   
   
   $appQ = "SELECT application_form.*,lesson.semester FROM application_form,lesson 
        WHERE application_form.lessonId=lesson.id AND userId='".$userId."' 
        AND application_form.departmentId='".$departmentId."' 
        AND application_form.sectionId='".$sectionId."' 
        AND academicYear='".$academicYear."' 
        ORDER BY semester,lessonTitle";
        $appResult = mysql_query($appQ);
        
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');

// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH,'','');

// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));

// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

//set margins
//               PDF_MARGIN_LEFT       PDF_MARGIN_RIGHT
$pdf->SetMargins('10', PDF_MARGIN_TOP, '10');
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

//set some language-dependent strings
$pdf->setLanguageArray($l);

// ---------------------------------------------------------

// set font
$pdf->SetFont('dejavusans', '', 7);

// add a page
$pdf->AddPage();

// writeHTML($html, $ln=true, $fill=false, $reseth=false, $cell=false, $align='')
// writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=0, $reseth=true, $align='', $autopadding=true)

// create some HTML content
$myHtml = '<table width="100%">
           <tr>
                <td align="center"> 
                <font size="10">ΜΗΧΑΝΟΓΡΑΦΙΚΟ ΕΝΤΥΠΟ<br>
                ΑΙΤΗΣΗ              <br>
                ΕΠΙΣΤΗΜΟΝΙΚΟΥ / ΕΡΓΑΣΤΗΡΙΑΚΟΥ ΣΥΝΕΡΓΑΤΗ</font>
                </td>
                <td align="right">
                    Αριθμός Πρωτ.:........................<br><br>
                    Ημερομηνία:.............................<br>
                </td>
           </tr>
           </table> <br>
           <table width="100%">
            <tr>
                <td>
                      <font size="9">Πρός:   <br>
                     <b>Τμήμα:</b>   '.$departmentRow['departmentName'].'<br>
                     <b>Τομέας:</b>  '.$sectionRow['sectionTitle'].' </font><br>               
                </td>
            </tr>
           </table>
           ';

$pdf->writeHTML($myHtml, true, false, true, false, '');


$myHtml = '<h2>Ατομικά Στοιχεία Εκπαιδευτικού</h2>
    <table width="50%">
        <tr><td><b>Επώνυμο:</b></td><td>'.$usrRow['surname'].'</td>
        </tr>
        <tr><td><b>Όνομα:</b></td><td>'.$usrRow['name'].'</td>
        </tr> 
        <tr><td><b>Αριθμός Ταυτότητας:</b></td><td>'.$usrRow['idNumber'].'</td></tr>
        <tr><td><b>Όνομα Πατρός:</b></td><td>'.$usrRow['fathersName'].'</td></tr>
        <tr><td><b>Ημ/νία Γεννήσεως:</b></td><td>'.$usrRow['birthday_'].'</td>
        </tr>
        <tr><td><b>Ιδιότητα:</b></td><td>'.$usrRow['status'].'</td></tr>
		<tr><td><b>ΑΦΜ:</b></td><td>'.$usrRow['afm'].'</td></tr>
    </table>
    <h2>Στοιχεία Επικοινωνίας</h2>
    <table width="50%">
        <tr><td><b>Τηλέφωνο Οικίας:</b></td><td>'.$usrRow['phoneNumber'].'</td>
        </tr>
        <tr><td><b>Κινητό Τηλέφωνο:</b></td><td>'.$usrRow['mobileNumber'].'</td>
        </tr>
    </table>
    <h2>Στοιχεία Διεύθυνσης</h2>
    <table width="50%">
        <tr><td><b>Διεύθυνση:</b></td><td>'.$usrRow['address'].'</td>
        </tr>
        <tr><td><b>Τ.Κ:</b></td><td>'.$usrRow['postCode'].'</td>
        </tr>
        <tr><td><b>Πόλη:</b></td><td>'.$usrRow['city'].'</td>
        </tr>
    </table>';
    
$pdf->writeHTML($myHtml, true, false, true, false, '');

$myHtml = '<h2>Σπουδές Εκπαιδευτικού</h2>
    <table width="100%" cellspacing="5">
        <tr>
            <th><b>Τίτλος</b></th>
            <th><b>Ίδρυμα </b></th>  
            <th><b>Επίπεδο</b></th>
            <th><b>Βαθμός</b></th>     
            <th><b>Ημερομηνία Λήψης</b></th>            
        </tr>';
        
        while( $dgrRow = mysql_fetch_array($dgrResult)) {
            if( $dgrRow['grade'] == 0 ){$dgrRow['grade']='-';}
            $myHtml .='<tr>
                        <td>'.$dgrRow['title'].'</td>
                        <td>'.$dgrRow['university'].'</td>
                        <td>'.$dgrRow['level'].'</td>
                        <td>'.$dgrRow['grade'].'</td>  
                        <td>'.$dgrRow['degreeDate_'].'</td>
                       </tr>';
        }
$myHtml .='</table>';
$pdf->writeHTML($myHtml, true, false, true, false, '');

$myHtml = '<h2>Ξένες Γλώσσες Εκπαιδευτικού</h2>
    <table width="100%" cellspacing="5">
        <tr>
            <th><b>Γλώσσα</b> </th>
            <th><b>Τίτλος Πτυχίου</b> </th>  
            <th><b>Αριθμός Παραστατικού </b></th>     
            <th><b>Διδακτική Ικανότητα</b></th>            
        </tr>';
        
        while( $lngRow = mysql_fetch_array($lngResult)) {
            $myHtml .='<tr>
                        <td>'.$lngRow['language'].'</td>
                        <td>'.$lngRow['titleCertificate'].'</td>
                        <td>'.$lngRow['snCertificate'].'</td>
                        <td>'; if($lngRow['teachability']==0){$myHtml .='Όχι';}else{ $myHtml .= 'Ναί';}     
                       $myHtml .= '</td></tr>';
        }
$myHtml .='</table>';
$pdf->writeHTML($myHtml, true, false, true, false, '');

$myHtml = '<h2>Επαγγελματική Εμπειρία Εκπαιδευτικού</h2>
    <table width="100%" cellspacing="5">
        <tr>
            <th><b>Αντικείμενο</b> </th>
            <th><b>Ιδιότητα</b> </th>  
            <th><b>Από </b></th>     
            <th><b>Έως</b></th> 
            <th><b>Αριθμός Παραστατικού</b></th>           
        </tr>';
        
        while( $proRow = mysql_fetch_array($proResult)) {
            $myHtml .='<tr>
                        <td>'.$proRow['scope'].'</td>
                        <td>'.$proRow['status'].'</td>
                        <td>'.$proRow['since_'].'</td>
                        <td>'.$proRow['until_'].'</td>
                        <td>'.$proRow['docNumber'].'</td>
                       </tr>';
        }
$myHtml .='</table>';
$pdf->writeHTML($myHtml, true, false, true, false, '');

$myHtml = '<h2>Εκπαιδευτική Εμπειρία Εκπαιδευτικού</h2>
    <table width="100%" cellspacing="5">
        <tr width="100%">
            <th><b>Τίτλος Μαθήματος </b> </th>
            <th><b>Ίδρυμα </b></th>  
            <th><b>Τμήμα </b></th>     
            <th><b>Από</b></th> 
            <th><b>Έως</b></th>
            <th><b>Εκαδημαϊκά Εξάμηνα</b></th>  
            <th><b>Αριθμός Παραστατικού</b></th>           
        </tr>';
        
        while( $eduRow = mysql_fetch_array($eduResult)) {
            if( $eduRow['semesters'] == 0 ){$eduRow['semesters']='-';}
            $myHtml .='<tr>
                        <td>'.$eduRow['lesson'].'</td>
                        <td>'.$eduRow['educInstitution'].'</td>
                        <td>'.$eduRow['department'].'</td>  
                        <td>'.$eduRow['since_'].'</td>
                        <td>'.$eduRow['until_'].'</td>
                        <td>'.$eduRow['semesters'].'</td> 
                        <td>'.$eduRow['docNumber'].'</td>
                       </tr>';
        }
$myHtml .='</table>';
$pdf->writeHTML($myHtml, true, false, true, false, '');


$myHtml = '<h2>Επιστημονική Δραστηριότητα Εκπαιδευτικού</h2>
    <table width="100%" cellspacing="3">
        <tr>
            <th width="10%"><b>Τύπος  </b></th>
			<th width="30%"><b>Τίτλος  </b></th>
            <th><b>Συγγραφέας </b></th>  
            <th><b>Περιοδικό/<br>Συνέδριο</b></th>     
            <th align="center"><b>Τόμος</b></th> 
            <th width="10%"><b>Σελίδα</b></th>
            <th width="5%"><b>Έτος</b></th>
            <th width="7%"><b>Αρ.Παρ</b></th>           
        </tr>';
        $numberOfRows = mysql_num_rows($sntResult);
        while( $sntRow = mysql_fetch_array($sntResult)) {
            $myHtml .='<tr>
			            <td width="10%">'.$sntRow['type'].'</td>
                        <td width="30%">'.$sntRow['title'].'</td>
                        <td>'.$sntRow['author'].'</td>
                        <td>'.$sntRow['magazineCouncil'].'</td>  
                        <td align="center">'.$sntRow['tome'].'</td>   
                        <td>'.$sntRow['page'].'</td>
                        <td>'.$sntRow['year'].'</td>
                        <td>'.$sntRow['docNumber'].'</td>
                       </tr>';
        }
        $myHtml .='<tr><td><b>Σύνολο</b></td><td></td><td></td><td></td><td></td><td></td><td><b>'.$numberOfRows.'</b></td></tr>';
$myHtml .='</table>';
$pdf->writeHTML($myHtml, true, false, true, false, '');

$myHtml = '<h2>Ώρες Απασχόλησης Εκπαιδευτικού</h2>
    <table width="100%" cellspacing="5">
        <tr>
            <th><b>Ημέρα </b></th>
            <th><b>Από </b></th>     
            <th><b>Έως</b></th> 
            <th><b>Σχόλιο</b></th>           
        </tr>';
        
        while( $availRow = mysql_fetch_array($availResult)) {
            $myHtml .='<tr>
                        <td>'.$availRow['day'].'</td>
                        <td>'.$availRow['fromHour'].'</td>
                        <td>'.$availRow['toHour'].'</td>
                        <td>'.$availRow['comment'].'</td>
                       </tr>';
        }
$myHtml .='</table>';
$pdf->writeHTML($myHtml, true, false, true, false, '');



$myHtml = '<h2>Δήλωση Μαθημάτων</h2>
    <table width="100%" cellspacing="5">
        <tr>
            <th><b>Τίτλος Μαθήματος  </b></th>
            <th align="center"><b>Εξάμηνο </b></th>  
            <th align="center"><b>Εξάμηνα Διδασκαλίας </b></th>     
            <th align="center"><b>Χρήση Εγκεκριμένων Σημειώσεων</b></th> 
        </tr>';
        
        while( $appRow = mysql_fetch_array($appResult)) {
            
            $lessonQ = "SELECT * FROM lesson WHERE id='".$appRow['lessonId']."'";
            $lessonResult = mysql_query($lessonQ);
            $lesson = mysql_fetch_array($lessonResult);
            
            $myHtml .='<tr>
                        <td>'.$lesson['lessonTitle'].'</td>
                        <td align="center">'.$lesson['semester'].'</td>
                        <td align="center">'.$appRow['semesterTeaching'].'</td>  
                        <td align="center">'.$appRow['userNotes'].'</td>
                       </tr>';
        }
$myHtml .='</table>';
$pdf->writeHTML($myHtml, true, false, true, false, '');

$myHtml ='
<br><br>
    <table align="right">
        <tr>
            <td>Ημερομηνία:.................</td>
        </tr>
        <tr>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td>Ο/Η Αιτών/ούσα &nbsp;            </td>
        </tr>
        <tr>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td>____________________________</td>
        </tr>
    </table>
';
$pdf->writeHTML($myHtml, true, false, true, false, ''); 

// reset pointer to the last page
$pdf->lastPage();

// ---------------------------------------------------------

//Close and output PDF document
$filename = $userId.'_'.$academicYear.'_'.$departmentId.'_'.$sectionId.'.pdf';
$pdf->Output($filename, 'D');
$pdf->Output('docs/'.$filename, 'F');

//============================================================+
// END OF FILE                                                
//============================================================+

Youez - 2016 - github.com/yon3zu
LinuXploit