<?php 
include "config.php";
session_start();
$user=$_SESSION['log'];
$employee_name = $_POST['employeename'];
$employee_code= $_POST['employeecode'];
$user_name = $_POST['username'];
$file_name = $_POST['filename'];
$insertuser = "insert into user_refer(filename)values('$file_name')";
$gouser = mysqli_query($connect,$insertuser);
foreach($employee_name as $id =>$value)
{
$sql = "INSERT INTO userpermission(employeename, employeecode, username, filename, dataadd, datashow, dataedit, datadelete, dataprint, dataexcel) VALUES ('$employee_name[$id]','$employee_code[$id]','$user_name[$id]','$file_name','','','','','','')";
$go = mysqli_query($connect,$sql);
}
header("Location:userpermission.php");
?>

