85
if (isset($_POST['date'])) { $date = $_POST['date']; if ($date == '') {
unset($date); print_r (0); return false;} }
if (isset($_POST['responsible'])) { $responsible =
$_POST['responsible']; if ($responsible == '') { unset($responsible); print_r (0);
return false;} }
if (isset($_POST['controlling'])) { $controlling = $_POST['controlling'];
if ($controlling == '') { unset($controlling); print_r (0); return false;} }
if (isset($_POST['author'])) { $author = $_POST['author']; if ($author ==
'') { unset($author); print_r (0); return false;} }
if (isset($_POST['type'])) { $type = $_POST['type']; if ($type == '') {
unset($type); print_r (0); return false;} }
$IsDate = date('Y-m-d');
$IsTime = date("H:i:s");
if(isset($_FILES) && $_FILES['inputfile']['error'] == 0)
{
$total = count($_FILES['upload']['name']);
$sql = "INSERT INTO `materials` (`type`,`name`, `description`,
`author`, `responsible`, `controlling`, `created_d`, `closed`, `closed_fact`, `status`)
VALUES ('$type','$title', '$description', '$author', '$responsible', '$controlling',
'$IsDate', '$date', '$date', 0);";
$result = $mysqli->query($sql);
$mid = $mysqli->insert_id;
$title";
$sql_l = "INSERT INTO `logs` (`text`,`date`, `time`) VALUES
('$logs','$IsDate', '$IsTime');";