Hétfői Backend óra
This commit is contained in:
parent
ff0026e138
commit
cb6d759caa
BIN
Suli/13.b/Backend/2024. 10. 24/Vera.ttf
Normal file
BIN
Suli/13.b/Backend/2024. 10. 24/Vera.ttf
Normal file
Binary file not shown.
|
@ -1,6 +1,17 @@
|
|||
<?php
|
||||
session_start();
|
||||
$celkonyvtar = "kepek/";
|
||||
|
||||
function vizjeljpg($kepfajl, $celkonyvtar) {
|
||||
$img = imagecreatefromjpeg($kepfajl);
|
||||
|
||||
$wmcolor = imagecolorallocatealpha($img, 255, 255, 255, 25);
|
||||
|
||||
imagefttext($img, 18,0,0,24, $wmcolor, "Vera.ttf", "WATERMARK");
|
||||
|
||||
imagejpeg($img, $celkonyvtar."vizejeles.jpg", 75);
|
||||
}
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
if (!is_dir($celkonyvtar)) {
|
||||
mkdir($celkonyvtar);
|
||||
|
@ -37,7 +48,9 @@
|
|||
if (move_uploaded_file($_FILES["kepfajl"]["tmp_name"], $celfajl) == true) {
|
||||
if ($vanmar == 0) {
|
||||
$_SESSION["kepek"][] = $celfajl;
|
||||
vizjeljpg($celfajl, $celkonyvtar);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
BIN
Suli/13.b/Backend/2024. 10. 24/kepek/orangutan.jpg
Normal file
BIN
Suli/13.b/Backend/2024. 10. 24/kepek/orangutan.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 226 KiB |
BIN
Suli/13.b/Backend/2024. 10. 24/kepek/vizejeles.jpg
Normal file
BIN
Suli/13.b/Backend/2024. 10. 24/kepek/vizejeles.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 123 KiB |
41
Suli/13.b/Backend/2024. 11. 18/obj.php
Normal file
41
Suli/13.b/Backend/2024. 11. 18/obj.php
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
class Tanulo {
|
||||
public $nev;
|
||||
public $kor;
|
||||
public $jegyek = [];
|
||||
|
||||
public function __construct($nev, $kor) {
|
||||
$this->nev = $nev;
|
||||
$this->kor = $kor;
|
||||
}
|
||||
|
||||
public function adjegy($jegy) {
|
||||
$this->jegyek[] = $jegy;
|
||||
}
|
||||
|
||||
public function atlagkiszamit() {
|
||||
if (count($this->jegyek) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
else {
|
||||
return array_sum($this->jegyek) / count($this->jegyek);
|
||||
}
|
||||
}
|
||||
|
||||
public function adatkiir() {
|
||||
$atlag = $this->atlagkiszamit();
|
||||
echo "Név: {$this->nev}, Kor: {$this->kor}, Átlag: {$atlag}";
|
||||
}
|
||||
}
|
||||
|
||||
$tan1 = new Tanulo("Kis Péter", 15);
|
||||
$tan1->adjegy(5);
|
||||
$tan1->adjegy(1);
|
||||
$tan1->adjegy(3);
|
||||
$tan1->adjegy(2);
|
||||
$tan1->adatkiir();
|
||||
|
||||
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user