<?php
/*#72*/ $db = new mysqli('localhost','root','','protokol');
/*#73*/
/*#74*/ if($db->connect_error):
/*#75*/ echo 'Verbindung Fehlgeschlagen';
/*#76*/ endif;
/*#77*/
/*#78*/ if(isset($_POST['submit'])):
/*#79*/ $seriennummer = $_POST['Serial-number-Text'];
/*#80*/ $object = $_POST['Object'];
/*#81*/ $user = $_POST['User'];
/*#82*/ $creator = $_POST['Creator'];
/*#83*/
//verzeichnis generieren
/*#85*/ mkdir("images/$seriennummer-$object");
/*#86*/
/*#87*/ $innenJpg = "images/".$seriennummer.$object."/".$seriennummer."-Innen.jpg";
/*#88*/ $obenJpg = "images/".$seriennummer.$object."/".$seriennummer."-oben.jpg";
/*#89*/ $steckerJpg = "images/".$seriennummer.$object."/".$seriennummer."-stecker.jpg";
/*#90*/ $seriennummerJpg = "images/".$seriennummer.$object."/".$seriennummer."-seriennummer.jpg";
/*#91*/ $deckelJpg = "images/".$seriennummer.$object."/".$seriennummer."-deckel.jpg";
/*#92*/
//Bilder Upload
/*#94*/ move_uploaded_file($_FILES["inside-Img"]["tmp_name"], "$innenJpg");
/*#95*/ move_uploaded_file($_FILES["top-Img"]["tmp_name"], "$obenJpg");
/*#96*/ move_uploaded_file($_FILES["plug-legend-img"]["tmp_name"], "$steckerJpg");
/*#97*/ move_uploaded_file($_FILES["Serial-number-Img"]["tmp_name"], "$seriennummerJpg");
/*#98*/ move_uploaded_file($_FILES["Top-Bag-img"]["tmp_name"], "$deckelJpg");
//Absenden
/*#100*/ $absenden = $db->prepare("INSERT INTO `kontrolliert`(`serialnumber`, `type`, `controller`, `build`, `inside`, `top`, `stick`, `snumber`, `topbag`, `date`) Values (?,?,?,?,?,?,?,?,?,NOW())");
/*#101*/ $absenden->bind_param('iisssssss',$seriennummer,$object,$user,$creator,$innenJpg,$obenJpg,$steckerJpg,$seriennummerJpg,$deckelJpg);
/*#104*/ $absenden->execute();
endif;