<?php 

include("config.php");

$cdate=dtformat($_POST[cdate]);

$user_ip = getUserIP();
	
$result=mysql_query("select * from hr_employee order by id asc ");
$row=mysql_fetch_array($result);

do{ 

$salary="salary_".$row[id];
$comments="comments_".$row[id];
$salaryx=$_POST[$salary];
$commentsx=$_POST[$comments];
 
mysql_query("INSERT INTO hr_salary ( employee, cdate, salary, commentx,suser,user_ip) VALUES (  '$row[id]','$cdate','$salaryx','$commentsx','$_SESSION[uid]','$user_ip')");
	
}while($row=mysql_fetch_array($result));
	
//
header("location:hr_salary.php");
?>