<?php

include "../../config/koneksi.php";


$judul = $_POST['judul'];

$deskripsi = $_POST['deskripsi'];


$gambar = $_FILES['gambar']['name'];

$tmp = $_FILES['gambar']['tmp_name'];



if ($gambar != "") {

    move_uploaded_file(
        $tmp,
        "../../uploads/layanan/" . $gambar
    );
}



mysqli_query(
    $koneksi,

    "INSERT INTO layanan
(judul,deskripsi,gambar)

VALUES

('$judul','$deskripsi','$gambar')

"

);



header("location:index.php");
