Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<?php
//echo $_POST;
include_once '../includes/db.inc.php';
include_once 'admin.inc.php';
check_login();
top_admin('occasions', $pagina_titel);
open_db();
$sql="INSERT INTO occasion (occasion_name, occasion_short_description, occasion_long_description, occasion_price, occasion_picture, occasion_picture_medium)
VALUES
('$_POST[artikel]', '$_POST[korte_omschrijving]', '$_POST[uitgebreide_omschrijving]', '$_POST[prijs]', '" . $_FILES[plaatje][name] . "', '" .$_FILES[plaatje_m][name]. "')";
//echo $sql . "<br />" . "<br />";
mysql_query($sql);
$uploadedfile = $_FILES['plaatje']['tmp_name'];
$uploadedfile2 = $_FILES['plaatje_m']['tmp_name'];
$src = imagecreatefromjpeg($uploadedfile);
$src2 = imagecreatefromjpeg($uploadedfile2);
list($width,$height)=getimagesize($uploadedfile);
list($width2,$height2)=getimagesize($uploadedfile2);
$newwidth=60;
$newheight=80;
$tmp=imagecreatetruecolor($newwidth,$newheight);
$newwidth2=300;
$newheight2=300;
$tmp2=imagecreatetruecolor($newwidth2,$newheight2);
imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
imagecopyresampled($tmp2,$src2,0,0,0,0,$newwidth2,$newheight2,$width2,$height2);
$filename = "../occasions/fotos_small/". $_FILES['plaatje']['name'];
imagepng($tmp,$filename,9);
$filename2 = "../occasions/fotos_medium/". $_FILES['plaatje_m']['name'];
imagepng($tmp2,$filename2,9);
imagedestroy($src);
imagedestroy($tmp);
imagedestroy($src2);
imagedestroy($tmp2);
?>
original_filename = "../occasions/fotos_small/".$_FILES['plaatje']['name'];
$new_filename = trim( strtolower( $original_filename ), 'jpg' ) . 'png';
$original_filename2 = "../occasions/fotos_medium/".$_FILES['plaatje_m']['name'];
$new_filename2 = trim( strtolower( $original_filename2 ), 'jpg' ) . 'png';
//echo $sql . "<br />" . "<br />";
mysql_query($sql);
//$filename = "../occasions/fotos_small/". $_FILES[plaatje][name];
imagepng($tmp,$new_filename,9);
//$filename2 = "../occasions/fotos_medium/". $_FILES[plaatje_m][name];
imagepng($tmp2,$new_filename2,9);