<?php
	include "koneksi.php";
	
	if (isset($_POST["kirim"])) {
		$jumlah = count($_FILES['gambar']['name']);
		//$jumlah2 = count($_FILES['gambar2']['name']);
		if ($jumlah > 0) 
		{
			$gambar = array();
			for ($i=0; $i < $jumlah; $i++) { 
				$file_name = $_FILES['gambar']['name'][$i];
				$tmp_name = $_FILES['gambar']['tmp_name'][$i];				
				move_uploaded_file($tmp_name, "tes/".$file_name);
				$gambar[$i] = $file_name;
                $id = '232';				
			}
			mysqli_query($conn,"INSERT INTO tes VALUES('','$id',
			                                           
													   '$gambar[0]','$gambar[1]','$gambar[2]','$gambar[3]','$gambar[4]','$gambar[5]','$gambar[6]','$gambar[7]','$gambar[8]','$gambar[9]',
													   '$gambar[10]','$gambar[11]','$gambar[12]','$gambar[13]','$gambar[14]','$gambar[15]','$gambar[16]','$gambar[17]','$gambar[18]','$gambar[19]',
													
													   '','')");
												   
			echo "Berhasil Upload 1";	

		}
		else
		{
			echo "Gambar tidak ada";
		}
	}
        
    
?>