<?php
include "koneksi.php";
//insert.php

$connect = new PDO("mysql:host=localhost;dbname=data_karyawan_mhb", "root", "");
$tanggal = date('m');
echo $tanggal;

$query = "
INSERT INTO daily_report 
       (isi, progres, mhb_id, remarks, nik, tanggal_upload, departement) 
VALUES (:first_name, :last_name, :mhb_id, :remarks, :pic, NOW(), :departement)
";

for($count = 0; $count<count($_POST['hidden_first_name']); $count++)
{
	$data = array(
		':first_name'	=>	$_POST['hidden_first_name'][$count],
		':last_name'	=>	$_POST['hidden_last_name'][$count],
		':mhb_id'	=>	$_POST['hidden_mhb_id'][$count],
		':remarks'	=>	$_POST['hidden_remarks'][$count],
		':pic'	=>	$_POST['hidden_pic'][$count],
		':departement'	=>	$_POST['hidden_departement'][$count]
	);
	$statement = $connect->prepare($query);
	$statement->execute($data);
}

?>