Your IP : 216.73.217.87


Current Path : /hdd/hdd11/www/vlevski/enter/digital/
Upload File :
Current File : /hdd/hdd11/www/vlevski/enter/digital/index.php

<?php
	$df9dsjds09fjs09fj90sdfjdsv09jds0vc = mysqli_connect('localhost', 'digital', '!D1g1t4l!', 'digital');
	$db=$df9dsjds09fjs09fj90sdfjdsv09jds0vc;
	@mysqli_set_charset($db, 'utf8');
	if (isset($_GET["p"]))
	{
		$p=$_GET["p"];
		$p--;
	}
	else
	{
		$p=0;
	}
	if ($p<0)
	{
		$p=0;
	}
	$n=$p;
	$p=$p*21;
	$students=mysqli_query($db, "SELECT * FROM `students` WHERE `cy`='2021' ORDER BY `i` LIMIT ".$p.", 21");
	$i=0;
	while ($st=mysqli_fetch_row($students))
	{
		$im=imagecreatefrompng("./".$st[5]."");
		$font = './gara.ttf';
		$black = imagecolorallocate($im, 0, 32, 96);
		$text = "№ ".$st[1]." - ".$st[2]." г.";
		imagettftext($im, 75, 0, 2100, 2200, $black, $font, $text);
		$text = "на ".$st[3]."";
		$bbox = imagettfbbox(130, 0, $font, $text);
		$center_x = (imagesx($im) / 2) - (($bbox[2] - $bbox[0]) / 2);
		imagettftext($im, 130, 0, $center_x, 2450, $black, $font, $text);
		$text = "".$st[4]."";
		imagettftext($im, 120, 0, 3500, 2050, $black, $font, $text);
		header('Content-Type: image/png');
		imagepng($im, "./myimage.png", 0);
		$i++;
		$v=$i+$p;
		$systemline = system("convert -quality 100 myimage.png myimage".$v.".pdf", $dont_print);
		imagedestroy($im);
	}
	$k=2+$p;
	$f=1+$p;
	$prep="myimage".$f.".pdf";
	while ($k<=$v)
		{
			$prep.=" myimage".$k.".pdf";
			$k++;
		}
	$n++;
	$systemline = system("/usr/bin/pdftk ".$prep." cat output myimage.pdf", $dont_print);
	$systemline = system("/usr/bin/ps2pdf14 myimage.pdf newimage".$n.".pdf", $dont_print);
	$systemline = system("rm myimage*.*", $dont_print);
	$t=time();
	header("location: ./newimage".$n.".pdf?t=".$t."");
?>